Fan controlled with Broadlink

I have a ceiling fan that has a IR remote, my broadlink has learnt the codes and I have them working in HA as a switch.
I’m not sure how to translate this into the fan.template component. The fan is simple, just Off, Low, Med, High commands. I think, that I need to write a script that calls the switch component and turns it on or off?

Anyone who ends up on this page looking for the answer. I used this repo to setup the fan component using Broadlink.
https://github.com/vpnmaster/homeassistant-custom-components

1 Like

Based on the link, it stated RF, but the fan use IR. Does it still work? How you configured?

You can use either. You just need to edit the broadlink_fan_codes ini files with your commands.

You need to get the commands out using the HA switch.broadlink_learn_command tool.

Ya, i manage to configure and its working.

Just in Google Home, it is visible as 2 entries, 1 as On/Off switch and 1 as “fan”. Clicking on the fan shows the config only - no On/Off/Speed. Using the switch, yes i can On/Off the fan.

I can’t control the fan speed in Google either using the fan entity. It’s either on or off. I don’t think the integration is there yet?

Hi can you integrate temperature and Humidity sensor in smart ir fan component???

Yes. I have the wirelesstag temperature sensors. I use these in automations for setting the fan speed when I get home and it’s hot.

There’s an updated component for this now.

smartir:

fan:
  - platform: smartir
    name: Plafondventilator
    unique_id: bedroom_fan
    device_code: 1020
    controller_send_service: switch.broadlink_send_packet_10_0_1_41

I have this in my configuration.yaml. When I check my config it says “Platform not found: fan.smartir”

In my switches.yaml I have

- platform: broadlink
  host: 10.0.1.41
  mac: '**:**:**:**:**:**'

I have al the files in in the directories:

Thanks for the help!

The smartir directory is in the custom_components directory of your config?

Yes it is in config/custom_components

I can’t see anything wrong with your config. It all looks the same as mine. Have you tried restarting the server?

Do you see a fan.bedroom_fan component in your states menu?