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

Sensor icon colour

$
0
0

@PierreScerri wrote:

Hi

Until recently (2 or 3 HA updates back I think) I had sensor cards like:

     - entity: sensor.sdm230import
        graph: none
        state_color: true
        icon: 'mdi:import'
        name: Import
        style: |
          :host {
            --paper-item-icon-color:
              {% if states.sensor.import_power.state|int > 0 %}
                red
              {% else %}
               rgb(138, 185, 45)
              {% endif %}
              ;
        type: sensor

and the colour of the icon would change according to the if condition.

Why is this not working anymore?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95394

Trending Articles



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