home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.75k stars 30k forks source link

Shelly H&T and Shelly TRV - Temperature & Humidity Entities -> No or wrong state_class is configured #84009

Closed dominikamann closed 1 year ago

dominikamann commented 1 year ago

The problem

The Shelly H&T and Shelly TVR Sensor/Devices provides temperature & humidity values. For these entities a wrong or no state class is configured. This leads to an error in HA Statistics. Please fix the Shelly Integration and set the correct state class. Thanks!

"The state class of this entity, is not supported. Statistics can not be generated until this entity has a supported state class.

If this state class was provided by an integration, this is a bug. Please report an issue."

Home Assistant 2022.12.5 Supervisor 2022.11.2 Operating System 9.4 Frontend 20221213.0 - latest

What version of Home Assistant Core has the issue?

2022.12.5

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

Shelly

Link to integration documentation on our website

https://www.home-assistant.io/integrations/shelly/

Diagnostics information

-

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

-

home-assistant[bot] commented 1 year ago

Hey there @balloob, @bieniu, @thecode, @chemelli74, @bdraco, mind taking a look at this issue as it has been labeled with an integration (shelly) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `shelly` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign shelly` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


shelly documentation shelly source (message by IssueLinks)

bieniu commented 1 year ago

The temperature and humidity sensors have the correct state_class for both devices.

image

Are you sure you are using core integration, not custom one?

dominikamann commented 1 year ago

Hi, thank you for your answer. I am pretty sure that i use the offical integration. Iam running home assistant since years. May it was a migration issue? Attached some screenshots. Do you need more data or details?

1 2 3 4 5 6

chemelli74 commented 1 year ago

Hi,

cannot reproduce the issue with my H&T and TRV.

But I see exactly the same behavior with my DW2. If you have a DW2 and it doesn't show the error, I bet is some kind of race coming from the core in showing the info.

Simone

thecode commented 1 year ago

@dominikamann can you try to remove and re-add one of the devices with the wrong state class? we had a problem with this in the past which was fixed.

philmale commented 1 year ago

Seeing the same thing with a couple of Shelly devices specifically a button1 and an HT sensor. I removed the statistics using the UI, then reloaded the (core) integration for the impacted devices, again on the HA UI, (not restarted HA or removed any devices) and that appears to have removed the error message for now from the dev->statistics panel at first sight.

Screenshot 2023-01-02 at 14 37 48 Screenshot 2023-01-02 at 15 25 48
thecode commented 1 year ago

@dominikamann if you still have issues after removing and adding the device please report back. Thanks 👍

dominikamann commented 1 year ago

@thecode Sorry for the late reply. Deleting and adding the device helped. I have about ~50 Shelly's ... that would be a lot of work. But it seems to help if I delete the statistic error messages. For some sensors the error did not appeared again. Thanks for your help.