Shelly Binding

I did openhab-cli clean-cache and noticed the following:

  • Google Gson 2.8.2 (which I installed) changed back to 2.7.0
  • Gson 2.8.5 is removed.

After reinstallation of Gson 2.8.5 I get the following message with bundle:diag:
Gson (252)
Status: Installed
Unsatisfied Requirements:
Declarative Services

As it looks like there is a problem with the installation of Gson 2.8.5. Perhaps because there is already a Google version installed.

could you remove 2.8.5 and try
only with 2.8.2 or even 2.7?

This means switching back to the original status.
I did

  • feature:install esh-io-transport-mdns
  • log:set TRACE org.openhab.binding.shelly
  • copied the jar file
    but could not notice anything in the openhab.log

is GSon 2.8.2 showing Active in bundle:list and 2.8.5 removed, run a openhab-cli clean-cache to make sure nothing is cached

I run openhab-cli clean-cache already many times.
Currently I have this Gson version:
21 │ Active │ 80 │ 2.7.0.v20170129-0911 │ Gson: Google Json Library for Java
I cannot find anything regarding shelly in the openhab.log.

I still have this issue…

Do you have the ability to just setup a plain 2.4:

  • download the distro package from
  • unpack to a folder, start OH
  • set debug level for org.openhab.binding.shelly to TRACE
  • check bundle:list if Gson is already there, if not install GSon 2.8.2
  • copy the shelly jar to the addon folder
  • check the log

no feature install etc. - so we have a clean environment, this came up on my system without any issues.

I just checked with my Windows Computer a fresh install. Installation comes with GSon .2.7. Out of the box it did not work.
The day after tomorrow I can try it also with TRACE log option and with Gson 2.8

@markus7017 as you described, I reinstalled the openhab 2.4 M2 version, clean install and didn’t work… with Gson 2.8.2 nothing happened when I copy the jar file to the addon folder…

puh, I’m running out of ideas.
My test was: 2.4 on macOS, unzip to a folder, copy the jar and run ./ - done.
However, I can’t guarantee that it didn’t found a module “somewhere else”, because the system is my Dev environment.

RollerShutter item type is implemented in beta1 ?

i have the rgbw2 installed on openhabian 2.4 and get this error :

2019-09-05 16:28:19.697 [hingStatusInfoChangedEvent] - ‘shelly:shellyrgbw2-white:661ee1’ changed from OFFLINE (COMMUNICATION_ERROR): Shelly API call failed on url=, response=ERROR: java.util.concurrent.TimeoutException: Total timeout 2500 ms elapsed - class to OFFLINE (COMMUNICATION_ERROR): Shelly API call failed on url=, response=ERROR: java.util.concurrent.TimeoutException: Total timeout 2500 ms elapsed - class

and then

2019-09-05 16:42:47.124 [INFO ] [helly.internal.handler.ShellyHandler] - Status update triggered thing initialization for device shellyrgbw2-661EE1
2019-09-05 16:42:47.126 [INFO ] [helly.internal.handler.ShellyHandler] - Start initializing thing shellyrgbw2-661EE1, ip address
2019-09-05 16:42:49.231 [INFO ] [helly.internal.handler.ShellyHandler] - Initializing device shellyrgbw2-661ee1, type SHRGBW2, Hardware: Rev: prod-190410b, batch 1; Firmware: v1.5.2 / 20190821-095258 (4148d2b7); Thing Type=shellyrgbw2-white
2019-09-05 16:42:49.339 [INFO ] [helly.internal.handler.ShellyHandler] - Thing shellyrgbw2-661EE1 successfully initialized.
==> /var/log/openhab2/events.log <==
2019-09-05 16:42:49.342 [me.event.ThingUpdatedEvent] - Thing ‘shelly:shellyrgbw2-white:661ee1’ has been updated.

It’s triggered by a rule

rule "Test"
		Item smaenergymeter_energymeter_1900055144_powerOut changed 
		var Number bright = smaenergymeter_energymeter_1900055144_powerOut.state as Number
		bright = (bright / 5000) * 100

    		sendCommand(shelly_shellyrgbw2_white_661ee1_channel4_brightness, bright.intValue) // value between 0..100 needed

? I already release a stable 2.4.1 (master branch)
and yes roller shutter works fine

what is the question?

In general the binding tries to initialize all things on startup. If this fails the thing stays in state INITIALIZING. The following conditions trigger a new initialization

  • every minute the status is checked and reinit is performed for OFFLINE devices
  • every sendCommand() triggers the initialization if the thing is OFFLINE
  • an incoming event triggers initialization
    on the next status update a new /settings and /status is performend.

As far as I could see the re-initialization is successful.

And yes I see those timeouts from time to time. Together with @igi we could verify that they are not related to the binding. Under certain conditions the device doesn’t response for 5-15sec. All http requests in that time window will not be responded. Without intervention the device comes back and processes further requests.
2 situations are identified and reproducible so far:

  • Shelly 1: the device doesn’t response to http requests when
    an auto timer for ON/OFF is configured
    the action urls are set and
    the relay output is set to IN ON via the API
    then the device stops responding to http requests for 5-15s
  • Shelly 2.5: scenario like the one before
    when pressing both buttons events gets issues,
    but device stops responding to http requests for 5-15sec

Nevertheless I have seen this behavior from time to time in other situations. I started to collect feedback to Shelly and will try to create some awareness to fix those issues and improve the API documentation - let’s see… Feel free to report other problems, which I could include in the report.

Could someone also confirm this problem:

  • Shelly1: After updating to FW 20190711-084053/v1.5.0-hotfix4@3b4f7414
    the API returns “update”:{“status”:“unknown”,“has_update”:false,“new_version”:"",“old_version”:“20190711-084053/v1.5.0-hotfix4@3b4f7414”}
    (worked fine with previous fw versions)

Thank you for feedback, so everything works as expected.

Kindest regards

let’s say: the binding is able to deal with the issue. In fact that’s a firmware bug.

On my fresh Windows OH installation I installed Gson 2.8.2 and activated it.Set the log to TRACE. Then I copied the latest shelly.jar file into the addons folder. I searched afterwards in the openhab.log file for “shelly” but could not find anything.Any idea what to do?

I created a post in the forum, maybe some other developer could help

are you also using Windows?
I have macOS and RPi, but @hmerk also saw that on Ubuntu

not on windows. RPi and Mac