Page 2 of 2

Re: Domoticz 17592 . Waterflow devices not triggered if flow = 0

Posted: Saturday 04 April 2026 22:51
by domcars0
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.

Re: Domoticz 17592 . Waterflow devices not triggered if flow = 0

Posted: Wednesday 08 April 2026 15:54
by Gravityz
Maybee i can help you out.
i used to use espeasy also for a watermeter.
at first i tried to calculate the flow also until i found out that the pulscounter not only counts pulses, total but also time.
this time can be used to represent the flow/minute

this is the script i used but of course i do not know anymore which devices i specified(besides the pulsecounter).
it also collects the total value again in case there was an outage and the esp was reset.
i did this by initiating a mqtt broadcast so domoticz sends out the total through mqtt which is collected by espeasy

I migrated everything to a new watermeter using esphome.
that one is way better than the one i used with espeasy since it sends out everything over MQTT so no more dummy devices.

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&param=udevice&idx=344&nvalue=0&svalue=[Watermeter#Total]
		SendToHTTP 192.168.1.50,8084,/json.htm?type=command&param=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&param=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&param=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&param=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 :roll: