Lovelace Card Mod not Updating on state Change

Hello I have this entry in my lovelace file:

      cards:
        - type: entities
          title: Luzes
          entities:
            - entity: light.maindoor_light
            - entity: light.hallway_spotlight
            - type: custom:slider-entity-row
              entity: light.hallway_tablelight
              style: |
                :host {
                  color: {% if is_state('binary_sensor.hallway_tablelight_autoon', 'on') %} green {% endif %};
                }

The idea is to have the text green when the “binary_sensor.hallway_tablelight_autoon’” is ON… This works, but the display only updates when I change tabs or when I refresh the page. I would like it to update when the binary_sensor.hallway_tablelight_autoon changes state. Is this possible? What I’m doing wrong?

Also, is it possible to change the color of the toggle button on the entities depending on state with Card Mod?

Thank You

Don’t you have to specify a theme class instead of ‘color’ like:

style: |
    :host {
    --paper-item-icon-color: 
    {% if states.automation.notify_hall_motion.state == "on" %}
        #3182b7
    {% else %}
        #9da0a2
    {% endif %};
    }