This may be a stupid question, but I can’t figure it out… I installed AppDaemon on HASSio as a plug-in and configured the API to listen on port 3030. NGINX can forward calls to this port from outside (exposed as 443). How do I make remote calls to the AppDaemon API from outside my network? And how do I passs on authentication info to the app? The documentation says:
"To call into a specific App, construct a URL, use the regular HADashboard URL, and append /api/appdaemon, then add the name of the endpoint as registered by the app on the end, for example:
you cant just do it from your browser, but you can do it from a curl statement out of a terminal.
the url would work from a browser if you didnt set a pwd.
from the outside you did expose 443?
and what port for HA?
and what for the dashboard?
obviously nginx needs to be setup to listen for 3 different things to forward to 3 different servers.
could be helpfull for other when you show how you did setup nginx.
I don’t really use the AppDaemon dashboard, at least outside my network, so I did not forward it. I installed AppDeamon to use the API outside my network and run Python scripts that way. In particular, to interact with Amazon Alexa/Echo.
You can, you just need to make sure the forwarding is setup correctly in NGINX - you configure the port the API listens on in the config file, and, the IP address is the Internal IP address of AD, you need to a to that from NGINX
I already have that configured. The API port is configured as 3030 and NGINX exposes that port as 443 on the Internet (with its own name and valid SSL certificate as seen above in my config). Now, what is the URL I need to use?
I’m sure I can use a browser. That’s what the API is for! cURL command does not work. At least, I can’t make it work. Do you have an example of a cURL command? I tried variations of:
curl -i -X POST -H "Content-Type: application/json" http://myLocalIP:3030/api/appdaemon/myApp -d '{"type": "Hello World Test"}'
to no avail. It’s like the server was not listening on 3030. But logs says that the API is running.
i know that when api just arrived in AD i did try it and it didnt work from a browser (and andrew said that wouldnt work)
i did try some curl commands and finally got it to work.
Would you mind sharing your configuration and how you use it? Do you have Alexa interactions/dialogs working to fill in slots when they are not provided?
Ok, let me ask this differently… When you built your Alexa skill using the Amazon Developer console, how did you configure your Endpoint? Do you call your own instance (which is what I wanted to use AppDaemon for) or do you use Lambda? If you use your own instance, what HTTPS address are you calling?
Ah, great… That’s what I was looking for. Did you activate the API at all (ie, did you set it to a different port than the dashboard)? If I don’t put in a port for the API in the Appdaemon configuration file, the log tells me that the API is not started.
Also, which HASS intall do you use? I use HASSio, along with the Community AppDaemon plug-in. Thanks!