Hello,
I’m looking into combining some of my automations, since there is some overhead in some of them.
I currently have the following configuration in my ‘automation.yaml’ file:
- alias: "Coming Home Notification"
trigger:
platform: state
entity_id: device_tracker.myPhone
to: 'home'
action:
- condition: time
before: '22:00:00'
after: '08:00:00'
- service: notify.NotifyTelegram
data:
message: "Welcome home"
- alias: "Goodmorning Notification"
trigger:
platform: state
entity_id: device_tracker.myPhone
to: 'home'
action:
- condition: time
before: '08:00:00'
after: '04:00:00'
- service: notify.NotifyTelegram
data:
message: "Goodmorning!"
This sends me a message (via Telegram) when I come home, and if the time is between 4am and 8am I get a “Goodmorning”. However the automations are more or less the same, except for the condition (and the text).
Is it possible to combine both automations into one? To have one trigger with multiple conditions and with an action for a specified condition?
I am fairly new to Home Assistant, so I am not sure if what I want is possible. Nonetheless, any help is welcome!
Thanks!!