Turn on fans at night (depdending on some temperatures), and off in the AM!


#1

1) Give a description of the problem
This is my first automation… I am trying to figure out how to make it run regularly based on sunset and sunrise times.

2) What is the expected behaviour?
After sunset, if temperature conditions are met, turn on a couple switches (fans are connected). After sunrise, no matter what, turn them off.

3) What is happening/not happening?
I’m confused about how this is triggered (is the if condition of “it is sunset” being evaluated constantly?) - and how this would turn off, without some kind of while() loop…

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full
I don’t think this is needed as of yet, thanks.


#2

For the current temperature (forecasted) use $twcweather.conditions.temperature. That said, to avoid hammering the twcweather servers, you might want to create a currentTemp variable and update it on a timer every 30 minutes.
“Time is between” is being evaluated frequently (I’m not sure of the period. Every minute? maybe).