Hi,
I’ve tried to install AppDaemon but just as @petro I’m not able to get it running.
I’m running ver 0.4 with AIO in a RPi3 with the latest updates on Raspbian using the url https://192.168.xx.xxx:8123 to access HA internally and https://xxx.duckdns.org from the outside (I cant access ussing xxx.duckdns.org from the inside), with the default port (8123) opened on my router and fowarded to the RPi3, the SSL is from letsEncrypt obtained just as in the @bruhautomation video and the port 443 is remaped to the 8123 on my router
Regarding the appdaemon.cfg file I have tried several config including the last one adviced form @gpbenton but each one leads to different errors reviewed trough the Debug command;
The one suggested from @gpbenton at some point says:
`2017-03-13 00:39:11.875061 INFO AppDaemon Version 1.5.2 starting
2017-03-13 00:39:11.875553 DEBUG get_ha_config()
2017-03-13 00:39:11.994014 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-03-13 00:39:11.994573 WARNING ------------------------------------------------------------
2017-03-13 00:39:11.995009 WARNING Unexpected error:
2017-03-13 00:39:11.995319 WARNING ------------------------------------------------------------
2017-03-13 00:39:12.005235 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 ‘localhost’ doesn’t match ‘xxx.duckdns.org’
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 ‘localhost’ doesn’t match ‘xxx.duckdns.org’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py”, line 1629, in main
ha_config = ha.get_ha_config()
File “/usr/local/lib/python3.4/dist-packages/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 ‘localhost’ doesn’t match ‘xxx.duckdns.org’
wich I guess gives me the awnser of wich url do I need to use in the ha_url
(which is the https://xxxduckdns.org)
So with that in mind if I use that domain I get the following errror;
2017-03-13 00:44:58.851278 INFO AppDaemon Version 1.5.2 starting
2017-03-13 00:44:58.851770 DEBUG get_ha_config()
2017-03-13 00:44:58.958068 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-03-13 00:44:58.958539 WARNING ------------------------------------------------------------
2017-03-13 00:44:58.958855 WARNING Unexpected error:
2017-03-13 00:44:58.959137 WARNING ------------------------------------------------------------
2017-03-13 00:44:58.968993 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 0x760cff50>: 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=‘xxx.duckdns.org’, port=443): Max retries exceeded with url: /api/config (Caused by NewConnectionError(‘<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x760cff50>: 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/appdaemon/appdaemon.py”, line 1629, in main
ha_config = ha.get_ha_config()
File “/usr/local/lib/python3.4/dist-packages/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=‘xxx.duckdns.org’, port=443): Max retries exceeded with url: /api/config (Caused by NewConnectionError(‘<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x760cff50>: Failed to establish a new connection: [Errno 111] Connection refused’,))
2017-03-13 00:44:58.970163 WARNING ------------------------------------------------------------
^C2017-03-13 00:44:59.823788 INFO AppDaemon is shutting down
Traceback (most recent call last):
File “/usr/local/bin/appdaemon”, line 9, in
load_entry_point(‘appdaemon==1.5.2’, ‘console_scripts’, ‘appdaemon’)()
File “/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py”, line 1641, in main
time.sleep(5)
File “/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py”, line 162, in handle_sig
ws.close()
AttributeError: ‘NoneType’ object has no attribute ‘close’
In there, the problem I guess is that AD is trying to connect through the 443 port (probably trying to authenticate the cert),
And finally if I force the connection through the port 8123 using ha_url = https://xxx.duckdns.org:8123
I get a similar error as the above;
2017-03-13 00:49:22.761244 INFO AppDaemon Version 1.5.2 starting
2017-03-13 00:49:22.761744 DEBUG get_ha_config()
2017-03-13 00:49:22.780860 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-03-13 00:49:22.781326 WARNING ------------------------------------------------------------
2017-03-13 00:49:22.781650 WARNING Unexpected error:
2017-03-13 00:49:22.781943 WARNING ------------------------------------------------------------
2017-03-13 00:49:22.791080 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 0x7612cf50>: 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=‘xxx.duckdns.org’, port=8123): Max retries exceeded with url: /api/config (Caused by NewConnectionError(‘<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7612cf50>: 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/appdaemon/appdaemon.py”, line 1629, in main
ha_config = ha.get_ha_config()
File “/usr/local/lib/python3.4/dist-packages/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=‘xxx.duckdns.org’, port=8123): Max retries exceeded with url: /api/config (Caused by NewConnectionError(‘<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7612cf50>: Failed to establish a new connection: [Errno 111] Connection refused’,))
2017-03-13 00:49:22.791680 WARNING ------------------------------------------------------------
^C2017-03-13 00:49:23.384095 INFO AppDaemon is shutting down
Traceback (most recent call last):
File “/usr/local/bin/appdaemon”, line 9, in
load_entry_point(‘appdaemon==1.5.2’, ‘console_scripts’, ‘appdaemon’)()
File “/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py”, line 1641, in main
time.sleep(5)
File “/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py”, line 162, in handle_sig
ws.close()
AttributeError: ‘NoneType’ object has no attribute ‘close’
Probably this last 2 errors are “obvious” as I can’t reach the duckdns URL from the inside as stated before and therefore AD neither, but if I try to put ha_url = https://192.168.xx.xxx:8123
the cert can be validated (which I think is also obvious as the cert is not valid for the internal IP)
2017-03-13 01:14:33.496602 INFO AppDaemon Version 1.5.2 starting
2017-03-13 01:14:33.497734 DEBUG get_ha_config()
2017-03-13 01:14:33.547354 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-03-13 01:14:33.548256 WARNING ------------------------------------------------------------
2017-03-13 01:14:33.548855 WARNING Unexpected error:
2017-03-13 01:14:33.549396 WARNING ------------------------------------------------------------
2017-03-13 01:14:33.559228 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 326, in connect
ssl_context=context)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/ssl.py", line 324, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File “/usr/lib/python3.4/ssl.py”, line 364, in wrap_socket
_context=self)
File “/usr/lib/python3.4/ssl.py”, line 577, in init
self.do_handshake()
File “/usr/lib/python3.4/ssl.py”, line 804, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
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: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py”, line 1629, in main
ha_config = ha.get_ha_config()
File “/usr/local/lib/python3.4/dist-packages/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: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
2017-03-13 01:14:33.566658 WARNING ------------------------------------------------------------
^C2017-03-13 01:14:34.493885 INFO AppDaemon is shutting down
Traceback (most recent call last):
File “/usr/local/bin/appdaemon”, line 9, in
load_entry_point(‘appdaemon==1.5.2’, ‘console_scripts’, ‘appdaemon’)()
File “/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py”, line 1641, in main
time.sleep(5)
File “/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py”, line 162, in handle_sig
ws.close()
AttributeError: ‘NoneType’ object has no attribute ‘close’
So the only “problem” in which I can think is that as I installed AD in a different folder that HA and with a different user (because HA is installed through venv through the AIO and AD was installed from the “pi” user with pip3) AD its being unable to authenticate the SSL cert; If that’s the case does anyone knows how to fix this? Or can someone please help with another solution?
Thanks