[HASS.IO] [API] Specify version for add-on install

It would be great to be able to specify the version number of an add-on when installing.

Currently, the API consist in a request to the following url:
POST https://<hostname>/api/hassio/addons/<addon_slug>/install with a json-empty payload {}.

It would be great to be able to specify the version number in the payload like that:
{"version": "0.1.2"}

Since the version is simply translated into a repository tag, it would simply request this tag instead of the one supplied in the config.json file. Obviously, it can only work with pre-built docker images, but it would allow the following scenarios:

  1. Downgrade a faulty add-on to a known good version without loosing the settings.
  2. QA test a new published version before updating the config.json of the add-on on Github.
  3. Give users a way to test special builds for feature branches, etc…

Obviously, it should be also available on the update endpoint:
POST https://<hostname>/api/hassio/addons/<addon_slug>/update.

ANYWAY it’s already “kind-of” available when you’re restoring a package from a backup… just let us do as if it were restored from a backup.

After that we can add the following hassio's CLI parameter:

hassio addons update superaddon --version 1.2.3

It could/should be an advanced feature only available on command-line.

Anybody else interested in this feature?

I would very much appreciate this feature

YES! Just installed breaking add-on update, I WANT rollback!

In this way I solved the problem of downgrading an add-on

it can be useful?

1 Like

Yea, MQTT 5.1.1 is broken and I’m having issues downgrading… This would be helpful

3 Likes

+1

I needed to install older UniFi Network add-on for legacy UAP.

Here is my approach:

  1. Download ZIP with the older add-on version
  2. Copy it into /addons and unzip (I uploaded it using VSCode add-on and then just unzip from the Terminal & SSH addon)
  3. Go to add-on store, open the three-dots menu (top right corner) and click Check for updates
  4. You should see new Local add-ons section
  5. Install the add-on
1 Like

Hey!

the first part worked. I cloudl unzip, refresh addons, and see it in local addons, click on installl but then I got:

The command ‘/bin/bash -o pipefail -c apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends binutils=2.34-6ubuntu1.8 libcap2=1:2.32-1ubuntu0.1 logrotate=3.14.0-4ubuntu3 mongodb-server=1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 openjdk-17-jre-headless=17* && curl -J -L -o /tmp/unifi.deb “https://dl.ui.com/unifi/8.0.28/unifi_sysvinit_all.deb” && dpkg --install /tmp/unifi.deb && apt-get clean && rm -fr /tmp/* /var/cache/* /var/lib/apt/lists/* /var/log/*.log /var/log/apt’ returned a non-zero code: 100