switch:
- platform: template
switches:
b_state:
name: B State
unique_id: b_state
value_template: >
{{ is_states('switch.srv_bedroom', 'on') }}
availability_template: >
{{ has_value('switch.srv_bedroom') }}
turn_on:
- condition: template
value_template: >
{{ is_state('input_boolean.heating_switch', 'on') and is_state_attr('climate.b_temp', 'hvac_action', 'idle') }}
- service: switch.turn_on
target:
entity_id: switch.srv_bedroom
turn_off:
- condition: template
value_template: >
{{ is_state('input_boolean.heating_switch', 'on') and is_state_attr('climate.b_temp', 'hvac_action', 'heating') }}
- service: switch.turn_off
target:
entity_id: switch.srv_bedroom
1 Like