My ZHA bulb show connected after a few hours of mains OFF. ( need to find time to fix this implementation)
So I want to create automation for now that would send power off command to the light and change my Toggle if the command returns : Error: Failed to send request: device did not respond.
How to change this condition so it returns true using GUI. Or that is the case when a template needs to be created? Thank you.
This is the result of the power_off command: Error: Failed to send request: device did not respond
This is the code that checking what was returned by power_off command.
I think you’re going about this the wrong way. Zigbee routers (most mains powered devices) shouldn’t be switched off since that will cause issues with the rest of your zigbee mesh.
The general recommendation is to avoid dumb switches with smart bulbs, since smart bulbs don’t really like it when you cut off their power.
Having said that, there’s 2 things you can try if you want to ignore my advice.
Add unavailable as a state in your automation condition section. You’re currently only looking for unknown.
Get rid of the automation entirely. ZHA has a specific setting to poll mains powered devices every X minutes (set to 6 hours by default iirc).
Lower that setting to something more frequent, but I don’t recommend setting it to 3 minutes because you’ll end up spamming your mesh.