Shelly Binding

openhab> bundle:list | grep Shelly
208 │ Active │  80 │ 3.1.0.202102202342      │ openHAB Add-ons :: Bundles :: Shelly Binding

Installed the new one you linked in your authgraph,
-> no longer visible true paperui as a binding.
-> shelly’s do seem to get ‘discovered and are in the inbox’

but the motion is still listed as shelly:unknown

PaperUI is not part of OH3, I‘m confused
it seems that you have some mix

use bundle:list on the OH console and make sure that there is no other version installed, sometimes the uninstall has left-overs

maybe you need to do a clean-cache

you need

  • OH3 (3.0.1 or current SNAPSHOT)
  • Shelly binding not installed in the UI
  • Both Californium jars in the addon folder
  • Binding 3.1.0-SNAPSHOT jar in the addon folder
  • delete all Shelly things

If you use password protection make sure to set the credentials in the binding settings, delete all things and then re-discover

You have to see the Binding in the UI, start the discovery from there and it brings up all yout Shellys in the Inbox incl the Motion.

Yeah I didn’t mean paper UI just web UI.
I have oh 3.1 from openhabian. (3.1.0.M1 - Milestone Build could that be the issue?)
(cache has been cleaned too)

The binding isn’t listed in the web UI, but it does seem to work except for the motion sensor

UPDATE:
it’s working now i found an old shelly addon generated file in the OH setup deleted the file and rebooted.
now: the binding is not visible under settings -> bindings
BUT
you can go to settings -> things -> + sign -> select shelly

  • is manual
    it should work in discover mode

you may need to wake up the Motion. Try a device reboot. The motion disables mdns 3min after restart

discovery mode is working:
vibration also works
in your readme I saw that there was a channel sensors#motion
but in the channels I can’t find this one :slight_smile:

Check the updated build

1 Like

Did so:
openhab> bundle:list | grep Shelly
196 │ Active │ 80 │ 3.1.0.202102211348 │ openHAB Add-ons :: Bundles :: Shelly Binding

but the option sensors:motion is still unknown :slight_smile:

Hi @markus7017 ,
I installed 2 spots ( Shelly DUO GU10 ) and they do not work with the binding.
I assume they are on your radar? Haven’t found some comments using the search function.
It is detected without IP address - can be fixed manually - then it is recognized as shellyunknown and I can get the power measurements, but cannot control it.
I am running on the 3.0.1 stable version.
Thanks!
PhiL

Please update to DEv build

Latest DEV build: 2.5.13 - 3.1.0 - README - Installation - Bugs/Features - Firmware Index - Firmware Archive - API Doc
Note: The binding version included in the final OH 3.0 distro is significantly older than the DEV build. I can’t make it in-time. Make sure you deleted older versions of the binding when installing the 2.5.13-SNAPSHOT or 3.1.0-SNAPSHOT if you are already on OH 3.

ok, verified - Allterco changed to JSON layout for the motion indicator, fixed & verified

1 Like

Yep, I can confirm it’s working now,
thx for the effort, keep up the good work!

Hi @markus7017,

thanks for providing that binding.
Now I am facing another challenge with Shelly Motion. I put the motion sensor into a room with no motion - but openHAB still reports motion. But that’s not true. Even the Shelly App does not report any motion, but OH log shows:

2021-02-22 12:31:50.989 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyMotion244_LetzteBewegung' changed from 2021-02-22T12:16:49.000+0100 to 2021-02-22T12:31:50.000+0100
2021-02-22 12:46:52.715 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyMotion244_LetzteBewegung' changed from 2021-02-22T12:31:50.000+0100 to 2021-02-22T12:46:52.000+0100
2021-02-22 13:01:53.331 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyMotion244_LetzteBewegung' changed from 2021-02-22T12:46:52.000+0100 to 2021-02-22T13:01:53.000+0100
2021-02-22 13:16:53.952 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyMotion244_LetzteBewegung' changed from 2021-02-22T13:01:53.000+0100 to 2021-02-22T13:16:53.000+0100
2021-02-22 13:31:55.803 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyMotion244_LetzteBewegung' changed from 2021-02-22T13:16:53.000+0100 to 2021-02-22T13:31:55.000+0100

Because this status obviously change every 15 minute - I assume it polls the status of the Sensor?
But why does it report motion? Maybe I do have a wrong understanding?
Is there something mixed up with regards to “MotionTimestamp” and “last Update”? :slight_smile:


Hi,
using the latest snapshot binding to try to get rid of a minor problem I have with the binding but no success.

Platform: Windows
Version: openHAB 3.0.1
Binding version: 3.1.0-SNAPSHOT (the same problem with the 3.0.1 stable release version)
Hardware: Shelly2.5 Roller SHSW-25

Managed to get the snapshot to work after manual installation of the jar-file even after it was complaining about californium missing (this is only for other people searching for this error, it took me a while to find it):

Error executing command: Error executing command on bundles:
        Error starting bundle 268: Could not resolve module: org.openhab.binding.shelly [268]
  Unresolved requirement: Import-Package: org.eclipse.californium.core; version="[2.0.0,3.0.0)"

Solved by entering this in the console:
openhab> feature:install openhab-transport-coap

Confirm by:
openhab> bundle:list -s

Problem description
Everything works fine with the latest Shelly binding (and also the 3.0.1 stable version) with buttons, sensors, curtains and windows. The only small problem I have is that every fifteen seconds or so, Shelly (I guess) reports the state like this, over and over again:

14:15:20.423 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'Curtains' changed from 0.0 to 100.0
14:15:22.865 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'Curtains' changed from 100.0 to 0.0
14:15:35.438 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'Curtains' changed from 0.0 to 100.0
14:15:38.152 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'Curtains' changed from 100.0 to 0.0
14:16:01.225 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'Curtains' changed from 0.0 to 100.0
14:16:02.689 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'Curtains' changed from 100.0 to 0.0
....

So everything is working fine except the logging. Buttons respond correctly, window and curtains open/close correctly and show up in the openHAB interface and can be controlled from there.

My trials to solve it
I have tried to downgrade and upgrade the firmware of the Shelly switch but no change. I have deleted and added the things/items - no change. Note: I have two exactly the same switches used in the same manner (one for curtains and one for window).

Configured the same, the same (and also tested different) firmware. Absolutely no change.
The only thing that I can see as the difference is that the curtains (the problematic switch) has NOT been calibrated since it is actually not possible to do with a motor that uses so little current as my curtains do. So maybe the Shelly binding thinks (or tries to get) the state is “floating” and that is why it reports all the time. I have no idea.

This is not a big problem, just a bit annoying since the log fills up with unnecessary rows. I can of course reduce the logging of the Shelly binding but I thought I should report this, maybe it confuses someone else.

If there is anything information I can add to the above, please tell me.

PS: thanks for a very well working binding and also lots of kudos to all working on the openHAB3 release!

hmm, check the code, but looks ok

what does “bundle:list | grep Shelly” shows?
Please follow the How-To-Install and make sure you have the correct jars

This problem is known, but was fixed month ago.

Hi,
thanks for coming back to me.

I have tried to follow the install of jars very carefully according to the manual. And as I wrote, this is exactly the same with the released 3.0.1 version (stable). I am just showing you the result of my trials to upgrade to the absolutely latest version. But it is the same with the stable one.

I am on Windows so I am not fully aware of your command but is this what you are looking for?
bundle:list

258 │ Active │  80 │ 3.0.1                   │ openHAB Add-ons :: Bundles :: Network Binding
260 │ Active │  80 │ 1.0.0                   │ IO.Socket Engine Client
261 │ Active │  80 │ 1.0.0                   │ IO.Socket Socket Client
262 │ Active │  80 │ 20180813.0.0            │ JSON in Java
263 │ Active │  80 │ 3.8.1.1                 │ Apache ServiceMix :: Bundles :: okhttp
264 │ Active │  80 │ 1.13.0.1                │ Apache ServiceMix :: Bundles :: okio
265 │ Active │  80 │ 3.0.1                   │ openHAB Add-ons :: Bundles :: IO :: openHAB Cloud Connector
266 │ Active │  80 │ 3.0.1                   │ openHAB Add-ons :: Bundles :: Voice :: Google Cloud Text-to-Speech
268 │ Active │  80 │ 3.1.0.202102210341      │ openHAB Add-ons :: Bundles :: Shelly Binding
269 │ Active │  80 │ 2.0.0                   │ Californium (Cf) Core
270 │ Active │  80 │ 2.0.0                   │ Californium (Cf) Element Connector
271 │ Active │  80 │ 2.0.0                   │ Californium (Cf) OSGi
272 │ Active │  80 │ 2.0.0                   │ Scandium (Sc) Core

bundle:list -s

260 │ Active │  80 │ 1.0.0                   │ io.socket.engine.io-client
261 │ Active │  80 │ 1.0.0                   │ io.socket.socket.io-client
262 │ Active │  80 │ 20180813.0.0            │ json
263 │ Active │  80 │ 3.8.1.1                 │ org.apache.servicemix.bundles.okhttp
264 │ Active │  80 │ 1.13.0.1                │ org.apache.servicemix.bundles.okio
265 │ Active │  80 │ 3.0.1                   │ org.openhab.io.openhabcloud
266 │ Active │  80 │ 3.0.1                   │ org.openhab.voice.googletts
268 │ Active │  80 │ 3.1.0.202102210341      │ org.openhab.binding.shelly
269 │ Active │  80 │ 2.0.0                   │ org.eclipse.californium.core
270 │ Active │  80 │ 2.0.0                   │ org.eclipse.californium.element-connector
271 │ Active │  80 │ 2.0.0                   │ org.eclipse.californium.osgi
272 │ Active │  80 │ 2.0.0                   │ org.eclipse.californium.scandium

300% sure that the DEV build is different to the release version

Latest DEV build: 2.5.13 - 3.1.0 - README - Installation - Bugs/Features - Firmware Index - Firmware Archive - API Doc
Note: The binding version included in the final OH 3.0 distro is significantly older than the DEV build. I can’t make it in-time. Make sure you deleted older versions of the binding when installing the 2.5.13-SNAPSHOT or 3.1.0-SNAPSHOT if you are already on OH 3.

It’s time to make you aware of an significant new feature of the Shelly Binding: Shelly Manager

Development of this integrated feature was driven by

  • it’s hard to get an overview on all your devices and check if they are working fine
  • the hazel dealing with firmware updates (esp. when finding older ones)
  • the demand of separating the device from the Internet for improved security

Core features

  • Allows to see device insights not available has regular channels (settings + status)
  • Provides statistics to verify WiFi and device stability (timeouts, restarts, device alarms)
  • integrated device actions like reboot, factory reset, set login credentials…
  • Integrated firmware upgrade to latest prod/beta version and from firmware archive
  • Integrated download proxy to detach device from Internet (improve device security)

overview_devsettings overview_devstatus

overview_actions

Versions from the Allterco repository and also http://archive.shelly-tools.de
overview_versions

Those could be installed

  • in regular mode (device downloads the image from the Internet)
  • using the openHAB host as download proxy (device doesn’t require Internet connection)
  • using a custom URL (e.g. a local web server)

This allows to separate the device from the Internet. You could also set a local time server (sntp). However, when you are using the Cloud feature of course is requires an Internet connection. The firmware download is transparent, so the device gets 1:1 the image from the remote server, the binding is just redirecting the URLs and requests the device to start the download (same as the Shelly App and Web UI do).

More primarily information could be found here

The current status is almost stable. @igi supported on testing during the last weeks. This feature will be part of the next PR, but is already available for the 2.5.13 and 3.1 DEV builds. I’ll add some more info to the README outlining how the statistics helps you to identify instable WiFi connectivity.

You get access to the Shelly Manager by opening http://:8080/shelly/manager in the browser (you could also use https to access the manager, but the firmware download in proxy mode will fail, because the device doesn’t support https).

Have fun, feedback welcome.


Latest DEV build: 2.5.13 - 3.1.0 - README - Installation - Bugs/Features - Firmware Index - Firmware Archive - API Doc
Note: The binding version included in the final OH 3.0 distro is significantly older than the DEV build. I can’t make it in-time. Make sure you deleted older versions of the binding when installing the 2.5.13-SNAPSHOT or 3.1.0-SNAPSHOT if you are already on OH 3.

3 Likes

Hi Markus,
I honestly don’t know what to do with your information. I uninstalled the 3.0.1 binding that came with the released stable version, checked so it was gone with bundle:list, restarted, downloaded the snapshot addons for 3.1.0 from here:

Inside that package I found the Shelly binding and manually installed that according to the documentation.
This is the file inside the addon package:

I checked that the new version was installed and indeed it was:

I am obviously doing something wrong but I don’t know what to do with your comment. I am sure you are sure it is different from the release version - but what version is it that I am downloading and installing from the openHAB homepage if it is not the snapshot version? Or is the version you are talking about different from the snapshot addon on the homepage?

I am sorry but I am a bit lost and don’t know how to give you more information or do something else from what I have done.

UPDATE
Redid the whole procedure, found your links in your footer (Read Me - installation) and did exactly as it stated there. Also downloaded the californium-core and element-connector from that page. Uninstalled them first and then put them in the addons folder as described (I had manually installed them before so this was a new variant to put them into the folder, just to follow your instructions very carefully).

Added the things again, linked them to items.

This is after update:

Seems correct to me. But sorry to say, the repeating of events goes on:

13:41:03.422 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'Curtains' changed from 0.0 to 100.0
13:41:03.846 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'Curtains' changed from 100.0 to 0.0
13:41:18.424 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'Curtains' changed from 0.0 to 100.0
13:41:19.149 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'Curtains' changed from 100.0 to 0.0

In general: OH 3.x release != 3.x SNAPSHOT != 3.1 DEV build

The 3.x-SNAPSHOT is based on the “official code base”. The code gets updated through a PR process, usual outcome are changes requested by review.

The DEV build is based on my latest code base. From time to time I create a new PR, run that process, but continue with development in parallel. So the DEV build is ahead of the official SNAPSHOT release and far ahead of the release version.


Could you please enable the DEBUG trace on the OH console “log:set DEBUG org.openhab.binding.shelly” This provides the output I need to check the code. Post log extract here or send me a PM.