1
0
ansible-home-assistant/configuration/automations/computer-button.yaml

59 lines
1.7 KiB
YAML

- id: button-office-on
alias: '[Office] Button Light'
trigger:
- device_id: 5b972523e427721ec88e095994f7cc16
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_on
action:
- choose:
- conditions:
- condition: state
entity_id: light.office
state: 'on'
sequence:
- service: light.turn_off
entity_id: light.office
- conditions:
- condition: state
entity_id: light.office
state: 'off'
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'on'
sequence:
- service: light.turn_on
entity_id: light.office
data:
brightness_pct: 100
kelvin: 2000
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'off'
sequence:
- service: light.turn_on
entity_id: light.office
data:
brightness_pct: 100
kelvin: 3200
mode: single
- id: button-office-off
alias: '[Office] Button WoL'
trigger:
- device_id: 5b972523e427721ec88e095994f7cc16
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_off
action:
- service: switch.turn_on
target:
entity_id: switch.hulk_wol
mode: single