Display a device count on dashboard

Hello.

I wanted to display the number of devices I have in my application.

I tried to search on the forums and documentation but I had no luck finding a solution. Is there maybe a way of doing it that I missed or could this be a new feature?

Thank you very much.

Hello!

I would recommend using an Application List block to list the number of devices in your application. They can list the number of devices in your applications and can also be filtered to show only one application, or applications of similar characters. Here are some examples:

Thanks,
Julia

Actually, I’m looking for something more elegant like a gauge where the main focus is the device count.

Hi,

The way to accomplish this is to report device count as state, as to show a value on a dashboard, it has to be a state from a device.

To start, create a new device, and give it an attribute for the device count.

Next, grab the Losant API node and set the Resource and Action to Devices: Get, and a payload will output with a device count.
15%20AM

Add a Device State node and use the payload path for the device count to update the “count” attribute in your new device.

You will then be able to use this device and it’s count attribute to show the number of devices in your application!

Thanks,
Julia

That works. Thank you very much. :slight_smile:

Is this method to get a count of devices in a certain state still valid? The windows don’t quite match what I see today and it’s not working like I expect (e.g. I cannot get the ‘count’ and ‘totalCount’ fields to appear in the API datastructure.

Hi @Bryan_Chase,

Yes, today this is still the way. However, we do have some features on the roadmap that address this. I’ll be sure to update this forum post when this release happens.

Could you provide more info on your problem? The most helpful thing would be some screenshots of your workflow, the node configuration, and the resulting payload.

Here are 4 screenshots of the simple device and workflow. I cannot find the ‘count’ attribute with value of 1.




@Bryan_Chase,

Thank you so much. That was super helpful :slight_smile:

It looks like you’re doing the API call for Device: Get. I think what you’re looking for is Devices: Get. The Device: Get API won’t return a count due to it only returning one device.

OMG I thought my eyes were pretty good, but I guess I overlooked the ‘s’. That’s frustrating! Thanks for the reply!!

No problem at all! It’s always the little things :slight_smile:

1 Like