diff --git a/include/automations/bryggerbutton.yaml b/include/automations/bryggerbutton.yaml index afe04b9..db99029 100644 --- a/include/automations/bryggerbutton.yaml +++ b/include/automations/bryggerbutton.yaml @@ -1,68 +1,61 @@ -- id: '1691939802290' - alias: Åbn garage ved tryk på 1 - description: '' +- id: hue_switch_garage_and_lights + alias: Hue switch - garage og lys + mode: restart + trigger: - - device_id: 5f6b41e54f3226acd9c9ab54a3acb527 - domain: hue - platform: device - type: initial_press - subtype: 1 - unique_id: 4b8a056e-973f-48cf-8a19-3586f6b05dcf - condition: [] + - platform: event + event_type: hue_event + event_data: + id: 5f6b41e54f3226acd9c9ab54a3acb527 + action: - - device_id: 3bc3eab99b46dae3e469bfa4060ce0f5 - domain: cover - entity_id: 4bd9c13b7bb0cc3245e38211ded2be92 - type: open - mode: single -- id: '1691941083623' - alias: Sluk alt lys ved tryk på 0 - description: '' - trigger: - - device_id: 5f6b41e54f3226acd9c9ab54a3acb527 - domain: hue - platform: device - type: initial_press - subtype: 4 - unique_id: f97d54a1-2283-4fb0-8709-b873a310732b - condition: [] - action: - - service: light.turn_off - data: {} - target: - entity_id: light.alle_lys - mode: single -- id: '1691941222856' - alias: Tænd alt lyset ved langt tryk på 0 - description: '' - trigger: - - device_id: 5f6b41e54f3226acd9c9ab54a3acb527 - domain: hue - platform: device - type: long_press - subtype: 4 - unique_id: f97d54a1-2283-4fb0-8709-b873a310732b - condition: [] - action: - - service: light.turn_on - data: {} - target: - entity_id: light.alle_lys - mode: single -- id: '1692023138692' - alias: Luk garage ved langt tryk på '1' - description: '' - trigger: - - device_id: 5f6b41e54f3226acd9c9ab54a3acb527 - domain: hue - platform: device - type: long_press - subtype: 1 - unique_id: 4b8a056e-973f-48cf-8a19-3586f6b05dcf - condition: [] - action: - - device_id: 3bc3eab99b46dae3e469bfa4060ce0f5 - domain: cover - entity_id: 4bd9c13b7bb0cc3245e38211ded2be92 - type: close - mode: single + - choose: + + # --- GARAGE --- + + # Kort tryk på knap 1 → Åbn garage + - conditions: + - condition: template + value_template: > + {{ trigger.event.data.type == 'initial_press' + and trigger.event.data.subtype == 1 }} + sequence: + - service: cover.open_cover + target: + entity_id: cover.anne + + # Langt tryk på knap 1 → Luk garage + - conditions: + - condition: template + value_template: > + {{ trigger.event.data.type == 'long_press' + and trigger.event.data.subtype == 1 }} + sequence: + - service: cover.close_cover + target: + entity_id: cover.anne + + + # --- LYS --- + + # Kort tryk på knap 4 → Sluk alt lys + - conditions: + - condition: template + value_template: > + {{ trigger.event.data.type == 'initial_press' + and trigger.event.data.subtype == 4 }} + sequence: + - service: light.turn_off + target: + entity_id: light.alle_lys + + # Langt tryk på knap 4 → Tænd alt lys + - conditions: + - condition: template + value_template: > + {{ trigger.event.data.type == 'long_press' + and trigger.event.data.subtype == 4 }} + sequence: + - service: light.turn_on + target: + entity_id: light.alle_lys