I’ve been trying to make my first custom automation with temperature based switch control.
I.e. if temperature drops below a certain value, i would like to turn a switch on - and if it goes above the same number it should turn the switch off.
There are a lot of examples here, and it seems fairly simple - but most of them seem to be slightly deprecated syntax wise, and I can’t seem to get them to run.
All i get when i reload my automations is this error:
“Invalid config for [automation]: [service] is an invalid option for [automation]. Check: automation->service. (See /config/configuration.yaml, line 9).”
Can you help me out? This is what i got so far:
(Like to skip the trigger above/below value, but that seems to be mandatory now as well)
I think this will execute every minute as sensor.temperature_2 is set conditionally at 7.5 but triggers at 100. I think you could save some resources by going
No. There is no time pattern trigger. It has a numeric_state trigger that will only trigger when the state changes from above 100° to below 100°. Changing from 90 to 80 or 50 to 60 for example will not trigger this automation.
The way the automation is written it is unlikely to ever trigger.
This whole automation could be replaced with a generic thermostat.
This is what i ended up with, before switching over to using the generic thermostat instead - which is indeed a much better solution, especially with the thermostat dashboard card.
Figure it’s best to post the solution here if someone else is having the same initial issues as me:
I’m trying to do something very similar here. I have a fan controlled by a switch, and a temp sensor in that room, and I’m trying to basically say:
“if the temp in the room has been above 72 for more than 5 minutes, turn the fan on”, and the functionality I’m looking for is for HA to turn the fan off again once the temp is below 72.
It looks like we still can’t put the ‘for x amount of time’ stanza inside an if statement. This is the automation I have right now for it, but I could totally use a second set of eyes if anyones willing to see if they can spot any issues with the logic.
As suggested above, you could use a generic thermostat and it would just work. You could also use scheduler if you wished to change the temperature throughout the day.