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.
-
[Optional] Let the team know I’m not the only one with this problem by upvoting the GitHub issue or commenting with your experience if you have something interesting to add.
-
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 from the switches, and if the lights disobey it will send a HA command. You will need to replicate this blueprint for every switch.
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:
-
The next part requires ZHA Toolkit to be downloaded and configured (don’t miss the step about adding it to your YAML!)
-
Then import this script blueprint with no user-inputs and configure it once
-
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.