Change power measurement unit from "Watts" to "W"


I am a very happy Iotawatt user, it works just great. One question, though: due to the limitations of InfluxDB in summing up different measurements, I would like to have Iotawatt power expressed in “W”, which is the current symbol for power from an SI perspective, rather than in “Watts”. The reason is that other devices are generally using “W” and by collecting also Iotawatt output into “W” measurement will give more possibilities to calculate aggregates.
Is there a way to do it?


Hi Guido,

Have you considered using regular expressions in your aggregation queries?

Changing Watts to W would be awkward from a compatibility perspective, but I can think of some other approaches if you could be more specific about what you need to do.


I asked for support in Grafana’s forum and I got the answer that triggered me to change measurement to $units in the Iotawatt InfluxDB setup, as this is the way that other sensors (through Home Assistant) are recorded in the same DB. But then I realized the “Watts” and the “W” are still seen as two different measurements that I cannot easily sum in a query, hence my question here.
For sure I can easily change in Homeassitant from “W” to “Watts” but I am hesitating because “W” is more correct…
In case you have any other idea, please let me know. I am getting old to learn all those new things… :slight_smile:

I’ll leave this for comment from IoTaWatt/HA users. I know there are a couple of ways to interface to HA. Seems to me that if it’s necessary to have W rather than Watts, the place to translate would be in that interface.

This is really a Grafana question. Grafana has many ways to do things and select things, so it really depends on what you are trying to accomplish. Grafana supports InfluxDB group by syntax to allow a single query to become multiple lines. You can use a where clause with units to select things that have the same units. This doesn’t work for W and Watts, since they are not the same string even if they are the same unit. There are multiple ways to get around this. You can add an OR to the where clause. I don’t think the GUI supports this, but the underlying syntax should.

I don’t have units tagging on my IotaWatt, so I have a Grafana query variable that gets all the CT channels and another one to get the watts channels from my Tasmota devices. I then have independent queries in each panel for IotaWatt and Tasmota. Grafana has some tools for reducing data that can do simple math.

You can use Flux queries (have to have the latest 1.8 Influxdb and latest Grafana) to do more complex math, but they can be tricky to get right.