[Solved] Context attribute as a filter

So, I have a single device acting as a gateway, it receives data from several devices. This gateway has an attribute called “Name”, for example “55b8”, “00c3”, depending on the device that sent the data to the gateway.

I have a dashboard for showing the attribute called “Temperature”, the thing is, I need to filter, I want to have the option to choose “55b8” and my dashboard shows the attribute Temperature for the data which has the attribute “Name” = “55b8”.

If I choose “00c3”, I want the dashboard to show the attribute “Temperature” for the data which has the attribute “Name” = “00c3”.

Hi @Flavio_Garlet,

Just a quick clarifying question, are you utilizing only one device in Losant? It sounds as though your environment has a gateway/peripheral relationship, which could be replicated in Losant with Gateway and Peripheral devices. Is this something you’ve considered or implemented? There is also a thorough forum post here on how they work in Losant.

This device relationship in Losant would allow you to create the dashboards you have described, as each peripheral (“55b8”, “00c3”) would be an individual device and could be used within the dashboards.

Thanks!
Julia

Hi Julia, I managed to get it working, modifying my workflow (I think I did the hard way but it’s working)

A new problem appeared, I was going to share the dashboard with my coworker, but in my developer mode, i can select the device:

When I shared the link to view, the only option is to type the device ID, which is kind of impossible because it’s a big number haha

How can I have a selection box in the viewer side?

Hi @Flavio_Garlet,

Great! Thank you for the screenshots as well, they are quite helpful. :smile:

When a non-member of your organization is linked to your public dashboard, these fields expect strings for security, as the link is accessible to anyone.

There are a couple of ways you can accomplish this, however. You could add a Device List Block and allow the user to copy the deviceId from the block. You could also configure the device names to link to your dashboard with the correct deviceId, like so:

Clicking Alarm 1 will now route me to my dashboard with Alarm 1 as my context device.

Let me know if this suggestion doesn’t fit your use case.

Thanks!
Julia

It worked perfectly, thanks!

1 Like

@JuliaKempf, I have another little problem, I created an Experience View to show this dashboard in a custom URL, how can I link the device list using Experience view?

Hi @Flavio_Garlet,

You have a couple of options for accomplishing this.

If you would like to link using the Device List Block, you can reconfigure the block with your experience domain, like so:

Clicking the device name navigates to the experience dashboard page for the specific device:

You also have the option of creating your own custom navigation using experiences. The Industrial Equipment Monitor application template comes preconfigured with a device navigation menu you can use as a base or for reference:

Let me know if either of these will work for your use case. :smile:

Thanks!
Julia

Hey, I managed to get the first one working, but with a modification, i had to put the context variable “{{request.query.device}}”, then, the solution worked :slight_smile: Thanks!

1 Like