Bifrost – a Hue smart light emulator

A screenshot of the Bifrost logo

Today I’m writing about Bifrost, which is software that emulates a Philips Hue bridge for controlling smart light bulbs. It works with Zigbee2MQTT, and is designed to replicate the core Philips hardware using open source software.

Bifrost allows you to control any Zigbee smart lights (bulbs, strips etc) using the Philips Hue app, without needing to buy the Hue Bridge. The Hue bridge normally costs around £50 on Amazon (sponsored link). Instead, Bifrost can run on the same hardware as, say, Home Assistant, or an old an PC.

Setting up Bifrost

I’ve recently installed Bifrost on the same Raspberry Pi that hosts my Home Assistant instance (there’s an addon to make it easier). As it stands, it’s relatively new software, and so it has to be configured manually using a YAML file. You also need to be using Zigbee2MQTT, and have Zigbee smart bulbs – non-Zigbee devices aren’t supported, and nor is Home Assistant’s built in Zigbee controller. Also, Bifrost only works with lights – for example, I have a Zigbee smart plug which controls a light, and Bifrost ignores this.

The other thing to be aware of is that Hue uses ports 80 and 443, so if you want to use Bifrost, there can’t be any other software acting as a web server on the same machine. I had to pause my use of Nginx Proxy Manager to get it to work; thankfully, I’m now using Homeway for remote access to Home Assistant so this wasn’t an issue. Whilst you can tell Bifrost to open other ports instead, most Hue apps won’t work if you do this.

Once Bifrost is running and has found your Zigbee devices, you should be able to use the official Hue app to set up your lights. You’ll need to tell the app that your bridge doesn’t have a QR code; if all goes well, it’ll detect the Hue mDNS packets that Bifrost broadcasts, and it’ll then work just as if you had a genuine Hue bridge.

Benefits of the Hue app

The official Hue app has some features that other smart home apps don’t have – mainly the ‘Scene Gallery’. If you have multiple multi-colour lights in a particular room, Hue can offer to set them to different, but complementary colours.

It should be noted that, with Bifrost, you can use the Hue app to control (theoretically) any smart lights, regardless of whether they were manufactured by Philips or not. The multi-colour lights I have were a couple of cheap Tuya Zigbee strips from AliExpress, and they work fine in the Hue app through Bifrost.

Other Hue emulators

Bifrost isn’t the only emulator in town. There’s also DIY Hue, which, like Bifrost, can be installed using Docker or as a Home Assistant addon. There’s a comparison between Bifrost and DIY Hue here.

Home Assistant itself includes a Hue emulator. It’s an older integration that has to be configured using YAML, and it’s more limited. It probably won’t work with the official Hue app – I haven’t tried it myself. It’s mainly there as an easier way to bridge devices in Home Assistant into Amazon Alexa.

Grouping devices together in Home Assistant

A screenshot of a Home Assistant dashboard showing a light group set to 50% brightness and a green colour

If you have several devices of the same type, and want to be able to control them all together, then it’s possible to group them together in Home Assistant. The integration is simply called ‘Group‘, and once configured, it creates a helper entity that will perform the same action on all grouped devices.

Last year, I picked up two Zigbee colour-changing LED strips from AliExpress. One was to go in our nine-year-old’s bedroom and the other in the living room – the idea being that we could set the colours depending on the time of year. Rather than having Christmas lights that we put up in December, and took down in January, these lights could stay up all year round. For example, they could be pink around Valentines Day, or green at Halloween.

That was the theory. However, despite ordering 3 metre long strips, they were too short. Our house is about 100 years old with tall ceilings, and consequently, tall windows. In the end, two LED strips together, totalling 6 metres, were long enough just for one window and so they’re both in our nine-year-old’s bedroom. Because they’re two separate strips, they appear and work as separate Zigbee devices.

Creating a group in Home Assistant

You can start the process of creating a group either on the Integrations or Helper screens of Home Assistant’s settings. First of all, Home Assistant will ask you what type of devices you are grouping – all the devices must be of the same type, so you can’t group a switch and a light together.

Well, actually you can – but first you need to create a ‘Change Device Type of a Switch’ helper. Say you have a smart plug controlling a light; you can then create a Helper that appears as a Light, and then that can be grouped with other lights.

Anyway, in my example, I selected Light, gave it a name, and then selected the entities that needed to belong to the group – i.e. the individual lights. There’s also a ‘Hide Members’ option, which will hide the devices you’ve selected from the list of entities in Home Assistant. If you’ll only ever want to interact with the lights as a group, then tick this. However, if you still want to be able to manage individual lights as well, then keep it unticked.

On my Home Assistant dashboard, the icon shows that the new group helper is for multiple lights. The good news is that, even with colour changing lights, all the lights in the group will respond the same way together once grouped.

I also make these lights available in Apple Home and Google Home, and again, I make sure that Home Assistant is exposing the group, rather than the individual lights. As such, when I use Google Assistant to turn them on and change the colour, both lights change simultaneously.