Start an Addon with shell command?

Hi,
is it possible to start an addon with a shell command?

I have problems with homebridge and I want to make a automation to start the homebridge addon delayed and manually.

I also had problems with the auto startup of homebridge.

Homebridge started nicely, but the timing was to fast.
As a result not all of the modules were loaded and we couldn’t use them within HomeKit.

My solution is a reboot of homebridge (60 seconds after starting homeassistant):

automation:
  - alias: "Homebridge restart"
    trigger:
      platform: homeassistant
      event: start
    action:
      - delay: '00:01:00'
      - service: hassio.addon_restart
        data:
          addon: "a0d7b954_homebridge"

I’ve chosen autostarting the addon and use hassio.addon_restart (not addon_start), this because I dont know if it’s stopped by a homeassistant on a reboot. This way I don’t need to check if it’s running or not.

The name of the addon i found by going to hass.io dashboard and then selecting the homebridge addon.
In the url you’ll see the name (like: [domain:8123]/hassio/addon/a0d7b954_homebridge).
I don’t know if the name always will be a0d7b954_homebridge.

Hope this will help you and the many other posts I found.

7 Likes

Hi,

wow thx a lot. That works without problems.
I generated this automation with the Automation Editor. Works fine.

My name is also a0d7b954_homebridge

This is what I needed, thank you. I think what is happening is Homebridge is starting before the zwave devices are full operational and thus it does not see them.

Do you know how to trigger a restart for my fire tv server? I tried using your code as a reference but I don’t know how to figure out my server’s addon name?
Thanks

Hello,

Did you ever figure this one out? Im trying to get my Fire TV Server to reboot when the device state becomes “Unknown” to try and get around the server failure issue.

Cheers

In the home assistant menu, click the menu item hass io, select the addon.

In de url you will see the full addon name.

http://localhost:8123/hassio/addon/a0d7b954_homebridge