[RELEASE] Sonoff (Connect)

Just wanted to share that I was also having problems with the "no matching device found for ..." message for 3 of my 7 Sonoffs. I deleted all my devices and tried to rediscover them (found 5 of 7, and installed 2 manually). I got the same warning messages with the manual ones, so I deleted them and continued to find them with discovery. After about 20 minutes, the app found the 2 and I was able to use them without any warning messages. One of the 5 initially discovered Sonoffs had issues with a null MAC address which generated errors, so I deleted it and rediscovered it multiple times before a MAC address was showing on the device characteristics. As of today, I have all 7 Sonoffs (5 basic, 1 TH, and 1 POW all running on Eric's firmwares) working ok. One thing I did do for all devices was to reboot them (via their web interface) just prior to app discovery. Hope this helps others out there with similar issues.

@ericm any chance you have an update to the Sonoff TH? I've flashed your firmare and I get nothing. If I flash the Releases · arendst/Sonoff-Tasmota · GitHub sonoff.bin I get wifi access and can controll through the web interface.

@ericm Update for everyone if you're having trouble directly flashing the eric's firmware. I was able to OTA flash his firmware over the Sonoff-Tasmota sonoff.bin and it now works. Eric, Thank you for all your work on this project!

Hey @damon.dinsmore, I think the problem is that Sonoff (and other manufacturers) have changed how the SPI communicates in the esp8266 from QIO to DOUT. My firmwares have been compiled using QIO, but flashing applications such as NodeMCU flasher can change it on the fly during the flashing process. The NodeMCU flasher can be found here:

@ericm Thank you for that information. I will be ordering more of these soon and will give it a try.

Could someone please add Sonoff to this list.

I've added them under LAN devices.

Would your app work for over the air flashing of the Sonoff Touch? I can't post links but search github mirko SonOTA

It should if you replace the image_arduino.bin file with one of my bin files. Having said that, it looks like newer Sonoff devices don't support this method though:

"ATTENTION: It appears SonOTA does not work with devices running current firmware"

1 Like

Do these drivers work for these 1, 2 or 3 gang switches?

I'm actually not sure. The original Sonoff Touch works, but I haven't tested these new devices. I thought I remember hearing someone installing the 4ch firmware on the 3 gang device and it working, but can't say for sure.

Tried to use for a new sonoff basic. Evidently the new ones are based on the ESP8285 Chip instead of the 8266. Tried to flash your firmware and tried to recompile....both didn't work. What version of the esp library do i need to build the software in the arduino ide? Or could you recompile for ESP8285? Spent 4 hours today trying to get this to work.

You can flash the 8285 if you use the instructions in the post above:

I am using the SmartLife RGBW Controller for my deck lights which has been working great until yesterday. I can access them via their IP's and the SmartLife RGBW app sees them but I can't turn them on. Nothing happens when I try to turn them on. And my Rules aren't working for them either. Now I did to an HE update yesterday to 2.0.7.112. There does seem to be an error in the logs:

2019-03-20 09:07:38.190 pm warnstartup failed:

General error during canonicalization: Expression [DeclarationExpression] is not allowed: (c = s.charAt(i)) at line number: 781

java.lang.SecurityException: Expression [DeclarationExpression] is not allowed: (c = s.charAt(i)) at line number: 781
at sun.reflect.GeneratedConstructorAccessor3623.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
at com.hubitat.hub.executor.SecureASTCustomizerHub$SecuringCodeVisitor.assertExpressionAuthorized(SecureASTCustomizerHub.groovy:641)
at sun.reflect.GeneratedMethodAccessor18568.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
at com.hubitat.hub.executor.SecureASTCustomizerHub$SecuringCodeVisitor.visitDeclarationExpression(SecureASTCustomizerHub.groovy:976)
at org.codehaus.groovy.ast.expr.DeclarationExpression.visit(DeclarationExpression.java:89)
at org.codehaus.groovy.ast.expr.DeclarationExpression$visit.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.ast.expr.MethodCallExpression$visit.call(Unknown Source)
at com.hubitat.hub.executor.SecureASTCustomizerHub$SecuringCodeVisitor.visitExpressionStatement(SecureASTCustomizerHub.groovy:728)
at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
at org.codehaus.groovy.ast.stmt.ExpressionStatement$visit.call(Unknown Source)
at com.hubitat.hub.executor.SecureASTCustomizerHub$SecuringCodeVisitor.visitBlockStatement(SecureASTCustomizerHub.groovy:688)
at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
at org.codehaus.groovy.ast.stmt.BlockStatement$visit.call(Unknown Source)
at com.hubitat.hub.executor.SecureASTCustomizerHub$SecuringCodeVisitor.visitForLoop(SecureASTCustomizerHub.groovy:696)
at org.codehaus.groovy.ast.stmt.ForStatement.visit(ForStatement.java:49)
at org.codehaus.groovy.ast.stmt.ForStatement$visit.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.ast.stmt.ExpressionStatement$visit.call(Unknown Source)
at com.hubitat.hub.executor.SecureASTCustomizerHub$SecuringCodeVisitor.visitBlockStatement(SecureASTCustomizerHub.groovy:688)
at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
at org.codehaus.groovy.ast.stmt.BlockStatement$visit.call(Unknown Source)
at com.hubitat.hub.executor.SecureASTCustomizerHub.call(SecureASTCustomizerHub.groovy:518)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
at groovy.lang.GroovyClassLoader$parseClass.call(Unknown Source)
at com.hubitat.hub.executor.ExecutorHelper.parseDevClass(ExecutorHelper.groovy:274)
at sun.reflect.GeneratedMethodAccessor647.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
at com.hubitat.hub.executor.ExecutorHelper.loadDriverClass(ExecutorHelper.groovy:322)
at com.hubitat.hub.executor.ExecutorHelper.getCachedDeviceClass(ExecutorHelper.groovy:302)
at sun.reflect.GeneratedMethodAccessor495.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
at com.hubitat.hub.executor.ExecutorHelper.getDeviceExecutorScript(ExecutorHelper.groovy:235)
at com.hubitat.hub.executor.ExecutorHelper$getDeviceExecutorScript$7.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at com.hubitat.hub.route.DeviceRoute.getDeviceUpdater(DeviceRoute.groovy:683)
at sun.reflect.GeneratedMethodAccessor2047.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
at com.hubitat.hub.route.DeviceRoute.getDeviceSettings(DeviceRoute.groovy:692)
at sun.reflect.GeneratedMethodAccessor2046.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
at com.hubitat.hub.route.DeviceRoute.buildModelForDeviceEdit(DeviceRoute.groovy:428)
at sun.reflect.GeneratedMethodAccessor2044.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
at com.hubitat.hub.route.DeviceRoute$_configureDevicePages_closure7.doCall(DeviceRoute.groovy:220)
at sun.reflect.GeneratedMethodAccessor2043.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027)
at groovy.lang.Closure.call(Closure.java:414)
at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:54)
at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:124)
at com.sun.proxy.$Proxy25.handle(Unknown Source)
at spark.RouteImpl$1.handle(RouteImpl.java:72)
at spark.http.matching.Routes.execute(Routes.java:61)
at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:130)
at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1568)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:61)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:564)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:673)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:591)
at java.lang.Thread.run(Thread.java:748)

Any idea what the problem could be?

I found that you had done an update in the github. Thanks! It is working again!

1 Like

Can you point me in the right direction to get Sonoff Basic working? I have been searching with no sucess

Did you check the very first post at the top?

I've got your app and firmware installed, its awesome! Next is iFan2. Could you do the community a solid and setup your github to work with App Watchdog? One thing i noticed right away that Hubitat was lacking is a way to identify when an app is updated. [RELEASE] App Watchdog

There hasn't been any new versions of this app in a long time and I don't believe there is any new development work going on. This is just to connect the Sonoff devices.

I tried using the Sonoff POW firmware instead of the basic as it has the power monitoring features which don't appear to be in the Sonoff Basic firmware. Although the initial flashing seemed to go okay; as soon as I enter my ssid and passphrase and allow the config to save and do a restart, it seems to be bricked. I can see the device connected to the network and I can ping it, however if I try and connect to it, it refuses to connect. I've tried this with two plugs and it now appears both are bricked. The only way I can get back to the basic config screen is by forcing it off my network by restarting my router which then refers to it as "sonoff:macaddress" ssid which I can then connect to, but it's limited to device info and re-entering ssid and passphrase config.

Any suggestions on how I can fix this issue without having to break them open?