fairecasoimeme / ZiGatev2

ZiGate+ (v2) universal zigbee gateway
https://zigate.fr
22 stars 6 forks source link

[Question] How can my App know if a device is offline for any reason #52

Open dmsherazi opened 1 year ago

dmsherazi commented 1 year ago

I have seen apps like orvibo's Home mate etc show a device as offline if its not accesable for any reason like powered off or out of network range. I am wondering how can I know if a certain device is out of range or powered off , In general I would like to know if its online or not.

One way I tried was to set a counter of APS data confirm failed for any node. if I recieve APS data confirm failed I would incremnet the value. If I got any response from the device I will mark it 0. hence a device where the APS data confirm fail value has reched 2 or 3 I can mark it offline . Unfortunately even if switch off these devices I am not getting APS data confirm failed for them when send light on/off command. Wondering what would be the besta pproach for it?

fairecasoimeme commented 1 year ago

Be careful because there are two types of sensors: battery-powered devices and powered devices. Regarding devices with battery, you cannot use your system because the device is sleeping. I think the right way to handle is to give a timeout, if the device doesn't talk for x sec you can consider it not reachable.

pipiche38 commented 1 year ago

Be careful because there are two types of sensors: battery-powered devices and powered devices. Regarding devices with battery, you cannot use your system because the device is sleeping. I think the right way to handle is to give a timeout, if the device doesn't talk for x sec you can consider it not reachable.

As stated battery devices, are just sleeping and won't send any messages until they wakeup by the end use So for battery devices, you cannot make any decision on the fact they are or not on the network, you can just say they have not show up since a a while.