Problem with a rule set if-statement
Posted: 09 Feb 2025, 20:35
Context:
I have an electric boiler to get hot water(duh..) manly for showering.
To reduce the electricity bill i added a heat exchanger to preheat the cold tapwater entering the boiler when it is being used.
The heat exchanger is getting its warm water from a buffertank that is being heated from a woodstove in my house.
I placed temperature sensors onto all the lines entering and leaving the heat exchanger and after the install time to test it working manually.. and its a success!!
But now to automate this..
In the tabwater-line i added a hall-effect flowmeter so i can sense when there is warm water being used installed this onto my esp8266 and after some callibration this is also working correct. the interval i set to 10 seconds
In my Domoticz setup i added a dummy-switch (idx 359)that i can use to see if there is hot water being used and i made a rule to get this done:
and this works! Hurray!!
The only thing i don't like is that every 10 seconds these commands are sent cluttering the logs so i tried to expand on this rule..
Problem:
I added a Internal variable to get a counter going, the counter starts adding 1 to it when the flowmeter is measuring flow. and send the command to switch on the dummy swich. also 1 is added to the counter.
when the counter gets to 3 the command wil not send anymore to domoticz.
When the flow measured zero and the counter is more or equal to 2 the off command is sent and 1 is substracted from the counter until the counter hits 1 and every thing is paused until again water is flowing..
This reduces the commands beeing sent to 4 (double to be shure..) in stead of 360 an hour. In (my) theory this should be working but it doesn't and i don't see why.. Some info into this failing is greatly appreciated.
I have an electric boiler to get hot water(duh..) manly for showering.
To reduce the electricity bill i added a heat exchanger to preheat the cold tapwater entering the boiler when it is being used.
The heat exchanger is getting its warm water from a buffertank that is being heated from a woodstove in my house.
I placed temperature sensors onto all the lines entering and leaving the heat exchanger and after the install time to test it working manually.. and its a success!!
But now to automate this..
In the tabwater-line i added a hall-effect flowmeter so i can sense when there is warm water being used installed this onto my esp8266 and after some callibration this is also working correct. the interval i set to 10 seconds
In my Domoticz setup i added a dummy-switch (idx 359)that i can use to see if there is hot water being used and i made a rule to get this done:
Code: Select all
On BoilerWarmWaterVraag#Count do
if [BoilerWarmWaterVraag#Count]>0.010
SendToHTTP,<user>:<password>@192.168.178.2,7080,/json.htm?type=command¶m=switchlight&idx=359&switchcmd=On
endif
if [BoilerWarmWaterVraag#Count]=0
SendToHTTP,<user>:<password>@192.168.178.2,7080,/json.htm?type=command¶m=switchlight&idx=359&switchcmd=Off
endif
endon
The only thing i don't like is that every 10 seconds these commands are sent cluttering the logs so i tried to expand on this rule..
Problem:
I added a Internal variable to get a counter going, the counter starts adding 1 to it when the flowmeter is measuring flow. and send the command to switch on the dummy swich. also 1 is added to the counter.
when the counter gets to 3 the command wil not send anymore to domoticz.
When the flow measured zero and the counter is more or equal to 2 the off command is sent and 1 is substracted from the counter until the counter hits 1 and every thing is paused until again water is flowing..
This reduces the commands beeing sent to 4 (double to be shure..) in stead of 360 an hour.
Code: Select all
On BoilerWarmWaterVraag#Count do
if [BoilerWarmWaterVraag#Count]>0.010 and [var#1]>3
SendToHTTP,<user>:<password>@192.168.178.2,7080,/json.htm?type=command¶m=switchlight&idx=359&switchcmd=On
Let,1,[var#1]+1
endif
if [BoilerWarmWaterVraag#Count]=0 and [var#1]>=2
SendToHTTP,<user>:<password>@192.168.178.2,7080,/json.htm?type=command¶m=switchlight&idx=359&switchcmd=Off
Let,1,[var#1]-1
endif
endon