[RELEASE] Sonoff (Connect)

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!

2 Likes

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?

Hi Shaun...welcome to Hubitat. Are you trying to flash Sonoff POWs or Sonoff Basics? Are they able to connect to HE?

Hey @shaun, if you are trying to flash the Sonoff Basic with the firmware for the POW, then it will definitely cause problems. If you can't get to the firmware update web page, then you will probably have to flash over the rx / tx terminals.

Thanks Ryan, I'm keen to get started with Hubitat. The switches I am using are actually https://www.kogan.com/au/buy/kogan-smarterhome-smart-plug-energy-meter/ it works with the sonoff basic firmware but doesn't work with the power monitoring in Hubitat.

Hey @ericm it's actually based on the esp8266 but it looks like the POW firmware was incompatible and I will have to open it up to flash it. :frowning:

Well, it's not a sonoff so I don't know that the sonoff firmware would work with it.

1 Like

The Kogan is a Tuya based device. You could flash it with TyuaConvert to a basic Sonoff firmware and then try @ericm's firmware on top of that. But, be warned that it's a pain in the a$$.

This is why I HATE Tuya-based devices. You have to jump through multiple hoops just to flash their devices to something that doesn't report your data back to some Chinese server farm.

@corerootedxb, @Ryan780 I flashed it initially using TuyaConvert to a basic Sonoff firmware and then applied @ericm's firmware on top of that and that's where it seems to have bricked the plugs.

Ahhh, gotcha. sigh Any chance of getting real Sonoff plugs? :wink:

I've actually worked a little bit on a Hubitat / SmartThings driver for the Tasmota firmware. Since Tasmota is such a great project and has support for so many devices, I figured a driver would be the easier route (easier than trying to release support for every device). It works with all the devices I have tested so far (S31, S20, 4-Channel, Bridge, and more.). The drivers need to be written for other devices, but it isn't difficult to do.

3 Likes

I've just flashed a sonoff 4ch pro r2, when trying to connect to it its asking for a password, any idea's?

configme maybe?

1 Like

Thanks Roy, I did search.

1 Like