You know, one thing I wish we could support was BACnet style priorities. The way they work is that you have sets of settings - for a light it might be ON, OFF, and DIM level - and each setting command is at a priority level. The state of any device is whatever the highest priority level says to do, and each priority level can be set to “relinquish” which means do nothing i.e. lower priorities take over.
Imagine a situation where you want to have a ‘panic’ mode. You hit one button, all lights turn on. Now what happens when you want to exit panic mode? You don’t want to just turn everything off. You don’t necessarily even want to return to the previous state, because what if an automation changed that state while you were in panic mode? The way BACnet does it is you write an ON command at a higher priority level. If automations or manual control does something, that’s fine - it gets noted at say priority 7. That has no effect on the device, because it is overridden at priority 1, but it is written into the priority array and noted. Then later you want to exit panic mode, so you send RELINQUISH: PRIORITY 1. Now it reverts to the net lowest level, so none of the automated actions or manual overrides that took place when it was in this special mode have any effect.
I’m actually trying to solve a specific problem right now - panic mode - but that’s not the only problem. I’m trying to set it up so that you can enter panic mode (all exterior lights on) but when you exit that mode things revert. The way I’m doing it right now is that panic mode is an automation that remembers the previous state before it makes any changes, then after a timeout it reverts to that remembered state It’s just not quite right … because automations may have changed the desired (non-panic) state while panic is active. There’s not really a good way to catch everything any manual override or automatic state changes have taken place while in this mode, and in fact, if I hit PANIC at 9:59PM and an automation turns the light off at 10:00 PM then that automation really defeats the panic.
This is just an idea, it doesn’t necessarily fit home-assistant (you be the judge) but BACnet spent a lot of time thinking this through, it’s relatively simple, and it makes sense. It’s something that certainly could be added to tasmota and esphome; probably less feasible for more manufactured hardware at least for manual overrides but in terms of having higher priority commands not interfere with automations it seems like home-assistant could solve most of the edge cases if this was interesting to people.