For some background on what I am trying to achieveā¦ I am attempting to migrate from several ESP8266 NodeMCU units running ESPEasy to a single Rpi running Hass.io. Not sure if anyone here has experience with ESPEasy, but for reference this is the code I created in the ESPEasy ārulesā section that controls relays based upon temperature sensors.
On System#Boot do
notify 1, "%sysname% is started" // Send email
timerset,1,30 // Set timer 1 to 30 seconds
timerset,2,30 // Set timer 2 to 30 seconds
timerset,4,30 // Set timer 4 to 30 seconds
gpio,12,1 // Turn off the fan
gpio,14,1 // Close the damper
TaskValueSet 7,1,0 // Set Damper to Close
TaskValueSet 7,2,0 // Set Fan to Off
Let,1,22 // Set lower temp to 22
Let,2,24 // Set upper temp to 24
endon
On Rules#Timer=1 do
timerset,1,30
if [Temp1#Temperature] >= [var#2] and [status#Damper]=1
Event,StartFan
endif
if [Temp1#Temperature] <= [var#1] or [status#Damper]=0
Event,StopFan
endif
endon
On Rules#Timer=2 do
timerset,2,30
if [Temp2#Temperature] < 19 and [counter#Dummy]=0
Event,OpenDamper
endif
if [Temp1#Temperature] >= 25
Event,CloseDamper
endif
endon
On OpenDamper Do
If [status#Damper]=0
gpio,14,0 // Open the damper
TaskValueSet 7,1,1
EndIf
EndOn
On CloseDamper Do
If [status#Damper]=1
gpio,14,1 // Close the damper
TaskValueSet 7,1,0
EndIf
EndOn
On StartFan Do
If [status#Fan]=0
gpio,12,0 // Turn on the fan
TaskValueSet 7,2,1
EndIf
EndOn
On StopFan Do
If [status#Fan]=1
gpio,12,1 // Turn off the fan
TaskValueSet 7,2,0
EndIf
EndOn
On ACStatusOn
Let,3,1
EndOn
On Clock#Time=All,3:26 do
timerSet,3,55
Endon
on Rules#Timer=3 do
WifiDisconnect
Reboot
endon
on Rules#timer=4 do
Publish %sysname%/IP,%ip%
Publish %sysname%/Damper/Status,[status#Damper]
Publish %sysname%/Fan/Status,[status#Fan]
Publish %sysname%/Door/Status,[StudioDoor#State]
timerSet,4,30
endon
I am essentially learning the Hass.io automation syntax to try and emulate what I developed above in ESPEasy. Hope this makes sense?