I want to have a HomeyScript running every x minutes, that will check if all Router devices in my zigbee mesh are still online. Some smart bulbs still have a standard wallswitch in place that just cuts the power. Until they’re all replaced by smart switches, my better half sometimes forgets not to use them… and gone is my Router…
So i created this HomeyScript that will send me a push notification when a router device is no longer online. However, this only works after i manually refresh the ZigBee network from the developer/zigbee tools page. That way, the status changes to online = false in the Homey.zigBee.getState() result.
So, to refresh the network from script, i tried using: await Homey.zigBee.runCommand({command: 'UPDATE_NODES', opts: undefined})
But that throws me a missing_scopes error, telling me not enough permissions to do this…
Any ideas on how to make this work? Can i elevate permissions or is there another way to refresh the zigbee mesh state?
With the current permissions HomeyScript has this will never work, and I think Athom won’t add any additional either, you can always try to ask them of course, but I only give it a very very small chance to it happening.
Hej @Peter_Kawa , thanks for your suggestion.
Although this is very interesting for checking on my sensors, checking the Homey.devices however wont work for this situation, because a zigbee Router device (not a motion sensor, but e.g. a lightbulb) can easily be unused for several hours, so i cannot determine it is offline just by looking at the last reporting datetime. I want to know when the router has been removed from my zigbee mesh network by accidental power cut (from using wallswitch).
The AVD however seems very powerfull. Any idea if i can run HomeyScript with elevated permissions from there maybe?
YW!
Yeah the script is aimed at sensors which ‘at random’ stop sending changes.
I think HomeyScript has the same permissions on Homey, where-ever you use it.
The web-api playground however, seems to have more permissions. But that is only useful for manually running some code.
Here’s a ‘bad route’ detection script which might be of any use: