ESPHome binding keeps disappearing

I’ve got the ESPHome binding installed from the Add-on store (so not via a jar file), and it has disappeared at least two times already. And not after an upgrade, both times were when I had been running 4.3.3 for a while.

Does anyone have a clue what the reason might be? Or how we can find out?

This is a marketplace binding.When you upgrade/downgrade OH, there’s no way (yet?) for OH to know if there is a version of the binding posted to the marketplace that works with the new version of OH you are running. Given that a version of a binding that doesn’t match the OH version can sometimes prevent OH from even starting up, OH removes these bindings and you have to reinstall them manually.

There was a discussion about this and I think an issue might be open to make this work better but for now that’s how it works.

But when does it do that? I just restarted openHAB, but the binding is still there.

On an upgrade. For example upgrading between 4.3.2 and 4.3.3 would cause that add-on to be removed.

They also get removed on a clearing of the cache, which is the step during an upgrade that does the removal and you can do that independently of an upgrade. But I think they might get reinstalled if you do a clear the cache on it’s own.

Aha. I indeed cleared my cache a few days ago, in an attempt to fix an issue. Which reminds me I should recreate a situation and see what went wrong. But that’s a different story.

But mystery solved then. :slight_smile:

Although… To enlarge my understanding: all bindings that are not automatically uninstalled have been updated during the ‘snapshot’ period of a new release, and that is how the store ‘knows’ they are compatible? Is that how it works?

I’m not sure I really know how it works with the snapshots.

Assuming it works the same I would expect you to need to resintall the marketeplace add-ons every time you move to a new snapshot.

How it works under the covers is the jar files that are the bindings get saved to userdata/cache. The jar files that get installed from the marketeplace are saved to userdata/marketplace or something like that.

Periodically OH will look at the files in userdata/config, particularly userdata/config/org/openhab/addons.config. If there is an add-on listed there that doesn’t exist in userdata/cache, it goes gets it and installs it. If there are bindings installed in cache that are not listed in that file, it removes them.

For the marketplace the installed versions are listed in userdata/jsondb/org.openhab.marketplace.json. I think when you clear the cache that marketplace JSON file get cleaned out. So when OH comes back up it doesn’t think it has anything to install.

If the snapshot upgrade doesn’t zero out that JSON file, then OH should go and redownload the jar file after the cache clearing same as it does for the official add-ons.

It not only disappears after an upgrade. It randomly disappears during runtime. every now and then I add an ESP32 board and I always have to reinstall the binding first.

I added a version range to the marketplace posting, but I have no idea if this helps as it specifies 4.0.0 → 5.0.0 and there are plus/minus 17 actual OH releases (not counting release candidates and milestones) in between.

I am using mine since long. Approx 15 things. It never disappeared except on OH upgrade. Thanks to this thread I know the reason and work around now.

Same for me. I have to reinstall it from the marketplace after every new OH release. Otherwise it never disapears.