Text Button with State

Hello,

I am looking for a way to display the status of an entity (window open/closed) in Lovelace as a coloured text button. Could someone tell me how to solve this?

I want a text button to be displayed without an icon, e.g. “Window Kitchen”. If the window is closed, the background colour of the button is green, if the window is open, the background colour of the button is red. The status to be queried here comes from an Aqara sensor (binary_sensor.oc_1 = off or on).

Thank you very much for your help.
Enni

1 Like