Simple Contact Closure Device Needed

Yes, I know that some of their devices have CE certification. As I was
talking about my devices, which are all Sonoff basics, these don’t have CE.
I didn’t mean to generalize.


Interestingly, the certificate does not mention the Basics but I have a Basic in a box right here on my desk with the CE logo.



Better check with Itead directly. They may have updated the basic and/or
obtained a CE for it.
I would check with them with the serial number. They are very helpful.


I have seen a number of posts / articles on how one makes use of these devices. Is there a definitive source you would recommend that I use once I get my hands on one of these?

1 Like

Thanks @rlkoshak!

So… after I thought more about my project I wonder if this Sonoff unit is what I need.

I have a Rinnai tankless water heater. If you call for hot water, the water heater fires up and then the hot water makes its way to where ever you are running the tap. There is a hot water return loop that allows hot water to circulate out of the heater, past all of the hot water faucets, and then back into the hot water heater.

What I want to do is to put a momentary push-button on my OH2 UI so I can push it and turn on the recirculation pump. Then I have instant hot water at the shower. Once I finish, I can push the button again to turn the pump off.

One other detail - there is an indicator on the heater control panel that shows it is in recirculation mode. After about two hours, if you don’t turn it off earlier, the heater drops out of recirculation mode.

If I had run low voltage wiring to the pump location, I could use one pair to switch on the pump with a momentary closure, and I could use the other pair to pick up the status of the recirculation mode on the control panel. I could use the GPIO pins on my RaspberryPI and I would be good to go. But… no wires are in the walls.

I need some small device that I can put in the wall behind the water heater control panel. I need to be able to send a momentary switch command to a dry contact closure to put the heater in recirculation mode. I also need some sort of input on the device so that I can get the actual status of the water heater off of the panel into OH.

Clearly I could use a Sonos device to produce a momentary push-on, push-off contact closure to remotely push the recirculation mode button, but I would be running “blind”, having no idea whether the last button-press put it into recirculation mode, or took it out of that mode.

Sorry for the TLDR post, but perhaps I need some sort of different solution. Any ideas?

So get a RPi W0 and wire its GPIO pins to the pump and send a message from OH to that RPi Zero to trigger the pump. Almost no one has wires in their walls to control stuff like this.

I’ve written a script that does just this very thing using MQTT for messaging.

I use it for some sensors and actuators around the house (I’ve three RPis running sensorReporter doing various jobs).

You might also need a relay to make this work. I use a relay wired to the GPIO of one of the aforementioned RPis and wired to the garage door opener wall button. When I send a message to the right MQTT topic sensorReporter closes the relay for half a second then opens it simulating a button press.

If you are in the US and have a Microcenter nearby, they are currently selling the RPi 0W for $5. It is in store only and the regular price is only $10 so it isn’t like you are breaking the bank.

You could also do this with ESP8266 boards with ESPEasy or the like running on them. These are microcontrolers but have wifi built in and if you don’t mind shipping from the slow boat from China can be had in the $5 a piece range as well. An RPi is really overkill for this application but the price is right.

@rlkoshak that is a great suggestion. Yes, the RPI Zero is overkill, but a) the price is right, b) I know how to get it to do this without a lot of messing around, c) the form factor will work, and d) I can load and configure an RPI in my sleep. Yes, I am in the U.S., and I am an Amazon Prime customer, so I can get an RPI dropped on my doorstep for $5 - you can’t beat that. Heading to Amazon to order one after this post.

One other quick very OT comment - I use two RPI Zeros with the RPI camera to do remote monitoring, all in a very small package, with this integrated into an OH tablet UI. It works GREAT! and again, it is very inexpensive. The RPI case comes with a mount and a hole for the camera, so it all ends up being a super-small package. And for US$40 or so, you can’t beat it.

Thanks for the pointer to your sensorReporter! I will definitely look at that code when I get to work on this.

hey! I’m also prime, but in Germany. :frowning: here it’s 20bucks…

If you need one, let me know and I will order it and put it in an envelope to you.

@rlkoshak, I have left a PR and an issue on your GitHub site for this very helpful utility. Please take a look when you get a chance.

I saw it. I’m currently traveling so it will be a few days more before I get a chance to review it.

Thank you. One other thing. I saw your configuration for this application has evidently evolved over time. I have found a few posts from you on this. Would you mind posting your current config files? My end goal is to have a momentary push button communicating to a remote Pi Zero. Your script causes a contact closure at the GPIO pin of the Pi, which starts the recirculating pump on the hot water heater. I then take a voltage off of the pump in the water heater and use that to feed back a “sensor” on your script to confirm that the push button command resulted in an action at the water heater. This publishes to an MQTT channel that is picked up back at my OH2 system. That feedback causes the icon on the push button to change to another icon. When the water heater is off, I will use the “water” icon. When the contact closes and ‘ON’ is published on the MQTT sensor channel, I want the icon for the push button to change to “Fire”. I believe all of the pieces are in different posts from you, but seems like you have modified your approach to this over time. Any help would be very much appreciated.

@rlkoshak This is one of the posts I was referring to…

It actually wasn’t me but someone else submitted a PR that greatly expanded the GPIO capabilities and I’ve frankly been overwhelmed with other work and haven’t upgraded my instances of sensorReporter to the new code yet. I ran a few tests in isolation is all.

Assuming you have the MQTT messages working right then everything you need is here

among other places.

You will have to make copies of your icons.

@rlkoshak, “… completely overwhelmed with other work…” +1! That is why you have not seen much of me on the documentation side either :wink: . Hope to re-engage when things calm down.

I will look at the post you linked to - thank you.

Regarding sensorReporter, it is a great little utility - thanks for the pointer to it. Unfortunately I have never written a single line of Python, and to me, it looks as if a function call is returning a pointer to an object rather than the contents of the object itself. I have no idea where to start on that. Not urgent, but if you get a minute to look at it, you can point me in the right direction and I can mess with it and potentially post a PR to fix it.

Did you ever figure out how to integrate your Rinnai recirculation motor control into OH?

The controller that comes with the unit has a rudimentary timer but I’d like to add some more logic to when the recirc pump runs.