Have been developing the rules code below to activate an air conditioner. I have limited exposure to ESPEasy, and I am not totally comfortable with the various if, then, else type loops. The code below works, but I wouldn't say it was an 'elegant' way to do the job.
So I am looking for your advice... what suggestions do you have to improve my rules code?
Code: Select all
On Temp2#Temperature do
if [Temp2#Temperature] > [Temp1#Temperature] and [Temp1#Temperature] > 25
Event,StartHP
endif
endon
On Temp2#Temperature do
if [Temp2#Temperature] < [Temp1#Temperature] and [Temp2#Temperature] = 21
Event,StopHP
endif
endon
on Temp1#Temperature do
if [Temp1#Temperature] > 27
Event,StartHP
endif
endon
On StartHP Do
If [counter#dummy]=0
heatpumpir,daikin,1,3,0,24,4,2
TaskValueSet 4,1,1
EndIf
EndOn
On StopHP Do
If [counter#dummy]=1
heatpumpir,daikin,0,3,0,24,4,2
TaskValueSet 4,1,0
EndIf
EndOn