I am trying to automate my hallway lights when I come home.
I have a HUE motion sensor outside the door, and on the door I have a Aqara contact sensor.
What I am trying to achieve is to turn on the lights when I come home, that is, HUE motion sensor detects the motion outside the door and when the Aqara contact sensor on the door state changes to open the lights turn on. I don’t want the hallway lights to turn on when I open the door and I am about to leave, so, the order of state changes matters. First motion/occupancy detected, then binary sensor on the door changes to open, only then will the light turn on.
A binary sensor, during normal operation, only ever has two states - on and off. so the only state it can usually come from is off. The only other state it could have if something has failed is ‘unavailable’.
Instead of using the Trigger type State from - to I was using Trigger type Device and the trigger was contact is open. I wasn’t aware of the State trigger
While I don’t use the UI editor and therefore don’t use the device triggers I would assume that “contact open” from a device is functionally equivalent to “to on” from a state trigger.
But if it’s working then that’s all that really matters.