Hassio, appdaemon addon and appdaemon API

Context: hassio / appdaemon-addon / appdaemon API

For a small project I wanted to use the AppDaemon API to receive webhooks from various services over the internet to be able to ‘act’ on them. While setting this up I ran into the problem of the appdaemon API not being available/reachable and tried figuring out what was wrong here.

A few things that I concluded:

  • ad_port in documentation should be api_port
  • api_port should be different from dashboard port (e.g. 5555)
  • appdaemon addon from https://github.com/hassio-addons/addon-appdaemon doesn’t support an option to open up another port to the host so that the API can be reached (only 5050 is available for the Dashboard). For that I had to create a custom appdaemon addon in my /addons folder (by cloning the original addon repo mentioned earlier and changing config.json to have an extra port option for the API to be reached on (see ports section):
{
  "name": "AppDaemon",
  "version": "dev",
  "slug": "appdaemon",
  "description": "Python Apps and HADashboard for Home Assistant",
  "url": "https://github.com/hassio-addons/addon-appdaemon",
  "webui": "http://[HOST]:[PORT:5050]",
  "startup": "application",
  "boot": "auto",
  "hassio_api": true,
  "homeassistant_api": true,
  "host_network": false,
  "ports": {
    "5050/tcp": 5050,
    "5555/tcp": 5555
  },
  "map": [
    "config:rw",
    "share:rw",
    "ssl:rw"
  ],
  "options": {
    "log_level": "info",
    "commtype": "websockets"
  },
  "schema": {
    "log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)",
    "commtype": "match(^(websockets|sse)$)"
  },
  "environment": {
    "LOG_FORMAT": "{LEVEL}: {MESSAGE}"
  }
}

Hope this helps others in the future. I’m planning to post the project I’m working as well, so there will be some more context to this story.

3 Likes

Hi,

I’m running into the same issue. I did add “api_port: 3030” to my appdaemon.yaml file, and the API seems to start based the logs, but it just doesn’t work on the port specified.

What exactly did you copy to the /addons folder?

Thanks!