Unit of Measurement - 2022.4

I have 2 Tuya temperature and humidity sensors which default to C if they lose power but I want to display in C so I was very happy when 2022.4: Groups! Groups! Groups! - Home Assistant was announced but I am unable to find this setting for my temperature entity. I can see the the unit of measurement when I view the state so I thought it would be allowed to be converted. Am I doing something wrong or expecting more than I should?

Why do you need to change anything. You say they default to C, and you want to display in C.

Sorry was supposed to say I want to display F

Go to Configuration / Devices & Services. Find the integration your device was added with and click on the device. When you click on the temperature sensor on the Device page you should see this:

I do not have that option

Go to Developer Tools / States and take a screenshot of the entity attributes (right hand column). Like this:

So I do not have a device class.

Try adding it using Customize.

Added the customization and it shows in the dev tools but still no way to change the unit of measure in the sensor.

On closer inspection the unit used is not °C.

Look closely and you will see whoever designed that integration used something that looks like °C but is actually the Unicode character .

Try overriding the unit using customize. With either °C or °F.

Beware that changing the unit will start a new set of Long Term Statistics.

Thanks for the help Tom it does now show the correct °C but still doesn’t allow for the UI based conversion. I will look at the Customize tomorrow and see if I can perform arithmetic in customize as it’s not a very complicated formula.

I’m seeing the same thing in LocalTuya. The UI doesn’t expose the new features.

RJ, you should open an issue with the developer of LocalTuya.

Delfairen, someone has already opened an issue:

You could add the details of what you have found and tried.

1 Like

I’ve run into a similar issue with a different custom component: sensor.airthings_wave/custom_components/airthings_wave at master · custom-components/sensor.airthings_wave · GitHub The change unit dialog is available for the temperature sensor that this component creates but I cannot save changes to the temperature units via the UI. The data comes in to HA in C, but if I change the unit to F and click ‘update’, it remains in C. The attributes show both a device_class and unit_of_measurement:


I can also change the icon and area via the UI, just not the temperature. Are there other requirements beyond device_class and unit_of_measurement?

I suspect there must be. You’ve done the right thing by opening an issue with the 3rd party developer.

EDIT: Aha! Found it. native_unit_of_measurement that’s what needs to be added. https://developers.home-assistant.io/docs/core/entity/sensor/#properties

It’s a property of the sensor, not an attribute, so you can’t add it with customize. It’s something the developer has to support.

6 Likes

Hi,

I’m using the last version (2022.8.7) and I have a problem with the unit change of a pressure sensor, that despite doing it as you indicate, the change is not made. The sensor is a Zigbee2MQTT


But it always stays at hPa.

The only way I’ve found to make the change is through customize.yaml, but I don’t understand why through UI doesn’t work.

But, in another installation that I have with 2022.6.6 I can do the changes directly from the developer panel.

Regards

I’m very late to the party both in terms of realizing the great stuff that has been added and in commenting.

I’m looking for a UoM to display sun elevation, but the degrees symbol is not available in the UoM dropdown.

Assuming you’re talking about the UI template sensor creation interface, you can just type it in, then it becomes selectable:

It already is

Edit: I was referring to the sun.sun integration. It has a sensor.sun_solar_elevation entity.