joBr99 / nspanel-lovelace-ui

Custom Firmware for NsPanel with the design of HomeAssistant's lovelace UI in mind, works with Tasmota.
GNU General Public License v3.0
886 stars 191 forks source link

External Updates / Get events from homeassistant outside of page changes #9

Closed joBr99 closed 2 years ago

gerard33 commented 2 years ago

The listen_state can be used for this -> https://appdaemon.readthedocs.io/en/latest/AD_API_REFERENCE.html#appdaemon.entity.Entity.listen_state

Dattel commented 2 years ago

question on that: for what duration you want to enable the listen_state on entities/devices.. Only as long as the items are displayed on the current page, or for all devices for the whole time the appdaemon is running? So you need to take care, what items really needs an update cause they are currently displayed.. otherwise i assume mqtt spamming with useless messages.

As i already mentioned yesterday to @joBr99 with the switch from NodeRed to AppDaemon the UI already get's slightly slower. I assume, parsing more and more mqtt messages on the ESP would escalate these behaviour a bit.

joBr99 commented 2 years ago

@Dattel As you can see the following line this is already implemented, sending updates for all entities would result in unwanted changes on the page, in the worst case it would just change random things (if the page type doesn't match).

https://github.com/joBr99/nspanel-lovelance-ui/blob/6fba77e691f192de1fc43870b67acbd5f60e2915/appdaemon/apps/nspanel.py#L182

Dattel commented 2 years ago

Sorry.. didn't realized that..