Page 1 of 1

Water meter

Posted: Sunday 28 August 2016 21:29
by raptorjr
I've made a water flow sensor and use MySensors to send the data to Domoticz.

It is presented with:
present(WATERFLOW_ID, S_WATER, "Water flow");

And sends messages:
MyMessage flowMsg(WATERFLOW_ID, V_FLOW);
MyMessage volumeMsg(WATERFLOW_ID, V_VOLUME);

What I would like is to measure the amount of water when a valve is opened, and then close the valve after a given amount has flown through the sensor.

I added it to Domoticz and it is not working as I hoped. First, it says, in the upper right corner of the sensor, 353880992 Litres?? Where did that number come from? And how do I reset it every time the water valve is opened? I don't want a overall total amount of water, I want the total for this specific open/close session of the valve.

On the Utility page there is also a 0.000m3 meter that seems to show the value for the current open/close session, but it is not shown when used on the dashboard, all I see then is 353880992 Litres. And I would liked to have the value in litres instead of cubic meters and shown on the dashboard.

Is it possible to get what I want? A representation showing the volume in litres for the last open/close session of the valve? It feels like Domoticz is made for some very specific setups/sensors, and maybe not very flexible in it's usage? But I could very well be my lack of knowledge. I hope it is.

Re: Water meter

Posted: Monday 05 September 2016 22:08
by raptorjr
Not possible to solve this? Any suggestions on another way to do it?

Re: Water meter

Posted: Wednesday 14 September 2016 14:51
by Yobby
I don't if you still need it, but using a lua-script, a virtual meter and a uservariable it should be possible.

When the valve is opened, set the uservariable to the total water amount from the actual Waterflow sensor, and with each update of that sensor, set the value of the virtual meter to the difference in liters between Waterflow sensor and uservariable.
And to finish: If [virtual meter] >= [amount wanted] then [close valve]

Re: Water meter

Posted: Monday 19 September 2016 20:54
by raptorjr
Yobby wrote:I don't if you still need it, but using a lua-script, a virtual meter and a uservariable it should be possible.

When the valve is opened, set the uservariable to the total water amount from the actual Waterflow sensor, and with each update of that sensor, set the value of the virtual meter to the difference in liters between Waterflow sensor and uservariable.
And to finish: If [virtual meter] >= [amount wanted] then [close valve]
I still need it. Haven't found a solution. But all this is very new to me, so I don't really understand what kind of virtual meter to create?

Re: Water meter

Posted: Tuesday 20 September 2016 10:44
by Yobby
raptorjr wrote:I still need it. Haven't found a solution. But all this is very new to me, so I don't really understand what kind of virtual meter to create?
  • Setup
  • Hardware
  • Add Dummy
  • Create Virtual Sensors
You could just use Custom Sensor in the dropdown. Or Rain, as it has both flow&volume.

Image

Re: Water meter

Posted: Tuesday 20 September 2016 17:28
by raptorjr
Thank you for your reply. I could try the rain sensor. Not a problem for me to change the sketch and present the watermeter as a rain sensor. Then I wouldn't have to make a virtual sensor.

But anyway, I know how to make virtual sensors. But this custom sensor you talk about, how can I create it? In another thread I also got the advice to create a custom sensor, but never a explanation how to do that.

This is the only sensor types I have available when creating virtual sensors:

Image

Re: Water meter

Posted: Tuesday 20 September 2016 19:22
by Yobby
As you see above, I'm running the beta, version 3.5641

and I get this:
Image

Re: Water meter

Posted: Tuesday 20 September 2016 22:20
by raptorjr
Thank you. Guess I'll have to test the beta then.