Automation MQTT light entity triggering immediately

I have an light entity (MQTT). It triggers and registers within home assistant perfectly. I set a “trigger” on with motion/door sensors to activate the light. Works great even with conditions like after sun set ect. I am having issues now creating a new automation to turn off the light after some time or after the motion has stopped. No matter what conditions (motion/time) it will turn off the light within a second of triggering the light on. This is even if I have conditions saying after 30 mins after motion stopped or after 10-30 minutes time. I don’t know why these lights are acting this way. Please help.

Post your automation please

1 Like

Please post the automation’s YAML code, not a screenshot of it in the UI.

See #11 in the following guidelines:

The condition will be evaluated as true or false as soon as the automation is triggered.

In your automation, as soon as the light is turned on, if the door has been closed for more than ten minutes ( at the instant you turn the light on ), the light will turn off.

I think what you want is:

Trigger - light turns on

Action - delay for ten mins
- check if door is closed, or has been closed in the last ten minutes
- Turn light off.

Also, I’ve never had too much luck using devices in automations.
If you have further problems, you might want to address the underlying entity_id directly in your automation.