How to configure a sensor für resistance

For my PV I want to show and log the isolation resistance of my PV panels.
Unit of measurement of electric resistance is ohm = Ω

I get this value via MQTT (query of node-red using modbus/TCP). I have configured it as the following sensor:

 - sensor:
     state_topic: "fronius/inverter/isolation_resistance"
     name: "Fronius Isolation resistance"
     unique_id: "fronius_isolation_resistance"
     object_id: "fronius_isolation_resistance"

I did not find any device class that matches resistance. Also I did not find a way to tell HA that this value is a integer value. HA loggs this sensors like it would be a string:

image

My question: How can I configure the sensor so that HA handles this as a number and not as a string?

Add.a unit of measurement.

unit_of_measurement: "Ω"

Also, to format your config for the forum use the </> button. Not the quote button.

Thanks a lot. This works!

When creating a template sensor I can select different units of measurement. But Ω is not part of this.

I did not find this unit_of_measurement. Where do I find the complete list of these?

In the documentation for the integration.

You mean the MQTT sensor integration? There MQTT Sensor - Home Assistant is no documentation which units are defined.

Or did I look wrong?

You can use anything you want if you are not using a device class.

https://www.home-assistant.io/integrations/sensor.mqtt/#unit_of_measurement

Only if you use a device class must you pick one of the specified units, see: https://www.home-assistant.io/integrations/sensor#device-class

Ok. Thanks.

Does this mean that all undefinded units like “Ω” are handled as integer if I set "unit_of_measurement: " ?

Strange is that that settiing “unit_of_measurement:” to a not defined value behaves different than not setting unit_of_measurement.

Setting any unit of measurement causes the HA frontend to treat it as a number.

OK. Thanks. This is the trick. “Ω” is not defined as a unit_of_measurement, but setting it just treats the value as a number.