AppDaemon Q&A

Also, I have just pushed another version (1.4.2) that might also fix this - try it with timeout 60 as above, and let me know.

Then grab 1.4.2 and remove the timeout directive form the config file and let me know if it works or not.

Just out of curiosity do you have requests installed?

pip show requests

Also, have you updated your OS files lately?

Just trying to make sure we are on the same version of everything. Sorry if you have already been over this with someone else.

1.4.2 fixed the timeout request for me as expected. Cheers!

Follow up question: Is there a way for apps to be loaded sequentially?

A use case for my question … for the TTS/Announce app you and others have been working on… would want this to load first so that only 1 call to get_app would need to be made, instead of calling as-needed in the “work” functions.

How do you get to longitude and latitude in AD now?

Check the release notes for 1.4.0 and the updated docs for App configuration :slight_smile:

I pull it directly from Home Assistant

I’m working on a little different slant at the TTS than Rene and I were originally working on. I’m using an event to send the message and priority to the speak engine instead of pushing it directly into the speak application. It seemed a little more straight forward to me.

example please.

Of what? Not sure I understand - I make an API call to HASS when I first start up and pull the info from there.

If I want to use it in one of my apps. For example, if someone doesn’t put in the city state or other information for the weather underground alert thing, then I want to default to the HA instance long/lat. It would be nice if they were in a self.long/self.lat type of variable. Or in a HA class that had other home assistant configuration information in it.

AppDaemon doesn’t currently do that - were you relying on the config file for input into your Apps? If so, you should be able to continue to do so, the messages are only a warning., In a future release I’ll add some way of pulling the info - I didn’t realize people were actually using it for anything!

This would have been the first time. LOL

I’ll sort something out - it makes sense to expose HA configuration information to Apps.

I do not understand your request … (??) add a …? which config file …

I updated to 1.4.2

now is stuck here

pi@raspberrypi:~/appdaemon $ appdaemon -c conf/appdaemon.cfg
2017-01-22 00:05:34.681132 WARNING 'latitude' directive is deprecated, please re                       move
2017-01-22 00:05:34.681839 WARNING 'longitude' directive is deprecated, please r                       emove
2017-01-22 00:05:34.682177 WARNING 'timezone' directive is deprecated, please re                       move
2017-01-22 00:05:34.764649 INFO AppDaemon Version 1.4.2 starting
2017-01-22 00:05:39.994170 INFO Got initial state
2017-01-22 00:05:39.995737 INFO Loading Module: /home/pi/appdaemon/conf/apps/hel                       lo.py
2017-01-22 00:05:39.997561 INFO Loading Object hello_world using class HelloWorl                       d from module hello
2017-01-22 00:05:39.998367 INFO hello_world: Hello from AppDaemon
2017-01-22 00:05:39.998729 INFO hello_world: You are now ready to run Apps!
2017-01-22 00:05:39.999038 INFO App initialization complete
2017-01-22 00:05:39.999909 INFO Connecting to HA

Try using the internal ip address instead of your Duck DNS - it could be causing issues depending on your router config.

don’t be sorry, I am a total dumb newb here.

Regarding your questions

a) I have no idea of what a “requests” is …
b) you want me to
pip show requests
?

this is my result

pi@raspberrypi:~/appdaemon $ pip show requests
---
Name: requests
Version: 2.12.5
Location: /usr/local/lib/python2.7/dist-packages
Requires:

c) I am on 0.36.1

I put
ha_url = https://192.168.1.239:8123

and I receive this error

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 339, in connect
_match_hostname(cert, self.assert_hostname or hostname)
File “/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py”, line 349, 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.1.239’ 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 624, in urlopen
raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: hostname ‘192.168.1.239’ doesn’t match ‘xxx.duckdns.org

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/bin/appdaemon”, line 9, in
load_entry_point(‘appdaemon==1.4.2’, ‘console_scripts’, ‘appdaemon’)()
File “/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py”, line 1178, 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: hostname ‘192.168.1.239’ doesn’t match ‘xxx.duckdns.org
pi@raspberrypi:~/appdaemon $

I’m doing this for now.

  def loadHAconfig(self):
    self.haConfig={}
    locinfo=location.detect_location_info()
    self.haConfig["IP"]=locinfo.ip
    self.haConfig["country_code"]=locinfo.country_code
    self.haConfig["country_name"]=locinfo.country_name
    self.haConfig["region_code"]=locinfo.region_code
    self.haConfig["region_name"]=locinfo.region_name
    self.haConfig["city"]=locinfo.city
    self.haConfig["zip_code"]=locinfo.zip_code
    self.haConfig["time_zone"]=locinfo.time_zone
    self.haConfig["latitude"]=locinfo.latitude
    self.haConfig["longitude"]=locinfo.longitude
    self.haConfig["metric"]=locinfo.use_metric

it does seem that @aimc was a little confused, but after the update you got:

pi@raspberrypi:~/appdaemon $ appdaemon -c conf/appdaemon.cfg
2017-01-22 00:05:34.681132 WARNING 'latitude' directive is deprecated, please re                       move
2017-01-22 00:05:34.681839 WARNING 'longitude' directive is deprecated, please r                       emove
2017-01-22 00:05:34.682177 WARNING 'timezone' directive is deprecated, please re                       move
2017-01-22 00:05:34.764649 INFO AppDaemon Version 1.4.2 starting
2017-01-22 00:05:39.994170 INFO Got initial state
2017-01-22 00:05:39.995737 INFO Loading Module: /home/pi/appdaemon/conf/apps/hel                       lo.py
2017-01-22 00:05:39.997561 INFO Loading Object hello_world using class HelloWorl                       d from module hello
2017-01-22 00:05:39.998367 INFO hello_world: Hello from AppDaemon
2017-01-22 00:05:39.998729 INFO hello_world: You are now ready to run Apps!
2017-01-22 00:05:39.999038 INFO App initialization complete
2017-01-22 00:05:39.999909 INFO Connecting to HA

that seems to me as normal behaviour. hello world is there, ha is connected so appdaemon is running as it should.

so you can go back to your duckdns adress (which by the way isnt redacted a few posts back in 1 of the errorlog :wink:

Leave the port off

1 Like