Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95480

Change color with state-label

$
0
0

@Javier_Gomez wrote:

Hello
I want to change the color of the temperature in lovelace.
Depending on whether the heating is working but I don’t get it.
I have tried a lot of things but I have not managed to make it work for me.
This code does not give me an error but it does not change the color either green or red.
Have if you can lend me a hand
Thank you

       - type: state-label
          entity: climate.nombre_calefaccion_01
          attribute: current_temperature
          suffix: ' ºC'
          style:
            top: 65%
            left: 22%
            color: >
             if (states('switch.rele_calefaccion_01') == 'heat') return 'red'; else return 'green';

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95480

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>