Getting ESPHome to synchronize a display object state after firmware update or reboot?

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?

ESPHome Core Configuration — ESPHome take a look at the priority setting. Perhaps wait until a different priority level.

Good call. I ended up using priority and waiting for the HA API and that seems to have done it :slight_smile:

Glad you got it going.

Please mark my post as the solution :slight_smile:

You posted an hour after I solved it here and only mentioned HALF of the solution?

No bueno mate.