I am running home-assistant on a rpi3 using https without problem.
I acces HA version 0.57.2 on hasbian with an URL like: https://my_externalIP:8123
i.e. using the port 8123 with SSL (using SSL certification), because the classical port 443 is used by another server at home. It works without problem and I can access HA from outside my home.
I have tried to install appdaemon (on the same virtual env as HA) , but without success using
/srv/homeassistant/bin/appdaemon -c /home/homeassistant/.homeassistant
2017-11-09 16:24:14.799289 INFO AppDaemon Version 2.1.12 starting
2017-11-09 16:24:14.799889 INFO Configuration read from: /home/homeassistant/.homeassistant/appdaemon.yaml
2017-11-09 16:24:14.912715 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-11-09 16:24:20.044586 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
Thank you
i have add the ha_key: with the HA passwd in the file appdaemon.yaml
and now it works.
I need however to use the external address IP and not the local IP address of HA (i can connect HA using this local address with https)
If I use the local address with https I got a lot of error using appdaemon
/srv/homeassistant/bin/appdaemon -c /home/homeassistant/.homeassistant
2017-11-09 22:31:14.411019 INFO AppDaemon Version 2.1.12 starting
2017-11-09 22:31:14.411574 INFO Configuration read from: /home/homeassistant/.homeassistant/appdaemon.yaml
2017-11-09 22:31:14.586684 INFO Starting Apps
2017-11-09 22:31:14.715025 INFO Got initial state
2017-11-09 22:31:14.715952 INFO App initialization complete
2017-11-09 22:31:14.716647 INFO Dashboards are disabled
2017-11-09 22:31:14.716976 INFO API is disabled
2017-11-09 22:31:14.805051 WARNING Disconnected from Home Assistant, retrying in 5 seconds
2017-11-09 22:31:19.927178 INFO Got initial state
2017-11-09 22:31:19.927763 INFO App initialization complete
2017-11-09 22:31:20.014757 WARNING Disconnected from Home Assistant, retrying in 5 seconds
2017-11-09 22:31:25.132346 INFO Got initial state
2017-11-09 22:31:25.132924 INFO App initialization complete
2017-11-09 22:31:25.220007 WARNING Disconnected from Home Assistant, retrying in 5 seconds
2017-11-09 22:31:30.354950 INFO Got initial state
2017-11-09 22:31:30.355893 INFO App initialization complete
2017-11-09 22:31:30.460134 WARNING Disconnected from Home Assistant, retrying in 5 seconds
2017-11-09 22:31:35.581613 INFO Got initial state
2017-11-09 22:31:35.582192 INFO App initialization complete
2017-11-09 22:31:35.669020 WARNING Disconnected from Home Assistant, retrying in 5 seconds
i connect locally with http and not with https.
i dont know if you can do that how you have setup now, but if you can then that would be the smartest way.
if setup like that AD doesnt need to go on the internet to come back to your local network to connect to HA.
so you will gain in speed and AD will still work if the internet is down.
I have used HA with appdaemon using https but with the external address without problem until I lost my internet connection at home during several days. The appdaemon goes down and my home automation with HA becomes unusable.
Thus using an external address with https is not reliable for my home automation.
I have use both the
cert_path: <path/to/root/CA/cert>
cert_verify: False
in the configuration file appdaemon.yaml, but it does not work.
Debugging appdaemon, the problem appears in line 1207 of appdaemon.py
during the call create_connection.
From the documentation of websocket, to disable the ssl cert verification, you have to supply the following option sslopt:
sslopt={“cert_reqs”: ssl.CERT_NONE})
By adding this line before the call to create_connection (and importing ssl) ,
I was able to run appdaemon using a local internet address with https.
May be this should be included in the next release with a test of the parameter cert_verify.
but why?
why would anyone want to use certification inside his private network?
certification is to securre a secure connection between client and server.
and i may hope that ANY connection inside your own network is secured.
as i see it:
certification inside a secure network:
advantages:
none
disadvantages:
slowing down the speed
more difficult to setup
it creates difficulties with combining in and outside because in most situations only 1 port can be secure.
The problem is if you use https to access HA from outside , you have to use https even from your local network. You cannot use http from your local network.
As appdaemon needs to access HA, the only way is to use https but without certification for the connection between appdaemon and HA
i access HA from outside with https and from inside with http.
the way to set that up: (and avoid the risk of having your automations stop when the internet is down)
Hey @aimc, is this in the beta? I’m experiencing the same issue.
I have cert_verify = False and still getting “certificate verify failed” in the error log.
Running latest beta of appdaemon.
I just followed the docs and cert_verify was there…
This is the full error I’m getting:
2018-02-11 21:06:13.057974 WARNING AppDaemon: Traceback (most recent call last):
File “c:\users\shlomi\appdata\local\programs\python\python35\lib\site-packages\urllib3\connectionpool.py”, line 601, in urlopen
chunked=chunked)
File “c:\users\shlomi\appdata\local\programs\python\python35\lib\site-packages\urllib3\connectionpool.py”, line 346, in _make_request
self._validate_conn(conn)
File “c:\users\shlomi\appdata\local\programs\python\python35\lib\site-packages\urllib3\connectionpool.py”, line 850, in validate_conn
conn.connect()
File “c:\users\shlomi\appdata\local\programs\python\python35\lib\site-packages\urllib3\connection.py”, line 326, in connect
ssl_context=context)
File "c:\users\shlomi\appdata\local\programs\python\python35\lib\site-packages\urllib3\util\ssl.py", line 329, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File “c:\users\shlomi\appdata\local\programs\python\python35\lib\ssl.py”, line 385, in wrap_socket
_context=self)
File “c:\users\shlomi\appdata\local\programs\python\python35\lib\ssl.py”, line 760, in init
self.do_handshake()
File “c:\users\shlomi\appdata\local\programs\python\python35\lib\ssl.py”, line 996, in do_handshake
self._sslobj.do_handshake()
File “c:\users\shlomi\appdata\local\programs\python\python35\lib\ssl.py”, line 641, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720)
I found myself facing the same problem as mentioned in this thread that Appdaemon stops working when internet connection is lost. I installed Nginx and got it to work with Hass, though Appdaemon won’t connect to Hass locally (they run on the same server).
Will you also share the relevant part of your appdaemon.yaml and configuration.yaml? I need help to see if I missed something.
my appdaemon.yaml wont really help you.
but when you share yours i can tell what is wrong (if any)
do you have SSL activated in Hass?, in that case you need to deactivate that.
everything about https and ssl should be removed from appdaemon.yaml and configuration.yaml
its also helpfull if you tell in which way you did install hass and AD. (hassio, venv, docker)