Wow this is awesome. I had no idea. I don’t see the option in the UI either, so I tried using the YAML instructions in the ZHA documentation you linked to. Unfortunately it doesn’t seem to convert it to a fan.
Here’s what I tried:
zha:
device_config:
84:71:27:ff:fe:93:17:24-1: # format: {ieee}-{endpoint_id}
type: "fan" # corrected device type
In the meantime, I created a second entity that takes the fan switch “light” and creates a new dedicated fan entity. I wish I didn’t have to have a second entity, but it works well in the interim. Here’s what I did in case anyone else wants to do it too:
fan:
- platform: template
fans:
living_room_fan:
friendly_name: "Bedroom Fan"
value_template: "{{ states('light.bedroom_fan_switch') }}"
percentage_template: >
{{ (state_attr('light.bedroom_fan_switch', 'brightness') / 255 * 100) | int }}
turn_on:
service: homeassistant.turn_on
entity_id: light.bedroom_fan_switch
turn_off:
service: homeassistant.turn_off
entity_id: light.bedroom_fan_switch
set_percentage:
service: light.turn_on
entity_id: light.bedroom_fan_switch
data_template:
brightness: >
{{ ( percentage / 100 * 255) | int }}
speed_count: 3