Sometime relatively recently home assistants got to know who changed the state of a device.
For example, a light that is turned on via the Lovelace interface is “turned on by user”. But if it’s turned on by automation then the name of the automation is there. If it was appdaemon turned on then it says “turned on by Hass.io” I am not sure what to call this, but its what I am looking for!
I want to be able to have app daemon set this “by value” and also check its last value so that an action can be conditional. For example, if the light turned on via appdaemon due to motion then turn it off after a delay. But if it was turned on by the switch then leave it alone (or have a longer timeout).