Shelly Binding

Hi Markus,

first of all many thanks for the effort to develop this binding.
I’m quite new to the openHAB topic (so please be patient if I ask or say stupid things) and want to use openHAB 2.4 on a Synology NAS to automate my Shelly devices. Gave it a try today with the new binding connecting a Shelly 2.5, configured as rollershutter.

Good news: The binding installation went well & the Shelly was autodiscovered :slight_smile:

The initial configuration in the .item and .sitemap file took some time, though.
Quick Feedback:

  • The README file explains the “turn” channel of Shelly 2.5 in roller mode as “Switch”. The PaperUI defines it as “String”. Hence it needs to be defined as “String” in the .items file, not as “Switch”.
  • The “turn” channel has 3 state, not just 2 as described in the README. I used the following definition in my .sitemap and it works well:
    Switch item=shelly25_egr04_Turn label=“Rollo Wohnzimmer 4” mappings=[OFF=“Zu”, STOP=“stop”, ON=“Auf”]

Maybe you can specify this in the README and save some trouble for other users :slight_smile:

Again, thanks for all your work and I’ll test & investigate further as soon as I get my other Shelly devices!

All the best,
Uwe

I’ll wait for the first beta. I have 4 RGBW2’s 2 Shelly2.5’s as a rolling shutter and 6 Shelly 2.5’s as a relay with more to come.

thanks for the feedback

thanks for the input, README corrected. For a roller this is a string with the values open/stop/close
you should use OPEN and CLOSE, but ON and OFF also work

Please be aware that the channel structure might/will change with beta1 (mostly bulb, rgbw2, sense)
You can get access to the current build in the beta1 branch, but again, this branch will constantly change

you’ll be the perfect candidate to stress with beta 1 :slight_smile:
I’m working with @Igi to get RGBW2 running (basic features are working, but struggeling with the conversion of RGB values)

Do someone has a Smoke or Pro4 and support testing these devices?

In general I need

  • the json string from /settings
  • the json string from /status

to start implementing a new device.

A Wireshark while using the Web-UI would be perfect. Check for the HTTP GETs and send me the URLs on the various functions.

I can test your binding with 2 sheely 1 and 5 shelly 2 in Rollershutter mode. I made a post on FB in Shelly support group to inform other pepole.

sure, you can take the beta 1 snapshot. Not yet done, bust in fact just working the last days on the RGBW2/Bulb integration, the other parts are kind of stable / unchanged since days

I’ll get some new Shelly1, 2.5 and H&T hopefully in a couple of days directly from Bulgaria. Will test them as soon as I have installed them.

I’m also planning to order a 4pro short term. Happy to test that, too…

have fun :slight_smile:
make sure the HT is ON if you want to discover the device

I got my HT today, so I started integrating right away :slight_smile:

The Shelly was discovered nicely, so far so good. But when I defined the .items and .sitemap entries, no values for temperature, humidity or battery level show up.
In Shelly Cloud everything works fine. I have no clue what has gone wrong.

Here my .items definition:
Number shellyht_01_Temp “Shelly H+T 01 Temperatur” {channel=“shelly:shellyht:62b075f3:sensor#temperature”}
Number shellyht_01_Hum “Shelly H+T 01 Feuchtigkeit” {channel=“shelly:shellyht:62b075f3:sensor#humidity”}
Number shellyht_01_Bat “Shelly H+T 01 Batterielevel” {channel=“shelly:shellyht:62b075f3:battery#batteryLevel”}

and my .sitemap definition:
Default item=shellyht_01_Temp label=“Temperatur Shelly 01”
Default item=shellyht_01_Hum label=“Feuchtigkeit %”
Default item=shellyht_01_Bat label=“Batterielevel %”

I got no syntax errors or similar. The GUI works fine, just no values are displayed. It seems there are no values available.

To forced the HT out of sleep mode, I heated it up and cooled it down. The Shelly HT woke up and reported the temperature changes in the Shelly Cloud app, but nothing in openHAB

I did some investigation and found out, that the native web UI for my Shelly HT listed the following under “Actions”:

// Report as GET parameters to HTTP url:
// http://192.168.178.10:8080/shelly/event/shellyht-58f06d/sensordata

(The IP address is the address of my openHAB installation)

“shellyht-58f06d” was the initial name of the Thing in Autodiscovery. I changed the name of the Thing afterwards to “shellyht-02” to get a more human readable name.

Could that be causing the issue? Isn’t it allowed to change the Thing name after discovery?

Edit: Bingo! That WAS the issue. Corrected the Thing name back to the initial value and everthing works fine…
This is important to know!

Hi Uwe, thanks for the input.
yes, correct the URL you see points back to the OH system so the binding could receive the events. I use the hostname to be able to support multiple devices on the endpoint.
When changing the hostname you need to remove and re-discover the thing - could you please try that.
Maybe I could change that and build my own deviceid: shelly<last 6 dights of mac> so that the hostname doesn’t matter.

Could you please open an issue here: https://github.com/markus7017/org.openhab.binding.shelly/issues
so it stays on the list of things to be solved. First I want to get done with the color handling of the RGBW2 (drive me nuts:-)) and then I could look into requests.

Hi Markus,

sure, will document that in GitHub. I also have to admit that I got a little ahead of myself.
Truth is, I just got one single temp reading and afterwards - nothing. I wasn’t able to reproduce the issue nor to solve it today. Will go on trying tomorrow.

Hi Markus, Hi all,
yesterday I found your binding. very nice :wink:
I want to test the rgbw2. it already worked with mqtt (on/off).
So i deleted in paper ui - clean the json (do not find the rgbw2 ID) - clear the cache - reboot.
in the inbox I find the shelly ( shellyrgbw2-xxxxxB** (shelly:shellyrgbw2:xxxxxb) but when I want to apply (add as thing) I get an Error 409 - conflict.
Do anyone had a idea what to to?

in the log I found:
2019-08-01 08:31:16.476 [ERROR] [home.core.thing.binding.ThingFactory] - Thing factory (class org.openhab.binding.shelly.internal.ShellyHandlerFactory) returned null on create thing when it reports to support the thing type (shelly:shellyrgbw2).
2019-08-01 08:31:16.482 [WARN ] [g.discovery.internal.PersistentInbox] - Cannot create thing. No binding found that supports creating a thing of type shelly:shellyrgbw2.

regards und Grüße Stefan

Hi Stefan, welcome to the club :wink:

Please check the README, it lists the supported devices.
I currently work on the RGBW2 integration supported by @igi with testig.
The current status could be found in the beta1 branch on github, bis this build is not yet released.
It works in general, but there are things related to color & co, which prevent from using it. I think those will be solved over the weekend.

1 Like

beta1 is coming soon. would be nice if someone could do some additional testing before I close the release. What’s in?

  • Shelly 1, 1PM relays incl. power meter
  • Shelly 2, 2.5 in relay or roller mode incl. OH roller shutter control and positioning
  • RGBW2 in color and white mode incl. Color Picker - many many thanks to @igi
  • Shelly HT, Plug-S (Plug supposed to work too)
  • Shelly Bulb will be finalized soon
  • Shelly Sense in implementation, maybe I could include this in the final beta1 (@MHerbst ;-))
  • in roller mode the power meters are accumulated
  • various bug fixes, decimals for power etc.

Known issues so far:

  • test for RGBW2 white mode not completed
  • not sure if the Shelly 2 supports the last min 1/2/3 power even if it returns 0.0 values on /status
  • Bulb and Sense implementation is work in progress (80% done)

I’m still looking for someone with a Shelly Smoke and Plug (Plug-S already verified)
The new flood and 1EM will be supported when the API doc is updated, but I need someone with those devices. Same with Shelly Eye.

If you want to support a stable beta1 download the latest build from branch beta1-pre
https://github.com/markus7017/org.openhab.binding.shelly/blob/beta1-pre1/target/org.openhab.binding.shelly-2.4.0-SNAPSHOT.jar

1 Like

we finished implementation of RGBW2 in color and white mode and fixed some small issues around roller positioning. Now the last thing on the list is the handling of the LEDs for the Plug-S.

Bulb and Sense support will be included as is. I need @MHerbst for testing unless nobody else has those devices.

Still looking for contributors to do some testing before closing the release. So far it looks good, but confirmation from some other installations would be helpful.go community go :slight_smile:

@markus7017

I installed the binding against the 2.5.0 M1 test build.

First results;

Shelly 2.5 rolling shutter

  • Automatic discovery of switch and rolling shutters types (nice!)
  • Rolling shutter up/down/stop works without any problem.
  • Rolling shutter direct position entry works without any problem.
  • Values in Paper UI are updated when I control the rolling shutter from the official Shelly App.

Shelly 2.5 switch

  • Automatic discovery of switch and rolling shutters types (nice!)
  • Both switches on/off work without any problem.
  • Values position of switch and power in Paper UI are updated when I control the physical switch manually
  • Values position of switch and power in Paper UI are updated when I control the switch in the Shelly app

RGBW2

  • Automatic discovery works
  • I can’t control the RGBW2 at all. On/Off doesn’t work isn’t responsive. Power meter shows -NaN. I can’t control colours, brightness, saturation.
  • In paper UI the values are not updated when I change the RGBW2 through the Shelly App.

Is there any additional configuration in the shelly app or on the RGBW2 needed?

@janser1

You downloaded last beta1-pre1 version? What is your Bundle-Version if you look within the JAR in /META-INF/MANIFEST.MF?
What is your firmware version?
For me RGBW2 works as expected. Also the changes made from Web GUI are synchronised with OH within 60 seconds update cycle.

@igi

You downloaded last beta1-pre1 version?

yes

What is your Bundle-Version if you look within the JAR in /META-INF/MANIFEST.MF?

2.4.0.201907271416

What is your firmware version?

20190711-084448/v1.5.0-hotfix4@3b4f7414

I’m also running the RGBW2 through MQTT on a 2.4.0 instance as is described here. But I can’t imagine that that has any impact.