I'm new to HA, but my first use case seems to be so hard I must be doing something wrong. I have outside lights A, B, C, D. And want the following
- Around subset A comes on
- At midnight A, B, C, D all go off
- Switch S1 on, A, B, C should come on
- Switch S1 off, A, B, C should go to whatever state their default state should be e.g. A will be on if its before midnight, off after
- Switch S2 on, A, C, D should come on
- Switch S2 off, A, C, D should come on revert to their default state
- Motion detected A, C, D should come on for 10 mins, before reverting to their default state (which depends on time and S2)
In essence I have a back light (S1), front light (S2) and motion sensor and they all overlap on what lights to turn on/off.
I can technically program this with huge numbers of complex interacting automations - but it's impractical to keep straight. I can get close with a save/restore state script, but it gets confused if they overlap. I can see a way with lots of helpers I could probably do it as well, but again, wildly complex. Am I missing some easy option?
What I really want is assertion/ref counting lights where each of the above actions turn_on a set of lights which increments a refcount for the light, and at off, decrements it - but the light only goes off if refcount == 0. That way they can overlap all they want and it would work logically regardless of the ordering/overlap