Add and display a "state" element with value obtained with some logic

Hello.

I would like to create an element, displayed on the GUI (read-only by the user), that has

  1. state=ON with icon_1.png when light.light_1 is OFF
  2. state=OFF with icon_2.png when light.light_1 is ON AND ( sensor_1 == 1 OR sensor_2 == 0)

How can I do that? Where do I have to start?

thanks.

Maybe Template Sensor would be a good start.

thanks, it seems it exactly fits what I was searching for

You’re welcome.