Shelly Binding

should be there, are you using the dev build?

fyi: fixed a problem with updating the input channels if the device has more than one (e.g. Shelly 2.5)

Just the standard one through PaperUI. I tried to install dev build before, but failed at the first hurdle
 “Run “bundle:list | grep Gson” on the openHAB console”
 I’m running openHAB on my synology NAS and not sure how to access the openHAV console.

I’ve found some instructions online now, so will give it a try and see how I get on! Thanks for building the binding - it’s really helped in my projects!

I’m also one the Shelly binding users which face a lot of API timeouts.
I just installed the newest test build from yesterday.
If there is anything I could help with my installation, please let me know.
I have around 15 Stelly 1, 2 and 2.5.

welcome, please check the stats* variables in the device properties, those count the timeouts and successful recoveries

Good news, the pending PR has been merged into the OH 2.5.2 code base and an official SNAPHOT build is available: JFrog

This build defiantly has the control#input channel for the RGBW2

Please try this build

  • disable mqtt and cloud on the device
  • disable http events in the thing config
  • enable CoIoT events in the thing config

This version still uses HttpUtil. I enhanced the timeout handling, but not sure if this provides a relevant improvement. In parallel I try to find a better solution with Alterco. Please check the statusTimeout* properties after running for a while.

Hello Markus,

great binding ! Thanks!

have got shelly RGBW2 in WHITE mode:

2020-02-04 22:49:35.477 [INFO ] [e.model.script.terraSSE dimmer links] - 30
2020-02-04 22:49:36.783 [INFO ] [e.model.script.terraSSE dimmer links] - 30
2020-02-04 22:49:37.735 [INFO ] [e.model.script.terraSSE dimmer links] - 20
2020-02-04 22:49:38.301 [INFO ] [e.model.script.terraSSE dimmer links] - 10
2020-02-04 22:49:52.755 [INFO ] [e.model.script.terraSSE dimmer links] - 0
2020-02-04 22:49:52.806 [WARN ] [y.internal.handler.ShellyBaseHandler] - shellyrgbw2-66260d ERROR: Unable to process command for channel shelly:shellyrgbw2-white:66260d:channel1#brightness: Shelly API call failed: Unexpected http response: Not Found, url=http://192.168.42.254/relay/0?turn=off (class java.io.IOException)
Stack Trace: [org.openhab.binding.shelly.internal.api.ShellyHttpApi.request(ShellyHttpApi.java:494), org.openhab.binding.shelly.internal.api.ShellyHttpApi.setRelayTurn(ShellyHttpApi.java:134), org.openhab.binding.shelly.internal.handler.ShellyLightHandler.handleDeviceCommand(ShellyLightHandler.java:155), org.openhab.binding.shelly.internal.handler.ShellyBaseHandler.handleCommand(ShellyBaseHandler.java:287), sun.reflect.GeneratedMethodAccessor780.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.$Proxy4565.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.GeneratedMethodAccessor779.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)]
2020-02-04 22:49:52.845 [WARN ] [y.internal.handler.ShellyBaseHandler] - shellyrgbw2-66260d ERROR: Unable to process command for channel shelly:shellyrgbw2-white:66260d:channel2#brightness: Shelly API call failed: Unexpected http response: Not Found, url=http://192.168.42.254/relay/1?turn=off (class java.io.IOException)
Stack Trace: [org.openhab.binding.shelly.internal.api.ShellyHttpApi.request(ShellyHttpApi.java:494), org.openhab.binding.shelly.internal.api.ShellyHttpApi.setRelayTurn(ShellyHttpApi.java:134), org.openhab.binding.shelly.internal.handler.ShellyLightHandler.handleDeviceCommand(ShellyLightHandler.java:155), org.openhab.binding.shelly.internal.handler.ShellyBaseHandler.handleCommand(ShellyBaseHandler.java:287), sun.reflect.GeneratedMethodAccessor780.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.$Proxy4569.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.GeneratedMethodAccessor779.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)]

i’m decreasing brightness for channel 0 and 1 by 10% each time (triggered by motion sensor)

going to “0” there is a exception 


/relay is not supported on RGBW2 dimmer IMHO

is this covered in newer shelly binding or OH 2.5.1 ?

This is a bug, please open an issue here: Issues · openhab/openhab-addons · GitHub
[shelly] Bug: Exception with RGBW2 when setting brightness to 0

done :slight_smile:

Thank you so much Markus!

welcome :slight_smile:

I hven’t fount time for that yet, but I updated all my Shelly1 today witht the new FW.
Since then, I see only timeouts for my Shelly2 which have no new Fw available yet.
If the new Fw resolves the timeout issue, it would be graet, not only for me I guess :wink:

Just another small isuue with the new Firmware:
shelly1-xxxxxx: WARNING: Firmware might be too old (or beta release), installed: v1.5.10/20200206-083100 (e6a4205e), required minimal v1.5.2. The binding was tested with version 1.50+ only. Older versions might work, but do not support all features or show technical issues. Please consider upgrading to v1.5.0 or newer!

sometimes the simple check is not enough :slight_smile:
Do others already have 1.5.10 and see improvements on timeouts?

I created a GitHub issue for this: https://github.com/openhab/openhab-addons/issues/6971

Priority: low :wink:

I updated yesterday but unfortunately the timeout issue is not resolved for Shelly1 - Shelly Dimmer looks good so far
I also updated Gson 2.5.2 and followed your instructions:

Update: I didn’t clear all action urls. Now Shelly1 is working again.

Shelly DOOR output as requested from @markus7017

output of \status for the door in OPEN state: {“wifi_sta”:{“connected”:true,“ssid”:“XXXXXXX”,“ip”:“192.168.1.135”,“rssi”:-59},“cloud”:{“enabled”:true,“connected”:true},“mqtt”:{“connected”:false},“time”:“12:24”,“serial”:4,“has_update”:false,“mac”:“XXXXXXXXX”,“is_valid”:true,“lux”:{“value”:30, “illumination”: “dark”, “is_valid”:true},“sensor”:{“state”:“open”, “is_valid”:true},“bat”:{“value”:100,“voltage”:6.38},“act_reasons”:[“button”],“update”:{“status”:“idle”,“has_update”:false,“new_version”:“20191216-090511/v1.5.7@c30657ba”,“old_version”:“20191216-090511/v1.5.7@c30657ba”},“ram_total”:50592,“ram_free”:39700,“fs_size”:233681,“fs_free”:162648,“uptime”:19}

Output when in closed state:

{“wifi_sta”:{“connected”:true,“ssid”:“XXXXXXXXX”,“ip”:“192.168.1.135”,“rssi”:-59},“cloud”:{“enabled”:true,“connected”:true},“mqtt”:{“connected”:false},“time”:“12:27”,“serial”:3,“has_update”:false,“mac”:“XXXXXXXX”,“is_valid”:true,“lux”:{“value”:5, “illumination”: “dark”, “is_valid”:true},“sensor”:{“state”:“close”, “is_valid”:true},“bat”:{“value”:100,“voltage”:6.38},“act_reasons”:[“button”],“update”:{“status”:“idle”,“has_update”:false,“new_version”:“20191216-090511/v1.5.7@c30657ba”,“old_version”:“20191216-090511/v1.5.7@c30657ba”},“ram_total”:50592,“ram_free”:40212,“fs_size”:233681,“fs_free”:162648,“uptime”:6}

And output of /settings

{“device”:{“type”:“SHDW-1”,“mac”:“XXXXXXXXX”,“hostname”:“shellydw-F3BXXX”,“sleep_mode”:true},“wifi_ap”:{“enabled”:false,“ssid”:“shellydw-F3XXX”,“key”:""},“wifi_sta”:{“enabled”:true,“ssid”:“XXXXXXXXX”,“ipv4_method”:“dhcp”,“ip”:null,“gw”:null,“mask”:null,“dns”:null},“wifi_sta1”:{“enabled”:false,“ssid”:null,“ipv4_method”:“dhcp”,“ip”:null,“gw”:null,“mask”:null,“dns”:null},“mqtt”: {“enable”:false,“server”:“192.168.33.3:1883”,“user”:"",“id”:“shellydw-F3B7F5”,“reconnect_timeout_max”:60.000000,“reconnect_timeout_min”:2.000000,“clean_session”:true,“keep_alive”:60,“max_qos”:0,“retain”:false,“update_period”:30},“sntp”: {“server”:“time.google.com”},“login”:{“enabled”:false,“unprotected”:false,“username”:“xxxxx”,“password”:“XXXXX”},“pin_code”:“xxxx”,“name”:"",“fw”:“20191216-090511/v1.5.7@c30657ba”,“build_info”:{“build_id”:“20191216-090511/v1.5.7@c30657ba”,“build_timestamp”:“2019-12-16T09:05:11Z”,“build_version”:“1.0”},“cloud”:{“enabled”:true,“connected”:true},“timezone”:“Europe/Amsterdam”,“lat”:XX.XXXXX,“lng”:X.XXXXX,“tzautodetect”:true,“time”:“12:29”,“dark_threshold”:100,“twilight_threshold”:300,“sleep_mode”:{“period”:6,“unit”:“h”},“led_status_disable”:true,“report_url”:"", “dark_url”:"", “twilight_url”:""}

All sensitive info replaced with XXXX.

:+1:

could you do a /status at daylight so I can see other encodings for “illumination”: “dark”

I created issue #6981

I did fake it a bit, the ILLUMINATION DEFINITIONS setting is adjustable. The first status was when i changed the “Set Dark” status below the current lux setting. The second status was when i changed the “Set dusk” below the current lux setting.

{“wifi_sta”:{“connected”:true,“ssid”:“xxxxxxx”,“ip”:“192.168.1.135”,“rssi”:-57},“cloud”:{“enabled”:true,“connected”:true},“mqtt”:{“connected”:false},“time”:“09:04”,“serial”:12,“has_update”:false,“mac”:“xxxxxxxx”,“is_valid”:true,“lux”:{“value”:76, “illumination”: “twilight”, “is_valid”:true},“sensor”:{“state”:“open”, “is_valid”:true},“bat”:{“value”:100,“voltage”:6.10},“act_reasons”:[“poweron”],“update”:{“status”:“idle”,“has_update”:false,“new_version”:“20191216-090511/v1.5.7@c30657ba”,“old_version”:“20191216-090511/v1.5.7@c30657ba”},“ram_total”:50592,“ram_free”:39548,“fs_size”:233681,“fs_free”:162648,“uptime”:97}

{“wifi_sta”:{“connected”:true,“ssid”:“xxxxxxxx”,“ip”:“192.168.1.135”,“rssi”:-60},“cloud”:{“enabled”:true,“connected”:true},“mqtt”:{“connected”:false},“time”:“09:05”,“serial”:21,“has_update”:false,“mac”:“xxxxxxxxx”,“is_valid”:true,“lux”:{“value”:76, “illumination”: “bright”, “is_valid”:true},“sensor”:{“state”:“open”, “is_valid”:true},“bat”:{“value”:100,“voltage”:6.10},“act_reasons”:[“poweron”,“sensor”],“update”:{“status”:“idle”,“has_update”:false,“new_version”:“20191216-090511/v1.5.7@c30657ba”,“old_version”:“20191216-090511/v1.5.7@c30657ba”},“ram_total”:50592,“ram_free”:39540,“fs_size”:233681,“fs_free”:162648,“uptime”:156}

ok, is that a “baseline of illumination” at the installation point or what do I configure here?

what is the twilight option?

Could you please include screenshots from the Web UI?