I would love to be able to have an automation that runs any time triggers are met and have a second account that runs only after a condition is also met without the need to create a second nearly duplicate automation. For example, if front door is left open send me a notification, but if it is after 10pm also turn on the bedroom lights and play sound through Google home.
Have you considered using choose ?
5 Likes
You can do this already by using conditions in the action section. Quick example:
action:
- service: notify.notify
data:
message: "Door open!"
- condition: time
after: '22:00:00'
- service: light.turn_on
entity_id: light.bedroom
- service: media_player.play_media
data:
#data for that service call here of course
Here’s where this is documented at: https://www.home-assistant.io/docs/automation/action/
As Mutt said, the new choose:
ability is good for more complex situations, but for this situation where you just want to add an additional set of actions to run only if certain conditions are met, what I have above will fit the bill.
4 Likes