ButtonBot - a DIY Solution to Automate Any Switch With Home Assistant

by taste_the_code in Workshop > Home Improvement

2357 Views, 25 Favorites, 0 Comments

ButtonBot - a DIY Solution to Automate Any Switch With Home Assistant

ButtonBot - A DIY solution to automate any switch with Home Assistant
video.00_01_01_19.Still002.jpg

I've created a device that can be used to automate any switch in your house. The device is made with a NodeMCU board, running ESPHome, and a 9g Mini Servo to push the switch.

Supplies

MVI_0968.MP4.00_00_02_08.Still001.jpg

Tools and materials used in the video:

NodeMCU - https://s.click.aliexpress.com/e/_Eur8JFZ

9g Mini Servo Motor - https://s.click.aliexpress.com/e/_DDiIp4z


By buying through the links below, you support the channel at no extra cost!

Soldering Station - https://s.click.aliexpress.com/e/_DBmBjUX

Jumper Wires - https://s.click.aliexpress.com/e/_DkWW1nZ

Wire Snips - https://s.click.aliexpress.com/e/_DFP86vv

Prototyping PCBs - https://s.click.aliexpress.com/e/_DcvrbuF

Mini PC to run Home Assistant - https://s.click.aliexpress.com/e/_DDoIAMb

The Problem

video.00_00_05_15.Still001.jpg

With the usual Home Automation setups, the problem comes when you need to replace all of your existing switches or add an additional device between the switch and the load that it turns on.

This requires that you mess with the mains wiring inside the switch and not many people are comfortable doing that with a good reason.

Additionally, if you are renting a space, most often you will need to leave the place in the exact same way as you found it so messing with the wiring is not really an option at all, but you still want to have automation for certain switches and areas.

The Solution

MVI_0966.MP4.00_00_01_00.Still001.jpg

To mitigate this, the ButtonBot attaches on top of an existing switch with double-sided tape so it is only a temporary and non-invasive option. This tape can be easily removed if there is ever a need to do so and since it only mounts on the side, the switch can still be easily accessed and manually operated.

The Wiring

video.00_02_22_25.Still003.jpg
video.00_02_34_27.Still004.jpg

The servo is powered from the 5V (Vin) pin on the NodeMCU and GND, while the controlling signal is provided on pin D5.

In order to connect the servo in that way, I had to remove the wires from the plastic housing of the servo connector, but that is very easily done with a small screwdriver.

On the servo, red is VCC, brown is GND and orange is the signal wire.

Mounting

MVI_0967.MP4.00_00_01_24.Still001.jpg
video.00_03_32_19.Still005.jpg
video.00_13_28_19.Still011.jpg
video.00_13_53_26.Still012.jpg
video.00_04_16_10.Still006.jpg
video.00_04_31_15.Still007.jpg

The servo needs to sit a bit above the switch so in my case, I used double-sided tape and a few ice cream sticks to raise it to the proper height.

This will be different for your style of switches but it should be easily achievable. If you have a 3D printer, then the easiest way is to make a support bracket that fits your switch.

When the servo presses on the switch, there is a lever force that wants to tip it over so it is important that you add support from the sides to prevent this.

Controlling the Device

video.00_04_52_08.Still008.jpg
video.00_07_29_07.Still009.jpg

The device is controlled through Home Assistant where we have several options to set. Besides the two trigger buttons, we have a slider that allows us to manually set the servo position anywhere we like as well as two numbers to set the proper distance and duration of the press for the buttons.

I explain all these in great detail in the video above so please watch that.

Code

video.00_08_02_12.Still010.jpg

The configuration code for the ButtonBot is available on my website at:

https://www.tastethecode.com/buttonbot-a-diy-solution-to-automate-any-switch-with-home-assistant

All options, actions, and details are explained in the video above.

Next Steps

video.00_14_34_08.Still013.jpg

The ButtonBot is created to be as versatile as possible while still being very easy to make and use in any situation. If you make this project on your own and use it, please let me know in the comments.

If this is something you liked, then be sure to check out my other Instructables, and also feel free to subscribe to my YouTube channel.