-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Philips 9290012607: Entity sensor.xxx_illuminance (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement '' which is not a valid unit for the device class ('illuminance') it is using #15958
Comments
The device exposes this:
With the new HA-Version the device_class and the unit_of_measurement must be correct, see: https://www.home-assistant.io/integrations/sensor/#device-class The "illuminance"-value is the raw measured for illuminance. It has no unit. |
This is a change in HA recently, nothing to do with Z2M. I have Z-Wave devices that do this with illuminance and opened an issue in the HA branch. Those devices I have report illuminance in %, not lux. I think there were a few other issues opened for other sensor types and fixed already. |
I don't think so. The unit of measurement are not in the zigbee stream and not in mqtt. In the preparation of the HA sensors, this is attached by z2m. |
I have the same with two Xiaomi GZCGQ01LM light sensors:
There is also a issue raised at home assistant: here |
…ts.mqtt.sensor.MqttSensor'>) is using native unit of measurement '' which is not a valid unit for the device class ('illuminance') ` warning. #15958
Fixed! Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html) |
The problem is still there After updating to the latest z2m edge version and restart from HA the error message has changed slightly.
The HA entity looks like: And i get a new error
|
Can you provide the debug log when starting z2m? See https://www.zigbee2mqtt.io/guide/usage/debug.html on how to enable debug logging. |
I upload it |
@frenck I think:
is caused by the lack of Full discovery payload for future reference:
|
Correct. The unit of measurement is optional, but once a device class is set, we only accept a subset of units. This has always been the case, but only recently have we started adding runtime checks for this (which currently result in a warning log). Ref: https://developers.home-assistant.io/docs/core/entity/sensor#available-device-classes |
@frenck thansk! Issue should be fixed now, please confirm. Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html) |
That linked commit seems wrong. State class and UoM are not related? |
I test it with Zigbee2MQTT Version Log file attached |
@frenck whoops, I was confused. Thanks for your sharp eyes, fixed it. Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html) |
Wouldn't it be better to delete the "device_class" if there is no "unit_of_measurement" instead of the "state_class"?
https://www.home-assistant.io/integrations/sensor/#device-class |
@GerdRuetten is this issue fixed now? |
Zigbee2MQTT Version error still available Zigbee2MQTT Version error is fixed |
But there is a second error
Should i open a new issue? Best regards Gerd |
@GerdRuetten this error is because the unit is changed from an empty string to none now. I suggest that you clear the old data which should get rid of this error. |
as suggested, i deleted the old data via https://my.home-assistant.io/redirect/developer_statistics. there is no more error. good job i close this issue. |
Zigbee2MQTT Version Sorry I have to ask again: I just installed the update from 1.29.1-1 to 1.30.0-1 but the error still exists. This applies to the Zigbee plugs with Tasmota. `Logger: homeassistant.components.sensor Entity sensor.tas5klein_nuc_moni_energy_reactivepower (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'VAr' which is not a valid unit for the device class ('power') it is using; 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 Where and how do I have to delete old data under developer_statistic? I don't see any way to delete old data there? |
What happened?
After update HA to Verion 2023.1.0, i get in the HA logs for the device https://www.zigbee2mqtt.io/devices/9290012607.html following error:
What did you expect to happen?
No error :-)
How to reproduce it (minimal and precise)
No response
Zigbee2MQTT version
1.29.0-dev commit: cf80134
Adapter firmware version
20220219
Adapter
SONOFF Zigbee 3.0 USB Dongle Plus,TI CC2652P + CP2102(N)
Debug log
No response
The text was updated successfully, but these errors were encountered: