Device Unreachable with Zigbee Devices

Who knows what this is?

I have a bunch of Leds connected on Zigbee. When I want to switch them on or off I get spurious errors, sometimes it works, sometimes I get an error.

Error: Device is unreachable.: Device is unreachable.
at /node_modules/athom-api/dist/index.js:1:1186403
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
name: ‘Device is unreachable.’,
code: 500,
cause: t {
__athom_api_type: ‘HomeyAPI.ManagerDevices.Error’,
code: 500,
error: ‘Device is unreachable.’,
error_description: ‘Device is unreachable.’,
‘$stack’: undefined

Ideas how to make it reliable are appreciated!

Do you mean you’re switching them individually, or are you switching multiple lamps using flows which is causing the problems?

Hi Robert, pleased to emeet you! I actually first defined groups to group lights in hallways on various floors of the building.
Then I found out that randomly some lights did not switch on or off. Then I tried them individually and got errors every so many times when I try to switch them.
I tried it in a script but that also gives errors on some of the lamps (different lamps every time).

To answer your question: In both cases I get the errors.

Thanks for thinking about it

You’re running into the problem that Homey cannot handle sending commands to multiple devices very well. There’s not much you can do about that, other that use workarounds like other people have (for instance using delays so lights are sent a command with a delay in between each light).

Thanks for that, just a problem lie with Homey itself, or is it that the commands don’t wait until the completion of the previous command?
Do you think that there is a way that Athom can fix it?

Homey fires all action cards at once, and doesn’t check.
It is what it is.
Things could also depend on your wifi & zigbee network configuration.
You can also consider the < group > app as workaround.
It has a general setting to add a delay between every on or off command for each device in a particular group.

If they could, they would have done so already, the problem has existed for years now.

Yes, reading about it, I see that it has been an issue probably far as long as Homey is around.

I’m trying the Group option with a delay between each action in the group of 6000ms.

However, If I run the flow that switches the group from a script, it does not take any time:

let now = new Date()
log('before: ', now)
await Homey.flow.runFlowCardAction({ uri: ‘homey:manager:flow’, id: ‘programmatic_trigger’, args: { flow: { id : ‘---------’ } } });
now = new Date()
log('after: ', now)

The result is:

before: 2022-02-16T20:06:45.911Z
after: 2022-02-16T20:06:46.447Z

So the await does not wait, or the group does not pause between its actions. Or, of course, i don’t understand how JS works :slight_smile:

Anyone got an idea how to check if the group really applies the pause?

Well, I’d say put 5 lights in a group, put them in one room, add a group delay of 6000ms, and watch when you switch the group on.

And/or create a flow for every light in the group
Light X is turned on
Timeline notification: light X was turned on