I am using a Sonoff Dual R2 to control 120v contactors to control my pool pump and cleaner, but this does not give me freeze protection. With it getting cooler, I need to make sure that I get this going. How would I go about adding freeze protection to these very basic automations? I have tried on my own a few times, but it doesn’t even validate in HomeAssistant.
I would like to keep it on for the times listed, but I need it to kick on when it gets to 39 degrees as well no matter what.
- id: pool_pump_start
alias: Pool Pump start in the morning
trigger:
- platform: time
at: '08:00:00'
action:
service: switch.turn_on
entity_id:
- switch.Pool_Pump
- id: pool_cleaner_start
alias: Pool Cleaner start in the morning
trigger:
- platform: time
at: '12:00:00'
action:
service: switch.turn_on
entity_id:
- switch.Pool_Cleaner
- id: pool_pump_stop
alias: Pool Pump stop in the evening
trigger:
- platform: time
at: '18:00:00'
action:
service: switch.turn_off
entity_id:
- switch.Pool_Pump
- id: pool_cleaner_stop
alias: Pool Cleaner stop in the evening
trigger:
- platform: time
at: '14:00:00'
action:
service: switch.turn_off
entity_id:
- switch.Pool_Cleaner
Indentation and syntax is very important. So, for us to better help you, please format your code per the instructions in the blue box at the top of the page:
It will probably be easiest to create a separate anti-freeze automation that fires every five minutes. Look at automaton 3 here.
You also will need to add a numeric_state condition that the temperature is below 39 degrees. That way home assistant will check every five minutes, and if so turn on the pump.
You should do that instead of triggering on the temperature dropping, because if you miss the temperature crossing from above to below your threshold it will never fire (e.g. You restart home assistant and it’s already cold out).
You could also create a freeze stop automation that just triggers on the numeric state of the temperature going to above say 41 degrees that turns off the pump, with a time condition to check that it’s not during the normal pumping hours.
You need to add a numeric_state condition to that first automation. As is now, it will fire every ten minutes regardless of temperature. (and also when the temperature drops.)
Also I would change the temp in the second automation to 40, just in case the temp bounces rapidly above and below 39. Not essential, just my paranoia.
Yes. I haven’t checked the syntax but the general triggers and conditions and whatnot should do what you want.
You can test this automation by manually setting the temperature using the states tool under development tools on the front end. The sensor will read that fake temperature until your actual sensor sends an update.