Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- automation:
- # Telecomando Ikea 4 tasti con Deconz (per Massimiliano Mazzurco)
- # Implementati solo tasto su, giù e pressione/rilascio su/giù per dimming
- # Usare la stessa tecnica per gestire i tasti destra/sinistra/pressione/rilascio
- - id: 12c75001-291f-41db-8b56-978143118402
- alias: 'Gestione telecomando Ikea'
- mode: restart
- trigger:
- - platform: event
- event_type: deconz_event
- event_data:
- unique_id: 'cc:86:xx:xx:xx:xx:xx:xx'
- action:
- - variables:
- command: "{{ trigger.event.data.event }}"
- light_dest: light.tua_luce
- - choose:
- # ON
- - conditions: "{{ command == '1002' }}"
- sequence:
- - service: light.turn_on
- target:
- entity_id: "{{ light_dest }}"
- # OFF
- - conditions: "{{ command == '2002' }}"
- sequence:
- - service: light.turn_off
- target:
- entity_id: "{{ light_dest }}"
- # Luminosità up hold (aumenta luminosità)
- - conditions: "{{ command == '1001' }}"
- sequence:
- repeat:
- while: "{{ repeat.index <= 10 }}"
- sequence:
- - service: light.turn_on
- target:
- entity_id: "{{ light_dest }}"
- data:
- brightness_step_pct: 10
- - delay: 1
- # Luminosità down hold (diminuisce luminosità)
- - conditions: "{{ command == '2001' }}"
- sequence:
- repeat:
- while: "{{ repeat.index <= 10 }}"
- sequence:
- - service: light.turn_on
- target:
- entity_id: "{{ light_dest }}"
- data:
- brightness_step_pct: -10
- - delay: 1
- # Rilascio luminosità up/down
- - conditions: "{{ command == '1003' or command == '2003' }}"
- sequence:
- - service: light.turn_on
- target:
- entity_id: "{{ light_dest }}"
Add Comment
Please, Sign In to add comment