Skip to content

Sensor error log messages are useless - should say the name of the sensor #146313

@jaredgisin

Description

@jaredgisin

The problem

In my logs, I see a lot of this

2025-06-07 20:31:13.496 ERROR (MainThread) [homeassistant.components.trend.binary_sensor] could not convert string to float: <SensorStateClass.TOTAL: 'total'>
2025-06-07 20:32:33.525 ERROR (MainThread) [homeassistant.components.trend.binary_sensor] could not convert string to float: <SensorStateClass.TOTAL: 'total'>
2025-06-07 20:34:53.515 ERROR (MainThread) [homeassistant.components.trend.binary_sensor] could not convert string to float: <SensorStateClass.TOTAL: 'total'>
2025-06-07 20:36:03.533 ERROR (MainThread) [homeassistant.components.trend.binary_sensor] could not convert string to float: <SensorStateClass.TOTAL: 'total'>
2025-06-07 20:37:13.524 ERROR (MainThread) [homeassistant.components.trend.binary_sensor] could not convert string to float: <SensorStateClass.TOTAL: 'total'>
2025-06-07 20:38:43.540 ERROR (MainThread) [homeassistant.components.trend.binary_sensor] could not convert string to float: <SensorStateClass.TOTAL: 'total'>

The problem is that this is absolutely useless to action on. I have dozens of sensor. Unless the log messages give me some indication about WHAT sensor it is that is producing this error, how can I resolve it? As it stands, these error log messages are as good as if they didn't appear at all. They're useless now.

As a general rule, an error log message needs to provide clear details that help to indicate precisely WHERE and WHAT the issue is.

What version of Home Assistant Core has the issue?

core-latest

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

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

Additional information

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions