Well it sounds simple but I couldn’t seem to find a way.
Long story short, I’d like my light automation to only turn off light when the light was turned on by automation. In other words, if the light is turned on manually it should not be turned off by the automation. In activity I can easily see when the light was on by which automation, but this info is not exposed when the automation is later triggered.
I know I can add a input Boolean helper, it’s not a perfect solution and hence would like to ask maybe there is another smart way to make it work?
Take a look here:
You can save the turn on context in a sensor.
Edit: too slow.
Thanks both - I have already bookmarked the post and it was very helpful!
One thing I don’t like to is create a helper just to keep history (in Tom’s example a mode selector between Auto and Manual). In my simple mind anything done manually should just not be overridden by automation.
With context id I need to remember the action for later automation - it would be nicer if HA can somehow allow query Activity data of a device in the future (the data is certainly there in activity view).
For now I will just do something for each room - don’t want too many helper for each light ![]()
Have a nice weekend!
Find this: Home Assistant Context | Home Assistant Data Science Portal
Will dig further
This feature will be added in the 2026.9 version.
Sorry which feature do you mean?
There is a new feature in the current beta to provide better insight in the things that caused something to happen. You can check it out now by joining the beta program or wait till next wednesday for the final release.
That’s view only. It does not help with automation.
Unfortunately. That and the new security views are screaming action or template for me please…
one of my first automations (and still running 3 years later) runs however the entity was changed, manual or by automation.
It’s simple and has to work this way: it turns of a switch after 150ms to simulate a button press.
Just as an example on why somthing might need to be overridden by an automation even when done manually.
I like your idea for basic lighting though.