Re: Domoticz 17592 . Waterflow devices not triggered if flow = 0
Posted: Saturday 04 April 2026 22:51
OK thanks, I will see what I can do to turn around this bug. But for me, if it's not a bug, it's a bad regression.
Join 16,000+ members discussing home automation with Domoticz. Get help with Zigbee, ZWave, MQTT, scripting, and 150+ integrations
https://forum.domoticz.com/
Code: Select all
on Pulsecounter#Count=1 do // When Pulse is detected
if [Watermeter#Total] != 0 // and watermeter was not reset
TaskValueSet 3,2,60000/[Pulsecounter#Time] // set Water#Flow
timerSet,1,16
TaskValueSet 3,1,[Pulsecounter#Total]
SendToHTTP 192.168.1.50,8084,/json.htm?type=command¶m=udevice&idx=344&nvalue=0&svalue=[Watermeter#Total]
SendToHTTP 192.168.1.50,8084,/json.htm?type=command¶m=udevice&idx=338&nvalue=0&svalue=[Watermeter#Flow]
//Publish domoticz/in,'{"idx":344,"nvalue":0,"svalue":"[Watermeter#Total]"}'
//Publish domoticz/in,'{"idx":338,"nvalue":0,"svalue":"[Watermeter#Flow]"}'
if [Watermeter#Flow] > [Watermeter#MaxFlow]
TaskValueSet 3,3,[Watermeter#Flow] // copy Flow to MaxFlow
endif
endif
if [Watermeter#Total] = 0 // in case watermeter is still 0
SendToHTTP 192.168.1.50,8084,json.htm?type=command¶m=switchlight&idx=334&switchcmd=On //initiate mqtt broadcast
endif
endon
on System#Boot do // When the ESP boots, do
TaskValueSet 3,2,0 // Reset the Flow counter to 0
endon
on MQTTimport#Connected do
if [Watermeter#Total] = 0
SendToHTTP 192.168.1.50,8084,json.htm?type=command¶m=switchlight&idx=334&switchcmd=On //initiate mqtt broadcast
endif
endon
on DomoticzWatermeter#Total do
if [Watermeter#Total] = 0
TaskValueSet 3,1,[DomoticzWatermeter#Total]
SetPulseCounterTotal,[DomoticzWatermeter#Total],1
endif
endon
on Clock#Time=All,00:00 do
TaskValueSet 4,1,[Watermeter#Total]
endon
on Rules#Timer=1 do // When flow Timer 1 expires, do
TaskValueSet 3,2,0 // reset flow to 0
SendToHTTP 192.168.1.50,8084,/json.htm?type=command¶m=udevice&idx=338&nvalue=0&svalue=0
//Publish domoticz/in,'{"idx":338,"nvalue":0,"svalue":"0"}'
timerSet,1,0
endon
domcars0 wrote: Saturday 04 April 2026 19:44 I need to know how much water has been consumed and for how long from the moment the water starts to flow. The device is updated every 30 seconds by ESPEasy. Timer trigger every 30 seconds is not possible![]()