Greetings
I realise I still have issues with how to do advanced stuff with Home Automation and need som pointers. I have two automations set to turn on and off a switch, switch.aux1, based on the state of a drop-down helper input_select.leakomatic which can be either Home or Away. I know I’ve passed this subject when googling or maybe I’m just tired but I suspect these two automations can be “made” into one using templating or something like that. I just don’t know how.
alias: Leakomatic Away
trigger:
- platform: state
entity_id: input_select.leakomatic
to: Away
action:
- service: switch.turn_on
target:
entity_id: switch.aux1
alias: Leakomatic Home
trigger:
- platform: state
entity_id: input_select.leakomatic
to: Home
action:
- service: switch.turn_off
target:
entity_id: switch.aux1