Polling Nextion Variables vs Custom Protocol in if/condition

Hi all,

I´m integrating my HA domotics in a Nextion NSPanel with ESPHOME. I´m experiencing some problems that I can not understand and surely some of you can help me.

I’m having stability issues (probably due project size), and I notice that Nextion panel polling variables increase instability. So I moved to the nextion custom protocol, but if does not work.

Variable definition with polling:

  - platform: nextion
    nextion_id: $NspanelID
    name: persiana
    id: persiana
    component_name: persiana
    update_interval: 2s

Action on response to button release:

  - platform: nextion
    name: boton_50_persiana
    page_id: 2
    component_id: 10
    on_release:
       then:
         - if:
             condition:
               # text_sensor.state:
                  # id: persiana
                  # state: 'estudio'
               - lambda: 'return id(persiana).state.c_str()=="estudio";'

Without polling (removing update_interval), using the custom protocol (and adding the proper code on nextion panel), I can see in ESPHOME how the variable are properly updated (in the web), but the if condtion does not work.
I´ve tried lambdas, YAML, .state and .state.c_str() … all fails.

And this is something I cannot understand. Seeing the same value in the web, the condition does not work.

Thx for your help.
Regards

Dear all,

Several months and ESPHOME Versions the problem is still there. Is no one else is also experiencing this problem?

The condition only works if the parameter is defined with the update interval despite the parameter is properly updated by nextion :frowning: .

Thanks
César