So i have an issue that when i reboot home assistant it triggers an automation that runs when presence changes from detected to clear on a sensor which adjusts lighting. i imagine that this is because it shuts down the esphome integration before the automation stuff and the light controlling stuff which then triggers it when its disconnected. but when it comes back up it doesnt trigger the reverse automation. so i am left sat in the dark...
any ideas on stopping the automation from starting if the system is going down for reboot? is there a flag somewhere i can check with a template condition perhaps?
its a minor inconvenience really as i am not really restarting a lot and if i am i can disable the automation. but i feel like there is probably a solution but i haven't found it as of yet. Its just a pain when i update a couple of integrations and end up in the dark...