Hi,
I have a master switch for all of my input_boolean.notify_{action} 's:
2 automations for On and Off
Off:
- alias: 'Master - Switch off'
id: '1511801570100'
initial_state: 'on'
trigger:
platform: state
entity_id: 'input_boolean.notify_master_switch'
from: 'on'
to: 'off'
condition: []
# - condition: state
# entity_id: group.probably_at_home
# state: 'off'
action:
- service: notify.notify
data_template:
title: "Master switch"
message: "{{ trigger.to_state.attributes.friendly_name }} is set to: {{ trigger.to_state.state }}."
- service: input_boolean.turn_off
data:
entity_id: input_boolean.notify_motion
- service: input_boolean.turn_off
data:
entity_id: input_boolean.notify_mode_selection
- service: input_boolean.turn_off
data:
entity_id: input_boolean.notify_activity_selection
same for On.
i have 2 questions to make it more robust, and flexible.
- Could i make the above 2 automations into 1, with a template sensing the On and Off state?
- For now, this is a one way automation. switching the master switch, switches all the others. But if one of the underlying booleans is flipped, the master switch doesn’t go along. It must be made responsive to the underlying booleans. How could i do that, without having to specify all booleans.
My wish is to add several more, (all following the naming principle of input_boolean.notify_{action} and it would be very handy if this Master switch could be made in a way it reads that pattern., instead of having to explicitly name all booleans. Taking new booleans into account automatically. Or causing no issues when deleting or changing existing ones.
Hope this makes sense… Please shine your templating magic on this
Cheers,
Marius