Shelly Binding

I’m using the binding with OH3 without any problem. I have 2 shelly1 with the latest firmware configured in detached mode to control some philips hue bulbs. When the relay#input channel goes ON I swith the bulbs ono or off. Now I would like to use the long press to change the dimmer but it seems that I’m not receiving the event. I tried with the trigger with no luck. Any suggestion?

I’m not sure what you mean with “I tried with the trigger” here.
Obviously you need a rule. What are you using, the rule DSL or Javascript/blockly?

@morci exactly. I used the trigger in a rule but it seems that the trigger is never started. I’m using DSL rules.

@Rickytr The suggestion I have for you if to monitor the logs and see if the various SHORT_PRESS, LONG_PRESS events show up. When they do, you can also easily infer the channel name. Also: in the rule you have to monitor the #button channels, not the #input ones.

@morci I know that the trigger is the #button channel, I’m using the #input (the switch channel) to change an item. I tried to TRACE the logs but I cannot see any event related to the trigger…

@Rickytr I just would like to know if button press events are new reported using CoIoT or the old “action” mechanism is still in place.
In my setup I have relays in which the binding set the action so that the Shellys call oH’s REST API to notify button presses and relays in which no action is set.
What about your Shellys, do they have the " I/O URL actions" set to something like http://myopenhab/shelly/event/shellyswitchXXXX/relay/0?type=shortpush ?

@morci I’m using only ColoT right now without any URL action defined.

@Rickytr Well, I have relays for which “Enable Push Events” is turned off that still have action URLs set and report events to oH. I tried turning that on or off but nothing changes ever. The action URL are only set at inclusion time and it seems there is no way to change them after that (whether you enable or disable CoIoT).
I never received a CoIoT event related to push events (or, at least, nothing is logged) and I’m only able to receive notifications for the Shellys with actions URLs correctly set. The other are simply gone, no way to receive notifications from them in any form even after changing the settings multiple times (the only thing that works is setting the action URL by hand).

My problem with all this stuff is that there is near-to-none documentation available.
CoAP is defined in RFC 7252. Where is CoIoT ever formalized? No idea.
To my understanding CoIoT is NOT used to report events, it is only used for status updates in place of periodic polling (but then, even after enabling CoIoT support I see from the logs that the Shellys are periodically polled!).
So, to have button press correctly reported, you still need action URLs.
If the binding does not set them (and there are obviously issues with that) you will never get the corresponding events.
I would like to have someone confirming that.

@Rickytr I see you are using oH3, in my case I’m still using oH2.5 and with paperUI the setting to enable/disable press events are in the “show more” section of the thing property. Probably you have something similar, have you checked these are turned on?

While I can’t get my Version 3.1.0 Snapshot back working :frowning: because of issue with Binding installation/de-installlation, I have to set up a new Instance of openHAB. Issue starts with de-install of Shelly Binding, which was not possible neither MainUI nor Karaf. I tried to uninstall another Binding, choosen NTP, which was successful and I was able to uninstall Shelly afterwards. But: I can’t get NTP back installed. Weid!!

Lucky me I’m on 100% File based Configuration, so installed 3.1.0.M1 this Morning with required Bindings (left Shelly off) and all ist up and working. Just liked to install Shelly, copied to add-on folder but got an Error

19:39:32.247 [WARN ] [org.apache.felix.fileinstall         ] - Error while starting bundle: file:/C:/openHAB/addons/org.openhab.binding.shelly-3.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.shelly [272]
  Unresolved requirement: Import-Package: org.eclipse.californium.core; version="[2.0.0,3.0.0)"

        at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [bundleFile:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4]

Installation of californium was just required for OH2 :-/ And no Version for OH3 with in links?

Regards
Joerg

Read the How-To, that’s what it’s made for

Yes, so did I but looks like I was to simple minded and mixed versions up. Thanks for swift and helpful reply, Dev binding brought no warn or errors and shelly things are now onlline. I will watching them now, if there is different behavior.

I’m having issues with the binding not setting the actions URLs in a Shelly ix3 after removal and re-inclusion (yes, I tried all the combinations of CoIoT enabled/disabled in the binding and for the specific item, no success).
While trying to solve this problem I’d like to set the actions URLs manually.
If somebody is using them, could you please tell me how their action URLs look like?
I tried with something like:
http://myhao/shelly/event/shellyix3-XXXXXXXXX/relay/0?type=shortpush
but it does not work, the culprit seems to be the relay part that does not apply to ix3s (and I got lost in the sources trying to understand how that should be).

@morci I tried those settings without any luck. It seems that the binding is not registering anything on the shelly config.

which button type is selected in the device ui?

the binding does, you should try coap
if you want to use event urls then

  • disable autoCoIoT in the binding settings
  • disable CoIoT events in the thing config
  • enable events to catch

@markus7017 I’m using detached button. May be this is why I cannot get trigger to work?

Momentary.

Does anyone had any experience with static IP addresses in combination with this binding? As soon as I assign a static IP, the device not longer work with this binding (the status of the thing is UNKNOWN - CONFIGURATION_PENDING). In addition to the IP, I have assigned the gateway and the DNS server within the configuration. As soon as I remove the fixed IP and restart the bundle, the thing comes ONLINE and worked again.
System is openhab-2.5.13, so far i have checked org.openhab.binding.shelly-2.5.12 and org.openhab.binding.shelly-2.5.13.202102121228. Shelly-Firmware is 1.9.4

I’m using the binding with static IP addresses without any problem.

1 Like