Marketplace installation for Shelly binding

I want to make the Shelly binding installable on the marketplace- Definition has been made, binding shows up, but installation failed. I suppose I have a syntax error in the page

There is a section ##Resources and from my understanding the marketplace uses the first link. When trying to install the binding the UI just shows an installation failed, no more details.

Any idea how to fix this issue?

![shellylogo|250x250](upload://nUewVcMEM5QNqNT2NGCU4hHTXFm.png)

The **Shelly Binding** integrates the Allterco Shelly Devices. It supports Generation 1 (Shelly 1 etc.) as well as the complete Shelly Plus and Pro Series (Generation 2).

**Features**

* Auto Discovery of connected Shelly devices (Gen 1, Plus/Pro, Plus Mini and BLU series)
* Provide a lot of status data (relay status, power meter, sensor values) 
* Some internal device information like wifi strength or internal device temp
* Event trigger, e.g. for pushed buttons
* Control functions like relay output on/off
* Shelly Manager for device configuration and firmware upgrades


See documentation in Resources section for setup.

## Status and future development.

Feedback is always welcome (do not hesitate to tell if it works !) Share your experiences, creative work or problems in the [Community Thread](https://community.openhab.org/t/shelly-binding). Also ideas and contributions are welcome.

Contribution welcome ! There is so much to do :
* Testing with all devices and all setup types
* Description of more use cases so others benefit from your work
* Maybe some nice widgets for Main UI

**Make sure to select the correct bundle matching your installed openHAB release** 
The are different builds for openHAB 3.4.5-SNAPSHOT and 4.1.0-SNAPSHOT. I'll provide updates for 3.4.5+ and 4.0+ only.

You need to install the Californium Soap implementation before installing the binding

1. open OH console and run "feature:install openhab-transport-coap"
2. and then copy the binding jar to the adding folder

The binding supports auto-discovery, there is no need to create .thing files. Maybe you need to scan multiple times to find all devices on your network. Docker users: You need to make sure that the container receives Multicast traffic for generation 1 devices (no Plus/Pro), or configure the device to CoIOT Peer Mode (using device UI or build-in Shelly Manager).

## Resources
[org.openhab.binding.shelly-4.1.0-SNAPSHOT.jar](https://github.com/markus7017/myfiles/blob/master/shelly/org.openhab.binding.shelly-4.1.0-SNAPSHOT.jar?raw=true)
[org.openhab.binding.shelly-3.4.5-SNAPSHOT.jar](https://github.com/markus7017/myfiles/blob/master/shelly/org.openhab.binding.shelly-3.4.5-SNAPSHOT.jar?raw=true)

[README](https://github.com/markus7017/myfiles/blob/master/shelly/README.md) | [Advanced Use Cases](https://github.com/markus7017/myfiles/blob/master/shelly/doc/AdvancedUsers.md)  | [Shelly Manager](https://github.com/markus7017/myfiles/blob/master/shelly/doc/ShellyManager.md)
[Bugs Reports /Feature Requests](https://github.com/openhab/openhab-addons/issues?q=is%3Aissue+is%3Aopen+%5Bshelly%5D)
[Shelly API Reference](https://shelly-api-docs.shelly.cloud/?fbclid=IwAR23ukCi_3aBSTPRHYUIcpr0pLi0vcyL0fF0PnJQdFvkkc8_Zo5LkAcli_A#http-server)

It doesn’t work with URL parameters so the URL should end with .jar:

So you mean it should be

https://github.com/markus7017/myfiles/blob/master/shelly/org.openhab.binding.shelly-4.1.0-SNAPSHOT.jar

?

No that will not work either because it does not download the JAR and will download the webpage instead.

I always create GitHub releases and attach the JAR to it:

That way you also have a tag on which the JAR is based. Not storing big files in your repo also reduces your repo size and time to clone it.

I did, now I have a release and changed the page to

## Resources

https://github.com/markus7017/openhab-addons/releases/download/v4.1.0.b1/org.openhab.binding.shelly-4.1.0-SNAPSHOT.jar

Same issue, even not a single message in the log file (did log:set DEBUG org.openhab.core.marketplace).

Did you try restarting openHAB (or the marketplace bundle)? IIRC there is a cache for Marketplace entries. I’ve also wasted time on that one day while trying to fix my Marketplace entry.

1 Like

nope, same :frowning:

But after enabling debugging, I see an exception in the log

2023-08-12 20:46:46.070 [DEBUG] [ity.CommunityMarketplaceAddonService] - bundle org.openhab.core.addon.marketplace:4.0.1 (151)[org.openhab.core.addon.marketplace.internal.community.CommunityMarketplaceAddonService] : Dependency Manager created $000interface=org.openhab.core.events.EventPublisher, filter=null, policy=static, cardinality=1..1, bind=null, unbind=null, updated=null, field=null, field-option=null, collection-type=service, parameter=0
2023-08-12 20:46:46.072 [DEBUG] [ity.CommunityMarketplaceAddonService] - bundle org.openhab.core.addon.marketplace:4.0.1 (151)[org.openhab.core.addon.marketplace.internal.community.CommunityMarketplaceAddonService] : Dependency Manager created $001interface=org.osgi.service.cm.ConfigurationAdmin, filter=null, policy=static, cardinality=1..1, bind=null, unbind=null, updated=null, field=null, field-option=null, collection-type=service, parameter=1
2023-08-12 20:46:46.073 [DEBUG] [ity.CommunityMarketplaceAddonService] - bundle org.openhab.core.addon.marketplace:4.0.1 (151)[org.openhab.core.addon.marketplace.internal.community.CommunityMarketplaceAddonService] : Dependency Manager created $002interface=org.openhab.core.storage.StorageService, filter=null, policy=static, cardinality=1..1, bind=null, unbind=null, updated=null, field=null, field-option=null, collection-type=service, parameter=2
2023-08-12 20:46:46.074 [DEBUG] [ity.CommunityMarketplaceAddonService] - bundle org.openhab.core.addon.marketplace:4.0.1 (151)[org.openhab.core.addon.marketplace.internal.community.CommunityMarketplaceAddonService] : Dependency Manager created $003interface=org.openhab.core.addon.AddonInfoRegistry, filter=null, policy=static, cardinality=1..1, bind=null, unbind=null, updated=null, field=null, field-option=null, collection-type=service, parameter=3
2023-08-12 20:46:46.075 [DEBUG] [ity.CommunityMarketplaceAddonService] - bundle org.openhab.core.addon.marketplace:4.0.1 (151)[org.openhab.core.addon.marketplace.internal.community.CommunityMarketplaceAddonService] : Dependency Manager created AddonHandlerinterface=org.openhab.core.addon.marketplace.MarketplaceAddonHandler, filter=null, policy=dynamic, cardinality=1..n, bind=addAddonHandler, unbind=removeAddonHandler, updated=null, field=null, field-option=null, collection-type=null, parameter=null
2023-08-12 20:46:46.076 [DEBUG] [ity.CommunityMarketplaceAddonService] - bundle org.openhab.core.addon.marketplace:4.0.1 (151)[org.openhab.core.addon.marketplace.internal.community.CommunityMarketplaceAddonService] : Dependency Manager created osgi.ds.satisfying.conditioninterface=org.osgi.service.condition.Condition, filter=(osgi.condition.id=true), policy=dynamic, cardinality=1..1, bind=null, unbind=null, updated=null, field=null, field-option=null, collection-type=null, parameter=null
2023-08-12 20:46:46.078 [DEBUG] [ity.CommunityMarketplaceAddonService] - bundle org.openhab.core.addon.marketplace:4.0.1 (151)[org.openhab.core.addon.marketplace.internal.community.CommunityMarketplaceAddonService] : Component created: DS=DS14, implementation=org.openhab.core.addon.marketplace.internal.community.CommunityMarketplaceAddonService, immediate=true, default-enabled=true, factory=null, configuration-policy=optional, activate=activate, deactivate=deactivate, modified=modified configuration-pid=[org.openhab.marketplace]
2023-08-12 20:46:46.079 [DEBUG] [ity.CommunityMarketplaceAddonService] - bundle org.openhab.core.addon.marketplace:4.0.1 (151)[org.openhab.core.addon.marketplace.internal.community.CommunityMarketplaceAddonService] : Component Services: scope=singleton, services=[org.openhab.core.addon.AddonService]
2023-08-12 20:46:46.080 [DEBUG] [ity.CommunityMarketplaceAddonService] - bundle org.openhab.core.addon.marketplace:4.0.1 (151)[org.openhab.core.addon.marketplace.internal.community.CommunityMarketplaceAddonService] : Component Properties: {service.config.label=Community Marketplace, service.config.category=system, osgi.ds.satisfying.condition.target=(osgi.condition.id=true), service.config.description.uri=system:marketplace, service.config.factory=false, service.pid=org.openhab.marketplace}
2023-08-12 20:46:46.081 [DEBUG] [ity.CommunityMarketplaceAddonService] - bundle org.openhab.core.addon.marketplace:4.0.1 (151)[org.openhab.core.addon.marketplace.internal.community.CommunityMarketplaceAddonService] : Querying state disabled
2023-08-12 20:46:46.082 [DEBUG] [ity.CommunityMarketplaceAddonService] - bundle org.openhab.core.addon.marketplace:4.0.1 (151)[org.openhab.core.addon.marketplace.internal.community.CommunityMarketplaceAddonService] : Querying state disabled
2023-08-12 20:46:46.084 [DEBUG] [ity.CommunityMarketplaceAddonService] - bundle org.openhab.core.addon.marketplace:4.0.1 (151)[org.openhab.core.addon.marketplace.internal.community.CommunityMarketplaceAddonService] : Component can not be activated since it is in state disabled
2023-08-12 20:46:46.066 [WARN ] [rketplace.MarketplaceBundleInstaller] - Failed reinstalling add-on from cache
org.openhab.core.addon.marketplace.MarketplaceHandlerException: The local cache folder doesn't contain a single file: /var/lib/openhab/marketplace/bundles/139554
	at org.openhab.core.addon.marketplace.MarketplaceBundleInstaller.installFromCache(MarketplaceBundleInstaller.java:85) ~[?:?]
	at org.openhab.core.addon.marketplace.MarketplaceBundleInstaller.lambda$3(MarketplaceBundleInstaller.java:158) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
	at java.util.Iterator.forEachRemaining(Iterator.java:133) ~[?:?]
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
	at org.openhab.core.addon.marketplace.MarketplaceBundleInstaller.ensureCachedBundlesAreInstalled(MarketplaceBundleInstaller.java:155) ~[?:?]
	at org.openhab.core.addon.marketplace.internal.community.CommunityBundleAddonHandler.lambda$0(CommunityBundleAddonHandler.java:58) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]

This is the magic hint:

MarketplaceHandlerException: The local cache folder doesn't contain a single file: /var/lib/openhab/marketplace/bundles/139554

Before I had 2 links under ##Resources. Obviously it downloads more than one link, but can’t handle more than once. For me that’s designed to fail, there should be a specific syntax like
add-on=url1
doc=url2

At least I got it working. Thanks @wborn, this was superb support - like always :slight_smile:

1 Like