ZHA IKEA Tradfri on/off switch binding backup and self healing

If you, like me, prefer to have your on/off switches directly bound to light bulbs in-order to ensure that they still work even if HA goes down then you may have noticed that these bindings seem to have a half-life.

After many trials and tribulations I have come up with a two blueprint solution.

  1. The first is simple, a blueprint in which you provide the switch and the bulbs you have bound to it. It will then listen for on/off commands, and if the lights disobey it will send a command. You will need to replicate this blueprint for every switch.
    Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

You could just leave it there and then every now and then mannually re-bind the devices. However that is no way to live so follow on:

  1. The next part requires ZHA Toolkit to be downloaded and configured (don’t miss the step about adding it to your YAML!)

  2. Then import this script blueprint with no user-inputs and configure it once
    Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

  3. As long as you didn’t rename the script when you created it in step 3 then you dont need to do anything else, if you did rename it then go to each of the automations you created in 1 and make sure the action at the end points to the right script.

From now on if your bindings fail then the light will still turn on or off 1.5 seconds after they should and then the binding should self-heal.

2 Likes