Fan icon not turning yellow when on (but it used to work...)

Hello!

After a start from scratch (from home assistant Python virtual env to Home Assistant Supervised on generic Linux) I’m migrating a bunch of entities (tamplate fans, template sensors, lights and so on) to the new installation. The most part is running smoothly, but FAN is not working as expected because of a minor issue: when the FAN is on the icon is not turning yellow when on (like lights, binary sensors etc).

An screenshot is below.

Captura de Tela 2020-05-12 às 13.03.19

The FAN is on (and is physically spining hehe), speed is LOW and direction is clockwise. But the fan icon is gray! Am I missing something? There isn’t any customisation, everything is quite “vanilla” (for now).

Just in case here is the FAN template describing “Centro Varanda”.

      varanda_centro:
        friendly_name: "Centro Varanda"
        value_template: >-
          {% if state_attr('sensor.auto_principal', 'ventdm') != None %}
            {% if states.sensor.auto_principal.attributes.ventdm[0]|int == 0 %} off {% else %} on {% endif %}
          {% else %}
            off
          {% endif %}
        speed_template: >-
          {% if state_attr('sensor.auto_principal', 'ventdm') != None %}
            {% if states.sensor.auto_principal.attributes.ventdm[0]|int|abs > 70 %} high
            {% elif states.sensor.auto_principal.attributes.ventdm[0]|int|abs > 40 %} medium
            {% elif states.sensor.auto_principal.attributes.ventdm[0]|int|abs >= 0 %} low
            {% endif %}
          {% else %}
            low
          {% endif %}
        direction_template: >-
          {% if state_attr('sensor.auto_principal', 'ventdm') != None %}
            {% if states.sensor.auto_principal.attributes.ventdm[0]|int >= 0 %} forward {% else %} reverse {% endif %}
          {% else %}
            forward
          {% endif %}
        turn_on:
          - service: shell_command.auto_principal_script
            data_template: 
              arg: >-
                {% if speed == 'low' and direction == 'forward' %} '<n,0,33>'
                {% elif speed == 'low' and direction == 'reverse' %} '<o,0,33>'
                {% elif speed == 'medium' and direction == 'forward' %} '<n,0,66>'
                {% elif speed == 'medium' and direction == 'reverse' %} '<o,0,66>'
                {% elif speed == 'high' and direction == 'forward' %} '<n,0,100>'
                {% elif speed == 'high' and direction == 'reverse' %} '<o,0,100>'
                {% else %} '<n,0,33>'
                {% endif %}
        turn_off:
          - service: shell_command.auto_principal_script
            data_template:
              arg: '<f,0,0>'
        set_speed:
          - service: shell_command.auto_principal_script
            data_template: 
              arg: >- 
                {% if speed == off %} '<f,0,0>'
                {% elif speed == 'low' and states.fan.varanda_centro.attributes.direction == 'forward' %} '<n,0,33>'
                {% elif speed == 'low' and states.fan.varanda_centro.attributes.direction == 'reverse' %} '<o,0,33>'
                {% elif speed == 'medium' and states.fan.varanda_centro.attributes.direction == 'forward' %} '<n,0,66>'
                {% elif speed == 'medium' and states.fan.varanda_centro.attributes.direction == 'reverse' %} '<o,0,66>'
                {% elif speed == 'high' and states.fan.varanda_centro.attributes.direction == 'forward' %} '<n,0,100>'
                {% elif speed == 'high' and states.fan.varanda_centro.attributes.direction == 'reverse' %} '<o,0,100>'
                {% endif %}
        set_direction:
          - service: shell_command.auto_principal_script
            data_template:
              arg: >-
                {% if states.fan.varanda_centro.attributes.speed == 'low' and direction == 'forward' %} '<n,0,33>'
                {% elif states.fan.varanda_centro.attributes.speed == 'low' and direction == 'reverse' %} '<o,0,33>'
                {% elif states.fan.varanda_centro.attributes.speed == 'medium' and direction == 'forward' %} '<n,0,66>'
                {% elif states.fan.varanda_centro.attributes.speed == 'medium' and direction == 'reverse' %} '<o,0,66>'
                {% elif states.fan.varanda_centro.attributes.speed == 'high' and direction == 'forward' %} '<n,0,100>'
                {% elif states.fan.varanda_centro.attributes.speed == 'high' and direction == 'reverse' %} '<o,0,100>'
                {% endif %}
        speeds:
            - 'off'
            - 'low'
            - 'medium'
            - 'high'

Cheers and thanks a lot for the good work!

From the 0.105 release notes:

Icons no longer change color based on state

A change that is not really apparent at first, but you probably notice it sooner or later.

… we did add a new option: state_color . Using this option, you can decide if you want to old behavior back

It’s a stupid default. It should have been left on and the one person who wanted it to be off would still able to disable it.

3 Likes