Problem with ports while configuring HADashboard

That’s actually what I encountered as well. In some configurations you can reach the Dashboard when you add the port to the url, but the javascript still uses the domain without the port.

I still haven’t found a solution.

the problem is with https in the homeassistant url.
browsers have trouble (for security reasons) mixing http and https or with https from different servers.
home assistant is server 1, dashboard is server 2
mixing them combined with https will give problems.

the best solution?
dont use https inside home assistant or inside dashboard.

still want to reach your homeassistant and/or dashboard from outside the network with https?
use a frontserver like NGINX

Okay. That’s right. And while I only want to use the dashboard inside my home network it does not really matter if it has ssl or not. But still no luck with the ports.

but you probably still have ssl in HA?

leaving you with trying to connect to a https server over a non https server.
and your browser probably wont like that.

I don’t think that that is the problem. Yes my HA-Installation uses SSL, but HADashboard does not. And the browser does not directly communicate with HA when using HADashboard.

browser > dashboard server > with api > Home assistant
from http to a https server

it can work, but can also give trouble.

if you dont give a port in the dashboardurl it will default to port 80 if i am correct.
and ssl through port 80 can give browser trouble.

so you should give a port in the dashboardurl (i use http://RPI_ip:5050)
and i use http://RPI_ip:8123 as my HA ip

and that works like it should

That’s actually my setup. The problem is:
dash_url in the appdaemon.yaml does also allow to have a port set. I use port 3030 which is set in HADaemon. I can reach the HADashboard, as long as no port is set in dash_url. So it tries to reach the Dashboard API via port 80. As soon as I set port 3030 in dash_url, the dashboard is unreachable.

so you have this in appdaemon.yaml:

HADashboard:
  dash_dir: /path/to/conf/dashboards
  dash_url: http://RPI_ip:3030
HASS:
  ha_key: my_password
  ha_url: http://RPI_IP:8123
  timeout: '30'

did you have dashboard V1 installed? could it still be running in the background?
did you try changing the port?

what do you have set for logging?
What is in the logfiles?

if you can reach it with the choice port 80 and not when you chose port 3030, it seems to me that port 3030 is making that the server isnt started, so there is a confict somewhere. but that should be found in the logs.

appdaemon.yaml

AppDaemon:
  logfile: STDOUT
  errorfile: STDERR
  logsize: 100000
  log_generations: 3
  threads: 10
  disable_apps: 1
HASS:
  ha_url: https://HA_Domain:8123
  ha_key: ********

HADashboard:
  dash_url: 'http://RPI_ip:3030'

V1 isn’t installed. It never was.
I tried some different ports w/ same result (5050, 8080, 8888, …)

I set the port to 80 for HADaemon.
Problem now is indeed with SSL: Home Assistant uses https and automatically forwards to https, so I need to set the domain to which the certificate is issued as ha_url w/ port 8123.
But the api the HADashboard is over port 80. Would be no problem, BUT interestingly HADashboard now uses the domain set in ha_url for apirequests WITHOUT port 8123, but with port 80, which resulst in a Access-Allow-Control-Origin violation.
I know that this api has to be from HADaemon/Dashboard since when I stop the Daemon the api isn’t reachable anymore.

Next try:
I set dash_url to also use my domain. Port 80 is forwarded to the RPI. Accessing from this domain now works completly.

I reactivated my ssl settings for HADashboard and forwarded port 443, which again doesn’t work.
Setting the dash_url to a https url also does not work since only HTTP is allowed.

So i’ll keep with a password protected Dashboard which is accessible from outside.
But sadly the password option simple doesn’t work.

so, best option:

install NGINX
remove SSL from HASS
listen in NGINX to domain with SSL and forward to HASS
set ha_url to http://RPI_id:8123

and you have all you want.

you can even have a second domain pointing to NGINX and have that forward to dashboard if you like.

I havn’t set up SSL yet because in my developing state and not implemented anything I will use later yet, just test cases. So SSL should not be my problem. All I have done is added so far is standard things like import sensors, made some automations etc. Also then added Appdaemon and get this problem. My appdaemon.yaml look like this
AppDaemon:
logfile: STDOUT
errorfile: STDERR
logsize: 100000
log_generations: 3
threads: 10
cert_verify: False
HASS:
ha_url: “http://HA_Domain:8123”
ha_key: password to “http://HA_Domain:8123”
HADashboard:
dash_url: “http://HA_Domain:3030”
dash_dir: /config/hadaemon/dashboards
dash_force_compile: 1

SSL should therefore not be my problem. Might I have missed something in my setup of appdaemon? In the app for appdaemon in homeassistant there is an option tab. Didn’t stand anything about this in the setup so does it do anything? I have tried changing domain there to all type of things

first a question: what do you mean with HA_domain (an ip to your device or an outside domain)?
another question: how do you start appdaemon and how do you see the output and errors?
if you can see it because you start appdaemon manually, what is the ouput?

if you cant see it (because you run it as service or daemon)
change your errorfile and logfile to files where appdaemon has writing access.
then the same question, what is in the logs.

HA_domain is just the ip of my raspberry pi. I start it through the home assistant app and it gives the following log:
starting version 3.2.2
2018-01-09 17:43:07.024874 INFO AppDaemon Version 2.0.8 starting
2018-01-09 17:43:07.028125 INFO Configuration read from: /config/hadaemon/appdaemon.yaml
2018-01-09 17:43:07.614776 INFO Got initial state
2018-01-09 17:43:07.620280 INFO App initialization complete
2018-01-09 17:43:07.624904 INFO Starting dashboard
2018-01-09 17:43:07.680917 INFO Connected to Home Assistant 0.60.0

This is for when I have the port added in appdaemon.yaml and that gives: “This site can’t be reached” when I try to connect to http://HA_domain:3030

thats hassio isnt it?
then you probably have an old or the wrong addon installed.
there are newer versions that have solved that problem.

Yeah, got linked to here https://github.com/vkorn/hassio-addons. Is this incorrect one?

i dont know what is the right and the old one.

but you have appdaemon 2.0.8 running and i have seen topics come by where they already got 2.0.10 and if i remember correct 2.0.11

the actual version from appdaemon is 2.1.12

Alright, will try to find a repository tomorrow then for a newer one. Thanks for the help

at the bottom he says that he updated for 2.1.11

Thanks, managed to get it to work now. Just got the javaerror “Failed to load resource: net::ERR_EMPTY_RESPONSE” in the dashboard for loading a switch but that is something I can work with atleast.

1 Like