AppDaemon Q&A

yep! Thanks, I didn;'t put the . (who wrote those linux instructions … ahah)

Now I get past it but a lot of errors

pi@raspberrypi:~/appdaemon $ appdaemon -c conf/appdaemon.cfg
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 594, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 350, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 835, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 323, 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 624, 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/bin/appdaemon", line 9, in <module>
    load_entry_point('appdaemon==1.4.0', 'console_scripts', 'appdaemon')()
  File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 1160, in main
    ha_config = ha.get_ha_config()
  File "/usr/local/lib/python3.4/dist-packages/appdaemon/homeassistant.py", line 175, 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)
pi@raspberrypi:~/appdaemon $

this is my appdaemon.cfg file.

I used letsencrypt instruction. Maybe cert_path is in other directory?

[AppDaemon]
ha_url = https://xxx.duckdns.org:8123
logfile = STDOUT
errorfile = STDERR
app_dir = /home/pi/appdaemon/conf/apps
threads = 10
latitude = xx.xx
longitude = xx.xx
elevation = 83
timezone = Europe/Rome
cert_path = /home/pi/certbot
# Apps
[hello_world]
module = hello
class = HelloWorld

Did you not include your password in ha_key: or did you just remove it for this post?

When posting configs, it’s always a good idea to include any passwords or private info like this:

ha_key: [REDACTED]

This way we know you’re just protecting your privacy rather than the issue that it might not have been included in the config file in the first place.

no I really did not include in the real file … is it the HA password?

Yes. That might be one of the issues at least.

Ok, stil not working.

Is the
cert_path = /etc/letsencrypt/live/xxx.duckdns.org

?

trying it now.

EDIT, not … same error …

Are you using self signed Certs? If not, you don’t need that line.

From the README.MD

- cert_path (optional) - path to root CA cert directory - use only if you are using self signed certs.

I never understoof well what self signed crt are. I am not sure if I have one or not.

I do have made the dusckdns+letsencrypt method described in HASS webpage. And now I can connect from outside my netwrok with https:xxx.duckdns.org:8123.

EDIT: I removed that line, now progressing

pi@raspberrypi:~/appdaemon $ appdaemon -c conf/appdaemon.cfg
2017-01-21 17:34:45.652956 WARNING 'latitude' directive is deprecated, please remove
2017-01-21 17:34:45.696678 WARNING 'longitude' directive is deprecated, please remove
2017-01-21 17:34:45.697110 WARNING 'timezone' directive is deprecated, please remove
2017-01-21 17:34:45.776555 INFO AppDaemon Version 1.4.0 starting
2017-01-21 17:34:51.027632 INFO Got initial state
2017-01-21 17:34:51.029288 INFO Loading Module: /home/pi/appdaemon/conf/apps/hello.py
2017-01-21 17:34:51.037779 INFO Loading Object hello_world using class HelloWorld from                                     module hello
2017-01-21 17:34:51.038794 INFO hello_world: Hello from AppDaemon
2017-01-21 17:34:51.039255 INFO hello_world: You are now ready to run Apps!
2017-01-21 17:34:51.039675 INFO App initialization complete
2017-01-21 17:34:51.040761 INFO Connecting to HA with timeout = 10
2017-01-21 17:35:10.604092 WARNING Not connected to Home Assistant, retrying in 5 secon                                    ds
2017-01-21 17:35:15.990729 INFO Got initial state
2017-01-21 17:35:17.994297 INFO Reloading Module: /home/pi/appdaemon/conf/apps/hello.py
2017-01-21 17:35:17.996512 INFO Loading Object hello_world using class HelloWorld from module hello
2017-01-21 17:35:17.997456 INFO hello_world: Hello from AppDaemon
2017-01-21 17:35:17.997864 INFO hello_world: You are now ready to run Apps!
2017-01-21 17:35:17.998188 INFO App initialization complete
2017-01-21 17:35:17.998468 INFO Connecting to HA with timeout = 10
2017-01-21 17:35:28.134244 WARNING Not connected to Home Assistant, retrying in 5 seconds
2017-01-21 17:35:33.370859 INFO Got initial state
2017-01-21 17:35:35.374687 INFO Reloading Module: /home/pi/appdaemon/conf/apps/hello.py
2017-01-21 17:35:35.376942 INFO Loading Object hello_world using class HelloWorld from module hello
2017-01-21 17:35:35.377623 INFO hello_world: Hello from AppDaemon
2017-01-21 17:35:35.377969 INFO hello_world: You are now ready to run Apps!
2017-01-21 17:35:35.378270 INFO App initialization complete
2017-01-21 17:35:35.378550 INFO Connecting to HA with timeout = 10

You don’t need this line then. Your cert is signed by Let’s Encrypt.

thanks starting to understand: in 5 years time I will know it all ahahah

Stop beating yourself up though. We’re ALL learning. :wink:

If you restart, you should see a message from the Hello app that tells you it’s working in your logs.

Ok restaring now. But to me it seems working. I just do not understand the message

2017-01-21 17:35:17.998468 INFO Connecting to HA with timeout = 10
2017-01-21 17:35:28.134244 WARNING Not connected to Home Assistant, retrying in 5 seconds
2017-01-21 17:35:33.370859 INFO Got initial state

@turboc - is the following a normal message as there are currently no alerts or did I do something wrong?

INFO weatherAlert: INFO - For some reason there is no alerts key in the data coming from WeatherUnderground

I have the same.

Is this normal?

I don’t have a port in my URL, but then I use port forwarding to redirect all 443 traffic to my Pi’s port 8123.

I think one of the others is going to have to check in here and tell you whether that’s an issue. But the logs are definitely showing that AD is unable to connect to your HA instance.

No for some reason, response coming from weather underground is giving a bad key message. I’m getting the same thing here.

I saw you included some JSON for testing, but where would I input this in HA? I mean, I’m guessing the service panel, but I wasn’t sure what service.

If you don’t have port forwarding set up in your router as I outlined, then this isn’t going to change anything for you.

Whether AD will accept the port is something I am not sure of, which is why I hoped someone would clarify.

I’ve got a Storm Watch alert currently in my area and HA is picking it up from the Alert sensors I configured so I know I am currently getting them from my HA setup.

Then that is what you should be using. Not sure why you had the port in there. The ha_url should be the same as you normally access it.