Introduction: $5 Home Automation Button
A $5 Home Automation Button
Sometimes the simplest solution is a single button.
We wanted an easy way to trigger a “bedtime” routine on our home automation hub (the Hubitat Elevation), which turns off most lights, sets others to specific levels, and changes the thermostat setpoints. I decided to combine a Zigbee contact switch with a simple pushbutton to make this a 1-click operation.
Supplies
Iris Zigbee Contact Sensor
Since Iris went out of business, these can be easily found on popular auction sites. I bought a package of 10 for $30, shipped. They did not include magnets for the sensor, but that wasn’t important for my purpose. When selecting a contact sensor, be sure to pick one that uses a magnetic reed switch – some newer models use hall effect sensors, which won’t work for this purpose. This sensor also reports temperature - a potentially useful addition to your automation system.
Push button – any type of normally open (NO) switch will work. The one I used was $2 on a popular auction site; plenty of similar alternatives online
Enclosure – this could be a simple project box, a 3D printed enclosure, or something custom – I’ll show you how I made one from a block of hard maple
Stranded wire – 12” will do the trick
Soldering iron
Misc. tools, based on your enclosure choice
Step 1: Sensor Wiring
Open the sensor and locate the magnetic reed switch. On the Iris model, it’s the rectangular black box with wires on each end. Inside this plastic box are tiny metal arms that are attracted to each other when a magnet is present. When the arms touch, they complete a circuit, which sends a signal to your alarm or automation system.
I found it easier to remove the circuit board from the case before adding the wires. Cut the wire into equal lengths and carefully strip about 2mm off each end. It works best to tin each end of the wire with a bit of solder, then add a tiny bit of solder to each end of the magnetic switch. Touch the tinned end of the wire to the end of the switch, apply a bit of heat from the soldering gun, remove it, and hold for a few seconds while it cools.
Once you’ve connected wires to each end of the magnetic switch, route them so they exit the sensor case. I used the tip of my soldering iron to make a groove in the case for the wires.
If you haven’t already paired the sensor to your alarm or automation system, this is a good time to insert a battery and go through the pairing process. Once it’s paired, touch the ends each wire together and verify that your alarm or automation system reads it as “closed”.
Step 2: Adding the Button
I picked a stainless steel switch with a flat button – this makes it less likely that it will be accidently pushed. You could use any type of momentary, normally open switch – arcade buttons, emergency stop buttons, a repurposed “Easy” button. Pick something that fits the location it will be placed.
Connect the ends of the wires from your modified sensor to the switch contacts and verify that your alarm or automation system still reads it as “closed” when you push the button.
Step 3: Making the Enclosure
At this point you could just hot glue the button to the sensor case and call it “good enough” – but where’s the fun in that? A small project box would hold both easily, or you could 3D print one.
For this one, I wanted something that looks nice on a bedside table. I started with a scrap block of hard maple that I salvaged from an old butcherblock kitchen counter.
First, I sketched out the approximate dimensions of the sensor on the block. Using a forstner bit in a drill press, I drilled holes the appropriate depth and about 1.5” longer than the sensor, creating a pocket on the underside of the block. A few minutes with a chisel cleaned up the pocket so the sensor fits snugly.
To give it a slight angle, I drew a line along one side and cut it on the bandsaw. Using a smaller forstner bit, I marked and drilled a hole for the pushbutton.
After sanding to 220 grit and easing the sharp edges, I applied two coats of clear lacquer and buffed with 0000 steel wool for a silky finish.
After assembling the button and sensor, I added a bit of Velcro to the inside of the pocket and the top of the sensor to hold it in place.
Step 4: Finished!
Looks great on the nightstand and makes shutting off all the lights a simple one-button push.
If you needed more control, you could add a second (or third, or fourth...) sensor and additional buttons.