Setting up Homebridge

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
  5. Use the QR code in the dashboard to include the bridge in your Apple Home setup.

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 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. This plugin configuration is through a JSON configuration and all the valid options can be checked in the official documentation.

The key part of the configuration is using the blaster to learn 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.

This is an outline of my configuration:

{
    "platform": "BroadlinkRM",
    "name": "Broadlink RM",
    "hideScanFrequencyButton": true,
    "hideLearnButton": false,
    "hideWelcomeMessage": true,
    "hosts": [
        {
            "address": "192.168.1.XXX",
            "mac": "00:00:00:00:00:01",
            "isRFSupported": true,
            "isRM4": true
        }
    ],
    "accessories": [
        {
            "name": "Air Conditioner (Office)",
            "type": "heater-cooler",
            "host": "00:00:00:00:00:01",
            "minTemperature": 16,
            "maxTemperature": 30,
            "fanStepSize": 20,
            "tempStepSize": 1,
            "turnOnWhenOff": false,
            "data": {
                "heat": {
                    "on": "2600...",
                    "off": "2600...",
                    "temperatureCodes": {
                        "16": {
                            "rotationSpeed20": "2600...",
                            "rotationSpeed40": "2600...",
                            "rotationSpeed60": "2600...",
                            "rotationSpeed80": "2600...",
                            "rotationSpeed100": "2600..."
                        },
                        "17": {
                            "rotationSpeed20": "2600...",
                            "rotationSpeed40": "2600...",
                            "rotationSpeed60": "2600...",
                            "rotationSpeed80": "2600...",
                            "rotationSpeed100": "2600..."
                        },
                        // ...
                        "30": {
                            "rotationSpeed20": "2600...",
                            "rotationSpeed40": "2600...",
                            "rotationSpeed60": "2600...",
                            "rotationSpeed80": "2600...",
                            "rotationSpeed100": "2600..."
                        }
                    }
                }
            }
        },
        {
            "name": "Learn (office)",
            "type": "learn-code",
            "host": "00:00:00:00:00:01"
        }
    ]
}

Some important notes: