Reference device tags without context

I have a dashboard that displays data for a given device, which is using deviceId context. It includes some gauges that have conditional colours based on some user-defined tags. They can refer to the tags using context:
eg. {{value}} <= {{ctx.deviceId-0.tags.levelLowAlarmT1.[0]}}

I’ve also got a dashboard that provides an overview of multiple devices, which includes gauges that I’d like to behave in the same way. Since these gauges are not able to use context (each is linked to a specific device), I cannot figure out a way to reference the device’s tags within the conditional colours section. Is there a way around this?

image

Something along the following lines, but that actually works
image

Sorry but no, there is no way at this time to reference values from a device’s configuration (i.e. tags) in those conditions unless the device is passed as a context variable.

The best workaround I can come up with is to instead create separate device context variables for each specific device being represented and individually use those variables in each of your blocks. You could then set the default value for each variable to the value used in each gauge, and by adding validation, simply not allow users to change those variable values to anything other than the default value like so:

1 Like

That’s great, many thanks Dylan. I hadn’t realised that multiple device contexts could be added to the same dashboard.