Shelly Binding

@Mario_Aerni @jeroenvdd @Mark_VG Please check the updated DEV builds. Make sure to select the correct jar
3.0.3-SNAPSHOT for OH 3.0, 3.1M1…M4 only
3.1.0-SNAPSHOT for OH 3.1 starting M5 only


Latest DEV builds: 3.1M5+ (current), 3.0.x (3.0.x, 3.1M1…M4) or 2.5.13 (no longer maintained) - README - Installation - Avdanced Users - Shelly Manager - Bugs/Features - Firmware Index - Firmware Archive - API Doc

I had a similiar situation. For any reason OH3 added a second ethernet adapter. Communication from shelly to OH server was fine. But the binding tried to establish a CoIoT connection through the 2nd adapter. So I think you are right in your opinion about the cuse.
However, I was not able to find a solution and put my effort in removing the 2nd adapter.
Have you enabled CoIoT?
What does the log say? Are there any Warnings that CoIoT could not established?
open shelly manager and set CoIoT to peer mode and see which IP address the binding is suggesting.

2 Likes

Did you set the IoT IP address in the binding’s config? There is bo CoIoT connection, the protocol is stateless. The binding just listens to a specific UDP port. You could also tr to set the Shelly to CoIoT Peer mode using Shelly Manager. Check the DEBUG log for inbound CoIoT traffic.

1 Like

Hi Markus

Thanks for this.

I am running on 3.1.0.M5:


                           _   _     _     ____
   ___   ___   ___   ___  | | | |   / \   | __ )
  / _ \ / _ \ / _ \ / _ \ | |_| |  / _ \  |  _ \
 | (_) | (_) |  __/| | | ||  _  | / ___ \ | |_) )
  \___/|  __/ \___/|_| |_||_| |_|/_/   \_\|____/
       |_|       3.1.0.M5 - Milestone Build

Use '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
To exit, use '<ctrl-d>' or 'logout'.

I have uninstalled the Binding via the UI and copied the .jar file to the addons folder.

I get the following error with the 3.1.0-SNAPSHOT for OH 3.1 starting M5 only build

09:50:40.138 [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 [274]
  Unresolved requirement: Import-Package: org.eclipse.californium.core; version="[2.0.0,3.0.0)"

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

Also think I have the correct bundles (from what I have read above):

openhab> bundle:list |grep Cali
275 | Active |  80 | 2.0.0                 | Californium (Cf) Core
276 | Active |  80 | 2.0.0                 | Californium (Cf) Element Connector
277 | Active |  80 | 2.0.0                 | Californium (Cf) OSGi

EDIT: I see these are removed when the binding is removed via UI. So I have copied the the two JARS from you files to the addons folder and still not showing up?

EDIT: Sorry, I managed to resolve this. I redownloaded the .JAR files via your download RAW option above (not from your MYFILES) and copied to addons again and they installed.

Any suggestions?
Thanks
Mark

check the How-To Install (that’s what it’s made for😙)

1 Like

Thank you Markus. Other than my hiccup with the manual requirements this is working well.

One small thing you MAY want to consider is to allow the full voltage value to be displayed?

It is currently set to %.0f %unit%, however the device reports with 2 decimal places, so that may be a preferable default setting?

try updated build for 3.1M5

I get the following with the latest version:

11:44:37.519 [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 [286]
  Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)"

        at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.16.200.jar:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:440) ~[org.eclipse.osgi-3.16.200.jar:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.8]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.8]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.6.8]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.6.8]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.8]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.8]

try

  • delete jar, wait a min
  • stop OH
  • run openhab-cli clean-cache
  • start OH, wait 2min
  • copy new jar into addons folder

Hi Markus

Still the same:


12:25:41.573 [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 [270]
  Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)"

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

I am running on Windows 10, so had to manually delete the /userdata/cache and /userdata.tmp folder contents.

If I put the previous file in addons all works.

I did a rebuild, please try again

Sorted. The rebuild fixed that error.

Thanks for the update. I think this is a better default, the state however still only has 1 decimal place, even though the device shows 2? The default stateDescription pattern is now 2 though:

{
  "link": "http://localhost:8080/rest/items/ShellyUNIshellyunie8db84d6b3e510163199230_VoltageADC",
  "state": "27.8 V",
  "stateDescription": {
    "pattern": "%.2f %unit%",
    "readOnly": true,
    "options": []
  },
  "editable": true,
  "type": "Number:ElectricPotential",
  "name": "ShellyUNIshellyunie8db84d6b3e510163199230_VoltageADC",
  "label": "Shelly UNI Voltage ADC",
  "category": "",
  "tags": [
    "Point"
  ],
  "groupNames": []
}

delete the thing and re-discover, the channel definition needs to be updated

Sorry, I tried that. Still the same. The 2nd decimal is displayed as 0 and the state from REST API is still 1 decimal:

 "state": "27.8 V",

ok, the code did the update with 1 digit too, check updated build
(both builds for 3.0 and 3.1 are updated)


Latest DEV builds: 3.1M5+ or 3.0.x/3.1M1-M4 - README - Installation - Avdanced Users - Shelly Manager - Bugs/Features - Firmware Index - Firmware Archive - API Doc
Note: A release for 2.5 is still available, but will not be updated anymore: 2.5.13

Thanks, that did it:

{
  "link": "http://localhost:8080/rest/items/ShellyUNIshellyunie8db84d6b3e510163199230_VoltageADC",
  "state": "27.81 V",
  "stateDescription": {
    "pattern": "%.2f %unit%",
    "readOnly": true,
    "options": []
  },

Please let me know if there is any info/testing you need to be able to add the Shelly EM Power Factor information if/when you get the chance to look at that.

Really appreciate your help.

There should already be the channel meter#meterPowerFactor
this gets created if pf is included in the emeter json

I don’t see it on mine:


Have deleted the Thing and rediscovered.

We access shows the PF as being available.

I created PR 10815

  • Feature #10090 New device#supplyVoltage channel for Shelly 2.5, 1PM and 1L
  • Change #10039 Info on “not reachable / timeout” should be warning, not info
  • Fix #10799 Missing Channel Definition for Vibration Events
  • Fix #10738 Shelly UNI - ADC Voltage units of measure missing
  • Fix #10111 Creating Equipment from Shelly Bulb Duo causes wrong min/max
  • README updated

maybe we could also a fix for PF if this doesn’t work
Please provide the output from /settings und /status

em-status.json (975 Bytes)
em-settings.json (1.9 KB)
Thanks