Open sorted-bits opened 1 month ago
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (websocket_api
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
websocket_api documentation websocket_api source (message by IssueLinks)
If you remove the statistics-graph
from your dashboard, do you still get the error? I'm asking because it could be that something else on your dashboard might actually generate the error, break the connection en that being the cause of your graph not being rendered.
What's happening here is that a message fails to be generated because self.container
can not be sorted. self.container
contains str
and NoneType
values, and those don't support the <
comparator.
File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 755, in __call__
or 'value must be one of {}'.format(sorted(self.container)))
^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'str' and 'NoneType'
Are you using conditional
cards or the new visibility configuration of cards on your dashboard?
Thanks for your reply, using an empty dashboard with just this statistics-graph
causes the error to appear in the log as well, this is an example of the raw dashboard configuration:
views:
- title: Home
type: sections
sections:
- type: grid
cards:
- chart_type: bar
period: day
type: statistics-graph
entities:
- sensor.zwembadpomp_dagelijks
stat_types:
- state
hide_legend: true
days_to_show: 30
I am not using any conditional cards. Not on this dashboard or any to be honest. I am using this on a sections
dashboard, but also adding it to an empty masonry
dashboard causes the same error.
Removing the card from that dashboard stops the error from appearing in the logs. Adding it back in, immediately makes it appear in the logs again (and also, the card is not loading).
After restarting Home Assistant a couple of times, this message appeared in the logs:
WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.zwembadpomp_dagelijks (kWh) cannot be converted to the unit of previously compiled statistics (None). Generation of long term statistics will be suppressed unless the unit changes back to None or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
Clicking the link allowed me to fix
a bunch of non functional sensors (the ones causing errors). It seems I lost some data there, but at least the graph started loading!
The problem
In my Home Assistant installation, I have a weird issue with using a
statistics-graph
in combination with some of my utility meters.I have the following configuration for a card in my dashboard:
The
sensor.zwembadpomp_dagelijks
is a utility meter, which I made. It uses anenergy
state for a smart-plug I am using, which is an always increasing value.When I add this card to my dashboard, the following errors show up in my log, when I try to display the dashboard.
There are a couple of things, that I looked at:
statistics-graph
in combination with some of my utility meters.I have the following configuration for a card in my dashboard:
The
sensor.zwembadpomp_dagelijks
is a utility meter, which I made. It uses anenergy
state for a smart-plug I am using, which is an always increasing value.When I add this card to my dashboard, the following errors show up in my log, when I try to display the dashboard.
There are a couple of things, that I looked at:
default_config:
in my config, not using a different database.What version of Home Assistant Core has the issue?
core-2024.7.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Home Assistant WebSocket API
Link to integration documentation on our website
https://www.home-assistant.io/integrations/websocket_api
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response