API Calls from outside network

i said that before.
just a restart from the app wont work if you change something on the appdaemon.yaml
and because others had trouble with 3030 i would suggest changing to 5051 and then do a complete restart.

I changed everything back to API port 5051. Completely rebooted my HASSio host. Sames results.

I wish someone would confirm if this is supposed to work in HASSio or not. Documentation is poor at best; it’s basically inexistent, or wrong.

the problem is that appdaemon is built by Anfrew and he never has used hassio in any way.
@frenck has created the plugin for it, he might be the only one that could tell if hassio could be blocking this somehow

i dont think that @aimc could come up with anything more then i did.
but it might be worth it to ask him if he has any clue left.

(just between us, i dont understand why someone with an IT background would chose hassio instead of normal install, hassio prevents you from complete local control, which an IT guy normally likes)

Right. But I like the Add-ons capabilities of HASSio. Makes it easy to control. I may revert back to a “regular” install later…

the same things you can use with hassio addon you can use the “regular” way.
the only thing is that they are not as ready made blocks.

i think hassio is great for people with little knowledge, but for advanced users i wouldnt advice it.
but oke, i just was curious why you had chosen hassio :wink:

I am now trying to build my own add-on. We’ll see…

My guess is that since hass.io is built on top of docker, there needs to be some way of mapping the API port from inside the container to the OS.

1 Like

hmm, now you say that. there were problems with the dashboard in the first versions from the addon as well, also about port mapping.

and since the api isnt a part that is extremely much used it could be that @frenck didnt do the same for the API port.

Yes, I think that’s what’s happening in my case… I hope this will get fixed in version 3 that’s currently being worked on.

Thanks to all,

Just to be clrear, this is not something that can be fixed in AppDaemon, it would need a fix in the Addon.

1 Like

Yes, of course, I understand that… Thanks!

1 Like

Hi,

I had the same problem. However it’s quite easy to fix. The addon only supports one open port at the moment. I’ve created a pull request which adds another port. You can either wait till it will be merged, create a temporary local addon version or you can disable the Dashboard for now and use the REST API. Both at the same time isn’t possible.

Example for the appdaemon.yaml:

AppDaemon:
  logfile: STDOUT
  errorfile: STDERR
  threads: 10
  app_dir: /config/appdaemon/apps
  api_port: 5050
HASS:
  ha_url: !secret url
  ha_key: !secret password
#remove or comment the dashboard lines
#HADashboard:
#  dash_url: http://127.0.0.1:5050
#  dash_dir: /config/appdaemon/dashboards

It is important to set the api_port to 5050 because that is the enabled one in the docker image. You can bind the port to something else in the hass.io config window under network

2 Likes

Cool… I never thought about trying what you propose. I will give it a try and report back.

Thanks!

UPDATE: Bingo! That works. Right away, it worked. Thanks again,

1 Like

You said:

"You can bind the port to something else in the hass.io config window under network"

What do you mean by that? Which config Window? You mean in configuration.yaml?

im glad that you could prove that the conclusion that it must be hassio was right. :wink:
at least our efford has brought that the problem is now known.

Like there.

Ah, yes… Thanks!

Just a quick update. The app daemon 3 and the next version of the app daemon 2 hass io plugin will support 2 Ports. Then dashboard and the rest API will work side by side.

Good news. Thanks for the update. Any ETA for version 3 ?

The 3.0 beta is alreay out and on beta2, and Last night @frenk released an updated plugin for hass.io, for AppDaemon 3.0, it also uses beta2 for now.