Automating a Flawed Christmas Tree with a Shelly1 (Low Voltage)

November 7, 2018

Today on the hookup we’re going to look at how to automate a pre-lit Christmas tree using the LOW voltage functionality of the shelly1.

It’s November, and in November my family and I do quite a bit of traveling, and spend basically all of our weekends away.  That means a few things, number 1, I’ll be producing slightly less content in November than I normally do, and number 2, my wife gets a free pass to start decorating for Christmas as soon as the Halloween decorations are put away.  As I record this video it’s currently November 5th and our Christmas tree has been up for two days.

Overall I really like our tree.  It is pre-lit and you can click the footswitch to toggle between four modes: off, white, multicolored, or alternating.  But the tree has one serious flaw:  The default state when power is lost is off, not the last selected LED color mode.  This means if you try to automate it using a smart plug you’ll be able to turn it off, but to turn it on you’ll need to first toggle the outlet on, and then walk over and step on the footswitch the specified number of times to get back to your desired mode.

After some quick probing around with a multimeter I was able to figure out that the white lights are lit by having +30 volts on the striped wire, and ground on the plain wire, and colored lights are lit by having +30 volts on the plain wire and ground on the striped wire.  The pushbutton contians the brain and controls the mode with a little IC chip.  The power wire before the pushbutton is at a constant 30 volts DC provided by the AC wall adapter.

My original plan was to hook up an ESP-01 with a buck converter to step the 30 volts down to 3.3V and then use one of these 3.3V relay modules, but I really didn’t want to re-invent the wheel since there are tons of these wifi relay modules out there.  Then I briefly thought about using a sonoffSV but quickly realized it can only handle 24V input, not 30.  Then I remembered that the Shelly1 can be powered not only by 110-240 volts AC, but also 24-60V DC, perfect!

That means that all I needed to do was steal a little power from the wires on the adapter side to power the shelly, and then interrupt one of the wires on the tree side with the relay.  Since the input and output of the relay on the shelly1 are isolated from voltage used to power the shelly it won’t mess up the lights at all, it will just prevent them from turning on when the relay is off.

Since the power interruption happens after the footswitch where the brain is, the brain never even knows that the lights aren’t on and therefore will continue to output the correct pattern.  If you’d like to change the pattern you still need to press the footswitch, and if the power goes out you’ll still need to press the footswitch to turn them back on, but 99% of the time this is a perfect solution for automating the lights without actually cutting the power to the brain in the footswitch.

I’ll probably put the shelly in a little project box just to hide some of the messy wires, but It’s pretty low voltage here, so I’m not particularly concerned about an electrocution risk.  I’m not sure if my particular issue with the lights defaulting to the off state has been fixed in current models of pre-lit trees, but it seems like a major oversight and effects anyone using a timer, not just a smart switch.

Because this is a pretty temporary thing and because the shelly firmware supports MQTT now I didn’t even bother putting tasmota on this shelly.  I set the switch up in home assistant using the settings that I posted in my last video on the shelly and it works like a charm.  If you’ve been trying to use the alexa local node in node-red, amazon has changed the way that discovery works, and new nodes are no longer being discovered.  I’m currently looking for a solution or work around, but I was not able to immediately get the Christmas tree added to my alexa due to that problem with the alexa local node.  Hopefully I’ll find a solution soon and I’ll let you all know about it when I do.

That’s it for today, as I said, November is going to have some shorter videos, but I’ve got some big projects coming up for December, and I’ve got some majors updates to push out for my holiday LED Arduino program that includes customizations for color and speed for every effect.

Thank you to all my patrons over at patreon for your continued support of my channel.  If you’d like to buy a shelly1 the link is down in the description.  Hopefully the shelly 2 will be back in stock soon also.  If you enjoyed this video, please consider subscribing, and as always, thanks for watching the hookup.

Shelly1 AmazonUS:

Shelly2 AmazonUS:

 (Still listed as unavailable, shelly tells me the shipment is en route, check back soon.  I’ll tweet it out once they are back in stock).

visit my website:

Follow me on Twitter: @TheHookUp1

Support my channel:


Music by

Related Posts