Google Assistant now shows template fans as always on

HA core version 0.112.5
I added two template fans some time ago to HomeAssistant (controlled via Broadlink remotes):

fan:
  - platform: template
    fans:
      living_room_fan:
        friendly_name: "Living Room Fan"
        value_template: "{{ states('input_boolean.living_room_fan_power') }}"
        speed_template: "{{ states('input_text.living_room_fan_speed') }}"
        turn_on: 
          - service: script.living_room_fan_on
        turn_off:
          - service: script.living_room_fan_off
        set_speed:
          - service: script.living_room_fan_set_speed
            data_template:
              speed: "{{ speed }}"
        set_direction:
          - service: script.living_room_fan_reverse
        speeds:
          - '0'
          - '1'
          - '2'
          - '3'
          - '4'
          - '5'

The fans are exposed to Google Assistant through Nabu Casa and all worked correctly.

As of this morning, I’ve noticed that both fans are permanently shown as ‘On’ in Google Home.
They are still represented correctly in Google Home.

Is anyone else seeing the same?

NB: I’ve tried the usual voodoo to resolve without success:

  1. Syncing devices (each end)
  2. Removing fan from Google Home entities list and re-adding
  3. Exposing the input_boolean that determines power state for the fan.
1 Like

I am not alone: Github Issue

1 Like

I’m seeing the same issue. No idea what’s causing it though…

I got this solved with a workaround here

I think I fixed the never being off problem. However, I’m missing the On/Off buttons beneath the fan icon. Does it show up correctly for you? My other (non template) fans have controls on the main Google Assistant page, but this one doesn’t. I wonder if it’s because it has speeds…

Not sure how other fans show in Google Assistant as I only have the two templated fans, but using one of them as an example here’s how it looks for me.

configuration.yaml

fan:
  - platform: template
    fans:
      bedroom_fan:
        friendly_name: "Bedroom Fan"
        value_template: "{{ states('input_boolean.bedroom_fan_power') }}"
        speed_template: "{{ states('input_text.bedroom_fan_speed') }}"
        turn_on:
          - service: script.bedroom_fan_on
        turn_off:
          - service: script.bedroom_fan_off
        set_speed:
          - service: script.bedroom_fan_set_speed
            data_template:
              speed: "{{ speed }}"
        set_direction:
          - service: script.bedroom_fan_reverse
        speeds:
          - '0'
          - '1'
          - '2'
          - '3'
          - '4'
          - '5'
      bedroom_fan_google:
        friendly_name: "Bedroom Fan"
        value_template: "{{ states('input_boolean.bedroom_fan_power') }}"
        speed_template: >
          {% set current = states('input_text.bedroom_fan_speed') %}
          {% set speeds = { '0': 'off','1': 'low', '2': 'low', '3': 'medium', '4': 'medium', '5': 'high'} %}
          {{ speeds[current] if current in speeds else 'low' }}
        turn_on:
          - service: script.bedroom_fan_on
        turn_off:
          - service: script.bedroom_fan_off
        set_speed:
          - service: script.bedroom_fan_set_speed
            data_template:
              speed: >
                {% set speeds = {'off': '0', 'low': '1', 'medium': '3', 'high': '5'} %}
                {{ speeds[speed] if speed in speeds else '0' }}
        set_direction:
          - service: script.bedroom_fan_reverse
        speeds:
          - 'off'
          - 'low'
          - 'medium'
          - 'high'

bedroom_fan is controlled via the HA ui using Thomas Loven’s custom entity rows installed via HACs:

bedroom_fan_google is exposed to Assistant:

i have this issue for a while, and it does not happen with alexa, not sure what is the problem, maybe is the google assistant integration