Install issues - please advise

So I’m trying to get HADashboard installed, and I’ve already followed the guide here. Updated the config file with my url/key, etc. Started with the supplied command, got the following message in the log:

2017-05-03 14:01:45.202082 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 14:01:50.509638 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 14:01:55.815137 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 14:02:01.144957 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 14:02:06.495271 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 14:02:11.863001 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 14:02:17.202063 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 14:02:22.569251 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 14:02:27.904774 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 14:02:33.277982 WARNING Unable to connect to Home Assistant, retrying in 5 seconds

Started looking at the versions of the python modules, to make sure they were up-to-date. Noticed this:

pip3 show requests
Name: requests
Version: 2.4.3
Location: /usr/lib/python3/dist-packages
Requires:

Tried to upgrade requests to >= 2.6:

sudo pip3 install 'requests>=2.6.0'
Downloading/unpacking requests>=2.6.0
  Downloading requests-2.13.0-py2.py3-none-any.whl (584kB): 584kB downloaded
Installing collected packages: requests
  Found existing installation: requests 2.4.3
    Not uninstalling requests at /usr/lib/python3/dist-packages, owned by OS
Successfully installed requests
Cleaning up...

Requests still reporting old version “owned by OS” so not upgraded, I’m assuming.

pip3 show requests
Name: requests
Version: 2.4.3
Location: /usr/lib/python3/dist-packages
Requires:

If I do a “sudo apt list |grep requests” I get:
python3-requests/stable,now 2.4.3-6 all [installed,automatic]

Then if I do a “sudo apt-cache showpkg python3-requests”, I get:
python3-pip,python3-requests

So, the question is, how do I install python3 on a rpi, and install the module “requests” at version >= 2.6.0?
It seems to me that if I install python3-pip, I automatically get “requests-2.4.x”, and because of this, I can’t upgraded “requests” to >= 2.6.x.

I’m also assuming this is why I’m getting the “Unable to connect to Home Assistant” messages above, is that accurate?

FWIW I’m on Raspbian Jessie (8.0)

If you run with -D DEBUG as an additional parameter you’ll get a more verbose error message that may shed some more light.

can you post your config file please?

i wouldnt start that way.
in your log it shows that appdaemon is running.
it is just not able to connect to HA.

first i would take a closer look at the config.
if you post that here it could be that you have something wrong there.

So I turned on debugging, thanks @aimc.

@turboc here’s the cfg:

[AppDaemon]
ha_url = https://<redacted>:8123
ha_key = <redacted>
logfile = /opt/appdaemon_dashboard/appdaemon/hadashboard.log
errorfile = /opt/appdaemon_dashboard/appdaemon/hadashboarderr.log
threads = 10
# Apps
[hello_world]
module = hello
class = HelloWorld 

For the ha_url, I’ve tried…
Internal IP, Internal host.domain.name (resolved via internal dns), external.host.domain.name.
Still getting connection refused.

Here’s the debug log, when trying with the external.host.name:

2017-05-03 16:35:15.780374 WARNING ------------------------------------------------------------
2017-05-03 16:35:20.785936 DEBUG get_ha_config()
2017-05-03 16:35:20.794758 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 16:35:20.871487 WARNING ------------------------------------------------------------
2017-05-03 16:35:20.872099 WARNING Unexpected error:
2017-05-03 16:35:20.872539 WARNING ------------------------------------------------------------
2017-05-03 16:35:20.874283 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/connection.py", line 83, in create_connection
    raise err
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x759120d0>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/retry.py", line 376, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='<redacted external name>', port=8123): Max retries exceeded with url: /api/config (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x759120d0>: Failed to establish a new connection: [Errno 111] Connection refused',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 1576, in main
    ha_config = ha.get_ha_config()
  File "/opt/appdaemon_dashboard/appdaemon/appdaemon/homeassistant.py", line 233, in get_ha_config
    r = requests.get(apiurl, headers=headers, verify=conf.certpath)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='<redacted external name>', port=8123): Max retries exceeded with url: /api/config (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x759120d0>: Failed to establish a new connection: [Errno 111] Connection refused',))

still i think that you didnt use the right url.

dont know if you tried:

http://your_ip:8123

thats the 1 i use

edit: no https what people often use also internally.

If I try using the internal IP address in the config file, like so:
ha_url = https://192.168.x.x:8123

I get the expected, “hostname does not match SSL hostname” error:

2017-05-03 17:06:59.780486 WARNING ------------------------------------------------------------
2017-05-03 17:07:04.793557 DEBUG get_ha_config()
2017-05-03 17:07:05.111598 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 17:07:05.112155 WARNING ------------------------------------------------------------
2017-05-03 17:07:05.112567 WARNING Unexpected error:
2017-05-03 17:07:05.113027 WARNING ------------------------------------------------------------
2017-05-03 17:07:05.114654 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 342, in connect
    _match_hostname(cert, self.assert_hostname or hostname)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 352, in _match_hostname
    match_hostname(cert, asserted_hostname)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py", line 154, in match_hostname
    % (hostname, dnsnames[0]))
requests.packages.urllib3.packages.ssl_match_hostname._implementation.CertificateError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 630, in urlopen
    raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 1576, in main
    ha_config = ha.get_ha_config()
  File "/opt/appdaemon_dashboard/appdaemon/appdaemon/homeassistant.py", line 233, in get_ha_config
    r = requests.get(apiurl, headers=headers, verify=conf.certpath)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 497, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
2017-05-03 17:07:05.115544 WARNING ------------------------------------------------------------
2017-05-03 17:07:10.128854 DEBUG get_ha_config()
2017-05-03 17:07:10.420095 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 17:07:10.420773 WARNING ------------------------------------------------------------
2017-05-03 17:07:10.421306 WARNING Unexpected error:
2017-05-03 17:07:10.421774 WARNING ------------------------------------------------------------
2017-05-03 17:07:10.423382 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 342, in connect
    _match_hostname(cert, self.assert_hostname or hostname)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 352, in _match_hostname
    match_hostname(cert, asserted_hostname)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py", line 154, in match_hostname
    % (hostname, dnsnames[0]))
requests.packages.urllib3.packages.ssl_match_hostname._implementation.CertificateError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 630, in urlopen
    raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 1576, in main
    ha_config = ha.get_ha_config()
  File "/opt/appdaemon_dashboard/appdaemon/appdaemon/homeassistant.py", line 233, in get_ha_config
    r = requests.get(apiurl, headers=headers, verify=conf.certpath)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 497, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
2017-05-03 17:07:10.424171 WARNING ------------------------------------------------------------
2017-05-03 17:07:15.437447 DEBUG get_ha_config()
2017-05-03 17:07:15.749283 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 17:07:15.749963 WARNING ------------------------------------------------------------
2017-05-03 17:07:15.750502 WARNING Unexpected error:
2017-05-03 17:07:15.750971 WARNING ------------------------------------------------------------
2017-05-03 17:07:15.752584 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 342, in connect
    _match_hostname(cert, self.assert_hostname or hostname)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 352, in _match_hostname
    match_hostname(cert, asserted_hostname)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py", line 154, in match_hostname
    % (hostname, dnsnames[0]))
requests.packages.urllib3.packages.ssl_match_hostname._implementation.CertificateError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 630, in urlopen
    raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: hostname '192.168.x.x' doesn't match '<external.domain.name>'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 1576, in main
    ha_config = ha.get_ha_config()
  File "/opt/appdaemon_dashboard/appdaemon/appdaemon/homeassistant.py", line 233, in get_ha_config
    r = requests.get(apiurl, headers=headers, verify=conf.certpath)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 497, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: hostname '192.168.x.x' doesn't match '<external.domain.name>'

If I try:
ha_url: http://192.168.x.x:8123 (no https)

I get:

2017-05-03 17:12:46.405746 INFO AppDaemon Version 2.0.0beta3.5 starting
2017-05-03 17:12:46.406390 DEBUG get_ha_config()
2017-05-03 17:12:46.444637 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-05-03 17:12:46.445258 WARNING ------------------------------------------------------------
2017-05-03 17:12:46.445675 WARNING Unexpected error:
2017-05-03 17:12:46.446087 WARNING ------------------------------------------------------------
2017-05-03 17:12:46.456448 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 386, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 382, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.4/http/client.py", line 1172, in getresponse
    response.begin()
  File "/usr/lib/python3.4/http/client.py", line 351, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.4/http/client.py", line 321, in _read_status
    raise BadStatusLine(line)
http.client.BadStatusLine: ''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/retry.py", line 347, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/packages/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 386, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 382, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.4/http/client.py", line 1172, in getresponse
    response.begin()
  File "/usr/lib/python3.4/http/client.py", line 351, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.4/http/client.py", line 321, in _read_status
    raise BadStatusLine(line)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', BadStatusLine("''",))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 1576, in main
    ha_config = ha.get_ha_config()
  File "/opt/appdaemon_dashboard/appdaemon/appdaemon/homeassistant.py", line 233, in get_ha_config
    r = requests.get(apiurl, headers=headers, verify=conf.certpath)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 473, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))

I should probably note. From any browser, on my local network, both https://192.168.x.x:8123 & https://internal.domain.name:8123 work. Also, externally, https://external.domain.name works.

i think the last option is the right one.
could be that you are right about the requests version.

but i dont know how you could get around the “owned by OS” part.

creating a virtual env with appdaemon in it?

I guess another option I could try would be to install it via Docker, on a different machine on my network. Any idea if any of these are current, aka, version 2.0.0beta3.5?

i hope so but i dont know for sure. i never used docker.

but i created a venv a few days ago and that worked like a charm (allthough i am not a fan from it, but i needed differen AD versions running at the same time on the same RPI :wink: )

So… I just managed to build, create, configure, and run a docker container for hadashboard, if I open the log, I’m still getting the same messages I was getting before:

2017-05-04 00:37:06.379077 INFO AppDaemon Version 2.0.0beta3.5 starting
stdout
00:37:06
2017-05-04 00:37:06.417171 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:11
2017-05-04 00:37:11.430298 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:16
2017-05-04 00:37:16.441067 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:21
2017-05-04 00:37:21.449387 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:26
2017-05-04 00:37:26.460525 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:31
2017-05-04 00:37:31.471518 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:36
2017-05-04 00:37:36.480847 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:41
2017-05-04 00:37:41.491092 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:46
2017-05-04 00:37:46.502554 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:51
2017-05-04 00:37:51.513881 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:37:56
2017-05-04 00:37:56.525161 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:38:01
2017-05-04 00:38:01.536867 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:38:06
2017-05-04 00:38:06.544887 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:38:11
2017-05-04 00:38:11.556518 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
stdout
00:38:16
2017-05-04 00:38:16.569357 WARNING Unable to connect to Home Assistant, retrying in 5 seconds

This is from an entirely different machine, on the same network, via docker.
Do I need to change anything within HA to allow HADashboard to connect to it? Seems like a url & password should suffice to me. I’ve got to be missing something here…

So I made some more progress.
Before I had the ha_url set to: https://external.domain.name:8123
Got to thinking about it, and that’s not correct, because externally HA is accessed by going to: https://external.domain.name (minus the port) and the router is doing port forwarding from 443 → 8123. So changing ha_url to: https://external.domain.name helped a lot!

It seems that HADashboard is running! (yay!)

2017-05-04 01:20:43.253605 INFO AppDaemon Version 2.0.0beta3.5 starting
2017-05-03 19:20:48.755775 INFO Got initial state
2017-05-03 19:20:48.756880 INFO Loading Module: /conf/apps/hello.py
2017-05-03 19:20:48.759555 INFO Loading Object hello_world using class HelloWorld from module hello
2017-05-03 19:20:48.903928 INFO hello_world: Hello from AppDaemon
2017-05-03 19:20:48.906181 INFO hello_world: You are now ready to run Apps!
2017-05-03 19:20:48.906443 INFO App initialization complete
2017-05-03 19:20:49.074631 INFO Connected to Home Assistant 0.43.0

But one thing I’m not seeing, is something like this:
INFO Listening on ('192.168.1.20', 5050)

And when I go to the external docker url, for this container, I get a 404, like nothing is listening…
So is there a way to tell hadashboard to listen on 5050? I don’t see a runtime flag for it, nor do I see it mentioned in the config file. If i run a port scan against the docker-host, I do see that the port for the container is open. Just seems like it’s not listening for connections.

Success!

Here’s what I did to fix the issues, maybe it will help someone else.
If your HA is using LetsEncrypt, and you’re doing router port forwarding from 443 → 8123, then set your ha_url: https://external.domain.name (no port necessary)

This forum post talks about setting dash_url to the LAN IP of the docker host, when I tried this, I got the following errror:

OSError: [Errno 99] error while attempting to bind on address ('192.168.x.x', 5050): cannot assign requested address

Basically, permission denied. So instead of trying to assign an IP address, I set to 0.0.0.0, which should tell the process to listen on any available IP address, and not specifically try to bind to one.
So, if you’re running HADashboard in a docker image, and everything seems to be working fine, but you’re not seeing the dashboard, like you’d expect…
Add this to your appdaemon.cfg file:
dash_url = http://0.0.0.0:5050

Start up the container, and you should see something like this in your appdaemon log:

2017-05-03 19:57:12.766450 INFO Listening on ('0.0.0.0', 5050)

Finally, open your browser and go to: http://docker-lan-ip:5050 and you should be greated with the HADashboard HelloWorld module!

EDIT: Well, almost…
going to: http://docker-lan-ip:5050 works, but the “hello” link from that page points to: http://0.0.0.0:5050/Hello which obviously won’t work… Hmm…

I had an issue with running on docker until i did this as someone else pointed out in another thread:

Before building docker image:

Modify appdaemon/appdash.py and change the create_server line under run_dash to:
f = loop.create_server(handler, “0.0.0.0”, int(conf.dash_port))

Also I found it to be easier to set up a nginx reverse proxy for ssl and in my internal network i dont use SSL for home assistant

now you know how you need to edit the url in your config, you could go back to your original install :wink:
unless you did an uninstall off course :wink:

Thanks, I’ll get this configured, and rebuilt.

In the meantime, do you have any idea about the relationship between “f = loop.create_server(handler, “0.0.0.0”, int(conf.dash_port))” and “dash_url = http://0.0.0.0:5050”?

I mean, currently appdash.py has the following line:
f = loop.create_server(handler, conf.dash_host, int(conf.dash_port))

Which would tell me it’s getting “dash_host” from the “conf” file, right?
So if the conf file, has “dash_url = http://0.0.0.0:5050” why would we need to change the appdash.py file at all? Does “dash_url = http://0.0.0.0:5050” set “conf.dash_host”?

So I’ve modified the appdash.py file, and updated the line, so it reads:
f = loop.create_server(handler, "0.0.0.0", int(conf.dash_port))

Rebuilt the container, and modified the conf file.
Now if I remove dash_url = http://0.0.0.0:5050
and start the container, it doesn’t bind to an address, and thus the url returns a 404.

But If I add dash_url = http://0.0.0.0:5050
It does bind to an address, and I get the main page, but when I click on “Hello”, I get the url: http://0.0.0.0:5050/Hello which obviously won’t work.

Finally, if I add dash_url = http://docker-lan-ip:5050
It starts up, but errors out with the following:

2017-05-04 16:45:30.272340 INFO AppDaemon Version 2.0.0beta3.5 starting
2017-05-04 10:45:36.078630 INFO Got initial state
2017-05-04 10:45:36.079715 INFO Loading Module: /conf/apps/hello.py
2017-05-04 10:45:36.086468 INFO Loading Object hello_world using class HelloWorld from module hello
2017-05-04 10:45:36.246972 INFO hello_world: Hello from AppDaemon
2017-05-04 10:45:36.249196 INFO hello_world: You are now ready to run Apps!
2017-05-04 10:45:36.249471 INFO App initialization complete
2017-05-04 10:45:36.250012 INFO Starting dashboard
2017-05-04 10:45:36.260184 WARNING ------------------------------------------------------------
2017-05-04 10:45:36.260527 WARNING Unexpected error in dashboard thread
2017-05-04 10:45:36.260698 WARNING ------------------------------------------------------------
2017-05-04 10:45:36.263732 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/asyncio/base_events.py", line 946, in create_server
    sock.bind(sa)
OSError: [Errno 99] Cannot assign requested address
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/appdaemon/appdash.py", line 254, in run_dash
    srv = loop.run_until_complete(f)
  File "/usr/local/lib/python3.4/asyncio/base_events.py", line 373, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.4/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/local/lib/python3.4/asyncio/tasks.py", line 240, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.4/asyncio/base_events.py", line 950, in create_server
    % (sa, err.strerror.lower()))
OSError: [Errno 99] error while attempting to bind on address ('docker-lan-ip', 5050): cannot assign requested address.

So, basically every option I can think of, still fails. Suggestions?

Anyone have any idea how to fix this:
bottom_panel: Error opening dashboard file './conf/dashboards/./conf/dashboards/bottom_panel.yaml'

dash_url is used for generating URLs and because of CORS issues it needs to exactly match what you put into your browser. Been bugging him to work on changing that up a bit, but it is what it is for now, it’s not the easiest thing to solve for and for most people you can get what you need working.

The source code assumes no virtual IPs, and then takes dash_url and extracts the hostname for a bind. Honestly, there’s no reason to ever do that, 0.0.0.0 will work for 99.9999% of everyone. So I was the one who suggested that mod

By the time 2.0 is done, I have a pull request in for a better Docker file and a readme on how to use Docker, and hopefully we’ll have the auto-build setup under home-assistant’s hub account. It’s extremely streamlined if you play with my fork right now, although I’m sure it’s behind upstream on the appdaemon version by now :slight_smile: