Power Wheels disappears randomly in 0.116.1
bluemantwo opened this issue · 11 comments
0.116.1 of HA
0.1.4 of Power Wheel
The Power Wheel will often no appear until I refresh the screen numerous times. This started immediately after install of 0.116.1 (from 0.115.6).
No debug info shows up in log.
I could reproduce this behavior for a minute when I switched to 0.116.2 myself. Maybe HA was using some cached frontend components, because after some time/refreshes it didn't happen again.
Is it still happening for you? If so, what version of the frontend do you use? (See /config/info
.)
It is random. But if you refresh enough, it will return. But then go away later when opening up that tab again. I am using the latest front end: Frontend version: 20201001.2. I find the same result on 2 different PCs and 2 different Android phones. More an annoyance than anything, since I can eventually get it to populate on the screen. I have not yet noticed any other cards having this behavior. Here are my settings for the card:
cards:
- active_arrow_color: green
auto_toggle_view_period: 2
energy_decimals: 2
grid_energy_consumption_entity: sensor.grid_energy_consumption
grid_energy_production_entity: sensor.grid_energy_production
grid_power_entity: sensor.power_now_meter_w_sensor
home_power_entity: sensor.power_now_usage_w_sensor
initial_auto_toggle_view: false
power_decimals: 0
production_is_positive: false
solar_energy_entity: sensor.solar_energy
solar_power_entity: sensor.power_now_solar_w_sensor
title_energy: Solar Energy Today
title_power: Solar Power
type: 'custom:power-wheel-card'
I was trying to go into Developer Tools in Chrome to see what is happening, but when I do that, the card pops up again! Strange behavior. I can also reproduce in FireFox was well. And, as I mentioned, on my Android phone in the HA mobile app.
I can reproduce it now. (In my first response I also said that I could reproduce, but I saw a partial rendered card there, and never saw that again.)
I can get the same behavior, when I play with an extra parameter (v
in my example) in the resources:
part of Lovelace configuration. That (if you change the value) mimics the situation where you get to see a new version of the card the first time after upgrading.
resources:
- url: /local/custom-cards-lovelace/power-wheel-card.js?v=20201008b
type: module
When I click 'Reload resources' and 'Refresh' in the UI and then refresh the browser, the issue occurs. The card doesn't show up. If I open the dev console, the card appears.
Same here Hassio on PI.
Card does not show at all even after repeated refreshing.
No errors when checking config and no errors reported.
regards martin
I'm trying to solve this issue, but it's hard (for me at least ;-) ). (First I thought it was caused by putting the power-wheel-card inside other cards and that I had to use https://github.com/thomasloven/lovelace-hui-element. But that didn't help.)
Next I was triggered by this and maybe HA got improved in lazy loading cards and power-wheel-card is impacted by that. I tried the hint there to preload a card. But I can't tell if the situation did improve. Maybe now its 1 out of 10 instead of 3 out of 10? For sure I had to disable some testing for config errors in the card itself before the card even could be preloaded.
Not sure where to look now. I will put a version on the dev branch (with the extra resource and the disabled config error testing). I had to put preload-cards.js
in the same folder as power-wheel-card.js
and added this to resources:
. Maybe others can check if there is some improvement for certain cases.
- url: /local/<A FOLDER>/preload-cards.js?v=20201020j
type: module
- url: /local/<THE SAME FOLDER>/power-wheel-card.js?v=20201020n
type: module
Please note the 'v' parameter that I had to upgrade every time to make HA load the latest version and not an old cached version. Please add debug: true
to the setup of power-wheel-card to be able to check which version of the card is loaded. You will see this in the dev console:
To help, could the three of you:
- Switch on debug mode and post a image like above? I can compare browser versions and a lot of other things.
- Check if the above change to (hard) preload the card did something for you?
- Post here how 'nested' your card is inside which other cards?
Interesting. I have not tried loading the dev version yet, but I did do a test by adding PowerWheel to another existing tab. Doing that, it appears to work fine and does not 'disappear' even after numerous refreshes. However, oddly, that causes the 3rd card in the Tab to randomly disappear!
- badges: []
cards:
- active_arrow_color: green
auto_toggle_view_period: 2
energy_decimals: 2
grid_energy_consumption_entity: sensor.grid_energy_consumption
grid_energy_production_entity: sensor.grid_energy_production
grid_power_entity: sensor.power_now_meter_w_sensor
home_power_entity: sensor.power_now_usage_w_sensor
initial_auto_toggle_view: false
power_decimals: 0
production_is_positive: false
solar_energy_entity: sensor.solar_energy
solar_power_entity: sensor.power_now_solar_w_sensor
title_energy: Solar Energy Today
title_power: Solar Power
type: 'custom:power-wheel-card'
- entities:
- entity: sensor.bbc_bat_volts_sensor
- entity: sensor.bbc_cabin_temp_sensor
- entity: sensor.bbc_load_watts_sensor
- entity: sensor.bbc_pv_watts_sensor
- entity: sensor.bbc_signal
title: BBC Status
type: entities
- entity: sensor.rpi_monitor_bbc
name: BBC Raspberry Pi Status
name_prefix: RPi
show_error: false
temp_scale: F
type: 'custom:rpi-monitor-card'
icon: 'mdi:tent'
Wait, did something change? For some reason, I cannot get the PowerWheel card to disappear anymore. I did not update any parts of HA that I know of, and did not update Chrome that I know of. But for now, the Power Wheel is rock solid.
EDIT 1:
All I did was copy the Power Wheel card from one Tab to another Tab. This created a duplicate 2nd copy of Power Wheel. But now, the Power Wheel is working fine on both my PC Chrome browser and Android app. The Tab I added it to (listed above in prior post) does still have an issue where the 3rd card (rpi-monitor-card) does sometimes disappear. But both copies of the Power Wheel card seem just fine now.
EDIT 2:
After further testing, it appears that adding a 2nd Power Wheel copy in a different Tab of HA caused both copies to be rock solid now. I cannot get either one to disappear. Before, it would disappear ~50% of the time. Now after 20 or 30 refreshes, it always shows up.
Thx for the extra info.
Maybe, by placing another instance of the power-wheel-card in your setup, the order of loading cards changes and this solves the issue. Or maybe this does trigger the lazy loading of custom cards in a different way. I got the feeling that this isn't specifically an issue for the power-wheel-card but could be an issue for all (custom?) cards in HHOME ASSISTANT Maybe the complexity/size/performance of power-wheel-card makes it more vulnerable, I don't know yet.
@gurbyz, I tend to agree. It is not an issue with just Power Wheel. After a full day of use and many, many restarts, Power Wheel is solid. But there is another custom card (rpi-monitor-card) that is now doing the disappearing act.
@bluemantwo I wonder if the problems you were seeing are build-tool or service-worker caching related. Which build tool are you using (webpack, parceljs, etc.) when you had the problem? And where you using a service worker that was caching things?