My current smart home setup is done by using a [[Homebridge]] instance that runs on a Raspberry Pi, that manages several integrations and includes them in the official Home app in [[iOS]] and [[macOS]]. # Initial Set Up Right now, setting the bridge is as simple as: 1. Download the image from the official GitHub repository 2. Burn it to an SD card and run it from a Raspberry Pi 3. Configure the internet connection 1. If you are using Ethernet, no further configuration is needed (simply connect the Raspberry Pi to the router) 2. If you are using WiFi, wait a minute until a new WiFi network appears and use the captive portal from other device to configure the WiFi. 4. To install plugins and configure them, use a browser to access [`http://homebridge.local`](http://homebridge.local/) 5. Use the QR code in the dashboard to include the bridge in your Apple Home setup. # Integrations ## Adding support for Ewelink devices I use several USB WiFi plugs to control dumb devices, and adding them is as easy as installing the plugin [`@bwp91/homebridge-ewelink`](https://github.com/homebridge-plugins/homebridge-ewelink) and configure them using your Ewelink account. Adding devices must be done through the official app. ## Adding support for Broadlink devices I have an Broadlink IR blaster to control infrared devices, which can be added to Homebridge using the plugin [`@kiwi-cam/homebridge-broadlink-rm-pro`](https://github.com/kiwi-cam/homebridge-broadlink-rm#readme). This plugin configuration is through a JSON configuration and all the valid options can be checked in the [official documentation](https://broadlink.kiwicam.nz/#installation). To ensure reliable support, I have found out that, at least for my setup, it is of key importance to **never complete the device configuration via the official Broadlink app**. The process consists in connecting to the Broadlink device local wifi network using the app, send the configurations of the actual wifi network to be used by the device, and add it to the Broadlink roster of devices. Instead, we just want the device to connect to wifi and, once that happens (the LED stops blinking) **manually close the app to prevent further configuration**. If you are using multiple devices, you will need the MAC address, and while you can find it in your router configuration page, there is a chance you need to complete the process once, note down the address, and then reset and partially configure the device once again. The key part of the configuration is using the blaster to l**earn the hex codes for each instruction**, which can be done through both Apple Home and Homebridge using the provided “Learn” switch. To do so, 1. Turn on the switch on Homebridge or Apple Home, 2. Point the devices’ remote to the blaster, 3. Press the button, 4. Obtain the hex code from Homebridge logs. # Complete configuration The complete configuration can be found in [this Github gist](https://gist.github.com/diego-vicente/a73ea42f40a756050d9ea58d851b578e). Some important notes: - The `hosts` entry and all their references in the devices are optional; if you are using a single IR blaster there is no need to define it and the auto-discover feature will sort it out for you. - The `heater-cooler` device supports fan swing and speed, but if you don’t need this kind of configuration there is an alternative `air-conditioner` device type.