Simple Contact Closure Device Needed


(Vincent Regaud) #18

I have a few of them around the house.
I have a custom firmware on them. Very simple mqtt client to activate the relay.
I have enabled the OTA update on them but I only used that once when I changed the IP address of my MQTT broker. No problems there.
I mostly use them to control radiator valves to create zone heating room by room.
But I also have two or three to control lights where I couldn’t get a wired control.

Great little devices BUT be careful with the load you put on them and they are NOT CE certified so your home insurance may frown on that.

Regards


(Rich Koshak) #19

Actually, as of October 2016, they do have CE Certification, at least for some of their products.

You can find links to other certifications and the CE reports at the bottom of this page.

https://www.itead.cc/wiki/Sonoff_Smart_Home_Solution

And at least for the ones I purchased last year they all have the CE logo on the box.

This is probably another good reason to buy new though and avoid eBay.


(Thomas Binder) #20

Don’t be so sure: Mine have both CE and RoHS (I bought my first ones in February 2017 I guess).


(Vincent Regaud) #21

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.

Regards


(Rich Koshak) #22

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.

image

Shenanigans?


(Vincent Regaud) #23

Probably…
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.

Regards


(Brad Gilmer) #24

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?


(Rich Koshak) #25

(Brad Gilmer) #26

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?


(Rich Koshak) #27

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.


(Brad Gilmer) #28

@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.


(Thomas Binder) #29

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


(Brad Gilmer) #30

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


(Brad Gilmer) #31

@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.


(Rich Koshak) #32

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


(Brad Gilmer) #33

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.


(Brad Gilmer) #34

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


(Rich Koshak) #35

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.


(Brad Gilmer) #36

@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.


(Steve M.) #37

@bgilmer
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.