I’m going crazy trying to change the color of a label on an LVGL display with esphome. The sensor it controls is this:
- platform: homeassistant
id: telecamera_citofono
entity_id: binary_sensor.ingresso_principale_motion
trigger_on_initial_state: true
on_state:
then:
- if:
condition:
binary_sensor.is_on: telecamera_citofono
then:
- lvgl.label.update:
id: presenza_telecamera_citofono
text_color: !lambda |-
return lv_color_hex(0xFF0000)
else:
- lvgl.label.update:
id: presenza_telecamera_citofono
text_color: !lambda |-
return lv_color_hex(0x00FF00)
while the label, whose text is displayed is this:
...
...
widgets:
- label:
id: presenza_telecamera_citofono
x: 0
y: 40
height: 90
width: 100
text: "Citofono"
text_font: montserrat_18
The color doesn't change when the sensor changes state. What could it be? Thanks everyone.