Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[Home Assistant] Ikea Traefdri Reset Script / Pairing mode

Handy script, to put Ikea Bulbs into pairing mode by using a Zigbee Switch: https://community.home-assistant.io/t/handy-script-to-reset-ikea-tradfri-bulb/435622

Just go to Settings -> Automations -> Scripts and paste the following YAML script:

alias: Reset IKEA bulb with Switch
sequence:
  - repeat:
      count: "5"
      sequence:
        - service: switch.turn_off
          data: {}
          target:
            entity_id: "{{ smart_plug }}"
        - delay:
            hours: 0
            minutes: 0
            seconds: 0
            milliseconds: 900
        - service: switch.turn_on
          data: {}
          target:
            entity_id: "{{ smart_plug }}"
        - delay:
            hours: 0
            minutes: 0
            seconds: 0
            milliseconds: 500
variables:
  smart_plug: switch.REPLACE_SWITCH_NAME
mode: single

Now just insert your light bulb with a light socket into the plug and run the script.

To use the script with other bulbs, just adjust the counter and seconds to your needs, e.g. like here for Ledvance bulbs:

alias: Reset Ledvance Gardenpole with Switch
sequence:
  - repeat:
      count: "5"
      sequence:
        - service: switch.turn_off
          data: {}
          target:
            entity_id: "{{ smart_plug }}"
        - delay:
            hours: 0
            minutes: 0
            seconds: 5
            milliseconds: 0
        - service: switch.turn_on
          data: {}
          target:
            entity_id: "{{ smart_plug }}"
        - delay:
            hours: 0
            minutes: 0
            seconds: 5
            milliseconds: 0
variables:
  smart_plug: switch.REPLACE_SWITCH_NAME
mode: single