[X] I have updated to the latest available Home Assistant version.
[X] I have cleared the cache of my browser.
[X] I have tried a different browser to see if it is related to my browser.
Describe the issue you are experiencing
The history-graph card says "loading state history" but doesn't load the entities for some entities.
The entities themselves have no problem showing their history when clicked on their own.
I've tried it with multiple browsers, computers, and from the mobile app. It seems to only affect some of the entities, but I haven't seen an obvious pattern of which ones. Sometimes, it works fine (and persists across refreshes of the page) and other times from the same device it doesn't (and also persists not working across refreshes of the page).
Card as seen on front end:
Card as seen when editing:
Same entity showing history with no problems:
When loading a page that has an affected card, the below error appears in the log:
Logger: homeassistant.components.websocket_api.http.connection
Source: components/history/websocket_api.py:242
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:25:28 PM (6 occurrences)
Last logged: 10:25:32 PM
[140480700928000] Error handling message: Unknown error (unknown_error) RedactedUser from 192.168.10.230 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0)
[140480398423472] Error handling message: Unknown error (unknown_error) RedactedUser from 192.168.10.230 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/history/websocket_api.py", line 524, in ws_stream
last_event_time = await _async_send_historical_states(
File "/usr/src/homeassistant/homeassistant/components/history/websocket_api.py", line 279, in _async_send_historical_states
last_time_ts, last_time_dt, payload = await instance.async_add_executor_job(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/history/websocket_api.py", line 242, in _generate_historical_response
and (state_last_time := state_list[-1][COMPRESSED_STATE_LAST_UPDATED])
TypeError: '>' not supported between instances of 'NoneType' and 'float'
Describe the behavior you expected
Expected to see the state history on the card.
Steps to reproduce the issue
Load a page that has a history-graph card.
...
What version of Home Assistant Core has the issue?
2023.5.3
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
Mozilla Firefox 113.0.1, also Google Chrome 113.0.5672.93
Which operating system are you using to run this browser?
Microsoft Windows Home 10 Version 10.0.19044 Build 19044
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
I would suggest opening an issue in the core repo against the history integration. That call stack is coming from core and suggests it is not able to provide the history data to the frontend.
Checklist
Describe the issue you are experiencing
The history-graph card says "loading state history" but doesn't load the entities for some entities. The entities themselves have no problem showing their history when clicked on their own. I've tried it with multiple browsers, computers, and from the mobile app. It seems to only affect some of the entities, but I haven't seen an obvious pattern of which ones. Sometimes, it works fine (and persists across refreshes of the page) and other times from the same device it doesn't (and also persists not working across refreshes of the page).
Card as seen on front end:![StateHistoryIssue](https://github.com/home-assistant/frontend/assets/5406336/1b4f0b98-d1a3-473e-a72f-61ddcbc31d12)
Card as seen when editing:![StateHistoryCardState](https://github.com/home-assistant/frontend/assets/5406336/19308404-8c34-44ca-a87b-0cd7a1969aa1)
Same entity showing history with no problems:![StateHistoryEntityState](https://github.com/home-assistant/frontend/assets/5406336/f0dca209-4b8e-4637-a775-484174686a55)
When loading a page that has an affected card, the below error appears in the log:
Describe the behavior you expected
Expected to see the state history on the card.
Steps to reproduce the issue
...
What version of Home Assistant Core has the issue?
2023.5.3
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
Mozilla Firefox 113.0.1, also Google Chrome 113.0.5672.93
Which operating system are you using to run this browser?
Microsoft Windows Home 10 Version 10.0.19044 Build 19044
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
No response
Additional information
No response