Previous state and previously triggered by

I would like to have a ‘previous state’ from an entity and a ‘previously triggered by’ as condition options (in ui) in automations.

This can be used for exampe in an automation, where lights need to turn on, when my tv gets paused, but only when my lights where previously on and triggerd by the automation that turned my lights off. So if i turned off my lights mannualy and i pause my tv, the lights stay off.
This could be handy for example in the bedroom when the wife is sleeping and i’m still watching tv.

An example for the ‘previous state’ can come in handy as i have my air conditioner running as a heater and i open my back door, then the heating turns off. But when i close the door, i need to set the same state to the air conditioner (heat / cool / dry / fan / etc), with the previous state i can easily reffer to the previous state.

Isn’t this what scenes are?
When an automation triggers you create a scene and then do the action, when you want to revert back you enable the scene.

Well it could be used for other things as well I’m currently using this to avoid getting multiple notifications if my entrance camera was triggered again within a certain time.

At the moment I’m just doing this

{% set last_triggered = state_attr('automation.entrance_camera_ai_trigger_person', 'last_triggered') %}
{% if last_triggered %}
{{ ((now() - last_triggered).total_seconds()) > 120}}
{% else %}
True
{% endif %}