Lovelace Card Mod not Updating on state Change

Hello I have this entry in my lovelace file:

        - type: entities
          title: Luzes
            - 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 {
    {% if states.automation.notify_hall_motion.state == "on" %}
    {% else %}
    {% endif %};