Announcement: HADasboard beta4 - Release Candidate!

with Debug option

pi@hassbian:~/appdaemon_dashboard/appdaemon $ sudo python3 -m appdaemon.appdaemo n -c conf -D DEBUG
2017-06-22 13:50:03.224664 INFO AppDaemon Version 2.0.0beta4 starting
2017-06-22 13:50:03.225201 INFO Configuration read from: conf/appdaemon.yaml
2017-06-22 13:50:03.225540 DEBUG get_ha_config()
2017-06-22 13:50:03.630455 DEBUG Entering run()
2017-06-22 13:50:03.684943 DEBUG Creating worker threads …
2017-06-22 13:50:03.685963 DEBUG Done
2017-06-22 13:50:03.686779 DEBUG Done
2017-06-22 13:50:03.687640 DEBUG Done
2017-06-22 13:50:03.688432 DEBUG Done
2017-06-22 13:50:03.689398 DEBUG Done
2017-06-22 13:50:03.690153 DEBUG Done
2017-06-22 13:50:03.690913 DEBUG Done
2017-06-22 13:50:03.691660 DEBUG Done
2017-06-22 13:50:03.692367 DEBUG Done
2017-06-22 13:50:03.693098 DEBUG Done
2017-06-22 13:50:03.693448 DEBUG Calling HA for initial state
2017-06-22 13:50:03.693712 DEBUG Refreshing HA state
2017-06-22 13:50:03.693954 DEBUG get_ha_state: entity is None
2017-06-22 13:50:03.880752 INFO Got initial state
2017-06-22 13:50:03.881617 DEBUG Reading Apps
2017-06-22 13:50:03.882641 INFO Loading Module: conf/apps/hello.py
2017-06-22 13:50:03.887221 INFO Loading Object hello_world using class HelloWorl d from module hello
2017-06-22 13:50:04.048178 INFO hello_world: Hello from AppDaemon
2017-06-22 13:50:04.051394 INFO hello_world: You are now ready to run Apps!
2017-06-22 13:50:04.051829 INFO App initialization complete
2017-06-22 13:50:04.052161 DEBUG Starting timer loop
2017-06-22 13:50:04.052671 INFO Starting dashboard
2017-06-22 13:50:04.071862 WARNING Disconnected from Home Assistant, retrying in 5 seconds
2017-06-22 13:50:04.072358 WARNING --------------------------------------------- ---------------
2017-06-22 13:50:04.072728 WARNING Unexpected error:
2017-06-22 13:50:04.073089 WARNING --------------------------------------------- ---------------
2017-06-22 13:50:04.075332 WARNING Traceback (most recent call last):
File “/home/pi/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py”, line 132 8, in appdaemon_loop
ws = create_connection("{}/api/websocket".format(url))
File “/usr/local/lib/python3.4/dist-packages/websocket/_core.py”, line 487, in create_connection
websock.connect(url, **options)
File “/usr/local/lib/python3.4/dist-packages/websocket/_core.py”, line 211, in connect
options.pop(‘socket’, None))
File “/usr/local/lib/python3.4/dist-packages/websocket/_http.py”, line 77, in connect
sock = _ssl_socket(sock, options.sslopt, hostname)
File “/usr/local/lib/python3.4/dist-packages/websocket/_http.py”, line 182, in _ssl_socket
sock = _wrap_sni_socket(sock, sslopt, hostname, check_hostname)
File “/usr/local/lib/python3.4/dist-packages/websocket/_http.py”, line 138, in _wrap_sni_socket
context.load_verify_locations(cafile=sslopt.get(‘ca_certs’, None), capath=ss lopt.get(‘ca_cert_path’, None))
TypeError: cafile, capath and cadata cannot be all omitted

2017-06-22 13:50:04.075887 WARNING ---------------------------------------------

you probably need to change your HA url to

http://192.168.1.238:8123

no, like that I can’t access HASS

2017-06-22 15:10:07.889257 INFO AppDaemon Version 2.0.0beta4 starting
2017-06-22 15:10:07.889808 INFO Configuration read from: /home/pi/appdaemon_dashboard/appdaemon/conf/appdaemon.yaml
2017-06-22 15:10:07.909309 WARNING Unable to connect to Home Assistant, retrying in 5 seconds

As long as his router is forwarding 443 to 8123, this will work. It’s how I’m doing mine and mine has worked since the first beta.

i dont think its a wise move to use an outside link to connect appdaemon with HA running on the same device in the same network.
if the internet goes down appdaemon will stop working also.

so the wisest thing is to connect AD and HA locally.

@anon35356645 did you use HTTP or HTTPS? when you tried to connect with HA?
in your home network can you connect to http://192.168.1.238:8123?? (so on your pc or mobile in a browser)

and i think you dont use selfsigned certs?

I use letsencrypt and duckdns the only way to access HASS with an url (from inside or from outside the network) is
https://myduckdns.duckdns.org

with https and without the port. I do not use selfsigned cert (not that I know of)

EDIT
but you can see that it connects to HASS, the problem is that it disconnects afterwards, but connection is established

tried both

pi@hassbian:~/appdaemon_dashboard/appdaemon $ python3 -m appdaemon.appdaemon -c /home/pi/appdaemon_dashboard/appdaemon/conf
2017-06-22 17:36:01.599428 INFO AppDaemon Version 2.0.0beta4 starting
2017-06-22 17:36:01.599978 INFO Configuration read from: /home/pi/appdaemon_dashboard/appdaemon/conf/appdaemon.yaml
2017-06-22 17:36:01.616971 WARNING Unable to connect to Home Assistant, retrying in 5 seconds

yes this is my settings

with that setup you also should be able to reach your HA with local IP with port and HTTP

using HA with encrypting is to make a secure connection from outside your homenetwork, inside your own network you dont need that.

if you only can use that url then you would have a big problem if the internet is down or even if you have a router problem.

tried both

i didnt say try it in your settings. i said try in in a browser.

I am not good with certificates (i do not understand them).

I installed HASS with letsencrypt, maybe for HADashboard do I need to use letsencrypt certifictes somewhere somehow?

Mine is a pretty standard setting used by many here in this forum

https://192.168.1.238:8123 works (after advising about the certificate from letsencrypt)
http://192.168.1.238:8123 does not work

So use https://192.168.1.238:8123 for your ha_url. Make sure you have ha_key filled out with your hass password.

tried got different error

pi@hassbian:~/appdaemon_dashboard/appdaemon $ python3 -m appdaemon.appdaemon -c /home/pi/appdaemon_dashboard/appdaemon/conf -D DEBUG
2017-06-22 18:12:02.723939 INFO AppDaemon Version 2.0.0beta4 starting
2017-06-22 18:12:02.724463 INFO Configuration read from: /home/pi/appdaemon_dashboard/appdaemon/conf/appdaemon.yaml
2017-06-22 18:12:02.724792 DEBUG get_ha_config()
2017-06-22 18:12:02.837765 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-06-22 18:12:02.838263 WARNING ------------------------------------------------------------
2017-06-22 18:12:02.838682 WARNING Unexpected error:
2017-06-22 18:12:02.838995 WARNING ------------------------------------------------------------
2017-06-22 18:12:02.850325 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.4/dist-packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.4/dist-packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.4/dist-packages/urllib3/connection.py", line 346, in connect
    _match_hostname(cert, self.assert_hostname or hostname)
  File "/usr/local/lib/python3.4/dist-packages/urllib3/connection.py", line 356, in _match_hostname
    match_hostname(cert, asserted_hostname)
  File "/usr/local/lib/python3.4/dist-packages/urllib3/packages/ssl_match_hostname/_implementation.py", line 154, in match_hostname
    % (hostname, dnsnames[0]))
urllib3.packages.ssl_match_hostname._implementation.CertificateError: hostname '192.168.1.238' 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 440, in send
    timeout=timeout
  File "/usr/local/lib/python3.4/dist-packages/urllib3/connectionpool.py", line 630, in urlopen
    raise SSLError(e)
urllib3.exceptions.SSLError: hostname '192.168.1.238' doesn't match 'xxx.duckdns.org'

During handling of the above exception, another exception occurred:

Ahh ok, I would edit /etc/hosts and add a line:

192.168.1.235 myduck.duckdns.org

This should keep you from having to hit the web and still keep the certificate happy.
Then add https://myduck.duckdns.org back as your ha_url.

Make sure that in your HASS config you have ssl_certificate: and ssl_key: filled out properly. Should probably be something like:

ssl_certificate: /etc/letsencrypt/live/[something]/fullchain.pem
ssl_key: /etc/letsencrypt/live/[something]/privkey.pem

I changed /etc/hosts

changed ha_url

in HASS I have those lines

now I receive connection refused

pi@hassbian:~/appdaemon_dashboard/appdaemon $ python3 -m appdaemon.appdaemon -c /home/pi/appdaemon_dashboard/appdaemon/conf -D DEBUG
2017-06-22 18:35:49.503061 INFO AppDaemon Version 2.0.0beta4 starting
2017-06-22 18:35:49.503691 INFO Configuration read from: /home/pi/appdaemon_dashboard/appdaemon/conf/appdaemon.yaml
2017-06-22 18:35:49.504072 DEBUG get_ha_config()
2017-06-22 18:35:49.520454 WARNING Unable to connect to Home Assistant, retrying in 5 seconds
2017-06-22 18:35:49.521037 WARNING ------------------------------------------------------------
2017-06-22 18:35:49.521427 WARNING Unexpected error:
2017-06-22 18:35:49.521735 WARNING ------------------------------------------------------------
2017-06-22 18:35:49.530679 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-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/urllib3/util/connection.py", line 83, in create_connection
    raise err
  File "/usr/local/lib/python3.4/dist-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/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.4/dist-packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.4/dist-packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.4/dist-packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.4/dist-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x75d0e590>: 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 440, in send
    timeout=timeout
  File "/usr/local/lib/python3.4/dist-packages/urllib3/connectionpool.py", line 649, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.4/dist-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=xxx.duckdns.org', port=443): Max retries exceeded with url: /api/config (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x75d0e590>: Failed to establish a new connection: [Errno 111] Connection refused',))

Probably need to flush the dns cache, or reboot.

this I put in /etc/hosts (instead of xxx my duckdns name)

192.168.1.238   xxx.duckdns.org

I did sudo reboot

What happens if you put https://xxx.duckdns.org:8123 into your browser?

I have a DNS server on another pi3 in the network with pi-hole. Not sure if it matters, but now I rebooted that too

https://xxx.duckdns.org:8123 does not work
https://xxx.duckdns.org does work