1
0
ansible-home-assistant/configuration/automations/computer-button.yaml
pgrondek 1e554cc0df Fix light automations
change light.toggle to light.turn_on
2021-05-25 16:56:30 +02:00

94 lines
2.5 KiB
YAML

- id: button-computer-cave-on
alias: '[Computer Cave] Button On'
trigger:
- device_id: 5b972523e427721ec88e095994f7cc16
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_on
action:
- 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
- id: button-computer-cave-off
alias: '[Computer Cave] Button Off'
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
mode: single
- id: button-computer-cave-hold-on
alias: '[Computer Cave] Button Hold On'
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: 5b972523e427721ec88e095994f7cc16
command: move_with_on_off
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'on'
sequence:
- service: light.turn_on
entity_id: light.tv_lights
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.tv_lights
data:
brightness_pct: 100
kelvin: 3200
mode: single
- id: button-computer-cave-hold-off
alias: '[Computer Cave] Button Hold Off'
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: 5b972523e427721ec88e095994f7cc16
command: move
args:
- 1
- 83
action:
- service: light.turn_off
data:
entity_id: light.tv_lights
mode: single