Skip to content

MqttSensor does not accept µs as native unit of measurement #143577

Open
@victorclaessen

Description

@victorclaessen

The problem

MqttSensor does not accept µs as native unit of measurement. I expected this to work after #140307 was accepted.

2025-04-24 15:14:28.879 WARNING (MainThread) [homeassistant.components.sensor] Entity 
sensor.modulator_test_pulse_length (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>)
 is using native unit of measurement 'µs' which is not a valid unit for the device class ('duration') 
it is using; expected one of ['s', 'μs', 'd', 'ms', 'h', 'min']; Please update your configuration if your
 entity is manually configured, otherwise create a bug report at 
https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22

configuration yaml: ( sensor: !include_dir_merge_list mqtt/sensor/ )

- name: Modulator Test pulse length
  unique_id: modulator_test_pulse_length
  state_topic: "FELIX/modulator/test/SR_FastCall.IFB_FastTank.IFB_Digi.IFB_FwhmRead.atq_rRead"
  unit_of_measurement: "µs"
  suggested_display_precision: 1
  device_class: duration
  state_class: measurement

What version of Home Assistant Core has the issue?

core-2025.4.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

mqtt

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

2025-04-24 15:14:28.614 WARNING (MainThread) [homeassistant.components.mqtt.sensor] 
The unit of measurement `µs` is not valid together with device class `duration`. this will stop working in HA Core 2025.7.0

Additional information

No response

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions