ITEAD Sonoff switches and sockets - cheap ESP8266 Wifi+MQTT hardware

I came across the maintenance part within openHAB also. I understand, that github only uses SSL and the sonoff-firmware isn’t capable of that. So, I think pointing the Manual updates to smadds URL would be the thing for that. We could set a link to your maintenance-approach. I did it in the wiki-Upgrade. But thing is, even if smadds’s solution is automatic, there’s no guarantee of having the latest Firmware on his Server, I also added that part.

Nice additon! I didn’t want to add smadds server in this article because it is not an official server by arendst. However, now that it’s there, I do not see any harm in it! Also mentioning the openHAB automation is nice advertisement :stuck_out_tongue_winking_eye: So once more: Nice work :wink:

I figured, since it was kind of official in the issue-discussion, it could be written there! :wink:

1 Like

It’s okay I think :wink: Btw, if you have other Itead products, please add them to the list of (tested) item definitions. Would be great to provide all kinds of Sonoff modules with a ready to go definition for new users. Who knows, maybe we can even attract new users by providing a complete wiki page over there :boom:

sorry, I only got those Sonoff Pows. No need for a WiFi switch or whatever, as I use KNX for that. Just didn’t saw the necessity to buy KNX actuators with built in power measure while planning the electric stuff! :wink:

Edit: Started another topic (here). :slight_smile:

Does anyone know if the Sonoff RF 433Mhz versions can be controlled directly with rfxcom for example?
(without wifi)

Thank you!

@AndrewZ challenge …? :wink:

Well, this is the quick and dirty solution, with some room for improvement :wink:

Adding another broker in mqtt.cfg

maddox.url=tcp://sonoff.maddox.co.uk:1883

Adding items:

String	Sonoff1LocalVersion "Sonoff #1 running fw version [%s]" { mqtt="<[broker:tele/sonoff1/INFO1:state:JSONPATH($.Version)], <[broker:stat/sonoff1/STATUS2:state:JSONPATH($.StatusFWR.Program)]" }
String	SonoffCurrentVersion "Sonoff fw version on public server [%s]" { mqtt="<[maddox:sonoff-version:state:REGEX(.*?(\\d+\\.\\d+\\.\\d+).*)]" }
String	Sonoff1fwVersion "Sonoff #1 fw version [%s]"
// optional binary flag
Number	SonoffUpgrade

Rule:

// Sonoff firmware check
rule "Sonoff-fw"
when
	Item SonoffCurrentVersion received update or
	Item Sonoff1LocalVersion received update
then
	val vLocal = Sonoff1LocalVersion.state.toString
	val vRemote = SonoffCurrentVersion.state.toString
	if(vLocal < vRemote) {
	Sonoff1fwVersion.postUpdate("upgrade available from " + vLocal + " to " + vRemote)
// as an alternative we update a flag to use it later in a sitemap for color, visibility, etc
//	SonoffUpgrade.postUpdate(1)
	}
	else Sonoff1fwVersion.postUpdate(vLocal)
end

And finally a sitemap:

Text item= Sonoff1fwVersion
// as alternative we use a flag to highlight the version number
// Text item= SonoffCurrentVersion valuecolor=[SonoffUpgrade==0="green", SonoffUpgrade==1="red"]
5 Likes

I’ve updated the above example to provide more readable output.

1 Like

Hi…i think the chip used is the same as the ESP-07 I’ve used and if the 433 module isn’t fitted, all the GPIOs should be available for other inputs and outputs if required. GPIO14 is the easiest to get access to and I have this working ), GPIO0, 13 (LED) and 15 go to resistors so are solderable, GPIO2, 4 and 5 would require very delicate soldering so I won’t be touching these.

turnkey assembly

Very nice @AndrewZ that was quick! I didn’t even make it home in that time. It’s great to see this community work together. Are you going to transfer your solution to the wiki or do you want me to do that part?

@ThomDietrich I will appreciate if you find some time to add this to the wiki. I’m back home after some travel and simply don’t have enough time.

This hardware looks fantastic, much cheaper than the Zwave sockets I’ve been buying over the last year or so. I’m very interested in energy consumption monitoring and from what I can see the Sonoff Pow isn’t available with UK pins and socket, it’s a relay that you wire inline between the device you want to control/monitor and the mains. If I wanted to make a portable Sonoff Pow switch would I need to wire a plug and socket to it (which is no trouble) or is there a Sonoff Pow available with UK pins on it already? I’ve looked on ebay and Amazon but not found anything.

The Sonoff Pow is not available with plug and socket. In order to get a “portable” version, you can mount one onto an extension cord:

That’s what I’ve done to not need to cut the cable of a fridge.

I had a feeling that would be the case but thought I’d ask just in case. Thanks for the info.

I just bought one on Ebay for £10! The cheapest Zwave device I know of with equivalent functionality is the Greenwave Powernode at £15 each but you need to buy ten at once to get the unit price:

http://www.vesternet.com/z-wave-greenwave-1-port-powernode-10-pack

I’ve bought all my modules from Itead directly. https://www.itead.cc/sonoff-pow.html
With the wait time and VAT, £10 is a great price :wink:

For whoever might be interested in that…

Sonoff TH16 and POW Recall Notice

here is a production defect in a small minority of Sonoff TH16 and POW that were produced from Dec 2016 to Jan 2017

http://blog.iteadstudio.com/wp-content/uploads/2017/03/affected-sonoff-1.jpg

1 Like

ESP Easy - show must go on :wink:
We’ve got a successor: GitHub - letscontrolit/ESPEasy: Easy MultiSensor device based on ESP8266/ESP32
Just updated my NodeMCU - works great.

At the same time Arendst keeps doing a great job and I see that NodeMCU got support in Sonoff-Tasmota firmware. Lots of possibilities.

These sonoff things are great!
And I second using MQTT and Tasmota. It might indeed be yet another binding, yet another piece of software running on the server. I felt reluctant to add yet another part to my openhab patchwork but if it works as reliable as this: why not.

As posted elsewhere I have added my doorbell to openhab, using Tasmota firmware and mqqt binding , next stop: adding a sonoff to my garage door door opener (including open indication).