Shelly Binding

:+1:

To complete the device support:
Does anybody has a Shelly Smoke or the new Window/Door sensor?

I ordered several door/ window sensors but they havent been deliverd yet

:+1: let me know when you have them

To start with I need the output form /settings and /status

The next OH release is on the road: 2.5.1. Deadline for submitting changes is 12.1.2020
I created a new PR including all last changes: #6764

The DEV build has been updated to the latest code base (2.5.1 core + binding): https://github.com/markus7017/myfiles

My test buddy @igi did already some testing :slight_smile:. I highly appreciate more support on this during the next days. The DEV build is stable, but maybe we catch 1 or 2 more bugs. There will be no new features until 2.5.1 is released. If you requested a feature for this release I would expect doing some final testing.

Please make sure to remove the 2.5.0-SNAPSHOT before installing 2.5.1-SNAPSHOT. Installation works in the same way (see READMEbeta). Also check the updated README

No comments / results?

Sadly, this week I donā€™t really have time to test. Moreover the new shellys door/windows sensors were not delivered yet.

Same for me no Door Sensors yet

Hi,
in the past days I received my new Shelly RGBW2 Controllers to replace some other led controllers and so far they make a good impression in combination with the Shelly binding.

Though while adjusting the colors on the controllers I stumbled over a problem which I donā€™t know if it is related to the binding or the Shelly itself.
The following scenario sometimes happens if I change the parameters via OH(2.5-stable):

If I do small color changes to find the perfect color in a small period of time, the Shelly sometimes seems to be ā€˜overwhelmedā€™ by the requests it gets. Subsequently the shelly is not responsive for about 30 seconds to a minute and does a reboot after this unresponsive time.

The log for this time:

==> /openhab/userdata/logs/openhab.log <==
2020-01-10 19:44:44.389 [WARN ] [y.internal.handler.ShellyBaseHandler] - shellyrgbw2-xxxxxx ERROR: Unable to process command for channel shelly:shellyrgbw2-color:fenster:color#hsb: Shelly API call failed: Timeout (6000 ms) (class java.io.IOException)

Stack Trace: [org.openhab.binding.shelly.internal.api.ShellyHttpApi.request(ShellyHttpApi.java:492), org.openhab.binding.shelly.internal.api.ShellyHttpApi.setLightParms(ShellyHttpApi.java:259), org.openhab.binding.shelly.internal.handler.ShellyLightHandler.sendColors(ShellyLightHandler.java:483), org.openhab.binding.shelly.internal.handler.ShellyLightHandler.handleDeviceCommand(ShellyLightHandler.java:211), org.openhab.binding.shelly.internal.handler.ShellyBaseHandler.handleCommand(ShellyBaseHandler.java:287), sun.reflect.GeneratedMethodAccessor163.invoke(Unknown Source), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:498), org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152), org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59), com.sun.proxy.$Proxy2800.handleCommand(Unknown Source), org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:74), org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48), sun.reflect.GeneratedMethodAccessor231.invoke(Unknown Source), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:498), org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152), org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52), java.util.concurrent.FutureTask.run(FutureTask.java:266), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624), java.lang.Thread.run(Thread.java:748)]


==> /openhab/userdata/logs/events.log <==
2020-01-10 19:44:59.411 [hingStatusInfoChangedEvent] - 'shelly:shellyrgbw2-color:fenster' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Shelly API call failed: Timeout (6000 ms)

2020-01-10 19:46:09.066 [vent.ChannelTriggeredEvent] - shelly:shellyrgbw2-color:fenster:device#alarm triggered RESTARTED

2020-01-10 19:46:09.070 [hingStatusInfoChangedEvent] - 'shelly:shellyrgbw2-color:fenster' changed from OFFLINE (COMMUNICATION_ERROR): Shelly API call failed: java.util.concurrent.ExecutionException: java.net.NoRouteToHostException: No route to host, url=http://192.168.x.x/settings to ONLINE

Has anyone else also encountered this behavior?

Yes, we are in contact with the manufacturer to work on this issue. The DEV build (in my myfiles repo) includes 1 retry on a timeout. Check READMEbeta for installation instructions.

I have a PR pending to integrate the last updates into release 2.5.1, but so far is still in review state so Iā€™m not sure if those get into the next release.

Thatā€™s great to hear, I hope that the update will be included in v2.5.1.
In any case, many thanks for your efforts. :slightly_smiling_face:

Hi,

I have a similar behaviour with Shelly 2.5PM Controller. It worked for 1 or 2 days, then I got these timeout messages also. After factory reset I can control them via Shelly App, but adding the controller again as Thing with Shelly Binding always results in the following log message:

2020-01-12 14:23:03.895 [WARN ] [discovery.ShellyDiscoveryParticipant] - Device discovery failed for  device shellyswitch25-686dda, IP 192.168.192.47: Shelly API call failed: Timeout (6000 ms) (class java.io.IOException
[org.openhab.binding.shelly.internal.api.ShellyHttpApi.request(ShellyHttpApi.java:492),
org.openhab.binding.shelly.internal.api.ShellyHttpApi.getDeviceProfile(ShellyHttpApi.java:85),
org.openhab.binding.shelly.internal.discovery.ShellyDiscoveryParticipant.createResult(ShellyDiscoveryParticipant.java:133),
org.eclipse.smarthome.config.discovery.mdns.internal.MDNSDiscoveryService.scan(MDNSDiscoveryService.java:160),
org.eclipse.smarthome.config.discovery.mdns.internal.MDNSDiscoveryService.access$1(MDNSDiscoveryService.java:148),
org.eclipse.smarthome.config.discovery.mdns.internal.MDNSDiscoveryService$1.run(MDNSDiscoveryService.java:133), 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511),
java.util.concurrent.FutureTask.run(FutureTask.java:266),
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180),
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293), 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149),
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624), java.lang.Thread.run(Thread.java:748)]

Direct calls to the Controllerā€™s web interface ("/status" and ā€œ/settingsā€) are successful. Is this the same issue and will most likely be fixed in 2.5.1?

Thanks for any support,
Marc

please try the DEV build, I see only a few timeouts in my setup, but those are recovered by a retry

Hi,
thanks for your fast reply, I tried your 2.5.1 Snapshot build from 7 days ago. Behavious is different, but i get two timeout messages. Second message is:

2020-01-12 23:34:41.556 [WARN ] [discovery.ShellyDiscoveryParticipant] - Device discovery failed for device shellyswitch25-686dda, IP 192.168.192.47: Shelly API timeout, uri=/settings (class java.io.IOException)
[org.openhab.binding.shelly.internal.api.ShellyHttpApi.request(ShellyHttpApi.java:490), 
...

Any further ideas or did I take the wrong jar?

Thanks and best regards,
Marc

You should verify the wifi signal strength. if you get frequent timeout messages. Link the timeoutErrors, timoutsRecivered and signalStrength channels to check details

Thanks - wifi signal strength is good: ā€œ/statusā€ gives a RSSI-value of -62 (dBM), so very well. Response via http and browser, as well as Shelly App, is very quick (<<1s at least). I cannot link the channels, because the timeout occury while trying to add the Controller as Thing in PaperUI.

I have got 4 door sensors up. Showed up as unknown devices on the openhab inbox for a short time and disappeared again.

ok, please provide the output of
/settings
/status when window/door is open and closed

Hello, i tried the shelly binding with my flood sensor in the RAIN MODE. I have the same problem when using Mqtt. If the sensor detects water, it starts flashing the led, but no message will be send.
I think the device is useless in rain mode. Or does anybody have an idea?

additional information: If i wake up my flood manually (pressing the dip switch) an then put it into water, it sends a messageā€¦

Same here:

OH 2.5.1-2 no UI // fully config file based

https://hastebin.com/yeweforoba.css

Thing shelly:shellydimmer:F39D8F "Shelly Dimmer F39D8F" @ "Esstisch" [deviceIp="10.10.1.201", userId="", password=""]

Dimmer DimmerEsstisch "Esstisch" {channel="shelly:shellydimmer:F39D8F:relay#brightness"}

Switch item=DimmerEsstisch mappings=[100="AN",0="AUS",20="LOW"]

If i switch rapidly between the states i get this: Shelly API call failed: Timeout (6000 ms)

WiFi RSSI: -58 dBm or better (-55)