Files
sarah/config/packages/devices/living_room/desk_switch.yaml
T

51 lines
1.4 KiB
YAML

automation:
- alias: Lighting · Living Room · Toggle ceiling lights on desk switch single click
trigger:
platform: event
event_type: zha_event
event_data:
device_ieee: !secret desk_switch_ieee
command: single
action:
- service: light.toggle
data_template:
entity_id: light.living_room_ceiling
brightness_pct: >-
{% if is_state('input_select.house_mode', 'night') %}
40
{% else %}
100
{% endif %}
- alias: Lighting · Living Room · Toggle ambient lights on desk switch double click
trigger:
platform: event
event_type: zha_event
event_data:
device_ieee: !secret desk_switch_ieee
command: double
action:
- service: light.toggle
data_template:
entity_id: light.living_room_ambient
brightness_pct: >-
{% if is_state('input_select.house_mode', 'night') %}
40
{% else %}
100
{% endif %}
- alias: Music · Living Room · Play pause on desk switch hold
trigger:
platform: event
event_type: zha_event
event_data:
device_ieee: !secret desk_switch_ieee
command: hold
action:
- service: media_player.media_play_pause
entity_id: media_player.living_room