Smart Bulbs: my lightbulb moment?

I’ve always disliked smart lightbulbs.

Turn them off at the wall and you immediately question why you paid 1000% more.

I’ve held this position for years and years, until one day I came across a tweet by Troy Hunt where he used the words detached and Shelly1. This immediately captured my interest!

Now, I’ve had a few Shelly 1 relays installed in my house and they brilliant. So brilliant in fact I’d sort of forgotten about them. But when I heard about Troy was using them in combination with smart bulbs, my mind started racing.

Somewhere in the past 18 months, Shelly added a new Button Mode into their settings called Detached Switch.

Traditionally, you would install a Shelly 1 and use the button type of Edge Switch, which would allow the wall switch to turn the light on and off by flipping it. You can turn it and off via an app and the wall switch. Brilliant. Of course, the problem with smart bulbs still remains – turn the Shelly off at the wall and the smart bulb loses power.

This is where Detached Switch mode comes in! The relay is basically On and when you flick the wall switch, it raises an event and you then react accordingly.

With this combination, we can have a smart bulb and use a light switch!

Setting it up, however, does require jumping through a few hoops.

Setting it all up

Once the relay has been physically installed and setup, you can switch the Button Type to Detached Switch using the settings webpage on the relay. This disconnects the relay from the switched live.

For me, I use HomeAssistant, so I use the Shelly Integration to add the relay. When you open the device, you’ll see there are seven entities. The switch.shelly1_xxxx entity points to the actual relay, so toggling this switch will actually toggle the relay on and off.

The entity we’re interested in is the binary_sensor.shelly1_xxxx_input. This entity is connected to the switched live on the Shelly 1, so flicking the light switch will change this entity from on to off. By default, this entity is disabled in HomeAssistant, so you’ll need to enable it.

The Shelly Integration shows more than just the relay control

I purchased a LIFX IR bulb, one with a full color range and HomeKit support. LIFX setup was easy. The LIFX app found the bulb and connected it to my WIFI and HomeKit.

LIFX Nightvision A60 1200 lumens [B22 Bayonet Cap], Full Colour with  Infrared, Wi-Fi Smart LED Light Bulb, No bridge required, Compatible with  Alexa, Hey Google, HomeKit and Siri : Lighting

As I use the LIFX integration on Home Assistant, the bulb was added automatically.

I now had my smart bulb and my detached Shelly relay.

To connect these two things together, I used NodeRed. I use NodeRed for all of my automations. The automation is just two nodes. The first listens for state changes from the _input entity and it then toggles the LIFX bulb on or off.


I’ve switched out all the a lot of the bulbs in my house to these LIFX bulbs as I picked up some refurbished dawn/dusk bulbs on Amazon.

It’s been around a month since I started converting all the bulbs and pendants, but in that time I’ve only had one issue and that was caused by one of the LIFX bulbs losing connection with HomeKit – which didn’t affect Home Assistant.

This setup is a great combination. The kids are can use Siri to turn on some of the lights and when we’re going to bed, the physical switch works as it always has.

There are some things I need to tweak, like brightness. For example, if we dim the light as we settle into the evening, we’re left fumbling for an app or asking Siri if we want the brightness back up when we turn the light on the following evening. I need to add some automations to just reset the brightness overnight or something.