WTH: Why can't we use context in automations?

If automations would know what changed the state, that would allow lots of new things.
E.g. context in trigger:
If user X turns on the light, scene X gets activated - if user Y turns on the light, scene Y gets activated
Or if I turn off one kitchen light with the button, this light should go out. If I turn off the same light with alexa and its night, all other lights in the room should follow.

E.g. context in condition:
A motion sensor automation wouldn’t turn on the light if it was turned off manually the last time (context: user in browser or smart wall switch)
Or a brightness automation could disable brightness updates if the last update was done manually

I’m sure other users will have even better ideas :wink:

You actually can use context in automations…

1 Like

Oh, I’m sorry - I must have missed that. I already searched through the docs, before posting this, but it seems not to be documented.
If others looking for something like this - that post helped me now: Is there a way to refer to the current running automation *within* that automation, like "self"?

In 115 you can also use the context variable in your scripts https://github.com/home-assistant/core/pull/39034

3 Likes