Open InToSSH opened 3 years ago
I thought it was only causing a problem if you had 2 entities with "include_history: true", as I have had a home feed card with only 1 entity with "include_history: true" for some time and I hadn't noticed any problems.
Today I added a card with 2 entities with "include_history: true" and my system froze up. The following graph shows cpu for the homeassistant container: The picture above is in 4 sections - ignore section 1, section 2 is with 2 entities with "include_history: true", section 3 with 1 entity with "include_history: true", and section 4 with none.
So my original home feed card was causing problems, but not so much that I noticed. As soon as I added 2 entities with "include_history: true" then my CPU really went up, and I noticed! For completeness here is my card with 2 x "include_history: true":
- type: 'custom:home-feed-card'
title: Showers taken today
max_item_count: 10
# history_days_back: 1
# show_empty: false
more_info_on_tap: true
state_color: true
# id_filter: ^home_feed_.*
entities:
- entity: binary_sensor.shower_in_use
format: time
include_history: true
remove_repeats: false
max_history: 10
content_template: 'Shower'
exclude_states:
- "off"
- "unknown"
- entity: sensor.hotwater_state
format: time
include_history: true
remove_repeats: false
max_history: 2
content_template: 'Hot Water {{state}}'
exclude_states:
- "unknown"
Can you please try this with the latest beta version, 0.6.1b1, which has an improvement to the history support so that it only calls the API to get the history if the state of any of the entities for which you have include_history set are changed.
Previously, a change in any state in Home Assistant (even ones you don't have in the feed card) could cause it to call the API.
I really like this card, but the times the browser usues it, my processor usage rockets sky high, sending all my HA down, to a restart. removed the "history = true" and it's fine, but not nearly as usefull. Great card, hope you can work around this! All this "peaks" in processor usage are due to this.
Can you please try this with the latest beta version, 0.6.1b1, which has an improvement to the history support so that it only calls the API to get the history if the state of any of the entities for which you have include_history set are changed.
Previously, a change in any state in Home Assistant (even ones you don't have in the feed card) could cause it to call the API.
PS: using this beta in the results above.
@FragMenthor Have you tried clearing the browser cache after updating to the beta version? This is sometimes necessary to ensure you are running the latest version of the code.
If you have already tried that, can you please let me know:
I've downloaded the beta (0.6.1b1) and it is a lot better. I still get a spike to around 100% cpu when the card loads, but it then falls back to normal. Previously it went a lot higher and then stayed high, so definitely an improvement but still not sure why I get the spike.
Hello again! Answering to your questions:
Thanks for your great work!
Hello, I used this card in my lovelace, but if I add
include_history: true
, it produces a huge number of requests. After adding the card, I could no longer open the "Edit dashboard", the "Edit" buttons under each card were not loading. After refresh, the browser (Chrome) said "Waiting for available sockets" and nothing on that dashboard view was loading. I checked the Developer tools and noticed huge number of requests being made by this card. These are my settings:I noticed this happens only if I have the
include_history: true
set. With no history it is ok.HA version: 2020.12.2