Skip to content

Connect Homebridge to Hue and expand your smart home

The original reason for me to set up a Homebridge was the fact that I registered the cheap Osram Smart Plugs on my Philips Hue, thought to myself “Good plan!”. Unfortunately, the plugs were not displayed in HomeKit or forwarded by Hue. So the Hue had to be connected to Homebridge. So that I can also use my smart plugs in HomeKit with Siri. In the end, it wasn’t that difficult. The recipe and the list of ingredients, so that you can do it, are here:

The Homebridge with Philips Hue recipe

If you haven’t set up a Homebridge yet, you can read my article “Installing Homebridge on Raspberry Pi, it’s easy!” to find out how it works and simply set up a Homebridge. Now to the list of ingredients, but it is not long:

  • Of course, you need a working Homebridge
  • Then another 2nd generation Philips Hue
    Philips Hue Bridge

    Philips Hue Bridge

    • Verbinde die Philips Hue Bridge über LAN-Kabel mit deinem Netzwerk.
    • Philips Hue App auf dein Smartphone herunterladen
    • 50 Hue Lampen und Leuchten sowie bis zu 12 Hue Zubehörteile hinzufügen je Bridge.
  • The “Homebridge Hue” plugin, which we install directly via the Homebridge web interface.

That’s it for ingredients 🙂
But before you even start changing anything, make a backup of your settings!

Preparing the Homebridge

First you have to install the Homebridge Hue plugin and to do this you call up your Homebridge in your browser. You do this with the IP of the Homebridge or by typing in http://homebridge.local. Once you have registered, click on Plugins in the menu above. The screen then looks like this with a virgin homebridge:

Plugin page of a Virgin Homebridge
Plugin page of a Virgin Homebridge

In the search field, you type “Homebridge Hue” and start the search. After searching, one of the first plugins should be the right one. If you’re not sure, here is the link to the plugin’s GitHub page. There you can find out the current version and select the right plugin. If everything is clear, click on “Install”.

Install the Homebridge Hue plugin
Install the Homebridge Hue plugin

Set up Homebridge Hue

After installing the Homebridge Hue plugin, a window will appear. If your Philips Hue is visible on the network, which it is by default, you don’t have to enter a hostname.

Homebridge hue settings
Homebridge hue settings

Under “Resource types”, select the resources you want to share with HomeKit. Osram Smart Plugs are “Lights”, so select this point. I don’t necessarily need the “Effects” item for the Osram Smart Plugs* and could also remain switched off. What is important for me is the point “Native Home Kit Lights”. If you have already connected the Philips Hue to HomeKit, the native Hue devices are already visible in HomeKit. If I leave the check mark for “Native Home Kit Lights”, then the devices are in HomeKit twice for me. So tick the box, who wants everything twice?

Homebridge Hue plugin Resource Types
Homebridge Hue plugin Resource Types

After making your selection, click Save. Now you switch to the configuration. This was adjusted by the plugin. My configuration now looks like this:

{
    "bridge": {
        "name": "Homebridge XXXX",
        "username": "XX:XX:XX:XX:XX:XX",
        "port": 51219,
        "pin": "XXX-XX-XXX"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "Hue",
            "anyOn": true,
            "effects": true,
            "lights": true,
            "nativeHomeKitLights": true,
            "nativeHomeKitSensors": true,
            "nupnp": true,
            "resource": true,
            "platform": "Hue"
        }
    ]
}

All positions with an “X” have your individual data. Now the configuration has been changed but not loaded yet. To load the new configuration, the Homebridge must be restarted.

Create Hue users

Now that you have triggered a restart of the Homebridge, it remains in a loop when trying to establish a connection with the Hue. The server tries to connect to the Hue every 15 seconds. If you click on the “Status” menu item above, you will see this message in the status window:

[19/12/2020, 08:56:14] [Hue] Philips hue: bridge request 4: POST / {"devicetype":"homebridge-hue#homebridge"}
[19/12/2020, 08:56:14] [Hue] Philips hue: bridge request 4: error 101 link button not pressed
[19/12/2020, 08:56:14] [Hue] Philips hue: press link button on the bridge to create a user - retrying in 15s

In order for the connection to be possible, you have to press the connect button, the “Link Button” on your Hue. Thus, a new user is generated. Once you have done that, the new user will be displayed in the status window, among other things. You may have to scroll in the status window to see the user entry. You have to integrate this into the existing configuration. Don’t worry, it’s easier than you think! In the status window, you select the user lines, which would be lines 5-7 in my example. Use the mouse on the selected text, right click and copy.

[19/12/2020, 08:56:29] [Hue] Philips hue: created user - please edit config.json and restart homebridge
  "platforms": [
    {
      "platform": "Hue",
      "users": {
        "XXXXXXXXXXXXXXXX": "XXXXXXXXXXXXXXXXXXXXXX"
      }
    }
  ]
[19/12/2020, 08:56:29] [Hue] Philips hue: 1 accessories

Transfer Hue users to the configuration

Now you switch back to this with the menu item “Configuration”. Paste the copied text as in the following example. After inserting, you have to make sure that, as in the example in line 24, there is a comma at the end. After the last entry, i.e. the “User”, there is no comma after the closing curly brackets. If that fits, it will be saved. If a green message appears after saving, everything is OK!

{
    "bridge": {
        "name": "Homebridge XXXX",
        "username": "XX:XX:XX:XX:XX:XX",
        "port": 51219,
        "pin": "XXX-XX-XXX"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "Hue",
            "anyOn": true,
            "effects": true,
            "lights": true,
            "nativeHomeKitLights": true,
            "nativeHomeKitSensors": true,
            "nupnp": true,
            "resource": true,
            "platform": "Hue",
            "users": {
                "XXXXXXXXXXXXXXXX": "XXXXXXXXXXXXXXXXXXXXXX"
            }
        }
    ]
}

Now you can restart your Homebridge. The updated configuration is then loaded. The Homebridge now connects to the Hue and the devices that are not otherwise displayed in HomeKit are displayed. If the Homebridge is already connected to HomeKit, the devices can now also be seen there. Congratulations, nothing stands in the way of expanding your smart home with additional Zigbee devices on the Hue.

Homebridge Hue devices for sending to HomeKit
Homebridge Hue devices for sending to HomeKit

Here you can see the plugs as a lamp in HomeKit. Once the Homebridge system has been set up, and you want to use other Hue devices with the Hue, you don’t have to change anything in the configuration. Now would be a good time for a backup!

Lamps in the Home app in HomeKit
Lamps in the Home app in HomeKit

7 thoughts on “Connect Homebridge to Hue and expand your smart home”

  1. Perhaps a dumb question, but do I need to have Homebridge running all the time or is the configuration running also without it once connections and configurations have been made?

  2. Bonjour
    Merci pour ce tuto très clair.
    C’est ma première utilisation du pont Hue, avec une ampoule Hue pour commencer.
    Tout se passe bien hormis que je n’arrive pas à avoir l’icône de l’ampoule Hue dans la partie Accessoires sur Homebridge.
    J’ai tourné ça dans tous les sens mais pas moyen. Aurais tu un conseil/éclairage à partager pour y remédier.
    A+

    1. Bonjour,
      si vous avez suivi mon tutoriel, les lampes natives “hue bridge” ne sont pas affichées dans homebridge. Pour la raison suivante : si le “pont Hue” est associé à HomeKit, ces lampes s’afficheront deux fois dans HomeKit. Si le Hue Bridge n’est pas connecté directement à HomeKit, vous devez décocher “Native HomeKit Lights” dans les paramètres “Resource Types”. Ensuite, la lampe Hue devrait également apparaître dans Homebridge.

  3. My brother was translating in French (mother tongue), so find it in English
    Good morning
    Thank you for this very clear tutorial.
    This is my first time using the Hue Bridge, with a Hue bulb to start with.
    Everything is going well except that I can’t get the Hue bulb icon in the Accessories section on Homebridge.
    I turned it all over the place but no way. Do you have any advice/light to share on how to fix this?
    A+

    1. Hello,
      if you followed my tutorial, native “hue bridge” lamps are not shown in homebridge. For the following reason: If the “Hue Bridge” is paired with HomeKit, then these lamps would be displayed twice in HomeKit. If the Hue Bridge is not connected directly to HomeKit, you must uncheck “Native HomeKit Lights” in the “Resource Types” settings. Then the Hue lamp should also show up in Homebridge.

Leave a Reply

Your email address will not be published. Required fields are marked *