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

95 lines
3.0 KiB
YAML

- id: button-office-table
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-desk
alias: '[Office] Button Desk'
trigger:
- device_id: 5b972523e427721ec88e095994f7cc16
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_off
action:
- service: light.turn_off
data:
entity_id: light.desk_lightbar
- choose:
- conditions:
- condition: state
entity_id: light.desk_lightbar
state: 'on'
sequence:
- service: light.turn_off
entity_id: light.desk_lightbar
- service: light.turn_off
entity_id: light.desk_lightbar_ambilight
- conditions:
- condition: state
entity_id: light.desk_lightbar
state: 'off'
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'on'
sequence:
- service: light.turn_on
entity_id: light.desk_lightbar
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.desk_lightbar
data:
brightness_pct: 100
kelvin: 3200
mode: single