I added bt0 in Nextion editor :
and in yaml
- platform: nextion
page_id: 0
component_id: 17
id: lightploshadka
on_press:
then:
- homeassistant.service:
service: light.turn_on
data:
entity_id: light.ploshadka
on_release:
then:
- homeassistant.service:
service: light.turn_off
data:
entity_id: light.ploshadka
- platform: homeassistant #status update
id: pl_lights
entity_id: light.ploshadka
on_state:
then:
- lambda: 'id(nextiondisplay1).send_command_printf("forecast.bt0.val=%d",id(pl_lights).state);'
When I press bt0 - everything works as it should. Light is switching on and off. Frontend also shows correct states.
But when I switch light on from HA web (point 1) I can not any more control it from LCD (point 2) ESPhome node detects release event, but nothing happens. Status update works good and bt0 value changes to val=1.
What i am doing wrong?