Besides just showing off the awesome stuff you can do with home automation, we’re using the Maker Faire display to demonstrate a few different situations that have come up in questions and comments on previous videos.

First, let’s look at a light switch wiring situation from my first “sonoff-as-a-light-switch” video. When I was explaining different possible wiring arrangements that you might find in your switch box, the first one I showed is where all you have in the switch box is the two wires that are going to the switch. If you could see into the walls you’d see something like this:

What’s happening here is the power from the circuit breaker is coming into the light box, then just the “hot” wire is going to the switchbox. In this situation you can’t put the sonoff in the switch box. The problem is there’s no neutral wire here. So, you can’t provide power to the esp chip. If you really want to make this a “smart” switch, you have to put the “brains” (the sonoff) up near the light, because that’s where the wires from the circuit breaker are. I didn’t describe this method in my video because I didn’t think anyone would want to do it this way. But since a lot of people have this situation, I’ll show you how it’s done. It’s easy to show it with our Wall of Zzonoffness because I can just walk behind it and see (and show) all the wiring. Finding these wires in your house, is another monster. The wires from the circuit breaker go to the input side of the sonoff. Then the output from the sonoff goes to the light itself. Then the wires that go to the switch connect to GPIO14 and Ground. To do that you solder a couple small wires to the pins on the sonoff then just wirenut them together with the wires that are going to the switch. I’d suggest putting a note of some kind in the switchbox to let other people know what you’ve done. Now, you’ve got control of the light in Home Assistant, AND at the light switch.

There’s another thing a lot of people have asked, that I can answer with this example. The question is usually something like this: “If I flip the switch on the wall, then turn the lights on with Home Assistant, do I have to turn them back off again before the switch on the wall will work”. That would suck. Good news, the answer is NO. A sonoff with a switch connected to GPIO14 will work like a 3-way switch. That is, it doesn’t matter which method you use to toggle the light, the next method you use, whether it’s the physical switch or Home Assistant, will toggle the light into the other state. [Demonstration]

That’s a nice segway into the next arrangement. The “alternative” 3 way switch. In my 3 way switch video I used one sonoff to control the lights, just like you would in a single switch arrangement. Then I put sonoffs in other switch boxes that just sent MQTT messages to toggle the lights that are connected to the first sonoff. It works great. My good buddy Cysix pointed out that there’s another way to do it. He made a video about it too.
https://youtu.be/l-CM8JQmges

In his scenario he has the power and load (wires from the lights) coming into the same switch box, then the 3-wires heading out to the other switches. In that situation you can use just one Sonoff. You don’t even have to open the other switch boxes. You just take the wire off the black screw (which is the “common” wire) on the 3-way switch in the main box, connect it to GPIO 14, then add a wire from ground on the sonoff to the black screw on the switch where the wire used to be. Then you can connect the sonoff just like you would if it was the only switch controlling the lights. Power from the circuit breaker to the input, and the output going to the lights. You don’t even have to open the other switch boxes or touch the other switches at all! Cool right!
https://www.easy-do-it-yourself-home-improvements.com/3-way-switch-wiring-diagram.html

If you did want to use the multiple sonoff method you still could by connecting the black and white wires that go to the other switch box to Hot and Neutral. That would supply power to a sonoff in the other box. The sonoff in the main box would get power from the circuit breaker and would handle the output to the lights.

Maker Faire part 2
In the last video we looked at 2 specific light wiring arrangements and their potential solutions. That was the 2-wire switch and the 3-way switch. We still have all these things included in the display that we need to talk about. No time to waste!

As one of the bulbs in the display wall, we’re using a sonoff B1. You can flash these with Tasmota. Doing so is a little tricky with only 2 hands. You can do it by soldering on a header, or by using this fancy little 3d printed jig with a header fitted into the jig. I spent a lot of time trying to make this jig just right… Then finally, I gave up and just soldered on a header. It took like 3 min and worked great. Soldering is your friend. Don’t be intimidated by it.
The Light entry in Home Assistant to get the Color wheel for the RGB component of this light looks like this:

light:
– platform: mqtt
name: “B1”
command_topic: “cmnd/DEVb1/power”
state_topic: “stat/DEVb1/POWER”
rgb_state_topic: “stat/DEVb1/color”
rgb_command_topic: “cmnd/DEVb1/color”
brightness_state_topic: “stat/DEVb1/dimmer”
brightness_command_topic: “cmnd/DEVb1/dimmer”
color_temp_state_topic: “stat/DEVb1/CT”
color_temp_command_topic: “cmnd/DEVb1/CT”
qos: 1
payload_on: “ON”
payload_off: “OFF”
retain: true

LED strips
We also included an example of Crown molding LEDs. In other places you may see this called Cove lighting. The idea is you hide led strips in some form of molding near the ceiling. It really gives an elegant look to any room. So that makes it high on the WAF scale! Now to do this without breaking the bank I use this inside corner molding. If you want to hide the lights a little more you can add this outside corner molding. I just glued the two moldings together. The combination of these two moldings including the LED strip is still only about $2 a foot. These are 12v strips so you need a 12v power supply and to control them you need a Sonoff SV. For our display we used one of those cool led touch modules. You could also use colored programmable LED strips. You’ll pay more of course but the ability to change the colors and make effects would sure be cool in some situations.

Speaking of programmable LEDs, our display wouldn’t be complete without an example of the outdoor Holiday LEDs. We built a fake roof line and used this plastic j-channel with ½” holes drilled every 3”. These are ws2811 waterproof lights. I’m using a D1 mini to control them. These programmable LEDs are what got me started in home automation. I’ve lost track of the number of effects I’ve got now. It’s a lot. They’re still a big hit especially with the kids. And the neighbors are jealous.

The last couple of switches here are two slightly different modifications of the Zzonoff. One is in a 3d printed box made with fire retardant ABS. The other one has a normal blank faceplate but I used the cheapest Touch module and it’s set up so the led on the module only blinks briefly when it’s pressed instead of staying on like the other one.

Another thing we included in the display wall is a Sonoff controlling to a receptacle. Nothing too difficult here. Flash the sonoff with tasmota, put the Hot and Neutral to the inputs on the sonoff, then the outputs from the sonoff go to the receptacle. You could put a button here too if you wanted.

Episode 3
We’ve looked at the wiring and the lights. For this last pre-maker Faire video we’re going to talk about the prettiest way to control these things. HA Dashboard.

Finally, to show off the coolest way to control all this stuff we set up an HA Dashboard on an old tablet. There are a couple of new things I did with this Dashboard that aren’t in the first HA Dashboard video I did. First is the weather widget. There’s a built in weather widget that draws information from a service called Dark Sky. To get dark sky set up you need to go to their website and register. That’ll generate an api key that you’ll need in your HA config. This is how the entry in the configuration.yaml file should look. There’s a lot of information you can get from DarkSky. The dashboard widget uses these parameters by default. So if you want to use the weather widget you need to include those in your configuration. The entry in the dashboard file looks like this. You can use this information from darksky without using the weather widget also.

Since we’re dealing with weather there’s a really cool way to include a radar image in your dashboard. The dashboard entry looks like this. It really just displays a url. To change it to your location go to this website and search for a town near you and change this part of the URL to your town. Thanks to __ for showing this to me a while back. I made my widget 3×2 but that’s something you can customize to your taste. It need to be kinda big to be useful.
Now we know what weather is coming, let’s look at getting some traffic info. I don’t know exactly how this might work for you in your area. For us in Utah we can access public traffic cameras by url. I set up the iframe widget to grab an image from 5 different traffic cameras that show my route to work. I’ve got it set to update the image every minute. You can do this to grab any image from a url. What other images would be fun to have? Ski conditions? Zoo cameras? And there are ways to see cameras in your house too but I haven’t tackled that one yet. One really great thing about appdeamon is you can very easily make changes and quickly see the result. If what you did doesn’t work you can easily try other changes until you get it right.

In trying to show an example of presence detection in our display dashboard I stumbled on a easy Bluetooth based method for knowing who is home. It requires that you’re using a pi3 and it’s easiest if you’re using hassio. I was actually pretty surprised how easy it was to set up. There’s an official hassio add on that enables the Bluetooth chip on the pi3. Install it and start it. You need to add a few lines to the configuration.yaml file and then you should find a new entry in your known_devices.yaml file. If the MAC address starts with BT you know it worked. I don’t fully understand how it works. You don’t have to pair your phone with the pi3 at all. I don’t know what the range limit is either. And I don’t believe you can set up other zones. Meaning you can know when someone is home or away but you can’t know when they’ve arrived at school or work or the mall.

The last surprise we’ll have at the Maker Faire is an interactive treasure chest. My good friend Matt has been working hard on this thing for months. It uses a variety of sensors, motors, lights, and a speaker to create a bit of a puzzle. If you can figure out how to open it there’s a little surprise waiting inside. After the Faire we’re going to make another one and of course make videos about how we did it. Personally I’m really excited about that thing. The future fun factor FFF is huge!

Product Links:
Amazon –

https://amzn.to/2EOM5oJ

https://amzn.to/2HBzOHr

https://amzn.to/2JNPSqn

AliExpress:
AliExpress.com Product – Sonoff B1 Led Bulb Dimmer Wifi Smart Light Bulbs Remote Control Wifi Light Switch Led Color Changing Light Bulb Works With Alexa

BangGood:
https://www.banggood.com/Sonoff-B1-E27-6W-RGB-Dimmable-Wifi-LED-Smart-Light-BulbWork-With-Alexa-AC90-265V-p-1198029.html?p=68211320136544201803

Lowes:
Inside Corner –
https://www.lowes.com/pd/0-6693-in-x-8-ft-Painted-Composite-Inside-Corner-Wall-Panel-Moulding/3401982
Outside Corner –
https://www.lowes.com/pd/0-937-in-x-8-ft-Prefinished-Polystyrene-Inside-Outside-Corner-Wall-Panel-Moulding/50148028
J-Channel – https://www.lowes.com/pd/J-channel-White-0-625-in-x-150-in-Vinyl-Siding-Trim/3037104