Add "us" to unit_system options

Units of measure in Home Assistant (unit_system) can be set to “imperial” or “metric”. An option for US system of measures (e.g. “us”) should be added.

The Imperial and US systems of measure are very similar, and share many unit names. Often these similarly named units are close enough for any ordinary, non-scientific, purpose. E.g., the mile used for precise historical survey data in the US is 3.2mm longer than the mile used in the Imperial system. I cannot imagine any HA user requiring accuracy to 2ppm.

OTOH, US and Imperial volume measures differ substantially. One Imperial pint is 20 Imperial ounces. A US pint is 16 US ounces. And a US ounce is slightly larger than an Imperial ounce. An Imperial gallon is slightly more than 1.2 US gallons. This is a 20% difference, which is significant for even the casual user. Anyone who’s used a US cookbook in the UK or vice-versa quickly learns the importance of this discrepancy (and subsequently turns around his/her measuring cups to use the ml scale instead).

I never thought this would come up until I started using the BMW connected drive component that reports fuel remaining. My full fuel tank appeared 20% empty, making me wonder where the gas had gone. (It was all there, just measured in another SOM).

I don’t know how many other components use volume units, but I see that there are at least a handful of car components that report fuel level, so I believe that this is a worthwhile enhancement.

This is interesting, I never knew imperial was different from what US uses.

This would be better served as a GitHub issue vs a feature request on the forums.

1 Like

I was going to add this request there but I then read this on the github form:

I’d consider this a bug more than a feature request. It’s fine to open, you have my blessing.

That’s true but has no bearing on Home Assistant because it does not do any automatic unit conversions. The only difference between imperial and metric, as far as Home Assistant is concerned, is the unit identifier it’ll use for the given device_class: temperature, pressure, illuminance.

Fact is if you switch from imperial to metric the only difference you’ll see in Home Assistant is what used to indicate 72 F will now say 72 C (which is pretty toasty). It won’t perform a unit conversion so concerns about imperial vs US volumetric differences are moot. Effectively, they’re ‘hard-coded’ by the component.

All this to say, if the component is measuring in US gallons but reporting in Imperial gallons, then that’s a bug with the component’s handling of unit conversion.

1 Like

Components that report measurable values can and do use Home Assistant’s global unit_system setting in order to return a value in the appropriate unit. Since Home Assistant doesn’t do unit conversion itself, what purpose would a unit_system have other than to tell components what to report in?

So I realize that it’s a component’s own responsibility to do proper unit conversion, but if unit_system doesn’t have a possible value of “us” then how would a component know to report a US Gallon? I also understand that this would be a change that could break a bunch of components until support for the additional units was added to each – so this change would be a big deal.

A quick hi-jack. I’d use a few f-bombs here because how I feel about the US and the Imperial system. Having to write code for this in 2019, I think is absurd.

Write to your congressman. https://www.house.gov/representatives/find-your-representative

Do you realize the United States is the only industrialized country in the world that does not use the metric system as its predominant system of measurement? Now how dumb is that?

Anyway, I agree with Robbie that having software report expected accurate information is important no matter how dumb you think your government is.

2 Likes

I see there’s a TankUtility component now. This reports volume of propane in a storage tank. Not having US units will result in an inaccurate value. It will be inconvenient, at best, for users to have to convert Imperial gallons to US gallons. At worst, a user might unexpectedly run out of fuel or risk a possible overfill due to inaccurate ullage, although I suppose a servicer would verify this before a fill.