Configuring BroadLink with SmartIR in Home Assistant
Tags: homeassistant, iot, smartir
Published: 2022-04-05 16:26:25

Configure SmartIR is a very simple process but it's not something we do very often, and since I have a very bad memory for this kind of thing I decided to make a quick tutorial.

**From SmartIR official doc:**
 > _SmartIR is a custom integration for controlling climate devices, media players and fans via infrared controllers.
SmartIR currently supports the following controllers:_

> - Broadlink
- Xiaomi IR Remote (ChuangmiIr)
- LOOK.in Remote
- ESPHome User-defined service for remote transmitter
- MQTT Publish service_

1.  Go to Configuration -> Devices & Services (Integrations, devices, entities and areas). And search for the BroadLink integration.![home assistant searching BroadLink integration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ybojit5t40r0q6pjw5fv.PNG)
2.  Enter the IP number of the BroadLink remote(you can get the IP easily using the BroadLink app. Select the remote, click on the 3 points in the upper right corner, device info and you will see the IP).![Add device using IP](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gwgaunidllsq3h1kmpux.PNG)  
3. Enter a name and click submit.![Add a name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vk0drmcx9h583bwlcawc.PNG)
4. Copy the entity id for later. ![copy entity id](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ik4pm2m7i2xu7u8wnx6u.PNG)
5. Add SmartIR to HACS, probably you will not find the integration, so you have to add it manually. 
 ![how to add custom repos](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/prhq0h4bufem5vj2nq4a.PNG) 
6. Just click on the Custom repositories option, and use the following link to fill the repository field https://github.com/smartHomeHub/SmartIR (make sure to choose Integration in the category list).  ![configure custom repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fiaeeo6f9ni0chp2142t.PNG)
7. Let's going to configure a climate device. Open your configuration.yml file and add the following block: 
```
smartir:

climate:
  - platform: smartir
    name: Living AC
    unique_id: living_ac
    device_code: 1760
    controller_data: remote.rc_living_remote
```

8.Replace name and unique_id with a value of your choice, device_code with one of the available codes of the [list](https://github.com/smartHomeHub/SmartIR/blob/master/docs/CLIMATE.md#available-codes-for-climate-devices) and controller_data with the entity id of the 4th step.

9.Save the configuration.yml and restart Home Assistant. 

10.Once the restart is completed, add a new card to your view. Click on add card button -> select the Thermostat card, and select the entity. ![configuring Thermostat card](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z5u9j3j7d4vbkze0x25b.PNG)

**Now you should be able to control your air conditioner in a very simple way.**

### Extra:
 
_When adding the BroadLink device to Home Assistant could be possible to get an error because the device is blocked, just follow the instructions mentioned below to unlock the device._

![unlock device instructions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/89ozgwtjkcg6vrwgqnvs.PNG)