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

Statistics Graph Card not populating for Shelly (Motion and TRV) temperatures (Gen 1 devices) #107530

Closed
fearntech opened this issue Jan 8, 2024 · 11 comments · Fixed by #108052
Closed

Comments

@fearntech
Copy link

The problem

Shelly Motion 2 and TRV temperatures were displaying on Statistics Graph Card with core_2023.12.4. After update to core_2024.1.0 temperatures stopped updating on Statistics Graph, and I now have 'No statistics found'. If I edit "Statistics Graph Card Configuration" and try to add any Shelly Motion/TRV then they are not available in the dropdown list. I restored backup to core_2023.12.4, and the data began populating again successfully. I tried totally deleting a device and re-adding but have the same problem again. If I go to 'History' tab, then data is recording there with no problem.

What version of Home Assistant Core has the issue?

core_2024.1.0

What was the last working version of Home Assistant Core?

core_2023.12.4

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

config_entry-shelly-12f14fc03f7d5c282b7a29d6aeb4d895.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jan 8, 2024

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 Renames 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.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


shelly documentation
shelly source
(message by IssueLinks)

@chemelli74
Copy link
Contributor

Hi, I bet you have a old firmware.
But to be sure please add the following to configuration.yaml , restart HA, and post the log:

logger:
  default: warning
  logs:
    homeassistant.components.shelly: debug
    aioshelly: debug

Note: it is better to drag the log into the comment (which will add it as an attachment) and not copy paste as it is hard to read logs in GitHub.

And add diagnostics (menu configuration -> integration -> shelly -> download diagnostics )

@fearntech
Copy link
Author

Thanks, it is most current firmware (20231122-131719 for the Motion 2). The log has shown lots of other items to tidy, I'll do that first, and then try a few things over next few days, then get back to you. Thanks for help.

@chemelli74
Copy link
Contributor

Thanks, it is most current firmware (20231122-131719 for the Motion 2).

Ok, then please check firewall rule / routing as I noticed in your diagnostic that the device and HA are on different subnet.

@fearntech
Copy link
Author

Yes, devices are on separate subnet (restricted internet access).

I've made an observation tonight, in Developer Tools > Statistics, there is the following error:
The state class '' of this entity is not supported.
In Developer Tools > Statistics, there is NO state_class defined for affected entity.
If I manually add "state_class: measurement" in "Set state, State attributes", then the entity starts working again.
Until... there is a reload, or if I restart HA, then the error appears again.

@mibbi1802
Copy link

Same issue as @fearntech and similar environment. Data from the last months are ok but since the update there ist no state_class anymore and the statistics graph in the dashboard shows no data. Shelly D&W and H&T have this issue as well.

@bdraco
Copy link
Member

bdraco commented Jan 9, 2024

We have determined the root cause is likely that the state class is not restored for gen1 devices

def _build_block_description(entry: RegistryEntry) -> BlockSensorDescription:

To fix this we would need to migrate gen1 devices to use the same/similar restore model as gen2 devices

@bdraco
Copy link
Member

bdraco commented Jan 9, 2024

To set expectations, its unlikely this will get fixed in a patch release as its a significant amount of refactoring work to solve this issue.

The good news is we have no identified the cause which means a solution can be developed

@bdraco bdraco changed the title Statistics Graph Card not populating for Shelly (Motion and TRV) temperatures Statistics Graph Card not populating for Shelly (Motion and TRV) temperatures (Gen 1 devices) Jan 9, 2024
@danieletorelli
Copy link

There's a way we can work-around it in the config file till when a fix gets shipped?

I'd not like to lose statistics because of this issue.

@fearntech
Copy link
Author

To set expectations, its unlikely this will get fixed in a patch release as its a significant amount of refactoring work to solve this issue.

The good news is we have no identified the cause which means a solution can be developed

That's great, thanks for looking into this.

@bdraco
Copy link
Member

bdraco commented Jan 13, 2024

There's a way we can work-around it in the config file till when a fix gets shipped?

The refactoring need to make this work is significant enough that there is no workaround available

@github-actions github-actions bot locked and limited conversation to collaborators Feb 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants