home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.54k stars 29.91k forks source link

Using native unit of measurement 'lux' which is not a valid unit for the device class ('illuminance') #102229

Closed radinsky closed 11 months ago

radinsky commented 11 months ago

The problem

Getting errors within miflora auto discovered mqtt sensors:

Entity sensor.palm_light (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'lux' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; 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 Entity sensor.banana_light (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'lux' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; 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

What version of Home Assistant Core has the issue?

core-2023.10.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

mqtt

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 11 months ago

Hey there @emontnemery, @jbouwh, mind taking a look at this issue as it has been labeled with an integration (mqtt) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `mqtt` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign mqtt` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


mqtt documentation mqtt source (message by IssueLinks)

jbouwh commented 11 months ago

The the miflora publishes an invalid config. The message in the logs is clear on this.

jbouwh commented 11 months ago

What integration do you use, it that xiaomi_ble?

home-assistant[bot] commented 11 months ago

miflora documentation miflora source

home-assistant[bot] commented 11 months ago

Hey there @jc2k, @ernst79, mind taking a look at this issue as it has been labeled with an integration (xiaomi_ble) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `xiaomi_ble` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign xiaomi_ble` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


xiaomi_ble documentation xiaomi_ble source (message by IssueLinks)

Jc2k commented 11 months ago

There is no miflora integration any more. It broke and was removed a long time ago.

jbouwh commented 11 months ago

Right, but is xiaomi_ble being used here?

Jc2k commented 11 months ago

I don't see how from the information available. xiaomi_ble has absolutely nothing to do with MQTT?

Jc2k commented 11 months ago

Given its MQTT, its more likely to be something like https://github.com/ThomDietrich/miflora-mqtt-daemon?

Jc2k commented 11 months ago

(And FWIW we use the HA constants https://github.com/home-assistant/core/blob/dev/homeassistant/components/xiaomi_ble/sensor.py#L70-L75)

jbouwh commented 11 months ago

(And FWIW we use the HA constants https://github.com/home-assistant/core/blob/dev/homeassistant/components/xiaomi_ble/sensor.py#L70-L75)

Thnx

jbouwh commented 11 months ago

@radinsky it seems this issue was fixed:

https://github.com/ThomDietrich/miflora-mqtt-daemon/commit/3ec456b4fea5e5fef575489c25591a786515460c

May be you just need to update your software.

radinsky commented 11 months ago

Yes, I've changed it manually before I saw your comment :) I confirm it's a fix.