Refactor packages - define automations per device where possible

This commit is contained in:
2020-05-16 13:51:01 +03:00
parent 279689c681
commit ccee1593bd
13 changed files with 84 additions and 85 deletions
@@ -0,0 +1,50 @@
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