Keep lights ON

Hi guys,
I am new to home assistant. Not so new to home automation.

I am re-doing my setup at home and before I do all rooms (lights automation) I would like input on running Automations and starting script from automation.

In automation triggered by motion sensor I have couple of conditions and if they are met I start script. My assumption was that the script would run separately from the automation.

Ideally I want to restart the automation when motion sensors re-trigger when person is still in the room.

I am getting error bellow.

Stopped because only a single execution is allowed

I am assuming that is because the script is still running (with set delay) and technically part of the automation before lights turn off.

How is this correctly handled in home assistant?

Why not skip the script and run automation in restart mode?

1 Like

you could also do this with two simple automations:

  1. if motion detected and lights are off, turn the lights on
  2. if no motion detected for x minutes and lights on, turn lights off
1 Like

Test running the automation in parallel mode and eliminate the delay if you can.

mode: parallel

Increase the occupancy time out on the sensor to account for the delay.

You should be able to eliminate running a separate script with all the features in Automation.

Can you post your Automaton and Script code?

1 Like

If the final action is off. Parallel will result in lights off(automation end) then back on(automation restart)

I agree, but both can be applied depending on the actions.

If multiple actions in the Automation execute in series, parallel will allow the other actions to execute if one of the other actions failed.

You may be 100% right, but without the actual script and automation, we could debate this all night.

Thank you guys… I will check out your suggestions. So much to learn. I’ll start experimenting with Automation mode now since I know it exists. :star_struck:

1 Like

This can be a single automation

trigger IDs allow you to identify triggers and trigger a different action for each trigger ID

1 Like

I have ended up with single automations in Restart mode… It was exactly what I was looking for.

Thank you for your help.