Closed mvaneijken closed 1 year ago
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (sensor
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
sensor documentation sensor source (message by IssueLinks)
We raise the exception as the sensor attributes are incorrectly set, either by the developer that created the integration of the sensor or by the user, if there's some entity customization or the user configuring the MQTT configuration.
In the first of your examples, the state class is set to measurement, which requires a numeric value. In the second example the unit of measurement is an empty string, while it should be None.
The problem
The sensor component detect strings as integers resulting in an error. See diagnostics information below.
I would expect that if the test for integer data type would fallback to default string instead of integer.
What version of Home Assistant Core has the issue?
core-2023.6.1
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
Sensor
Link to integration documentation on our website
https://www.home-assistant.io/integrations/sensor/
Diagnostics information
Example 1:
Example 2:
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response