[RELEASE] Sonoff (Connect)

@ericm

I know you haven't asked for any testers but I have been testing out your SmartLife RGBw code as it updates. The latest is now working with Scenes where color is being captured now. SO excited about this!

1 Like

Eric, I've not had any experience with Sonoff. Do I need to flash all devices to use your Device Code (and by flash, do you mean to the tasmota firmware)?

Also, have you released it for the S26? It's a little smaller than the S20.

If you want to use Eric’s drivers, I believe you’ll need to flash the Sonoff devices with Eric’s firmware for them. There is another user who wrote a Hubitat Driver for the Tasmota firmware. Just search the forum for it.

WaHoo, Just bought a hubitat yesterday, that was before I came in here and saw all the amazing devlopers invloved here -Now I know I made the right decision !

Hey Eric- quick question the enerwave ZB333 zigbee plug never worked right on ST-do you have any idea if it'll be better on Hubitat- I believe you wrote the handler for ST for this device.

sorry for off topic post :frowning:

Oh man, I don't remember making that handler LOL. I did do a few things for Enerwave. I'm not sure if it would work well on Hubitat. Probably better than on SmartThings, but you'd have to try it out.

@mike I believe Tasmota firmware supports OTA firmware updates so once you do the initial flash it is very simple to flash back and forth between firmware. So you can test to see which works best for you.

Just a side note...don't leave Sonoff connect app installed if you don't have any devices connected yet. I'm in the process of porting over and moved one just to test how it works and to my delight it was a snap. But then I moved the one device back to ST. So there were no Sonoff devices connected to HE. Every five minutes since then I have been getting 2 ssdpTerm hub events. In the last 2 days I have over 1,800 of them!!! Well, a couple quick pokes and i found that it was Sonoff Connect. I'm sure it doesn't do that if you actually have devices installed with it. Just wanted to give a heads up since I see people saying that these might be causing lockups. Too much preparing isn't always a good thing I guess. Either that or the universe is telling me to jut get everything over to HE already!
And btw...thanks Eric! Was relieved when I saw you'd ported these over to HE. :smiley:

UPDATE: Added sonoff connect back along with 4 sonoff switches and started getting the hub events again tonight. Will removing the app remove all my devices as well? Are these hub events okay?

The Sonoffs (and other SSDP devices like the Hue bridge) send out SSDP packets for discovery purposes. I believe the Sonoffs send one every 5 minutes. This traffic is so minimal I don't see how it could cause a problem. If it did, the Hue bridge would be at fault as well.

Hey, I'm just checking. I saw another post about these packets and it looked weird so I thought I'd check. Thanks!

So, what if any downside is there to the Sonoff devices? Prices are very attractive. I'd be interested in the wall switches and smart plugs.

The Sonoff devices are all based on the ESP8266 microcontroller. As a consequence, they all use Wi-Fi for communications, instead of Zigbee or Z-Wave. Not sure if this is a 'Pro' or a 'Con', as that is somewhat subjective.

I can tell you that you will receive great support for Zigbee and Z-Wave devices from the Hubitat Team. For these Sonoff WiFi devices, you will be more dependent on the community members for support. I'm not saying the Hubitat team won't help... But since these are not natively supported, I'm not sure how much assistance they will be able to provide.

Another consideration is whether or not these inexpensive devices are really up to the safety and reliability standards required to achieve UL ratings. I would personally not want to rely on these devices for switching 110/220 loads in my house. For low voltage applications, maybe.

There are a lot of low priced Zigbee and Z-Wave devices that are fully supported for wall-switch and outlet applications. I personally believe these are the safer, more well supported devices.

4 Likes

I am trying to implement this for the H801's that I have setup in ST. I have updated to the latest firmware but I am having a hard time understanding which driver code I use. I tried to copy and paste the one here https://github.com/erocm123/SmartThingsPublic/blob/master/devicetypes/erocm123/sonoff-wifi-switch.src/Sonoff.ino but it is giving me an error "expecting '!', found 'i' @ line 1, column 2. " I am really new to Hubitat so I am trying to learn and setup my devices from ST. From what I understand, I would need to install the device driver and then the App, right?

Eric's driver and apps will ONLY work if you flash your Sonoff device(s) with his firmware.

I have many first-release / early Sonoff devices (the simple on / off switches) and can confirm they, and Eric's Code / Drivers / Firmware work flawlessly. I use them exclusively on 2 wire plug-in devices.

Some of the Sonoff devices were real bears to flash, and took many, many tries, but in the event I succeeded. I also had to use (if memory serves me correct) 3 different flashing tools to do so. If 1 didn't work on 1 device, try the next tool until it worked. And to that, there is no rhyme or reason (perhaps different underlying build dates / micro code on the devices?)

Thanks
J

I did flash them with Eric's firmware. I updated them just this morning and they are working fine. So i copied and pasted this device driver sonoff-wifi-switch.groovy and then I added this app sonoff-connect.src. I am trying to discover the devices now using the Sonos connect app but nothing is being found.

Can you connect to the devices directly via web browser? If so, it means the firmware is good. It sometimes takes a looooong time for the Sonoff devices to be discovered.

Also, if you still have your (or if you even have one) ST white box up & running, see if they are discoverable in ST; being Wi-Fi you can control them from both devices simultaneously.

J

Yes I can connect to them with my browser and I can still see them in ST. Have I put the right codes into the right places in Hubitat? Do I have everything in? I notice the there are 3 things in eric's github hubitat. There is device-monitor.src, smartlife-rgbw-light-connect.src, and sonoff-connect.src. But I have only put in the sonoff-connect.src code into the apps section.

Can confirm I use:
App
name: "Sonoff (Connect)",
namespace: "erocm123",
Date: 2016-06-02

&

Driver
Sonoff Wifi Switch
definition (name: "Sonoff Wifi Switch", namespace: "erocm123", author: "Eric Maycock") {
Date: 2016-06-02

Thanks
J

Did you add the other things in the github?

Nope, just 1 app & 1 driver; as mentioned, I only have the simple Sonoff (Basic) switches.