Display device connection status on dashboard

Hi

I want to know if it is possible to indicate on a dashboard that the device (for which the data is being shown on the dashboard) is currently connected or not. This can be done as an example using an LED widget.

This will be similar to the connected status when viewing a specific device’s information.

Regards

Hello Charl,

Nice to find you here! Actually all the widgets have a thumps down to show device connection status, but that feature only works with thinger software clients. As you are using callback integrations it is not directly possible, but maybe you can put a led indicator that takes data from any device property :

then you can modify the value of that property using a Node-RED flow like this:

If you are interested on this solution let me know and I will help you with the codification of the nodes

On the other hand… you can use an HTML widget to retrieve device status by calling the device API and retrieving device “active” value, for example, if I call to my Sigfox device API:
https://acme.thinger.io/v1/users/jt/devices/sigfox_sme_C378F

I will receive the next JSON:

{"connection":{"active":false,"host":"trincado.do.thinger.io","ip":"81.44.203.7","location":{"lat":40.680574947833904,"lon":-3.969137228089218,"radius":3802.0},"rx":0,"timeout":10,"ts":1585561751193,"tx":110030},"description":"Auto provisioned Sigfox Device","device":"sigfox_sme_C378F","type":"HTTP"}

But this option, being much difficult to implement, is also less scalable / efficient, as the fist implementation is using server events, triggered only when the device status changes.

Hope it helps,
Best!

Hi Jorge

Thank you.

I haven’t had a look at Node RED yet and this looks like the better approach to take. I will start looking into this and be back when I get stuck with the code.

Thanks for the advice.

Could you please explain more about these node codification.
I need to do that exactly.

@JorgeTrincado

Hi @Moahmed_ELnahas,

Can you explain just a little about your device’s integration or any other requirement? the implementation is actually very simple if you obtain the right API to modify the property from the browser inspector, but maybe there is any other option depending on the characteristics of your project

best

Hi,
I am also looking for an option to indicate the device status on the dashboard.
I already understood that it is possible to get the device status through the API: SERVER API - Thinger.io Documentation

My doubts:

  • The only option is the HTML widget?
  • If so, how do I configure the HTML Widget to perform the query in the API and extract the status “connected”: true or “connected”: false from JSON, signaling a green (true) or red (false) ball, as in the image bellow?
  • Is it possible to configure the query to be made at a frequency of time? Ex: Every 1 minute

I understood by the previous messages, that you need to get the HTML feeded by a Device’s Property and modify the Device’s Property by NodeRED according the server events.

I dont know if the widget has the capability to run commands to request the api and then manipulate the answer to extract the values and make decisions according different values, it seems that handles just html commands.

I am not a programmer, but I think it is possible to do this through the widget script, with javascript.
Ex: 1) Consult the API; 2) Analyze JSON; 3) If “connected” status: true, then make a green ball; If “connected”: false, make a red ball

You are right, it can be done with javascript, I didnt knew that the html widget can handle javascript commands.

You have a pretty clear idea what you need to do.