WTH units and precision are applied globally per entity, not per presentation?

The presented unit and measurement precision should be configurable on per card basis, in addition to the global per-entity level.

Problems that I have right now:

  1. It is impossible to display one entity in two different cards with two different units (say in one card, the entity has kW units, but W in the other)

  2. For whatever reason, the configured visually represented unit affects the units in influxdb. (I unintentionally ruined my influxdb time-series data by changing the setting I thought only affected the dashboard).

For full transparency, I deleted numerous posts where I said there was no native unit system in HA. After some conversations with the original developer who added unit conversion, a lot has changed. When unit conversions were originally introduced, users had quite a few problems related to all the points I made, and the development team moved to native units under the hood. Plumbing was added to account for all the scenarios I was listing as problem points.

With that being said, Iā€™d like to apologize for derailing the conversation and throwing any doubt into this WTH.

2 Likes

If this were introduced at the UI level, the only outstanding change would be something that converts units for templates as well. The current states(.., with_units=True) method could be updated to support pointed unit conversion instead of defaulting to the configured units.

1 Like

Thanks @petro!