Advertisement
energywave

Ikea tradfri remote for dimmable light

Jan 13th, 2021
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.76 KB | None | 0 0
  1.   # Telecomando tavolo cucina
  2.   - id: telecomando_tavolo
  3.     alias: 'Gestione telecomando tavolo cucina'
  4.     mode: restart
  5.     trigger:
  6.       - platform: event
  7.         event_type: zha_event
  8.         event_data:
  9.           device_ieee: 'ec:1b:bd:ff:fe:b4:b6:35'
  10.     condition: []
  11.     action:
  12.       - variables:
  13.           command: "{{ trigger.event.data.command }}"
  14.       - choose:
  15.         - conditions:
  16.          - "{{ command == 'on' }}"
  17.           sequence:
  18.           - service: light.turn_on
  19.             entity_id: light.tavolo
  20.             data:
  21.               transition: 1
  22.         - conditions:
  23.          - "{{ command == 'off' }}"
  24.           sequence:
  25.           - service: light.turn_off
  26.             entity_id: light.tavolo
  27.             data:
  28.               transition: 1
  29.         - conditions:
  30.          - "{{ command == 'move_with_on_off' }}"
  31.           sequence:
  32.             repeat:
  33.               while:
  34.               - condition: template
  35.                 value_template: "{{ repeat.index < 10 }}"
  36.               sequence:
  37.               - service: light.turn_on
  38.                 entity_id: light.tavolo
  39.                 data:
  40.                   brightness_step_pct: 10
  41.               - delay: 1
  42.         - conditions:
  43.          - "{{ command == 'move' }}"
  44.           sequence:
  45.             repeat:
  46.               while:
  47.               - condition: template
  48.                 value_template: "{{ repeat.index < 10 }}"
  49.               sequence:
  50.               - service: light.turn_on
  51.                 entity_id: light.tavolo
  52.                 data:
  53.                   brightness_step_pct: -10
  54.               - delay: 1
  55.         - conditions:
  56.          - "{{ command == 'stop' }}"
  57.           sequence:
  58.           - service: light.turn_on
  59.             entity_id: light.tavolo
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement