Lovelace Card not getting updated with recent state value
See original GitHub issueBefore submitting a bug
[ x ] I updated to the latest version available [ x ] I cleared the cache of my browser
Describe the bug
I managed to configure the card quite nicely with Xiaomi Air Purifier 3c and everytihng is working properly (will add the code below), even the AQI is working, but the issue is that the states are not getting updated regularly (AQI, RPMs, Filter %, etc.). If I turn it on/off, interact with the card in any way or reload the browser, all states will get updated immediately, but if I leave it like that, nothing gets updated. Also if I call a service, to put on the child lock like:
shortcuts:
- name: Child Lock
icon: mdi:lock
service: switch.toggle
service_data:
entity_id: switch.mi_air_purifier_3c_2_child_lock
It works perfectly, but I get the loading circle and the card stops responding. It fixes itself on browser reload.
Steps to reproduce
- Install repo
- Add lovelace card with the following code:
type: custom:purifier-card
entity: fan.mi_air_purifier_3c_1
stats:
- entity_id: sensor.mi_air_purifier_3c_1_filter_life_remaining
unit: '%'
subtitle: Filter Remaining
- entity_id: sensor.mi_air_purifier_3c_1_motor_speed
unit: rpm
subtitle: Motor Speed
shortcuts:
- name: Auto
icon: mdi:brightness-auto
preset_mode: Auto
- name: Silent
icon: mdi:weather-night
preset_mode: Silent
- name: 25%
icon: mdi:circle-slice-2
preset_mode: Favorite
service: number.set_value
service_data:
entity_id: number.mi_air_purifier_3c_1_favorite_motor_speed
value: '750'
- name: 50%
icon: mdi:circle-slice-4
preset_mode: Favorite
service: number.set_value
service_data:
entity_id: number.mi_air_purifier_3c_1_favorite_motor_speed
value: '1250'
- name: 75%
icon: mdi:circle-slice-6
preset_mode: Favorite
service: number.set_value
service_data:
entity_id: number.mi_air_purifier_3c_1_favorite_motor_speed
value: '1700'
- name: 100%
icon: mdi:circle-slice-8
preset_mode: Favorite
service: number.set_value
service_data:
entity_id: number.mi_air_purifier_3c_1_favorite_motor_speed
value: '2200'
- name: Child Lock
icon: mdi:lock
service: switch.toggle
service_data:
entity_id: switch.mi_air_purifier_3c_2_child_lock
show_name: true
show_state: true
show_toolbar: true
compact_view: true
aqi:
entity_id: sensor.mi_air_purifier_3c_1_pm2_5
unit: µg/m³
Expected behavior The card to get updated on a regular basis with most recent state values.
Versions:
- Release: v1.0.1
- Browser: Chrome & Fully Kiosk
- HomeAssistant version: core-2021.11.5
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
@austwhite the issue you are describing is fixed in the latest release 2.0.0. The card got some major changes, so hopefully the issue will be resolved. Please, reopen if you still have this issue after upgrading to the latest version.
@denysdovhan Almost perfect again now on my system. Just a small bug where the icons do not highlight for 25, 50 and 75 percent speeds. Full speed, silent and auto highlight. Fan speed changes correctly, this is just a visual bug.
Appreciate your help with this. I’ll send you a donation later in the week after I return from my business trip 😃
Edit: Worked out where the bug may be. Xiaomi Air Purfier 3 only has 3 fan speed settings. Low, Med , High (33%, 66% and 100%) Not four. 😃 All good now 😃