New condition: Whether an event was triggered manually (through UI interaction) or automatically

It would be nice in automations to have a condition/check whether an event was triggered automatically/internally by the system or a device or manually by the user through the UI.

One use case is our patio light: If it is turned on by the motion sensor it should turn off again after 30sec but if I turn it on through the UI/app I want it to be permanently on.

Why do you need a condition to do this?

In your automation the motion sensor should be the trigger. Use a wait template in the action after the light turns on to keep the light on until there is no motion for 30 seconds then turn the light off.

Turning the light on from the UI or wall switch will never trigger this automation and therefore the light will not turn off automatically.

If you are using an event from the light turning on as the trigger, you’re making things way more complicated than they need to be.

Where things do get more complicated is if the light is already on when motion is detected. You don’t want the light to turn off when the motion sensor turns off (assuming since it was already on).

To prevent this put a condition in the automation that prevents it from running if the light is already on when motion is detected.

1 Like

Hi Andreas,

Look in the blueprints section. Several people have written blueprints for you that work that way.

Put this in your favorite search engine…

site:community.home-assistant.io blueprint motion light

1 Like