Closed kbabioch closed 7 months ago
Hey there @julius2342, @farmio, @marvin-w, mind taking a look at this issue as it has been labeled with an integration (knx
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
knx documentation knx source (message by IssueLinks)
Hi 👋!
Unfortunately setting a unit manually for Knx sensors is not supported.
You can try to use customize
or work around by omitting the device_class and use its value in a helper with correct unit and device_class.
Is this a technical limitation or something that might be improved later on? I'm currently trying to clean up my error logs, and this is one of the remaining issues ;-).
It's more of a historical / political limitation.
We didn't want to add (another) config value that does exactly the same as an already built in concept (customize
). And I guess no one has revised that thought in the past ~4 years, even though things are a bit different now (eg. customize not being as prominent as it has been in the past).
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The problem
I'm getting errors in my logs for sensor entities from my presence detector, which I cannot address with modifications to the configuration.
The configuration itself looks something like this:
The sensor returns a (custom) 2 byte float value, which represents "parts per billion" in terms of VOC / air quality.
The value itself is read correctly and can be processed within Home Assistant. However there is no unit set. In the logs of Home Assistant I'm getting the following error logged (several times):
According to the developer documentation of the Sensor Entity the device class should be
VOLATILE_ORGANIC_COMPOUNDS_PARTS
and the unit for this device class is eitherppm
orppb
.However I'm not able to set this
unit_of_measurement
and/ornative_unit_of_measurement
for this entity, as this will result in errors when parsing the YAML file.How I am I supposed to change the unit in order to get rid of the error log and have it displayed correctly in the interface?
What version of Home Assistant Core has the issue?
2023.10.0
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
knx
Link to integration documentation on our website
https://www.home-assistant.io/integrations/knx/#sensor
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