So when i reboot HA, i have various (zigbee) sensors that start. For example, i have a aqara door sensor and an automation that checks if the front door is closed (closed is the trigger).
This automation (and others) seem to run when i restart. They are all zigbee sensors and the problem is they go to unavailable, then back to the old state and the automation kicks off as a result.
Now i saw this discussion about creating inverse sensors (i have below problem as well with the rain sensor (it also uses a aqara sensor) and it going to unavailable upon restart for a while), and i was wondering if i should create these inverted sensors for the other zigbee sensors as well.
I hope i’m making sense. Although rather then creating inverted sensors, maybe i need to change the trigger ? I guess what’s happening is that the sensor goes to unavailable, then back to the previous state (closed) and the automation runs.
and for something like the quoted post an inverted sensor ?
Is that about right? The value_template condition still feels like a hack though, but i guess if my automation only triggers on state ‘closed’ and it’s coming from state ‘unavailable’ after a reboot for example, then i guess it’s correct… (but maybe there should be a button in HA somewhere to not start automations if coming from state unavailable).
I’m currently using device to trigger ‘front door closed’. So i suppose the better way would be to use state instead? That does seem to fix a lot of things indeed.
I have a battery percentage check which does the same:
But i guess it never went unavailable. The other alternative i can think off is setting a condition to make sure the battery is above 10 before running it. All seems way hackier then i want to. Using state seems like a elegant solution.