My ~$10 Smart Enough light switch replacement

I’m calling this my Smart Enough Switch.
It’s a ~$10 door sensor controlling a $10 smart bulb.
As far as I know, this is the lowest cost way for operating an always powered smart bulb with a manual switch.

See it in action!

How it works (short answer)

In the wall is a two-part window/door contact sensor. One part is stationary; the other part moves up and down with the switch. When the switch goes up it turns a smart bulb on and when it goes down, guess what. The bulb turns off!

Aside from two small 3D printed parts, the rest uses the existing hardware of the original light switch.

For more details including gifs, pictures, and the 3D printable fiels, see the “How it works (long answer)” further down.*

Why would I do this?

Mostly for fun! But the idea stems from the basic fact that a smart bulb can only operate when it has power.

If you don’t care to read about my history with home automation, you can skip to the next section. Just know that I have plenty of actual smart switches in my house.

I started getting into home automation in December of 2016. Started with a Google Home (GH) mostly as an easy way to play music and add things to our shopping list. Shortly after that I started looking into getting some smart lights and realized that the “cheaper” smart bulbs required an extra hub to operate so I thought it would be more cost effective to just buy a WiFi switch that worked out of the box with the GH. It cost me $40 but it controlled 3 light bulbs on the ceiling fixture in our living room. I was happy and bought several more and put them around the house. I currently have three installed and three more still in their boxes.

Fast forward to today and I’ve done a decent amount of research into home automation and settled into the Smartthings (ST) ecosystem. As you probably know, ST utilizes Zigbee and Z-Wave signals to control devices and they are often much cheaper than their WiFi counterparts.

I recently purchased my first Zigbee enabled smart bulbs for $10 each (Sengled Element Classic). I installed the first one in one of our hallways and my wife and I would continue to operate the light switch like normal.

Problem #1 - Losing power to the smart bulb

If the switch is left off there is obviously no powering going to the bulb and while it still functions like a “normal” light, it isn’t a “smart” light.

My first thought was to tape it up but that would be very unsightly and more importantly, it would completely change the way anyone had to use the light. The only time we need the hallway light on is when we’re standing right in front of the switch already. It’s counter-intuitive to then yell back to the GH, “Hey Google! Turn on the hallway light!” when the switch that is in front you used to work perfectly fine. You could ask why even have a smart bulb in that fixture then… Well it would still be nice to operate it remotely (in case you want to make sure all the lights are off when you’re not home).


Problem #2 - Switches without neutral wires
Anyone that’s installed a smart switch knows you need a neutral wire for it to work. You don’t need to know what it is but you know you need it because the instructions said that older homes that don’t have them won’t work with the smart switch.


Problem #3 - Cost effectiveness

When you have a fixture that you want to be smart but it only has or needs a single bulb, it can cost $30 - $50 to outfit it with a smart switch.

If you have a three-way switch (two switches that operate a single light), it can cost $50 - $70 to add standalone and add-on smart switches.

Smart Enough Switch to the rescue!

  1. My solution has power constantly running to the smart bulb while maintaining a traditional, instant, and tactile way to operate it.

  2. It doesn’t require any wires to be connected to it so it doesn’t matter if you don’t have a neutral wire or if it’s on a three-way switch system.

  3. Makes any standard light fixture a smart fixture for around $20! As some who loves to find great deals on devices, this is my favorite part.

How it works (long version)

Basic Overview

What it looks like with the face plate removed

Since the components of the switch are a door sensor, it basically boils down to “if the door is closed, turn on the light; if the door is open, turn off the light.”


I’m currently using webCoRE to handle the commands but I recently learned about the smart app “Smart Lights” that would easily work as well.


  1. I installed the smart bulb and got the door contact sensor working to control it (as described in the software section)
  2. I cut the power and removed the existing light switch
  3. I then connected the black and white wires (both hot) together with a wire nut and secured it with plenty of electrical tape to be sure none of the bare wire was exposed. (in this photo it looks like there are 2 sets of wires coming in from the top but only the set on the right is)
  4. Designed and 3D printed two parts, the harness and switch
  5. I removed the (very strong) magnet from an Iris contact sensor and slipped it inside the new switch housing
  6. Frankensteining the hardware from the existing light switch, I assembled my monster…
  7. The magnet is obviously critical to the operation of the contact sensor but it was also the solution I needed to keep the switch in the up position. The grooves of the new switch snap on to the metal frame of the old switch and ride along the “rails”.
  8. I used the ground wire connection point and screw to attach my harness (don’t worry, there’s still room to reattach the ground wire:
  9. Then the larger part of the Iris contact sensor is press fitted into the harness It has a very satisfying and snug fit…getting to press it in to the many prototypes I went through was my favorite part:)
  10. IT WORKS!! Notice the green led that blinks when it senses a state change. Also, in that gif you can see a little hole I added to the switch so you can push the magnet out if you need to.
  11. Turned the power off again and reattached the ground wire It will still function without the ground attached but as a safety precaution it’s best to have it grounded.
  12. Put it back in the wall and it’s done!

Here’s a bunch of photos in one album:

If you have a 3D printer and want to make your own, the files are here:

Final thoughts / Things to fix

I mostly made this to try something new and when I realized how useful, cheap, and easy it would be to implement, I knew I wanted to share it with the community. But even after countless hours and very late nights, it’s still not complete.

I need to figure out a way to keep the switch on the metal rails. The magnet is really strong but you could still push the switch back and off the rails. I think I can design it so the switch presses up against the contact sensor.

I want to find a way to fill in the gaps left above and below the switch.

I’d also like to make harnesses for other contact sensors.

My dream design wouldn’t require any extra 3D printed parts and would only use the original light switch to somehow move the sensors apart. I think all of this is doable but I need to take a much needed break from this project.


I like this idea very cool!

1 Like

You could wire the switch directly to a contact sensor that suplorts an external sensor, or if you willing to solder you can use an iris sensor.

Have you considered a toggle switch, something spring loaded that resets to the center? This would solve the issue of turning the light on via the app/automation and the physical switch still set to off.

This makes me want to dust off my 3d printer…

I considered using the spring that is inside of the existing wall switch but I haven’t thought too much about it. My goal is to only use parts that are already inside the light switch (with exception to the 3D printed parts).

I admire the ingenuity. There are A number of solutions for the problems you described, all discussed in the community FAQ, but there’s no question that most of them are more expensive.

Separately, as far as older homes that don’t have a neutral wire at the switchbox, the lutron caseta switches work fine without a neutral wire. (Lutron is an engineering company dedicated to improving lighting systems and has multiple patents on their devices, which is why they can do what most other companies cannot.) there is now an official integration with SmartThings which works well, but it does require also that you also buy the lutron smartbridge, so again expensive.éta-devices

Now as to this specific project.

Dang, I hate to be the bearer of bad news, and ordinarily I avoid it, but fire safety is a particular concern of mine and if you search the forum for other similar projects over the last couple of years you’ll see that I’ve made the same comments there.

If you check with your local jurisdiction you will probably find that it is against code to bury a battery operated device in the switchbox as you are doing here. Unless such a device is specifically designed for that purpose, which hardly any are. Batteries outgas, they can corrode, you don’t want them inside the wall. And if you burn down your house because of such a device and it is against your local code, your homeowners insurance will not cover your losses. So this stuff is important.

This is the reason that all of the commercially-produced battery-operated light switches, such as the Hue dimmer switch, the Hue tap switch, and the Cooper 9500 anywhere switch are all designed to mount on top of the wall. Not inside of it. I guarantee you that if it were to code to put those devices inside a regular wall switch, they would’ve done it. The fact that they didn’t tells you a lot.

Cooper even went to extra trouble to make their designs superthin and add a spacer for their regular inwall switches so you can put them side-by-side and both look like they are inside the wall. But the battery operated one is not.

You can use the contact sensor as a battery operated switch and still be to code, and some community members do. You just have to mount it in a box above the wall. Not put it inside the cavity where the other wires are.

Again, I do really admire the ingenuity and I’d like to see you do something similar that was surface mounted and not connected to the home wiring.


This is very good information! I hadn’t thought of batteries being in the wall being against fire code so that is definitely something I’ll look into. I guess I need to make another design that keeps the battery portion on the outside of the switch. Hopefully having a magnet in the wall isn’t an issue. Thanks for your very thorough and informative comment!