Cloud API - List Devices - Always returns connected=true

I have two devices. They are both off-line (no power). When I query using the cloud api using the List Devices I get a response showing both devices, and that they are both connected. They are not connected. Is this a bug or am I doing something wrong?

For Electron devices, connected will be true as soon as it first connects to the cloud and forever after. Literally it will never become false again. Part of the problem is that to save data, the Electron does not have a constant connection to the cloud. Within the 23 minute keep alive window the cloud has no idea whether the device is really connected or not. Since the 23 minute window is so unhelpful anyway, the connected flag is never cleared.

For Photon/P1 devices, it’s more accurate, but if you power off the device suddenly it’s possible for it to remain shown as online for a while before the flag gets cleared.

The online indicator is not meant to be particularly accurate - if you really need to know within a few seconds if the device is online, you’ll want to manage it yourself using events.

1 Like