More status options for devices

Good evening,

I am currently working on a dashboard with a “Device List” content block. I was wondering if there is a way to add additional options to the connection status. In my use case, we need to differenciate between “Connected”, “Disconnected”, and “Communication Errors”. I want to be able to show the green icon for connected and red icon for disconnected as it is on the device list on my image, but I also want a “gray” icon for connection errors.

image

Is there a way to achieve this? Or any workarounds to get a similar result?

Thank you in advance

Actually there is a workaround! The Losant API supports setting a device’s connection status, which you could use to set the device as “disconnected” with a custom reason (i.e. “Communication Errors”).

When it comes to the block, you could add a custom column that renders your own custom icon and the “reason” in the case of the third status.

Thank you for the help,

I managed to do most of this, but I am having issues with accessing the custom reason inside the custom column. As far as I can tell, there is no “disconnectReason” attribute inside the connectionInfo object. And I could not find it anywhere inside the device object give in the custom column.

Also, is there a way to control the size of the image? I used the format image but I can only change the image size by manually altering the image instead of inside the template.

Thanks again!

Huh, you’re right. The disconnectReason is available in the connection log block but not the device list. Let me see if we can get that added to the device list block response.

Thank you for the confirmation. Let me know of any updates, and if possible, when to expect this to be added if you plan on doing so. In the meantime, I think I will try to find a different workaround.

I was hoping it would be a quick fix to get that in before our November release but unfortunately it isn’t as easy to expose that property as I had hoped.

An alternative would be to store your custom disconnection reason as a device tag.

Thank you for the help,

I managed to create a workaround solution by directly using the device latest state instead, but I hope this gets added soon as a supported feature. Have a good day!