Announcement: AppDaemon 2.1.8, 2.1.9

2.1.9 addresses an issue for Dashbaord only users

If you are running HADashboard with no Apps, you need to do the following:

  1. Upgrade to 2.1.9
  2. Make sure that disable_apps is either unset or set to 0
  3. create an empty apps.yaml file in your config directory

Hi there - a minor release, but a lot of work is going on behind the scenes to integrate AppDaemon with HASS, and some nice additional example apps have been contributed by Torkild Retvedt.

Hass.io users - please do not upgrade yet

The changes I have mnade to AppDaemon will not work with the current AppDaemon addon for hass.io. I have informed @vkorn and hopefully he will make the required changes soon.

Breaking Changes to Configuration and Widget API

There are a couple of breaking changes here - the most important is that I have separated the App configuration out from the AppDaemon.yaml file into it’s own file called apps.yaml in the configuration directory - this is in preparation for moving AD into HASS where the main config will come from the HASS config itself when we get to that point. For now, both files are required. So, if you have an AppDaemon.yaml that looks like this:

AppDaemon:
  threads: '10'
  api_key: !secret ad_key
HASS:
  ha_key: !secret ha_key
  ha_url: http://192.168.1.20:8123
HADashboard:
  dash_url: http://192.168.1.20:5151
#Apps
hello_world:
  module: hello
  class: HelloWorld

Edit it so that AppDaemon.yaml looks like this:

AppDaemon:
  threads: '10'
  api_key: !secret ad_key
HASS:
  ha_key: !secret ha_key
  ha_url: http://192.168.1.20:8123
HADashboard:
  dash_url: http://192.168.1.20:5151

And apps.yaml looks like this:

#Apps
hello_world:
  module: hello
  class: HelloWorld

In addition, there has been a change to the Widget API. In the JavaScript portion of the widgets, when registering for events, there is a new required parameter called action. This has been added so that widgets can respond to all types of events, not just clicks. To fix any custom widgets, add the new parameter with a value of click like this:

 var callbacks =
        [
            {"selector": '#' + widget_id + ' > span', "action": "click", "callback": self.OnButtonClick},
            {"selector": '#' + widget_id + ' #level-up', "action": "click", "callback": self.OnRaiseLevelClick},
            {"selector": '#' + widget_id + ' #level-down', "action": "click", "callback": self.OnLowerLevelClick},
        ]  

Features

  • Refactor of dashboard code in preparation for HASS integration
  • Addition of check to highlight excessive time in scheduler loop
  • Split app configuration out into a separate file in preparation for HASS integration
  • Enhance widget API to handle all event types instead of just click
  • Add example HADashboard focussed Apps for Oslo City Bikes, Caching of local AppDaemon events, Monitoring events and logging, Google Calendar Feed, Oslo Public Transport, YR Weather - contributed by Torkild Retvedt

Fixes

  • Fixed a bug that gave a spurious “text widget not found” error

Breaking Changes

  • App configuration is now separate from AppDaemon, HASS and HADashboard configuration
  • The Widget API has changed to accommodate different event types and now needs an action parameter to specify what the event type to be listened for is
4 Likes

Is upgrading as simple as running the install appdaemon command or are there extra steps?

thanks this is awesome by the way!

1 Like

Yes, it should just be:

$ sudo pip3 install --upgrade appdaemon

http://appdaemon.readthedocs.io/en/latest/INSTALL.html#updating-appdaemon

thanks, i must have over looked that i was looking at the top of that doc.

1 Like

Yu have an idea what package it is looking for? I was not using apps I had the apps_disabled: 1 in my config file. But after the upgrade it complained about not seeing the apps.yaml mentioned in your post. I created that file and left it empty and am getting this…

AD is the only think I run on this pi.

Ive done the apt-get update/upgrade also

pi@hadash:/home/homeassistant/conf $ appdaemon -c /home/homeassistant/conf
2017-09-08 12:24:52.025272 INFO AppDaemon Version 2.1.8 starting
2017-09-08 12:24:52.025780 INFO Configuration read from: /home/homeassistant/conf/appdaemon.yaml
2017-09-08 12:24:52.367228 INFO Starting Apps
2017-09-08 12:24:52.718010 INFO Got initial state
Traceback (most recent call last):
  File "/usr/local/bin/appdaemon", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/appdaemon/admain.py", line 516, in main
    run()
  File "/usr/local/lib/python3.6/site-packages/appdaemon/admain.py", line 50, in run
    ad.run_ad(loop, tasks)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 1360, in run_ad
    read_apps(True)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 1032, in read_apps
    dependent_modules = find_dependent_modules(module)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 971, in find_dependent_modules
    for mod in conf.app_config:
TypeError: 'NoneType' object is not iterable

OK, I might need to tidy that up a little - does setting disable_apps: 1 fix it now you have the apps.yaml file?

no worries, even with the disable_apps it will not start.

pi@hadash:/home/homeassistant/conf $ cat appdaemon.yaml 
AppDaemon:
  logfile: STDOUT
  errorfile: STDERR
  threads: 10
  disable_apps: 1

  rss_feeds:
    - feed: http://rss.cnn.com/rss/cnn_topstories.rss
      target: news
    - feed: http://feeds.macrumors.com/MacRumors-Front
      target: macrumors

  rss_update: 300

HASS:
  ha_url: https://xx.duckdns.org
  ha_key: xx

HADashboard:
  dash_url: http://192.168.x.x:5050
  dash_dir: /home/homeassistant/conf/dashboards

pi@hadash:/home/homeassistant/conf $ 
pi@hadash:/home/homeassistant/conf $ 
pi@hadash:/home/homeassistant/conf $ cat apps.yaml 
pi@hadash:/home/homeassistant/conf $ 
pi@hadash:/home/homeassistant/conf $ 
pi@hadash:/home/homeassistant/conf $ appdaemon -c /home/homeassistant/conf
2017-09-08 12:33:55.018159 INFO AppDaemon Version 2.1.8 starting
2017-09-08 12:33:55.019063 INFO Configuration read from: /home/homeassistant/conf/appdaemon.yaml
2017-09-08 12:33:55.368947 INFO Starting Apps
2017-09-08 12:33:55.729439 INFO Got initial state
Traceback (most recent call last):
  File "/usr/local/bin/appdaemon", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/appdaemon/admain.py", line 516, in main
    run()
  File "/usr/local/lib/python3.6/site-packages/appdaemon/admain.py", line 50, in run
    ad.run_ad(loop, tasks)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 1360, in run_ad
    read_apps(True)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 1032, in read_apps
    dependent_modules = find_dependent_modules(module)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 971, in find_dependent_modules
    for mod in conf.app_config:
TypeError: 'NoneType' object is not iterable
pi@hadash:/home/homeassistant/conf $

OK, I’m working on a fix

Thank you sir.

OK, I just released version 2.1.9 - it has a workaround, not a fix, I’ll work on it some more but I wanted to get you up and running.
So, install 2.1.9, unset disable_apps and go back to your empty apps.yaml file and it should now work - let me know!

1 Like

You are quick!!! Very much appreciated!!! Working perfect, these have already become a very useful tool in my home that is used very often.

Thanks again, we are all good :slight_smile:

1 Like

Phew :slight_smile:

I was half way through a refactor when I decided to release to get the custom widget enhancement out, but this slipped through unnoticed - if I had finished the refactor it would have been fine :slight_smile:

In the next release you will be able to remove the apps.yaml file and set disable_apps back to 1 as intended.

2 Likes

Hey, your doing some amazing work here! Thanks again for the quick help! Im sure you have plenty of volunteers but if you ever want some assistance or testing done I would be happy to help an anyway.

I have a second pi setup that runs ha so I can do my testing on that before moving to the prod pi. I plan on setting up a second hadash pi to do the same.

1 Like

Hey quick question. Ive been using pexel for for an image inside a widget. How could I use a local file? I see img_list but Im not sure where I can put the file and if I should use the full path in the config…

Not yet possible but its on my to do list. You can host files on HASS however- although I couldn;t find it anywhere in the docs.

Alright, thank you

my solution was installing apache on another pi and sliding the image files in /var/www/html then using http://192.168.x.x/image_file_name.jpg works perfect.

Sounds good to me!

1 Like

@Darbos @aimc You don’t need to install Apache. You just need to create a new folder named “www” inside you “config” folder and put files inside it (example: “config/www”)

I’m using this to put images for known-devices:

jmra:
  hide_if_away: false
  name: Pike
  picture: "http://<server-address>:<server-port>/local/picture.jpg"
  track: true
  vendor: Samsung

Where server-address is you external, or internal if you don’t have HA exposed to the outside, server address. server-port is you server port, usually 8123.

I can’t remember where i saw how this works but i’m sure it was here, in the Community blog. I’m using Hass.io with HA 0.52.1 on Pi 3.

Hope it helps!

3 Likes

thanks I was wondering how to do that. I have a seperate pi other than ha that I installed sql on and am going to point the db over to it. Figured I could get a little more use outta that one and have it serve the images for the dashboards, I try to leave ha alone if I can.

1 Like