Hi Everyone - I am looking for pointers on synchronizing GUI button values, on a Nextion display, with HA entities.
After rebooting ESPHome or updating firmware. The initial GUI state is incorrect. It will eventually correct itself after you change the entity in HA or press the displays GUI button a couple times. Ideally I can synchronize state on bootup since all HA entity states are correctly read on ESPHome bootup.
I have tried
display:
on_setup:
as well as
esphome:
on_boot:
but the lambda that works in the binary_sensor to update the button state doesn’t have any effect in those places.
- lambda: |-
if (id(ha_entity).state) {
id(display).set_component_value("gui_button",1);
} else {
id(display).set_component_value("gui_button",0);
}
- component.update: display
Any thoughts on how I can get ESPHome to update all display objects after boot/firmware_update?