zigbeer / zigbee-shepherd

An open source ZigBee gateway solution with node.js.
MIT License
250 stars 89 forks source link

Determining status after power outage #57

Closed danpowell88 closed 5 years ago

danpowell88 commented 5 years ago

Whats the best way to determine a powered devices status after a power outage and then power resumes.

Specifically for hue light bulbs.

It would seem that if I do a checkOnline of any devices that I think should be online and let that fire the event if they don't respond then handle the event that is emitted?

The other issue is that when they come back online I don't always see a devIncoming request, it would seem it only is emitted the first time the device comes online after zigbee-shepherd has started.

Any ideas?

mariusmotea commented 5 years ago

What types of lights you are using because this support lot of types. Are you aware that in the header of the HueEmulator3.py script there is line:

update_lights_on_startup = False # if set to true all lights will be updated with last know state on startup.

If set tot True, after a power outage the lights will be set to last know state.

danpowell88 commented 5 years ago

If the lights had power but were set to off and then they receive power, the default action is to power on the lights, so I'm not sure if that would work here

Also where is that script?

danpowell88 commented 5 years ago

Im thinking perhaps in Controller.prototype.endDeviceAnnceHdlr

when the device is already registered to still raise some event (not sure which one) to say the device is now available again.