I have setup an Electron and am using the Cloud API to get device status. I have powered down the Electron but ‘connected’ is still returning true from the API. I have even let it sit over the weekend and it still shows connected to the cloud. I am getting the same result whether I query an individual device or all devices.
This is an extremely common question: the Electron uses the connection-less protocol UDP to talk to the cloud so the connected flag is not meaningful. With TCP on Photon, “connected” means there is an active TCP connection but no such thing exists for UDP.
You can use the “last_heard” field.
The last heard seems to be off as well. I have not powered on the Electron since 11/11 yet the last heard date is today. When I say not powered on, the battery is completely disconnected from the device.