robinostlund / homeassistant-volkswagencarnet

Volkswagen Carnet Component for home assistant
GNU General Public License v3.0
328 stars 60 forks source link

Sensor sensor.xxx_charger_max_ampere has device class None, state class None and unit A thus indicating it has a numeric value; however, it has the non-numeric value: Maximum (<class 'str'>) #465

Closed edwardtfn closed 9 months ago

edwardtfn commented 1 year ago

Before you post a new issue - you must first check the following (and check the boxes with an "X" below)

Environment

Describe the bug

The integration is working fine, however I have this error message in the log:

Sensor sensor.vw_passat_charger_max_ampere has device class None, state class None and unit A thus indicating it has a numeric value; however, it has the non-numeric value: Maximum (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

Steps to Reproduce

It happens on every startup since Home Assistant v2023.2.0.

Expected behavior

No errors in the log. So probably the device class have to be set properly or the "Maximum" state should be entered as a number.

Screenshots

Traceback/Error logs

Logger: homeassistant.components.sensor
Source: components/sensor/__init__.py:608
Integration: Sensor (documentation, issues)
First occurred: 09:29:51 (7 occurrences)
Last logged: 09:33:25

Sensor sensor.vw_passat_charger_max_ampere has device class None, state class None and unit A thus indicating it has a numeric value; however, it has the non-numeric value: Maximum (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
...

Debug information - all JSON responses from logfile

Additional context

mariuske commented 1 year ago

Same for this one: Sensor sensor.passat_charging_time_left has device class None, state class None and unit h thus indicating it has a numeric value; however, it has the non-numeric value: 03:45 (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

StefanoGiu commented 1 year ago

Same for me:

2023-03-10 10:13:21.618 WARNING (MainThread) [homeassistant.components.sensor] Sensor sensor.golf_heater_source_for_departure_timers has device class None, state class None and unit thus indicating it has a numeric value; however, it has the non-numeric value: electric (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author. 2023-03-10 10:13:21.618 WARNING (MainThread) [homeassistant.components.sensor] Sensor sensor.golf_parking_time has device class None, state class None and unit thus indicating it has a numeric value; however, it has the non-numeric value: 2023-03-10 07:55:05 (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author. 2023-03-10 10:13:21.634 WARNING (MainThread) [homeassistant.components.sensor] Sensor sensor.golf_request_results has device class None, state class None and unit thus indicating it has a numeric value; however, it has the non-numeric value: Unknown (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author. 2023-03-10 10:13:21.634 WARNING (MainThread) [homeassistant.components.sensor] Sensor sensor.golf_last_connected has device class None, state class None and unit thus indicating it has a numeric value; however, it has the non-numeric value: 2023-03-10 07:55:47 (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author. 2023-03-10 10:13:21.649 WARNING (MainThread) [homeassistant.components.sensor] Sensor sensor.golf_charger_max_ampere has device class None, state class None and unit A thus indicating it has a numeric value; however, it has the non-numeric value: Maximum (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

The fix is easy... just remove "unit_of_measure" from the sensor configuration...