Skip to content
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

Sensor has device class None #87

Closed
codyc1515 opened this issue Mar 6, 2023 · 6 comments · Fixed by #105
Closed

Sensor has device class None #87

codyc1515 opened this issue Mar 6, 2023 · 6 comments · Fixed by #105
Labels
bug Something isn't working

Comments

@codyc1515
Copy link

Receiving warnings from HA on each load.

Logger: homeassistant.components.sensor
Source: components/sensor/__init__.py:597
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 2:43:15 PM (2 occurrences)
Last logged: 2:43:23 PM

Sensor sensor.strava_0_0 has device class None, state class measurement and unit None thus indicating it has a numeric value; however, it has the non-numeric value: 2023-03-04 18:43:59 (<class 'datetime.datetime'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
Sensor sensor.strava_0_2 has device class None, state class measurement and unit min/km thus indicating it has a numeric value; however, it has the non-numeric value: 12:31 (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
@craibo craibo added the bug Something isn't working label Mar 6, 2023
@craibo
Copy link
Owner

craibo commented Mar 6, 2023

Thanks @codyc1515

I am aware of this but there is no quick fix.
I have already removed the device_class and state_class from the PACE sensor but HA still throws the warning as I set the unit_of_measure on the sensor.
To resolve this I need to get a device_class for PACE with the supported units of measure added to HA core.
I can sepcify the time value as an integer but then the formatting is not correct on the frontend.

@codyc1515
Copy link
Author

Not only is PACE sensor impacted but also the _0_0 descriptor sensor. On checking, it seems like the attribute is static.

@craibo
Copy link
Owner

craibo commented Mar 8, 2023

Hi @codyc1515

That is the inital setting of it as most of the sensors (besides 2) have this setting.
In the method def capability_attributes(self) the state_class is removed from both the PACE and Index 0 sensors.
The device_class for the index 0 sensor is set to datetime correctly in this method too.

Can you please check under

  1. Deveveloper Tools --> Statistics
  2. Search for strava
  3. Check if any have a button FIX ISSUES and resolve them using this.

The _0_0 sensor shoudl not be logging any issues.

@craibo
Copy link
Owner

craibo commented Mar 8, 2023

Hi @codyc1515
Please can you also confirm that you are running the latest version (3.2.16) of ha_strava from this repository https://github.com/craibo/ha_strava
Thanks

@codyc1515
Copy link
Author

Nope, none of them have Fix Issues button available and am on the latest version.

@craibo craibo linked a pull request May 7, 2023 that will close this issue
@craibo
Copy link
Owner

craibo commented May 7, 2023

This should be resolved with version 3.2.17

@craibo craibo closed this as completed May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants