Fine tune utility room reading with pulse counters and Domoticz

Moderator: leecollings

Post Reply
User avatar
mlamie
Posts: 122
Joined: Friday 25 October 2013 17:12
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: The Netherlands
Contact:

Fine tune utility room reading with pulse counters and Domoticz

Post by mlamie »

As mentioned in the title I need some help to fine tune utility room reading with pulse counters (connected via a NodeMCU ESP8266) in Domoticz. Please note I’m not an electric engineer, but really enjoy the time spend so far on the project ;-)

I mounted 3 sensors in my utility room. All have been configured as a pulse counter in the ESP Easy firmware and I configured them to communicate with Domoticz via HTTP. Domoticz is getting values, but the representation isn’t good. So I need to troubleshoot the setup. To see the actual details/values see the YouTube.

https://youtu.be/lY-bSa3NFPk

1st question: Can someone please help me out to get the right figures in Domoticz?

2nd question: I doubt when the reed switch is triggered and remains triggerd (gas meter magnet stopped), or the TCRT 5000 sensor remains on the reflectic part (water meter stopped), will the value get a 0? Will it only count the up and down of the pulse?

3rd question: As far I know there is no technical explanation/description available per Domoticz graph/chart (Counter, Counter incremental, Electric (instant+Counter), P1 Smart Meter (Electric), Usage (Electric), etc.... what are the differences? Shall we create a wiki page for it?

Some remarks:
Meters:
Electricity = Pulse rate = 1,000 imp/kWh
Water = 2 pulses = 0,0001 m3
Gas = 1 imp = 0,01m3

Measurements are send every 60 seconds from NodeMcu ESP8266 (is this ok??? What will Domoticz use?)
Electricity formula count = %value%*60
Debounce gas = 1000 mSec
Water formula count = %value%/2
Debounce water = 1 mSec

In Domoticz I created the following virtual devices:
Electricity = Counter Incremental
Gas = RFXMeter counter
Water = RFXMeter counter

Electricitymeter (values are too high)
Image

Gasmeter (not sensed...)
Image

Watermeter (values are too high)
Image


P.s. I also posted the same questions at the ESP Easy forum, but no response till so far.
http://www.esp8266.nu/forum/viewtopic.php?f=2&t=1362
Raspberry Pi 3, RaZberry, RFXtrx433
Various Z-Wave devices, KlikAanKlikUit devices, ESP8266 NodeMCU, Sonoff POW and a Essent E-thermostaat
IP camera: Dahua 4MP IPC-HDBW4421R-AS, Vivotek FD8134V
User avatar
mlamie
Posts: 122
Joined: Friday 25 October 2013 17:12
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: The Netherlands
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by mlamie »

I started with the water meter. I found some configuration faults and now the display in Domoticz is correct 8-)

1) The pulse counter TCRT5000 sensor detects on/of and count 2.
no reflective part = 0 (sensor module led off)
reflective part = 1 (sensor module led on)
no reflective part = 2 (sensor module led off)
Since the arrow is counted twice per rotation I corrected the calculation from %value%/2 towards %value%/4

My second question if the pulse counter in the ESP Easy firmware keeps counting in case the sensor is on and sees the reflective part and the water meter is stopped is answered as well.

Check: In Domoticz the count value is correct in the log.

2) In Domoticz the counter divers was 100 I adjusted it towards 1000 since each rotation is 1 liter.

3) In Domoticz I changed the virtual device from RFXMeter counter towards Counter Incremental.
Raspberry Pi 3, RaZberry, RFXtrx433
Various Z-Wave devices, KlikAanKlikUit devices, ESP8266 NodeMCU, Sonoff POW and a Essent E-thermostaat
IP camera: Dahua 4MP IPC-HDBW4421R-AS, Vivotek FD8134V
User avatar
mlamie
Posts: 122
Joined: Friday 25 October 2013 17:12
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: The Netherlands
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by mlamie »

So the next topic is the gas meter, I can not find the issue there. Let me explain, each rotation is correctly counted by the read switch. Each time the magnet triggers and releases the reed switch only 1 pulse is counted. So in the test I made 6 rotations (equals 0,06 m3 gas). In Domoticz I see the same value, but the Incremental counter will display 0,010 m3 gas.…

what is wrong?

Screenshot 1 (actual value is 0,060 m3, why is the today displayed as 0,010 m3?)
Image

Screenshot 2 (counter value = 6 which is correct, but why is it displayed as 0,010...?)
Image

Screenshot 3 (value is 5.…? where is that coming from? and why is is displayed as 0,010...?)
Image
Raspberry Pi 3, RaZberry, RFXtrx433
Various Z-Wave devices, KlikAanKlikUit devices, ESP8266 NodeMCU, Sonoff POW and a Essent E-thermostaat
IP camera: Dahua 4MP IPC-HDBW4421R-AS, Vivotek FD8134V
User avatar
mlamie
Posts: 122
Joined: Friday 25 October 2013 17:12
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: The Netherlands
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by mlamie »

I made another 4 pulses, (6+4). The value went from 0,010 m3 towards 0,050 m3 (increase of 4). So probably it is correct, but only the first value is a bit of a mystery.
Raspberry Pi 3, RaZberry, RFXtrx433
Various Z-Wave devices, KlikAanKlikUit devices, ESP8266 NodeMCU, Sonoff POW and a Essent E-thermostaat
IP camera: Dahua 4MP IPC-HDBW4421R-AS, Vivotek FD8134V
RidingTheFlow
Posts: 72
Joined: Friday 11 March 2016 18:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Essex, UK
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by RidingTheFlow »

mlamie wrote: 1st question: Can someone please help me out to get the right figures in Domoticz?
Its a question with no simple answer, you need to check entire data chain.
I would suggest starting from you pulse detector sensor hardware set up. Most likely you are getting false pulses due to RF noise and not quite robust sensor/cabling.
2nd question: I doubt when the reed switch is triggered and remains triggerd (gas meter magnet stopped), or the TCRT 5000 sensor remains on the reflectic part (water meter stopped), will the value get a 0? Will it only count the up and down of the pulse?
This will depend on how your trigger set up. Generally it should only respond to raising edge or falling edge (transition from off-on or from off-on), and should have some de-bounce protection (e.g. not counting several times if received several transitions too quickly).
3rd question: As far I know there is no technical explanation/description available per Domoticz graph/chart (Counter, Counter incremental, Electric (instant+Counter), P1 Smart Meter (Electric), Usage (Electric), etc.... what are the differences?
"Counter" is just an absolute counter. Each update sets the counter value - but its not expected to decrease, each update must be equal or greater number than previous one. Also you can set the resource type (gas, elec, or any other kind).
"Counter incremental" differs on what update means. Update for incremental will be the "delta", and Domoticz will auto-add it to current counter value (e.g. if you send "0" as update, and counter was 1000, it will remain 1000).
If you also track both instant power (watts) and total consumption (Kwh), "Electric (instant+Counter)" will do this.
P1 smart meter allows to count 2 different tariffs, and track instant power consumption for each. Generally it only useful if you actually have 2 different tariffs.
Usage (Electric) is when you only interested about instant power in Watts (e.g. some wattmeter devices) and don't care about tracking total usage in Kwh.

ESP8266-specific questions (e.g. how particular firmware interacts with GPIO and how its translated to Domoticz update) you better ask in its own ESP8266 forum.
User avatar
proza
Posts: 24
Joined: Friday 12 February 2016 15:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11415
Location: The Netherlands
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by proza »

@mlamie

I'v seen that you had some experience with the esp8266 and the energy- and watermeter. Mine Energy meter is a old one with a black part on rotation wheel (375 rotation = 1kW). I did some test with a counter script and have seen that the counter was incremental with 2 by entering and leaving the black spot on the rotation wheel. So 1 rotation is a count of 2, so I think mine pulserate should be (375 *2) = 750 = 1kW

My question is what kind of formula do i need in the esp8266 config for the right results in Domoticz

Meters:
Electricity = Pulse rate = 375 rotation /kWh
  • esp8266 Electricity formula count = (%value%/2)*0,375
    Or something else?
Can you help me, thanks.
Attachments
Energy meter - C = 375 tr/kWh
Energy meter - C = 375 tr/kWh
2016-04-29 21_06_57-.jpg (109.81 KiB) Viewed 11791 times
If you see me collapse, pause my Garmin fenix 3
frenchyyii
Posts: 53
Joined: Saturday 24 September 2016 18:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by frenchyyii »

mlamie wrote:So the next topic is the gas meter, I can not find the issue there. Let me explain, each rotation is correctly counted by the read switch. Each time the magnet triggers and releases the reed switch only 1 pulse is counted. So in the test I made 6 rotations (equals 0,06 m3 gas). In Domoticz I see the same value, but the Incremental counter will display 0,010 m3 gas.…

what is wrong?

Screenshot 1 (actual value is 0,060 m3, why is the today displayed as 0,010 m3?)
Image

Screenshot 2 (counter value = 6 which is correct, but why is it displayed as 0,010...?)
Image

Screenshot 3 (value is 5.…? where is that coming from? and why is is displayed as 0,010...?)
Image
Hi, did you set 1000 instead of 100 in setting, parameters, meters/counters, gaz ?

Eric

For information I have many troubles like yours with my system (that is closed to yours with water and anemometer pulse counter)

Please may you accept my apology concerning my poor english but I'm french.
Twinsen
Posts: 12
Joined: Wednesday 20 July 2016 22:39
Target OS: -
Domoticz version:
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by Twinsen »

mlamie wrote:So the next topic is the gas meter, I can not find the issue there. Let me explain, each rotation is correctly counted by the read switch. Each time the magnet triggers and releases the reed switch only 1 pulse is counted. So in the test I made 6 rotations (equals 0,06 m3 gas). In Domoticz I see the same value, but the Incremental counter will display 0,010 m3 gas.…

what is wrong?

Screenshot 1 (actual value is 0,060 m3, why is the today displayed as 0,010 m3?)
Image

Screenshot 2 (counter value = 6 which is correct, but why is it displayed as 0,010...?)
Image

Screenshot 3 (value is 5.…? where is that coming from? and why is is displayed as 0,010...?)
Image

I have the same problem...

Rotation is correctly counted by the reed switch, but the incremental counter display wrong value (0.13m3) gas
Image
Image


@mlamie - did you find the solution or what was wrong ?
User avatar
mlamie
Posts: 122
Joined: Friday 25 October 2013 17:12
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: The Netherlands
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by mlamie »

The project was fun, but I decided to go for P1 energy readings. I did gave up the value fine tuning. I asked "Liander" to replace my gas/electic meters and they did 2 days ago. I will go forward with a cable between the P1 port and Pi instead. Sorry for the limited help.
Raspberry Pi 3, RaZberry, RFXtrx433
Various Z-Wave devices, KlikAanKlikUit devices, ESP8266 NodeMCU, Sonoff POW and a Essent E-thermostaat
IP camera: Dahua 4MP IPC-HDBW4421R-AS, Vivotek FD8134V
dobje
Posts: 3
Joined: Sunday 11 December 2016 20:07
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta rel
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by dobje »

Same issue here I have a TCR5000 on my gas meter and for most the reading are fine , but sometimes ( at night) i have an extreme high count. I use a TCR5000 with an ESP8266 with esp easy firmware (stable). I use the same on my water meter and i am going to replace that one with a LJ12A3-4-Z/BX censor.

Maybe the issue is when the meter stops at the reflective part you get an high counting , but i am only guessing.
Twinsen
Posts: 12
Joined: Wednesday 20 July 2016 22:39
Target OS: -
Domoticz version:
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by Twinsen »

I think that in my case the problem is that I have invalid values ?!?
184467436613926900
How can I avoid this situation
at4500
Posts: 6
Joined: Wednesday 14 December 2016 12:59
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.9052
Location: Latvia
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by at4500 »

Basically, i have the same issue.
High, non-realistic values. Something wrong in Domotizc logic, for sure.
I took a wireshark trace, and pulses are sent correctly, no mistake there. Problem in interpretation in domoticz.

Im currently looking to startup second Ras2pi with beta Domoticz s/w on it to see if bug is fixed. If no chance, i will have to convert setup to some cloud based services.
Attachments
Domo_faux-numbersCapture.JPG
Domo_faux-numbersCapture.JPG (151.71 KiB) Viewed 10465 times
dobje
Posts: 3
Joined: Sunday 11 December 2016 20:07
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta rel
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by dobje »

Overview of last 24 hours of the water meter, and i am not home at all last 2 day's
water.jpg
water.jpg (51.39 KiB) Viewed 10409 times
Gas meter same readings i can monitor true the Honywell EvoHome if it's heating or not and that correspondents not with the gas reading ( no other gas equipment at home )

Moday at 07:00 1.060 m3 gas , and no heating :roll:

Both are setup as counter incremental in Domoticz and as Pulse counter in espEasy.
esp.jpg
esp.jpg (56.68 KiB) Viewed 10407 times
at4500
Posts: 6
Joined: Wednesday 14 December 2016 12:59
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.9052
Location: Latvia
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by at4500 »

Hi,
For myself, ive managed to sort out this wrong counter issue.

-Create incremental counter for gas, change its property to 'gas' in "utility"tab.
-set its initial value of Gas counter:
/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=USAGE
..where usage-=is-in-litres

-on ESP side: FormulaCount = %value%*10 and 'counter type="delta
-on Domoticz side, counter dividers=gas=1000 ( u can go with 100, but i prefer to see 3 digits after decimal, even though, last dignever changes.)

And, off you go!
Bear in mind, my cheap,chineese reed sensor, has habit to stick its contacts close. Ive moved about few mm further away from gas counter to lessen strong magnetic field from magnet. Well,shall see if this helps...
CherAlban
Posts: 6
Joined: Tuesday 22 November 2016 20:18
Target OS: Windows
Domoticz version:
Contact:

Re: Fine tune utility room reading with pulse counters and Domoticz

Post by CherAlban »

I have exactly the same problem, the total value of the counter is correct, while the today value is too low. Did anybody find a solution to this?

CherAlban
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest