Newbie here. I spent lots of time searching before asking and I can’t find what I need.
I have a working automation. I need to add something at the end of it to run a different working automation.
Would that be an action? Call Service?
Short story. Outside light on at a few percent dusk to dawn. I want it o go to 100% on camera motion for say 5 minutes. When it’s done I want it to call the on at dusk automation. I have everything working as I want but I can’t automate the return to on at dusk automation.
Triggering another automation is really just calling a script (automation actions and scripts are the same thing, feature-wise). Is your second automation a full automation, i.e. with a trigger that can also be triggered by itself?
What might be more readable and semantically better is to put part of your second automation in a script which either automation can then call.
That said, you can also emit a custom event in one automation that another can trigger on.
It also helps to see what you have so far, because for a newbie there could be more suggestions.
My goal is to have security lights on from dusk to dawn or times that I choose. Some I will want dusk to dawn and some I will want say dusk to 10pm.
I want the lights to come on at say 10% and stay that way until it’s time to go off. If a camera picks up motion and triggers say a cross line detection the lights of my choice will go to 100% for some period of time that I chose.
I also need a way simple way to override the automation and have it or them to stay at 100% as long as I way. Say I am working in the yard or have a gathering and I want the like to stay on. I could see putting something like a simple Zigbee button to toggle an override.
Switch the Automation Editor from visual mode to YAML mode, copy the displayed YAML and paste it here. Then select what you pasted and click the </> icon (in the forum’s menu) to format the YAML code.
alias: Front Porch - Off at Dawn
description: ""
trigger:
- platform: sun
event: sunrise
offset: 0
condition: []
action:
- service: light.turn_off
data: {}
target:
entity_id: light.front_porch
mode: single
Picking up on this thread as I run into the same need and can’t find a clear answer.
I need the exact same thing - do something after an automation has ended.
I think the above from: "off" to: "on" is looking at whether or not the automation itself is active or not, and not whether its running or not.
I tried the following attribute: current without greater success:
...
trigger:
- platform: state
entity_id:
- automation.the_automation_that_should_trigger_this_one_when_it_ends
from: "1"
to: "0"
attribute: current
condition: []
action:
- action: light.turn_on
...
Something tells me that there’s a more appropriate way to do it. @123 seems to know a better way but I didn’t understand his answer
Is there a best practice on how to trigger one automation when another ends?