I want to get notified when the absolute humidity outside is lower than inside in the basement, so I know when it makes sense to open the windows. Therefore, I found this solution and implemented it:
Unfortunatelly, it occurs the follwoing error message:
“Invalid config for [automation]: [minutes] is an invalid option for [automation]. Check: automation->minutes. (See /config/configuration.yaml, line 9).”
It’s not entirely clear when you actually want to trigger the automation. If every minute then you want the time_pattern platform, not the time platform. See the examples by following those links.
A more efficient way to do this would be to trigger on the state change rather than polling with a time pattern trigger. You can do this with a numeric_state trigger or a template trigger. The advantage of the template trigger is that it will trigger on change of state of either sensor, where as the numeric_state trigger only monitors one.
You are also not using the recommended method of retrieving your sensor state in the template see the warning here.
Also you need to convert your states to numbers (they are stored as strings).
Finally addition is performed before the comparison is made so you can remove some extraneous parentheses.
thank you very much for you support! Quite a bunch of information, but I get it running.
Yes, the idea was to check the values every minute, but state change trigger is also ok.
One more question: Does this automation turn off the switch again when the condition does not apply any more, or do I habe to make a second automation for truning it off again? Is there a way to combine it with an if/else phrase?
No. There’s no switch.turn_off service call in the automation’s action.
If you want a single automation that turns the switch on/off then you need to do more than just add an if/else. The automation’s trigger and condition must be modified because now it is designed to detect only when the switch must be turned on and not when it must be turned off (I’ll let tom_I explain how to do it … or just create a separate automation dedicated to turning off the switch).