How to include Units in Dashboard

Hi there,
I have my units of measure specified in the tag attributes.

Is there a way to use template in the Labels of charts?

It would be nice to setup the unit automatically, something like this in terms of syntax?


You can obtain this by using a device Context Variable. In production applications, it’s common for customers to have many identical devices. A context variable provides a way to build a dashboard once and then pass in the device to display. You also get access to the device’s details, including attribute tags.

Below is an example of setting that context variable. You’ll need to select Include full device info in context.

Here’s that device with an attribute tag:

Here’s how to use that device on a gauge block:

The template is:


One of the best ways I’ve found to explore what’s available on the context is by looking at the Custom HTML Block’s default configuration, which prints all available context.

It doesn’t seem to work on my setup:

I also tried:


But no luck.

Oh do you mean I can only do that by defining a device context in the dashboard?
So if in my case I already specified the device, then there is no way to retrieve the units?

Correct, at the moment, device details are only available if that device is provided as a context variable. Part of the challenge is that most blocks support selecting multiple devices and the data will be aggregated together. Not sure how to expose device details for that scenario.

When selecting a single device, which is the most common case, having access to that device’s details automatically does make sense. Something we’ll have to think about.

1 Like

Makes sense, for now I will use the context approach. Thanks.

Quick suggestion here:

could we use the Grafana approach where the drop selection box will be visible in the top header?

I find it much more intuitive and simple instead of going through the option menu.

Just a suggestion.