AppDaemon Q&A

Then that is what you should have in ha_url = and your normal HA password should be in ha_key =.

mmhh done both …

That’s about all I can offer you - someone else with more AD experience is going to have to pitch in.

BTW, I think you meant to put REDACTED instead of deprecated. Two different meanings and could confuse those trying to help.

Ahh I see … thabnks!

yes redacted

You don’t. It pushes in a persistent_notification if there is an alert. It checks every 30 minutes.

What area are you in (city state or the european code) so I can test it out?

Scotch Plains, NJ (ZIP 07076)

in the appdaemon config file, try taking out the quotes around your key.

I’ve got to run for about an hour. But I’ll be back after that.

I was thinking the same thing but wanted to wait for your reply. Testing now.

EDIT: BOOM! That was it.

This is exactly what I was looking for - I was trying to do this with my template sensors and group visibility so it would only show up when there was an alert, but persistent notification was exactly what I was looking for.

BTW, will this create a separate persistent for each alert type if more than one alert is sent?

I can add it in the next release :slight_smile:
IN the meantime, you can use call_service() to achieve the exact same thing - turn_on() and turn_off() are only convenience functions that use call_service() anyway,

1 Like

Still same error, does not connect to HA

pi@raspberrypi:~/appdaemon $ appdaemon -c conf/appdaemon.cfg
2017-01-21 18:25:21.799462 WARNING 'latitude' directive is deprecated, please remove
2017-01-21 18:25:21.817817 WARNING 'longitude' directive is deprecated, please remove
2017-01-21 18:25:21.818189 WARNING 'timezone' directive is deprecated, please remove
2017-01-21 18:25:21.937998 INFO AppDaemon Version 1.4.0 starting
2017-01-21 18:25:27.178409 INFO Got initial state
2017-01-21 18:25:27.180962 INFO Loading Module: /home/pi/appdaemon/conf/apps/hello.py
2017-01-21 18:25:27.188487 INFO Loading Object hello_world using class HelloWorld from module hello
2017-01-21 18:25:27.189908 INFO hello_world: Hello from AppDaemon
2017-01-21 18:25:27.190554 INFO hello_world: You are now ready to run Apps!
2017-01-21 18:25:27.191131 INFO App initialization complete
2017-01-21 18:25:27.192654 INFO Connecting to HA with timeout = 10
2017-01-21 18:25:40.731600 WARNING Not connected to Home Assistant, retrying in 5 seconds

Glad it works. It generates a new message for each alert.

1 Like

This is so awesome Chip! Thanks so much for doing this. It’s exactly what I was looking for.

OK, this will be in 1.4.1 :slight_smile:

One other user has reported this - it seems to be an issue with 1.4.0 - I don’t know what is causing it yet. I’ll add some more troubleshooting info in 1.4.1 that might help us track it down. Stay tuned!

1.4.1 is live - if you download it we should get more info about this error now.

I did uninstall and install, but I still have 1.4.0

pi@raspberrypi:~/appdaemon $ sudo pip3 install .

You need to do a git pull to update the local copy before you install. It should be in the docs under “Updating”

My log
Did update to 1.4.1 correctly, still errors. Now I go to dinner, will be online later

pi@raspberrypi:~/appdaemon $ appdaemon -c conf/appdaemon.cfg
2017-01-21 19:51:47.044213 WARNING 'latitude' directive is deprecated, please remove
2017-01-21 19:51:47.044925 WARNING 'longitude' directive is deprecated, please remove
2017-01-21 19:51:47.045258 WARNING 'timezone' directive is deprecated, please remove
2017-01-21 19:51:47.127103 INFO AppDaemon Version 1.4.1 starting
2017-01-21 19:51:52.357338 INFO Got initial state
2017-01-21 19:51:52.358894 INFO Loading Module: /home/pi/appdaemon/conf/apps/hello.py
2017-01-21 19:51:52.360798 INFO Loading Object hello_world using class HelloWorld from module hello
2017-01-21 19:51:52.361598 INFO hello_world: Hello from AppDaemon
2017-01-21 19:51:52.361943 INFO hello_world: You are now ready to run Apps!
2017-01-21 19:51:52.362233 INFO App initialization complete
2017-01-21 19:51:52.363093 INFO Connecting to HA with timeout = 10
2017-01-21 19:52:02.458129 WARNING Not connected to Home Assistant, retrying in 5 seconds
2017-01-21 19:52:02.458662 WARNING ------------------------------------------------------------
2017-01-21 19:52:02.459079 WARNING Unexpected error:
2017-01-21 19:52:02.459461 WARNING ------------------------------------------------------------
2017-01-21 19:52:02.481011 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/response.py", line 298, in _error_catcher
    yield
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/response.py", line 380, in read
    data = self._fp.read(amt)
  File "/usr/lib/python3.4/http/client.py", line 500, in read
    return super(HTTPResponse, self).read(amt)
  File "/usr/lib/python3.4/http/client.py", line 529, in readinto
    return self._readinto_chunked(b)
  File "/usr/lib/python3.4/http/client.py", line 614, in _readinto_chunked
    chunk_left = self._read_next_chunk_size()
  File "/usr/lib/python3.4/http/client.py", line 552, in _read_next_chunk_size
    line = self.fp.readline(_MAXLINE + 1)
  File "/usr/lib/python3.4/socket.py", line 371, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib/python3.4/ssl.py", line 745, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib/python3.4/ssl.py", line 617, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

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 1025, in run
    for msg in messages:
  File "/usr/local/lib/python3.4/dist-packages/sseclient.py", line 64, in __next__
    nextline = self.resp_file.readline()
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/response.py", line 397, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "/usr/lib/python3.4/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/response.py", line 303, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='1.duckdns.org', port=443): Read timed ou
2017-01-21 19:52:02.481571 WARNING ------------------------------------------------------------
2017-01-21 19:52:07.662129 INFO Got initial state
2017-01-21 19:52:09.666435 INFO Reloading Module: /home/pi/appdaemon/conf/apps/hello.py
2017-01-21 19:52:09.669934 INFO Loading Object hello_world using class HelloWorld from module hello
2017-01-21 19:52:09.671450 INFO hello_world: Hello from AppDaemon
2017-01-21 19:52:09.672089 INFO hello_world: You are now ready to run Apps!
2017-01-21 19:52:09.672644 INFO App initialization complete
2017-01-21 19:52:09.673191 INFO Connecting to HA with timeout = 10
^C2017-01-21 19:52:10.971423 WARNING Not connected to Home Assistant, retrying in 5 seconds
2017-01-21 19:52:10.971928 WARNING ------------------------------------------------------------
2017-01-21 19:52:10.972306 WARNING Unexpected error:
2017-01-21 19:52:10.972674 WARNING ------------------------------------------------------------
2017-01-21 19:52:10.973881 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 1025, in run
    for msg in messages:
  File "/usr/local/lib/python3.4/dist-packages/sseclient.py", line 64, in __next__
    nextline = self.resp_file.readline()
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/response.py", line

Looks like it is having trouble reading from your HA instance and timing out -0 this is related to a change I made.

Try the following:

Add a directove to your config file in the AppDamon section like htisL

timeout = 60

Lets see if that helps.