The scenario is a light that should mostly run on a motion sensor, but sometimes will also be manually set to something else and should then ignore motion until it is turned off again.
For that, I'd like the automation to be aware of itself having been what turned on the light in the first place.
I'm sure there could be some workarounds involving helper entities, but looking at the logbook, I can see that the data exists in home assistant.
Question is:
Can I already access that data?
And if not, am I only a custom_component away from having access to said data?
Answer:
Yes. Like this:
{{ states['light.se_laemp'].context.origin_event.data.entity_id == this.entity_id }}