Hi,
I’m currently building a control panel with an esp32 and a touch screen (using lvgl)
I just populate this screen with differents buttons to control light swicth, but also to execute scenes and scripts…
Currenlty, for scenes and scripts buttons, i update the state of each button “on press”
Example, if i press button 17, i turn_on the corresponding scene then set the state of button 17 on, and the state of button 18 off :
My problem : if i execute the scene/script from another device (HA dashboard, smartphone App,…), that does not update my control panel buttons state…
For light switch buttons, i update the state of the buttons with a binary_sensor “on_state”, but how can i achieve the same behavior for scenes and scripts ? Is there any sensor “on_execute” for scenes and scripts that i could use in my code ?
If you have any idea, thanks to let me know
Some examples of my current ESP32 scripts
Update light switch button
binary_sensor:
- platform: homeassistant
id: btn01_state
entity_id: ${btn01_entity}
publish_initial_state: true
on_state:
then:
lvgl.widget.update:
id: btn01
state:
checked: !lambda return x;
Click and update Scene button
- buttons:
- id: btn17
text: ${btn17_label}
control:
disabled: ${btn17_disabled}
hidden: ${btn17_hidden}
on_click:
then:
- homeassistant.action:
action: scene.turn_on
data:
entity_id: ${btn17_entity}
- lvgl.widget.update:
id: btn17
state:
checked: true
- lvgl.widget.update:
id: btn18
state:
checked: false