I was wondering if it is somehow possible to have priorities of automation using Home Assistant.
For example: HASS.io is used to control my ventilation at home based on humidity level. What I want it to do now, is having the following setup:
if I’m at home, run ventilation at level 2
if I’m not at home, run ventilation at level 1
If humidity is higher then x, run ventilation at level 3 despite the fact if someone is home or not.
if humidity is back to normal, go back to 1. or 2.
So 3. would always win aka have the highest prio. I know that I could just add conditions to check if someone is home for all the rules in order to work, but that seems to be a not so nice solution.
Also is it possible to define something like constants in automation so you don’t have to repeat values all the time like when having multiple rules with the same humidity values?
I think it’s not that difficult as automations are based on a trigger and conditions. So they are triggered when you get home and leave home. You can add a condition to these two automations to check if humidity is lower as x so both automations to not change the ventilation level. The humidity > x automation is simple. For the humidity back to normal you could use a template or split it up in two with a condition home or away.
You might even do it in one automation using templates but that probably takes some more time to figure out.
yeah it doesn’t work this way. I have several sensors here reporting humidity or air qualitty level and I want my ventilation to be triggered based on that values in a way that:
if one of the sensors a b c d e is higher then 70% turn on ventilation level 3
if one of the snesors a b c d e is between 60 and 70 turn on ventilation level 2
if all of the sensors a b c d e are below 55% turn on ventilation level 1
my problem now is, that the second rule will overrule the first one if one of the sensors is between 60 and 70 turning ventilation to level 2 only although 3 is the proper one. So what I need here is to define rule 1 as the one with highest priority and only if no of the sensors a b c d e is higher then 70, it will check the states of rule 2.
like: if rule 1 was triggered, skip rule 2. if rule 1 wasn’t triggered, try rule 2. and then back to normal with rule 3.
I can’t see how to model this state machine with HA’s automation.