Watermeter
Moderator: leecollings
-
- Posts: 18
- Joined: Saturday 04 January 2014 20:20
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Watermeter
I want to connect a water meter, using a TCRT5000 IR Barrier Line Track Sensor (With the code from the MySensor website)
I have connect it to my gateway, and the following is in the log:
2015-03-17 20:11:33.206 MySensors: Node: 2, Sketch Name: Water Meter
2015-03-17 20:11:33.211 MySensors: Node: 2, Sketch Version: 1.0
But there is no new device, when i test the sensor, this is working
another weird thing, i have on the same Rpi a 1-wire network, with two sensors, this works good
but when i connect the watermeter, to the MySensor gateway, i have errors on my 1-wire
2015-03-17 20:14:19.018 Error: 1-Wire system : error reading value from /sys/bus/w1/devices/28-000004cb3769
And my CPU_usage is going from 2% to 9%
Anybody an idea, whats wrong??
I have connect it to my gateway, and the following is in the log:
2015-03-17 20:11:33.206 MySensors: Node: 2, Sketch Name: Water Meter
2015-03-17 20:11:33.211 MySensors: Node: 2, Sketch Version: 1.0
But there is no new device, when i test the sensor, this is working
another weird thing, i have on the same Rpi a 1-wire network, with two sensors, this works good
but when i connect the watermeter, to the MySensor gateway, i have errors on my 1-wire
2015-03-17 20:14:19.018 Error: 1-Wire system : error reading value from /sys/bus/w1/devices/28-000004cb3769
And my CPU_usage is going from 2% to 9%
Anybody an idea, whats wrong??
CubieTruck with Domoticz
RfxTrx 433Mhz Usb, Rfx Sensor, Z-Wave
Slave Raspberry Pi with Domoticz, Piface, P1 usb
RfxTrx 433Mhz Usb, Rfx Sensor, Z-Wave
Slave Raspberry Pi with Domoticz, Piface, P1 usb
-
- Posts: 2
- Joined: Wednesday 15 April 2015 18:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Watermeter
I am also trying to get a MySensor water meter connected. With little success so far.
Using the basic skeleton of the MySensor water meter example that counts pulses from a meter either optically or via hall effect.
Here are my issues I see with Domoticz r 2382 running on a Rpi:
A.) There is a catch 22 when trying to connect a S_WATER sensor. Initially the sensor request the last recorded count from the controller ( via VAR1) before it can start to report usage . This fails on the initial connection of a new sensor, probably because the controller has no knowledge of a prior counter value and apparently doesn't just send a 0 instead. -- I worked around this by initializing the counter value from the sensors code once and then commenting out the lines after the sensor was known by the controller. Note that it is not a good idea to keep the last counter value in the sensors EEPROM -- it will wear out from the constant erasing/rewriting before too long.
B.) Domoticz does not enumerate the S_Water sensor unless an initial V_Volume message is sent ( i.e. does not show it in the devices list). Other sensors, for example a lamp switch shows up immediately upon the reception of the "present" message.
C.) S_WATER does not do anything with the V_FLOW message, only V_VARn and V_Volume do something.
D.) The sensor display once you have added it, under the "Utilities" menu shows two numbers. The little number immediately next to the icon displays the last reported Volume according tho the factor set in the setup pages, however the big number in the heading bar shows some unrelated number that doesn't seem to have any relation to flow or volume. The same incorrect number is also displayed on the Dashboard panel once you place the meter on the dashboard.
E.) The Log pages are completely goofed up. For the current hour in the last 24 display it shows 18 Pentillion m3 and for the last week it shows that same incorrect number as is displayed on the Dashboard sticker.
F.) There is no way of initializing / setting of the initial counter status -- defaulting and returning an initial 0 could work, but it doesn't satisfy the case when you have to transfer a counter value to a new sensor mid-run. Other sensors have a clear button on the log pages -- maybe a clear AND set button would be prudent
The Water Sensor is my main application for wanting to use Domoticz and I really need to get this working pretty soon -- We have a drought in California and people want to monitor their own water usage to avoid fines etc..
I must say that I'm overall impressed with Domoticz as everything up to this point worked as expected.
Thanks
Gary
Using the basic skeleton of the MySensor water meter example that counts pulses from a meter either optically or via hall effect.
Here are my issues I see with Domoticz r 2382 running on a Rpi:
A.) There is a catch 22 when trying to connect a S_WATER sensor. Initially the sensor request the last recorded count from the controller ( via VAR1) before it can start to report usage . This fails on the initial connection of a new sensor, probably because the controller has no knowledge of a prior counter value and apparently doesn't just send a 0 instead. -- I worked around this by initializing the counter value from the sensors code once and then commenting out the lines after the sensor was known by the controller. Note that it is not a good idea to keep the last counter value in the sensors EEPROM -- it will wear out from the constant erasing/rewriting before too long.
B.) Domoticz does not enumerate the S_Water sensor unless an initial V_Volume message is sent ( i.e. does not show it in the devices list). Other sensors, for example a lamp switch shows up immediately upon the reception of the "present" message.
C.) S_WATER does not do anything with the V_FLOW message, only V_VARn and V_Volume do something.
D.) The sensor display once you have added it, under the "Utilities" menu shows two numbers. The little number immediately next to the icon displays the last reported Volume according tho the factor set in the setup pages, however the big number in the heading bar shows some unrelated number that doesn't seem to have any relation to flow or volume. The same incorrect number is also displayed on the Dashboard panel once you place the meter on the dashboard.
E.) The Log pages are completely goofed up. For the current hour in the last 24 display it shows 18 Pentillion m3 and for the last week it shows that same incorrect number as is displayed on the Dashboard sticker.
F.) There is no way of initializing / setting of the initial counter status -- defaulting and returning an initial 0 could work, but it doesn't satisfy the case when you have to transfer a counter value to a new sensor mid-run. Other sensors have a clear button on the log pages -- maybe a clear AND set button would be prudent
The Water Sensor is my main application for wanting to use Domoticz and I really need to get this working pretty soon -- We have a drought in California and people want to monitor their own water usage to avoid fines etc..
I must say that I'm overall impressed with Domoticz as everything up to this point worked as expected.
Thanks
Gary
-
- Posts: 2
- Joined: Wednesday 15 April 2015 18:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Watermeter -- Gizmocus ??
Could Gizmocus please comment on the items above , especially on point D and E. Thanks !
-
- Posts: 46
- Joined: Tuesday 10 December 2013 22:27
- Target OS: Linux
- Domoticz version: beta
- Contact:
Re: Watermeter
I guess it should be written in Bugs thread for Gizmocuz to act faster 

Orange Pi (@ Debian) / MySensors Serial / GPIO / Custom Serial 433 MHz Transmitter (for plug switches and livolo wall switches) / JSON&Bash API scripts
- gizmocuz
- Posts: 2394
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Watermeter
Plz submit a code patch, thats the fastest way to get this implemented
Quality outlives Quantity!
- gizmocuz
- Posts: 2394
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Watermeter
you can now use the latest watermeter pulse counter from mysensors. (with the latest domoticz beta version, #2834)
(github latest code, i just changed some code)
i also implemented the V_FLOW, but at the moment as a percentage sensor, so when you have 0.44L/Minute, it displays 0.44 as percentage
this will have to change later to a better sensor
using this sketch now myself
I know for some people it might be to expensive to measure the water meter, specially like me, when you have a water meter that does not have a way to get a sensor on it.
My way was to install an additional water meter behind it
but for the hobby, it is great!
costs:
- Water Meter with pulse output - 87,50
http://www.bestelsnel.nu/winkel/O212000 ... 0pulsgever
- Installation costs (40 euro), needed some other connectors, and an engineer used some time
- Arduino Nano+nRF = ~8 euro
i connected the arduino to power....
(github latest code, i just changed some code)
i also implemented the V_FLOW, but at the moment as a percentage sensor, so when you have 0.44L/Minute, it displays 0.44 as percentage
this will have to change later to a better sensor
using this sketch now myself
I know for some people it might be to expensive to measure the water meter, specially like me, when you have a water meter that does not have a way to get a sensor on it.
My way was to install an additional water meter behind it
but for the hobby, it is great!

costs:
- Water Meter with pulse output - 87,50
http://www.bestelsnel.nu/winkel/O212000 ... 0pulsgever
- Installation costs (40 euro), needed some other connectors, and an engineer used some time
- Arduino Nano+nRF = ~8 euro
i connected the arduino to power....
Quality outlives Quantity!
-
- Posts: 228
- Joined: Thursday 21 May 2015 9:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Watermeter
Hey very nice..... added the device. And now watching what my little girl is using on waterflowgizmocuz wrote:you can now use the latest watermeter pulse counter from mysensors. (with the latest domoticz beta version, #2834)
(github latest code, i just changed some code)
i also implemented the V_FLOW, but at the moment as a percentage sensor, so when you have 0.44L/Minute, it displays 0.44 as percentage
this will have to change later to a better sensor
using this sketch now myself
i connected the arduino to power....

And the counter is now in Liters also nice.
Last edited by Justintime on Wednesday 26 August 2015 19:38, edited 1 time in total.
- gizmocuz
- Posts: 2394
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Watermeter
I had no idea how much water i used in one day.... it was a bit of a shock ! 
.... but i guess it is normal

.... but i guess it is normal

Quality outlives Quantity!
-
- Posts: 228
- Joined: Thursday 21 May 2015 9:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Watermeter
Uhhh yes i know.... i had to check it three times....gizmocuz wrote:I had no idea how much water i used in one day.... it was a bit of a shock !
.... but i guess it is normal
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Watermeter
ah, I'll stick to the cheap 2 euro watermeter
http://www.domoticz.com/forum/viewtopic ... ter#p45151
but the v_flow sounds promissing.
http://www.domoticz.com/forum/viewtopic ... ter#p45151
but the v_flow sounds promissing.

Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 228
- Joined: Thursday 21 May 2015 9:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Watermeter
I have the same sensor, so the flow works. Just allow new hardware device, unplug the power of the arduino and plug it back in. (If you run Mysensors, that was not clear to me)sincze wrote:ah, I'll stick to the cheap 2 euro watermeter
http://www.domoticz.com/forum/viewtopic ... ter#p45151
but the v_flow sounds promissing.
And you have a new (flow)device.
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Watermeter
Okay, in that case needs some modification.Justintime wrote:I have the same sensor, so the flow works. Just allow new hardware device, unplug the power of the arduino and plug it back in. (If you run Mysensors, that was not clear to me)sincze wrote:ah, I'll stick to the cheap 2 euro watermeter
http://www.domoticz.com/forum/viewtopic ... ter#p45151
but the v_flow sounds promissing.
And you have a new (flow)device.

I use external process running on a PI, that reads the sensors pulses and remotely updates a virtual device in domoticz with latest values.
In this case If domoticz crashes it still knows the actual water_meter value. Since I moved to Cubietruck to host my domoticz (on SSD) I have never witnesses a crash before.

Kudo's to the programmers for building rock-solid !!
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 156
- Joined: Monday 25 May 2015 22:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2020.2
- Location: Netherlands
- Contact:
Re: Watermeter
Did someone already connect this meter directly to the Pi? Is it possible? 
Thanks!

Thanks!
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Watermeter
I use it but with a PiFace between it. So you have to use a non latest kernel version otherwise it doesn't work.
-
- Posts: 156
- Joined: Monday 25 May 2015 22:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2020.2
- Location: Netherlands
- Contact:
Re: Watermeter
So you have to use a PiFace for it?roblom wrote:I use it but with a PiFace between it. So you have to use a non latest kernel version otherwise it doesn't work.
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: Watermeter
I'm not sure but I think you should also be able to connect tree sensor to a GPIO port without the piface.
-
- Posts: 36
- Joined: Tuesday 08 September 2015 16:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Location: Germany
- Contact:
Re: Watermeter
Domoticz V2.3304, mySensors V. 1.5
--------------------------------------------------
Hi,
I'd like to revisit this. Using an Arduino with mySensors firmware I am sending V_FLOW, V_VOLUME and V_VAR1.
I'm sending all three under the same child ID. Is that correct?
Now, when I look out for devices I find the device with type "General", a device ID 0f 10 and the percentage as
mentioned in this thread before. Which as I understand is l/min.
B.t.w., wIll that eventually be changed into the more meaningful units?
What I don't get there is the total water consumption.
Looking further, I find a device with an ID of 1001. It originally presents itself as a "gasmeter".
It's type is "RFXMeter", subtype RFXMeter counter, physical unit kWh.
Since I don't get any meaningful data from my sensor yet (darn pulse detection ...) I can
not really tell what I'm getting here. Some large number with 20 digits
(Which I interestingly can't erase in the "Usage Last 7 Days" - graph. Idea anyone?)
What have I done wrong? What do I have to look at?
I'm wishing for something like the energy meter stuff (which works flawlessly now. I hope
I never have to reboot!): Total consumption, preferably in liters. Current flow in l/min
and maybe like in the energy meter water the current daily usage which is very useful.
Help,
anyone?
--------------------------------------------------
Hi,
I'd like to revisit this. Using an Arduino with mySensors firmware I am sending V_FLOW, V_VOLUME and V_VAR1.
I'm sending all three under the same child ID. Is that correct?
Now, when I look out for devices I find the device with type "General", a device ID 0f 10 and the percentage as
mentioned in this thread before. Which as I understand is l/min.
B.t.w., wIll that eventually be changed into the more meaningful units?
What I don't get there is the total water consumption.
Looking further, I find a device with an ID of 1001. It originally presents itself as a "gasmeter".
It's type is "RFXMeter", subtype RFXMeter counter, physical unit kWh.
Since I don't get any meaningful data from my sensor yet (darn pulse detection ...) I can
not really tell what I'm getting here. Some large number with 20 digits

(Which I interestingly can't erase in the "Usage Last 7 Days" - graph. Idea anyone?)
What have I done wrong? What do I have to look at?
I'm wishing for something like the energy meter stuff (which works flawlessly now. I hope
I never have to reboot!): Total consumption, preferably in liters. Current flow in l/min
and maybe like in the energy meter water the current daily usage which is very useful.
Help,
anyone?
-
- Posts: 36
- Joined: Tuesday 08 September 2015 16:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Location: Germany
- Contact:
Re: Watermeter
Hi,
another question about the watermeter, if I may.
I'm detecting the rotation of a wheel with one rotation marking the use of one liter. Whenever the pulse is detected I send my
updated values for VOLUME and FLOW and pulsecount to the server.
SO, we are looking at a pulse which is dependant on a full period to occur. If we are using water at a rate of, say, 8l/min and suddenly
stop using water the current interval "gets stuck", so to speak. No more values are updated, which means that our 8l/min are going
to be the "current consumption rate" for maybe a long time. Whereas the real consumption might be "zero".
Do You deal with that in Your firmware? How?
Same problem with the energy meter of course, but for us to have a usage of 0 kWh would mean that there is a black out
so there's never a longer gap...
Thanks,
Christoph
another question about the watermeter, if I may.

I'm detecting the rotation of a wheel with one rotation marking the use of one liter. Whenever the pulse is detected I send my
updated values for VOLUME and FLOW and pulsecount to the server.
SO, we are looking at a pulse which is dependant on a full period to occur. If we are using water at a rate of, say, 8l/min and suddenly
stop using water the current interval "gets stuck", so to speak. No more values are updated, which means that our 8l/min are going
to be the "current consumption rate" for maybe a long time. Whereas the real consumption might be "zero".
Do You deal with that in Your firmware? How?
Same problem with the energy meter of course, but for us to have a usage of 0 kWh would mean that there is a black out

so there's never a longer gap...
Thanks,
Christoph
- gizmocuz
- Posts: 2394
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Watermeter
I think you should upgrade to the beta version of domoticz, remove the water meter devices, and power the mysensors node back up.hyla wrote:Domoticz V2.3304, mySensors V. 1.5
--------------------------------------------------
Hi,
I'd like to revisit this. Using an Arduino with mySensors firmware I am sending V_FLOW, V_VOLUME and V_VAR1.
I'm sending all three under the same child ID. Is that correct?
Now, when I look out for devices I find the device with type "General", a device ID 0f 10 and the percentage as
mentioned in this thread before. Which as I understand is l/min.
B.t.w., wIll that eventually be changed into the more meaningful units?
What I don't get there is the total water consumption.
Looking further, I find a device with an ID of 1001. It originally presents itself as a "gasmeter".
It's type is "RFXMeter", subtype RFXMeter counter, physical unit kWh.
Since I don't get any meaningful data from my sensor yet (darn pulse detection ...) I can
not really tell what I'm getting here. Some large number with 20 digits
(Which I interestingly can't erase in the "Usage Last 7 Days" - graph. Idea anyone?)
What have I done wrong? What do I have to look at?
I'm wishing for something like the energy meter stuff (which works flawlessly now. I hope
I never have to reboot!): Total consumption, preferably in liters. Current flow in l/min
and maybe like in the energy meter water the current daily usage which is very useful.
Help,
anyone?
You should receive a meter, that you can edit, and set the type to 'water'
About the 8/l pulse problem, you should solve this in your sketch
Quality outlives Quantity!
Who is online
Users browsing this forum: No registered users and 0 guests