Make your own Sonoff smart plug

You can post offtopics at the General category and also show us your smart home here at Showcase if you want :slight_smile:

:slight_smile: well there's no smart home yet... I live in appt where nothing is smart (I do have few wireless switches and few wireless sockets and a sensor network but is all related to different projects, not really a smart house), I do have tested a bunch of stuff I do plan to setup in a house I purchased recently that I'm renovating for 6 months already and there's at least another 10 months left and there I plan to setup a full smartness I can come up with (as that's, hopefully, my final house :smiley: ) ... I wanted to go PLC way but gave up as I could not find a good PLC module that does not cost arm & leg, then I looked at hooking it up on some custom mesh (xbee or nrf or ...) but I found so many bugs in those systems that there's no way in hell I'm gonna put it in my house... so I ended up deciding to go with esp (both 8266 and 32) using insecure wifi (as seems like WPA/WPA2 are not more secure than WEP :frowning: ) but with a custom layer on top that will provide security.... after I'm done I'll post the whole story somewhere (probbly on my elco blog if I get it out of the grave, clean from viruses and put back online - fscking wordpress got hacked) and will link here too :smiley: .. but I doubt it's very useful to link stuff totally unrelated to printing to octoprint forum... even in showcase space :smiley: ... (your post is ideal for showcase, I didn't want to be obstructive, just wanted to share a link to a tool many don't know exist that can be used to flash all those esp based devices without opening them, as when you wanna tweak one, it's cool, but when you want to tweak hundred it's pita... but a post about smart house, unless bunch of stuff for that is 3dprinted I doubt is a proper one)

now, wrt pinout I think tasmota have template for the ones you are using :smiley:

check out:
https://blakadder.github.io/templates/AWP08L.html

{"NAME":"AWP08L","GPIO":[0,0,56,0,0,0,0,0,0,17,0,21,0],"FLAG":0,"BASE":18}

1 Like

Well done!

Honestly, I'm considering pirating all my Amazon-based devices (Echo, Spot) since I don't 100% trust them anymore (with their fondness for turning back on the eavesdropping aspect). If I do, I'll add to the write-up.

And then again, there's the painfully-stupid Windows-based media control panel in my car's dashboard. <_<

1 Like

That didn't work for my plug - all GPIOs are wrong.

Here is my template

{"NAME":"WSIIROON","GPIO":[0,0,0,0,17,56,0,0,21,0,0,0,0],"FLAG":0,"BASE":18}

That would be great :slight_smile:

Pull a neutral from the panel!. Apparently it's not hard.

well in this appartment where I live attm is hard, they are not using the channel/tubes between junction boxes and the switches so I have ~1.5m of wall I'd need to dig a channel in to put the neutral from the junction box to the switch (not sure if I'm using proper English terminology for this, the live+neutral+ground comes to the junction box that's near the ceeling, from junction box live comes down to switch, normally trough a plastic pipe, but not in this appt, and then a 1 or 2 or 3 wires return to the junction after the switch, then from junction neutral and ground go directly to lights and the 1/2/3 wires from the switch go to the lights as live. In this appt the cables sometimes come to junction trough plastic pipes, sometimes they are just in the wall channel and mortar is on top so no way you can pull another wire there, and everywhere the switches are connected to the junction without tubing so impossible to pull another wire... In the house I'm redoing it all so will not be a problem, I even originally intended to pull a phone wire, the famous "blue/white" 1.8mm copper wire to every single switch & socket as a "data line" but gave up)

Perhaps you should try making your own again. Are you aware of this phenomenon?

1 Like

of course :slight_smile:
that's what I was about to be using to charge my liio pack for my switch that does not require neutral, but since I was informed that we need to redo the wiring in the house I gave up on the project as it will be simple to bring a neutral to the switches now..

1 Like

Don't give up. Somebody somewhere might need your solution :wink:

Any metal water pipe in your apartment by regulation should be well-grounded, for what it's worth.

1 Like

Ground != neutral!

3 Likes

I'm wondering how you could have an AC outlet without a neutral...? You must have those metric sockets over there.

1 Like

You can't have an AC outlet without neutral, but you can easily have an AC switch without neutral since you you usually only switch hot anyhow.

The thing I don't understand is. They had to run the neutral to the light socket form somewhere. Why don't electricians run a live and a neutral from the panel to pass through the light switch box, on it's way to the light socket!??! If not then you mean to tell me that you pulled the neutral from another direction in another conduit? What sense does that make.

The standard is to run live, neural and earth to the ceiling lamp fitting which has a four way connector and two live wires plus earth go from there down the switch. That leaves the bulk of the wiring in the ceiling as it can go from one lamp fitting to the next in all the rooms on that floor.

Running neutral to the switch would just be a waste of copper when switches where all mechanical.

1 Like

@nophead, therefore the most reliable way to get a neutral is to run one from the light fixture to the switch box?

Yes as there is already an existing cable route.

Although I think I would put the sonoff in the ceiling instead, either in series or in parallel with the switch depending on if I wanted to force it on or off.

I'll also suggest that there are times when there are two switches on the walls for the same set of lighting.

Having multiple printers, I was really hoping I could get this working https://www.amazon.com/Protector-Appliances-Individual-Schedule-Required/dp/B076VRH9WP and plug all the Octoprints and printers into a single controlled strip - It's sold under half a dozen names - Turns out it's fairly easy to flash with the Tuya firmware and you can address each plug independently, but the USB ports don't put out enough power for the Raspis :frowning: