Multiple devices dashboard using device tags variables

I’m trying to build a dashboard for a group of devices. The devices have the device tags “customer” and “station”. One customer can have multiple stations.
I have created three context variables:

I tried to list the devices using the ctx variables in my filters:

The dashboard context shows that the device tag “station” is set to 1 by default:

I have added a column for the device tag “station” on the device list block, my problem is that the list is not filtered correctly, I still get devices with the tag station=2:

Also, when trying to use the tags in a Time Series Graph block, I’m having the same issue. I set 2 series, one using the device name, the other one using the device tags. Both series should be the same, but it seems that the one selected with the tags is getting the data from all my devices:
time series graph device name
time series graph device tags

I must be doing something wrong?

Hi,

When you use a deviceTag context, it returns {“value”: “…”, “key”: “…”}, so to filter by the value you should use as {{ctx.deviceTags-station.value}}.

1 Like

Hi @Jules_Huguenin,

What @Vander_Maziero has mentioned is correct. When using deviceTag as a Context Variable, the returned value is a key-value pair.

To filter by that Context Variable value, you will need to use {{ctx.deviceTags-station.value}}. Here is an example that I was able to get working with the Industrial Equipment Monitor:


Please let me know if this works for you! Thank you @Vander_Maziero for the help!

Thank you,
Heath

1 Like

Thanks @Vander_Maziero & @Heath,
It works great with the filters, thanks!
Any idea how I can use the {{ctx.deviceTag}} with the Time Series Graph?

Could you explain how you would like to use it?

Thank you,
Heath

Hi @Heath, I have described it on my initial post, I’m trying to list two series, one for each device.
By using multiple device tags with the context variables, I thought I would be able to show specific device that has all the selected tags.

Example, I have a dashboard for plants with two devices. The 1st series is for device 1 (using
the tag “deviceNum = 01”), and the second series is for device 2 (using the tag “deviceNum = 02”). This dashboard is used by various customers and one customer can have multiple plants, so I have added a context variable for the tag “customer”, and another for the tag “plant”.

I think I have answered my own question since I realized that the time series shows all the devices for all the tags listed. It is not a filter.

I have created a new tag for my devices which is a combination of customer, plant, and deviceNum, which I can use as a context variable. It works for now. Thanks for putting me in the right direction though, and if you have a better idea to sort this out, please let me know.

1 Like