I just finished putting together a shutoff device for a remote cabin's electric well pump. It is a pretty simple device, but one that could really save us in the case of a water leak.
We have a cabin in the woods that is a part-time Air B&B so is occupied fairly often, but it could be days or weeks between anyone being home. I'm one of the closest family members to the house at a mere 7 hours away in another state! We do have a local caretaker, but if no one is renting than no one will be there.
What is it?
Well - its a relay in a box! I took a Sonoff Basic as the controller and stuck it in a discarded enclosure from work along with a 40 amp contactor with 110V coils. The Sonoff provides the control interface, status LED, and a button input; all while service a web interface. This is flashed to run stock Tasmota firmware.
I was able to build this for around $50 US which was mostly the Sonoff and a contactor. There aren't too many products like this on the market (WIFI enabled high-current switches), but the ones that are available are over $100-$150. This one will link via MQTT to a local OpenHAB home automation server located on-site at the cabin in the woods.
I have 10x flood sensors placed around the house that all report over Z-Wave into OpenHAB and would report seeing water somewhere in the house; and automatically turn off the well pump and send push notifications in OpenHAB.
This retains local control via a push button on the box and has a status LED on the side for quick reference.
I'm building up a second one for the water heater so that we can easily deactivate it as well when not at the cabin.
Looks pretty simple. Is it?
Yes. Yes it is. Very simple. Only took me like 8 months to complete it! I had the thoughts late last fall and got the enclosures from the 'discard bin' at work. I had about 3 to 7 projects jump queue; but finally got these done. They are super simple but I'm still pretty excited to have them together. This will really provide a large level of additional comfort to protect the home when no one is around. When the house was purchased, it wasn't properly winterized (in Northern Michigan it gets quite cold!) and the plumbing had literally over 30 burst pipes (no joke!)
Attenuation much?
Yeah - the Wifi reception is quite bad in these with a steel enclosure and the Sonoff's PCB antenna. I originally had the Sonoff bolted right down to the aluminum backplane and it barely could join Wifi at all. I settled by using 30mm M3 standoffs and now they seem to do "ok" (at best). Once they join Wifi they seem to hold pretty well. Mqtt is pretty lightweight and I'm not too far from the router where these are going. I really like using the Sonoff because it is an 'all in one' with enclosure: its own power supply from mains voltage, provides a 110V relay, can be flashed with Sonoff and have Wifi with MQTT local control. I could have used something like a D1Mini clone with external antenna but would have needed a separate 5V supply and it doesn't have its own case so I'd have to probably design my own and 3D print. Another option would have been to cut a big hole in the side and put a mesh screen or plastic grill. I like the route I went because it keeps things well enclosed. I see RSSI as low as 14 to 28 and signal level of -80 to -93 but holds well enough for my needs
How will it be used?
The idea here is that basically no one will ever need to explicitly turn it on or off. The cabin has the ability to go into "Secure" state via OpenHAB by turning down the thermostat and sending alerts if any doors open while no one is home. At the same time, I just now add the ability to turn off the well pump and water heater as well. We can turn them on locally (with the button) or remotely (via OpenHAB local on WIFI or remotely) or automatically when someone gets to the house.
Can I see it run?
Sure - here is one video (without narration) just showing the web UI (which is just Tasmota) and button turning it on and off and opening the box.
And here is a narrated end-to-end test using my ZWave flood sensors. You can see the near-instant reaction time round trip of battery-powered ZWave devices -ZStick controller--> OpenHAB --> Wifi --> Sonoff. Also in there is the Push notification on my phone which will work anywhere I have internet. The contactor will always work locally regardless of if the internet is down at the house.
Schematic
Not much going on here. This is a quick diagram done in Eagle. Mains voltage comes in and lands on the contactor. We steal a 110 leg to run the Sonoff. A switched 110 output from the Sonoff feeds the coil on the contactor. I soldered onto the LED and GPIO0/button pads of the Sonoff to bring out an external LED and button. The three switched legs are then available on the secondary side of the contactor for use by the downstream devices like well pump or water heater.