Hi, @krix this is an interesting question, I don’t think we have that functionality at the moment.
I’ve added a ticket for the supervisor where you can follow changes to to this
On the other hand, we’d like to ask some more questions about your request:
The supervisor in general is not related to the online/offline status. Whether a device shows up online or offline in the dashboard means just whether the device is connected to the balena backend over the VPN. If the device is “online” in the network connected way, but cannot connect through the VPN one way or another, it wouldn’t show up online in the dashboard.
Thus I wonder what online state are you interested in, really?
- Connected to the network in general?
- Connected to the balena backend?
If the former, you can do network checks instead.
If the latter, it might currently work with the backend API, getting the status by requesting the device info, either https://www.balena.io/docs/reference/api/resources/device/#device-by-id or using the SDK https://www.balena.io/docs/reference/sdk/node-sdk/#balena.models.device.isOnline For this you could use the device’s API key (need to set a label in your
docker-compose.yml file for that to be added to the service that you need it in https://www.balena.io/docs/reference/supervisor/docker-compose/#labels ) In the case your API request succeeds, you know the reply of the backend whether the device is online/offline in the dashboard. If the API request fails due to network, then you can know it is surely offline in the dashboard.
Does this help? What do you think overall of the suggestions and questions above? And thanks for the feature request!