Sensor with invalid unit of measurement

I am receiving this message from MQTT;
Sensor with invalid unit of measurement
Warning · Reported by MQTT
Manual configured Sensor entity sensor.weatherstation_temperture_degc has a configured unit of measurement ℃ which is not valid with configured device class temperature. Make sure a valid unit of measurement is configured or remove the device class, and reload the manually configured MQTT items or restart Home Assistant to fix this issue.

in the documentation the the accepted unit of measurement values for device class temperature are °C, °F or K.

My entry in configuation.yaml is;

  • name: “Weatherstation Temperature ℃”
    unique_id: “weatherStn_temperatureC”
    state_topic: “homeassistant/sensor/WthrStn-TmpC/TempC”
    unit_of_measurement: “℃”
    device_class: “temperature”
    value_template: “{{ value_json.temperature | round(2)}}”

So I am confused about what action I need to take.

Thanks

Plz format it correctly in code tags: How to help us help you - or How to ask a good question
Looking at it right now suggests that you used a instead of a °C and yes they are very different.

1 Like

Can you explain the difference and how I can type it into my yaml file. I get the same error with unit_of_measurement: ℉.

#
- name: "Weatherstation Temperture ℉"
  unique_id: "weatherStn_temperatureF"
  state_topic: "homeassistant/sensor/WthrStn-TmpF/TempF"
  unit_of_measurement: "℉"
  device_class: "temperature"
  value_template: "{{ value_json.temperature | round(2)}}"
#

Copy and paste it in from Dunith’s post. You can search for Farenheit symbol on google and copy and paste from there.

Where did you find these composite symbols?

You need to use two symbols. The degree symbol ° and a letter C or F.

You can copy them from the temperature device class description here: Sensor - Home Assistant I recommend you check that document for all valid sensor units in future.

And OP needs to keep in mind there are two more very similar looking symbols in Unicode, which will also cause an error if used. If they copy it as suggested, there won’t be an issue, but they or others may still try to type it.

1 Like