Access to trigger.to_state.context from a different entity?

Would it be possible to dynamically create attributes for all lights?
Or create the sensors dynamically?
Maybe using something like this: