Shelly Binding

Yes, now we could start working on details. I also want to support the color picker (item type color) etc., but as @hmerkmentioned “Please keep in mind that the binding is in alpha state” :wink: Looking forward to more suggestions.

I just started yesterday: https://github.com/markus7017/org.openhab.binding.shelly/blob/alpha5/README.md

Please send a TRACE Log as PM. So far I didn’t tried the timers. Nevertheless I would expect that the relay supports the ison property, which indicates the switch state.

Please feel free to open an issue here: https://github.com/markus7017/org.openhab.binding.shelly/issues or send me a PM.
Please make sure to include the thing type, e.g. Shelly1, Shelly 2.5 relay mode, Shelly Plug-S etc.

I just opened the issue Shelly2 relay: Thing initialization failed: Error saving the configuration!
The binding was unable to set the event URLs, instead received an error message.

I could easily clear the situation by disabling the action urls in the settings and then restarting the binding, but if other users hit that problem I could add some kind of auto recovery (see issue description)

@furax54

I looked into that and will add support for auto on/off timers in alpha 6

Hello,

the binding works really well when you set it up with a Shelly 1, everything is found automatically.

Only if I put the relay output on the Paper UI and activate the switch and then reload the page, the switch is off again, but the Shelly is still active.

Can somebody help me with it?

EDIT:

I Have found it, it was only the refresh time

Thank you

fyi: I’m still working on alpha 6 to get RGBW2 in
However the current build is functional: release notes

This jar in this branch gets constantly updated until I release alpha6
Objective for beta1: A more or less consistent channel structure so that updates don’t require a complete re-install

It would be helpful if more people give it a try. @igi is doing an excellent job in testing, but feedback from others help to verfiy other environment and maybe you miss a feature, discover a bug etc.

alpha6 is done :grinning:

I’m still working on alpha 6 to get RGBW2 in . discovery works, channes should be there, not sure of the channel updates and commands already work.

Please do a complete re-install before you run this release (see README)

Focus for beta1:

  • A more or less consistent channel structure so that updates don’t require a complete re-install
  • Complete RGBW2 support
  • Support for Shelly Bulb if @MHerbst could help
  • Support for the Rollershutter item type
  • Complete documentation on all channels

It would be helpful if more people give it a try. @igi is doing an excellent job in testing, but feedback from others help to verfiy other environment and maybe you miss a feature, discover a bug etc.

3 Likes

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