-
-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Help] Question about state update interval #1280
Comments
Hey, there is a list of entities for each page that is used to get state updates and re-render the page if they have changed in homeassistant. - However this subscription doesn't work for templates. A quick fix would be this:
Just put the entities you've used in the template after the last entity of your cardGird, won't be shown on the panel - but you will get state updates for them ;) |
Thanks for the tip, but I've just tried it out but still the updates are very slow. |
Please post your config |
Here the complete config for the bedroom nspanel: nspanel-bedroom-3:
module: nspanel-lovelace-ui
class: NsPanelLovelaceUIManager
config:
panelRecvTopic: "tasmota/sonoff/nspanel_bedroom_3/tele/RESULT"
panelSendTopic: "tasmota/sonoff/nspanel_bedroom_3/cmnd/CustomSend"
model: eu
locale: "nl_BE"
#dateFormatBabel: "EE d MMMM"
sleepTimeout: 20
sleepBrightness:
- time: "7:00:00"
value: 10
- time: "21:00:00"
value: 0
screensaver:
entities:
- entity: weather.forecast_home
- entity: sensor.weather_forecast_daily # see https://docs.nspanel.pky.eu/stable/prepare_ha/#workaround-for-homeassistant-202404
type: 0
- entity: sensor.weather_forecast_daily # see https://docs.nspanel.pky.eu/stable/prepare_ha/#workaround-for-homeassistant-202404
type: 1
- entity: sensor.weather_forecast_daily # see https://docs.nspanel.pky.eu/stable/prepare_ha/#workaround-for-homeassistant-202404
type: 2
- entity: sensor.weather_forecast_daily # see https://docs.nspanel.pky.eu/stable/prepare_ha/#workaround-for-homeassistant-202404
type: 3
statusIcon1:
entity: climate.smart_trv_bedroom_3
# prefix with ha: to render home assistant templates, icons must be put between <I></I>
icon: "ha:{{iif(state_attr('climate.smart_trv_bedroom_3', 'hvac_action')=='heating', '<I>mdi:fire</I>', '', '')}}"
#color: [255, 193, 7]
statusIcon2:
entity: climate.smart_trv_bedroom_3
icon: "ha:{{state_attr('climate.smart_trv_bedroom_3', 'current_temperature') | float(0) | round(1)}}°C"
#entity: sensor.nspanel_bedroom_3_analog_temperature1
#icon: "ha:{{states('sensor.nspanel_bedroom_3_analog_temperature1') | float(0) | round(1)}}°C"
#color: [255, 193, 7]
cards:
- type: cardGrid
title: Overzicht
entities:
- entity: button.bedroom_3_light_profile_default
name: Standaard
icon: mdi:lightbulb-on-50
color: "{{iif(state_attr('light.smart_leds_bedroom_3', 'brightness') | int(0) == states('input_number.light_profile_default_brightness') | int(0), '[255, 193, 7]', '[85, 115, 158]', '[85, 115, 158]')}}"
- entity: button.bedroom_3_light_profile_night
name: Nacht
icon: mdi:lightbulb-on-10
color: "{{iif(state_attr('light.smart_leds_bedroom_3', 'brightness') | int(0) == states('input_number.light_profile_night_brightness') | int(0), '[255, 193, 7]', '[85, 115, 158]', '[85, 115, 158]')}}"
- entity: button.bedroom_3_light_profile_work
name: Werk
icon: mdi:lightbulb-on
color: "{{iif(state_attr('light.smart_leds_bedroom_3', 'brightness') | int(0) == states('input_number.light_profile_work_brightness') | int(0), '[255, 193, 7]', '[85, 115, 158]', '[85, 115, 158]')}}"
- entity: navigate.light
name: Aanpassen
icon: mdi:lightbulb
color: "{{iif(states('light.smart_leds_bedroom_3')=='on', '[255, 193, 7]', '[85, 115, 158]', '[85, 115, 158]')}}"
- entity: sensor.smart_sensor_bedroom_3_temperature
name: Temperatuur
- entity: navigate.thermostat
name: Thermostaat
icon: mdi:thermostat
hiddenCards:
- type: cardEntities
title: Verlichting
key: light
entities:
- entity: light.smart_leds_bedroom_3
name: Kleuren
- entity: input_boolean.bedroom_3_light_disco_mode_toggle
name: Disco modus
- entity: input_number.bedroom_3_light_disco_mode_interval_nspanel
name: Disco interval
- entity: navigate.light_lamps
name: Lampen individueel
icon: mdi:lightbulb
- type: cardEntities
title: Lampen
key: light_lamps
entities:
- entity: light.smart_led_bedroom_3_lamp_1
name: Lamp 1
- entity: light.smart_led_bedroom_3_lamp_2
name: Lamp 2
- entity: light.smart_led_bedroom_3_lamp_3
name: Lamp 3
- type: cardThermo
title: Thermostaat
key: thermostat
entity: climate.smart_trv_bedroom_3 So when I press those profile buttons, the light brightness is set to the value of the respective input boolean, but the ui is not reflecting, as long as I stay on the same page. When I'm changing to another page and come back,the color is updated on the right button. PS: also when adding the addtitional entities as you said (not in config above) doesn't make a difference. |
This should work - not sure how you added the addtitional entities: nspanel-bedroom-3:
module: nspanel-lovelace-ui
class: NsPanelLovelaceUIManager
config:
panelRecvTopic: "tasmota/sonoff/nspanel_bedroom_3/tele/RESULT"
panelSendTopic: "tasmota/sonoff/nspanel_bedroom_3/cmnd/CustomSend"
model: eu
locale: "nl_BE"
#dateFormatBabel: "EE d MMMM"
sleepTimeout: 20
sleepBrightness:
- time: "7:00:00"
value: 10
- time: "21:00:00"
value: 0
screensaver:
entities:
- entity: weather.forecast_home
- entity: sensor.weather_forecast_daily # see https://docs.nspanel.pky.eu/stable/prepare_ha/#workaround-for-homeassistant-202404
type: 0
- entity: sensor.weather_forecast_daily # see https://docs.nspanel.pky.eu/stable/prepare_ha/#workaround-for-homeassistant-202404
type: 1
- entity: sensor.weather_forecast_daily # see https://docs.nspanel.pky.eu/stable/prepare_ha/#workaround-for-homeassistant-202404
type: 2
- entity: sensor.weather_forecast_daily # see https://docs.nspanel.pky.eu/stable/prepare_ha/#workaround-for-homeassistant-202404
type: 3
statusIcon1:
entity: climate.smart_trv_bedroom_3
# prefix with ha: to render home assistant templates, icons must be put between <I></I>
icon: "ha:{{iif(state_attr('climate.smart_trv_bedroom_3', 'hvac_action')=='heating', '<I>mdi:fire</I>', '', '')}}"
#color: [255, 193, 7]
statusIcon2:
entity: climate.smart_trv_bedroom_3
icon: "ha:{{state_attr('climate.smart_trv_bedroom_3', 'current_temperature') | float(0) | round(1)}}°C"
#entity: sensor.nspanel_bedroom_3_analog_temperature1
#icon: "ha:{{states('sensor.nspanel_bedroom_3_analog_temperature1') | float(0) | round(1)}}°C"
#color: [255, 193, 7]
cards:
- type: cardGrid
title: Overzicht
entities:
- entity: button.bedroom_3_light_profile_default
name: Standaard
icon: mdi:lightbulb-on-50
color: "{{iif(state_attr('light.smart_leds_bedroom_3', 'brightness') | int(0) == states('input_number.light_profile_default_brightness') | int(0), '[255, 193, 7]', '[85, 115, 158]', '[85, 115, 158]')}}"
- entity: button.bedroom_3_light_profile_night
name: Nacht
icon: mdi:lightbulb-on-10
color: "{{iif(state_attr('light.smart_leds_bedroom_3', 'brightness') | int(0) == states('input_number.light_profile_night_brightness') | int(0), '[255, 193, 7]', '[85, 115, 158]', '[85, 115, 158]')}}"
- entity: button.bedroom_3_light_profile_work
name: Werk
icon: mdi:lightbulb-on
color: "{{iif(state_attr('light.smart_leds_bedroom_3', 'brightness') | int(0) == states('input_number.light_profile_work_brightness') | int(0), '[255, 193, 7]', '[85, 115, 158]', '[85, 115, 158]')}}"
- entity: navigate.light
name: Aanpassen
icon: mdi:lightbulb
color: "{{iif(states('light.smart_leds_bedroom_3')=='on', '[255, 193, 7]', '[85, 115, 158]', '[85, 115, 158]')}}"
- entity: sensor.smart_sensor_bedroom_3_temperature
name: Temperatuur
- entity: navigate.thermostat
name: Thermostaat
icon: mdi:thermostat
- entity: light.smart_leds_bedroom_3
- entity: input_number.light_profile_work_brightness
hiddenCards:
- type: cardEntities
title: Verlichting
key: light
entities:
- entity: light.smart_leds_bedroom_3
name: Kleuren
- entity: input_boolean.bedroom_3_light_disco_mode_toggle
name: Disco modus
- entity: input_number.bedroom_3_light_disco_mode_interval_nspanel
name: Disco interval
- entity: navigate.light_lamps
name: Lampen individueel
icon: mdi:lightbulb
- type: cardEntities
title: Lampen
key: light_lamps
entities:
- entity: light.smart_led_bedroom_3_lamp_1
name: Lamp 1
- entity: light.smart_led_bedroom_3_lamp_2
name: Lamp 2
- entity: light.smart_led_bedroom_3_lamp_3
name: Lamp 3
- type: cardThermo
title: Thermostaat
key: thermostat
entity: climate.smart_trv_bedroom_3 |
I've just tried it and it's not working... 😢 |
Didn't think about the 4x2 layout - are the additonal entities on the 4x2 layout updateing? |
No update on the additional entities either. |
can you send some logs from appdaemon?
|
Callbacks:
Here I pressed the screensaver, went to the card and hit the button, but no color was reflected:
Could it be because I'm using the attributes in the template, and not the state itself? |
renderCurrentPage is acually not used by the appdaemon backend - rerendering is triggerd by the button's that are switching the page Callbacks are processed here:
Can you uncomment the logging in lines 161, 162, 168, 169 and 173; restart Appdaemon and send the logs again? |
Can you try to comment thoose 4 lines? They are an cooldown so you are not getting too many updates - might be an issue in your case. |
Will do it tomorrow, my daughter is sleeping now... 😉 |
I've tried it, but doesn't seem to make any difference. |
I would like to see the messages send to the panel in the log. Can you add this to your config? (Same level as panelRecvTopic, locale or model)
|
Some new logs after adding
I"ve toggled the |
o.O the messages about the callbacks are missing This is what I can see from this section:
Card was opened 20:33:18 But without the state callback stuff no clue what caused the updates. |
I've pressed the button twice, so I suppose the update was caused by that, as the color was reflected after I pressed the same button a second time? First button press at Any idea why the state callback is missing? |
Hi, I'm using your ui on my 3 panels and I'm really loving it.
However, I have 1 question about the interval on which the states of home assistant sensors are checked/update.
I have the following part in my config:
The color of the button depends of the brightness of the light.
However, when I'm toggling the button (which sets the corresponding brightness), it takes quite a few seconds until the color is updated.
When I'm navigating away from the screen and back, it's there immediately.
Only when staying on the same screen, it really takes almost 20-30s until the color is reflected.
Any idea why this is happening and how this can be improved?
The text was updated successfully, but these errors were encountered: