Announcement - AppDaemon v2!

Hello everyone, I would like to announce that AppDaemon v2 (including HADashboard) is now released!

AppDaemon v2 is very similar to the latest 1.5.2 version, however it has had some architectural changes and not insignificantly now has the addition of HADashboard v2 - if you have been following the beta this should be no surprise to you!

AppDamon v2 is very similar to the last beta, beta 4, with a couple of minor fixes and additions.

To install AppDaemon v2, follow the instructions that relate to your current circumstances:

AppDaemon 1.5.2 Users

The upgrade in this case is relatively simple. Just follow the usual upgrade procedure, There are 2 things to be aware of:

  1. There is a breaking change to the way AppDaemon;s arguments work - the -c option now refers to the config directory in which it expects to find a file called appdaemon.cfg, rather than to the full path of the config file. Make sure you change this in any startup scripts you may have

  2. AppDaemon is migrating to YAML for it’s configuration. The old cfg files will still work but will not necessarily support new features moving forwards. There is a tool to convert the file from the old format to the new, instructions are in the README file.

AppDaemon Beta users, running directly from the repository

If you have been running a separate instance of AppDaemon (1.5.2) as was recommended throughout the beta and have been running the beta just for the dashboard functionality, now is the time to merge them into a single installation. To do this, follow the instructions in the readme to install the latest version of AppDaemon from the master branch. If you want to continue using the dashboard you will need to copy your dashboard configuration files over from the beta install directory to your main directory, as well as edit your AppDaemon config file to include the appropriate HADashboard directives from the beta. Also remember that for 2.0.0 onwards, the -c argument now specifies a directory and not the configuration file, so make sure you update any startup scripts to reflect this.

AppDaemon Beta users, who performed a full install

This should be a seamless upgrade for you - just renew the repository (but use the master branch instead of the beta branch and follow the full installation instructions.

Enjoy the new AppDaemon, and as ever ask any questions you have here!

8 Likes

Forgive me as I haven’t looked myself, yet. But what about docker?

Great, I’ve updated my HaDashboard without a glitch.

A question, when can we hope to have custom widget in the “conf” directory in the same way as the dash themes ?
I would like to develop a compas widget for wind direction, but working in the system dir structure in root is not ideal.

2 Likes

Docker support is alive and well.

Support for custom widgets will be along at some point now the beta is over.

Can you post the required packages for this. I’m replacing my 1.5.2 version and it’s griping about jinja2, but I have a later release than it’s asking for installed and it’s owned by OS so I can’t uninstall it.

(homeassistant_venv) homeassistant@hass2:~/appdaemon$ /usr/local/bin/appdaemon -c /home/pi/appdaemon_dashboard/appdaemon/conf -p /home/pi/appdaemon_dashboard/appdaemon/appdaemon.pid
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 449, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 745, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 644, in resolve
    raise VersionConflict(dist, req)
pkg_resources.VersionConflict: (Jinja2 2.7.3 (/usr/lib/python3/dist-packages), Requirement.parse('Jinja2>=2.9.5'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/appdaemon", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2876, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 451, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 464, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 639, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: appdirs>=1.4.0
(homeassistant_venv) homeassistant@hass2:~/appdaemon$ pwd
/home/homeassistant/appdaemon
(homeassistant_venv) homeassistant@hass2:~/appdaemon$ /usr/local/bin/appdaemon -c /home/homeassistant/appdaemon/conf -p /home/homeassistant/appdaemon/appdaemon.pid
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 449, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 745, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 644, in resolve
    raise VersionConflict(dist, req)
pkg_resources.VersionConflict: (Jinja2 2.7.3 (/usr/lib/python3/dist-packages), Requirement.parse('Jinja2>=2.9.5'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/appdaemon", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2876, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 451, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 464, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 639, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: appdirs>=1.4.0
(homeassistant_venv) homeassistant@hass2:~/appdaemon$ pip3 show Jinja2
Name: Jinja2
Version: 2.9.6
Summary: A small but fast and easy to use stand-alone template engine written in pure python.
Home-page: http://jinja.pocoo.org/
Author: Armin Ronacher
Author-email: [email protected]
License: BSD
Location: /usr/local/lib/python3.4/dist-packages
Requires: MarkupSafe
(homeassistant_venv) homeassistant@hass2:~/appdaemon$

If I try to force install Jinja2 I get the following

pi@hass2:~$ sudo pip3 install 'Jinja2>=2.9.5'
Downloading/unpacking Jinja2>=2.9.5
  Downloading Jinja2-2.9.6-py2.py3-none-any.whl (340kB): 340kB downloaded
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe>=0.23 in /usr/lib/python3/dist-packages (from Jinja2>=2.9.5)
Installing collected packages: Jinja2
  Found existing installation: Jinja2 2.7.3
    Not uninstalling Jinja2 at /usr/lib/python3/dist-packages, owned by OS
*** Error compiling '/tmp/pip-build-5ws2m3_t/Jinja2/jinja2/asyncfilters.py'...
  File "/tmp/pip-build-5ws2m3_t/Jinja2/jinja2/asyncfilters.py", line 7
    async def auto_to_seq(value):
            ^
SyntaxError: invalid syntax

*** Error compiling '/tmp/pip-build-5ws2m3_t/Jinja2/jinja2/asyncsupport.py'...
  File "/tmp/pip-build-5ws2m3_t/Jinja2/jinja2/asyncsupport.py", line 22
    async def concat_async(async_gen):
            ^
SyntaxError: invalid syntax

Successfully installed Jinja2
Cleaning up...

Thank you, being using AppDaemon for dashboard only, but finally found time to migrate all automations. So much easier :slight_smile:

2 Likes

just from reading your error i suspect you should try to upgrade jinja instead of install.

i think that if you install a part thats already there, then it tries to uninstall and install the new version.

upgrade probably doesnt uninstall the old version.

Tried it, no good, same errors on install and when I try to run AD. I think it has something to do with the errors during the install, even though it says it was successful.

pi@hass2:~$ sudo pip3 install 'Jinja2>=2.9.5'
Downloading/unpacking Jinja2>=2.9.5
  Downloading Jinja2-2.9.6-py2.py3-none-any.whl (340kB): 340kB downloaded
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe>=0.23 in /usr/lib/python3/dist-packages (from Jinja2>=2.9.5)
Installing collected packages: Jinja2
  Found existing installation: Jinja2 2.7.3
    Not uninstalling Jinja2 at /usr/lib/python3/dist-packages, owned by OS
*** Error compiling '/tmp/pip-build-5ws2m3_t/Jinja2/jinja2/asyncfilters.py'...
  File "/tmp/pip-build-5ws2m3_t/Jinja2/jinja2/asyncfilters.py", line 7
    async def auto_to_seq(value):
            ^
SyntaxError: invalid syntax

*** Error compiling '/tmp/pip-build-5ws2m3_t/Jinja2/jinja2/asyncsupport.py'...
  File "/tmp/pip-build-5ws2m3_t/Jinja2/jinja2/asyncsupport.py", line 22
    async def concat_async(async_gen):
            ^
SyntaxError: invalid syntax

Successfully installed Jinja2
Cleaning up...

I believe that it was situations like this that virtual environments were created for.

I am using the same one as HA, but I think the correct way to do it would be to create a separate one for appdaemon, in case HA and appdaemon ever need to diverge.

If I was doing a fresh install, I agree, but at this point I really don’t want to try and separate the two. And since the object it is complaining about is “owned by the OS”, I don’t have any confidence that creating another virtual environment would fix it. Also that set of errors seems to be fairly command going back to early this year based on a google search. And in most cases it is a result of the version of Python. I did my testing with the dashboard on another box entirely, which has the same version of python as I have on my production box, and had no issues there. So I go back to my initial question, am I missing some required dependencies? I have verified that the following are installed.

$ pip3 install daemonize
$ pip3 install configparser
$ pip3 install astral
$ pip3 install ‘requests>=2.6.0’
$ pip3 install sseclient
$ pip3 install websocket-client
$ pip3 install async
$ pip3 install ‘aiohttp>=2.0.5’
$ pip3 install Jinja2==2.9.5
$ pip3 install aiohttp_jinja2
$ pip3 install pyScss
$ pip3 install pyyaml
$ pip3 install voluptuous

Are there any others I am missing?

You shouldn’t need to install the dependencies manually - it should be done by the pip install command, per the instructions in README - doing the stuff manually was part of the recommended beta install process but not for the final version.

Try it with $ pip install . as per the instructions and let me know what happens.

It says everything is met but still doesn’t work…

(homeassistant_venv) homeassistant@hass2:~/appdaemon$ pip install .
Processing /home/homeassistant/appdaemon
  Requirement already satisfied (use --upgrade to upgrade): appdaemon==2.0.0 from file:///home/homeassistant/appdaemon in /usr/local/lib/python3.4/dist-packages
Requirement already satisfied: daemonize in /usr/local/lib/python3.4/dist-packages (from appdaemon==2.0.0)
Requirement already satisfied: configparser in /usr/local/lib/python3.4/dist-packages (from appdaemon==2.0.0)
Requirement already satisfied: astral in /usr/local/lib/python3.4/dist-packages (from appdaemon==2.0.0)
Requirement already satisfied: requests>=2.6.0 in /usr/local/lib/python3.4/dist-packages (from appdaemon==2.0.0)
Requirement already satisfied: sseclient in /usr/local/lib/python3.4/dist-packages (from appdaemon==2.0.0)
Requirement already satisfied: websocket-client in /usr/local/lib/python3.4/dist-packages (from appdaemon==2.0.0)
Requirement already satisfied: async in /usr/local/lib/python3.4/dist-packages (from appdaemon==2.0.0)
Requirement already satisfied: aiohttp>=2.0.5 in /usr/local/lib/python3.4/dist-packages (from appdaemon==2.0.0)
Requirement already satisfied: Jinja2>=2.9.5 in /usr/local/lib/python3.4/dist-packages (from appdaemon==2.0.0)
Requirement already satisfied: aiohttp_jinja2 in /usr/local/lib/python3.4/dist-packages (from appdaemon==2.0.0)
Requirement already satisfied: pyyaml in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from appdaemon==2.0.0)
Requirement already satisfied: voluptuous in /usr/local/lib/python3.4/dist-packages (from appdaemon==2.0.0)
Requirement already satisfied: feedparser in /usr/local/lib/python3.4/dist-packages (from appdaemon==2.0.0)
Requirement already satisfied: pytz in /usr/local/lib/python3.4/dist-packages (from astral->appdaemon==2.0.0)
Requirement already satisfied: idna<2.6,>=2.5 in /usr/local/lib/python3.4/dist-packages (from requests>=2.6.0->appdaemon==2.0.0)
Requirement already satisfied: urllib3<1.22,>=1.21.1 in /usr/local/lib/python3.4/dist-packages (from requests>=2.6.0->appdaemon==2.0.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.4/dist-packages (from requests>=2.6.0->appdaemon==2.0.0)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.4/dist-packages (from requests>=2.6.0->appdaemon==2.0.0)
Requirement already satisfied: six in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/six-1.10.0-py3.4.egg (from sseclient->appdaemon==2.0.0)
Requirement already satisfied: multidict>=2.1.4 in /usr/local/lib/python3.4/dist-packages (from aiohttp>=2.0.5->appdaemon==2.0.0)
Requirement already satisfied: async_timeout>=1.2.0 in /usr/local/lib/python3.4/dist-packages (from aiohttp>=2.0.5->appdaemon==2.0.0)
Requirement already satisfied: yarl>=0.11 in /usr/local/lib/python3.4/dist-packages (from aiohttp>=2.0.5->appdaemon==2.0.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.4/dist-packages (from Jinja2>=2.9.5->appdaemon==2.0.0)
Requirement already satisfied: setuptools>=0.6b1 in /usr/local/lib/python3.4/dist-packages (from voluptuous->appdaemon==2.0.0)
Requirement already satisfied: packaging>=16.8 in /usr/local/lib/python3.4/dist-packages (from setuptools>=0.6b1->voluptuous->appdaemon==2.0.0)
Requirement already satisfied: appdirs>=1.4.0 in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from setuptools>=0.6b1->voluptuous->appdaemon==2.0.0)
Requirement already satisfied: pyparsing in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from packaging>=16.8->setuptools>=0.6b1->voluptuous->appdaemon==2.0.0)
(homeassistant_venv) homeassistant@hass2:~/appdaemon$

This is just for a simple AD install, no dashboard. Do I need the dash_url and dash_dir in the config file?

That won’t cause the errors you are seeing here …

However, it looks like you are not comparing like with like. In the install scenario, you are not using a venv, in the pip install you are. Also, in response to Rene’s suggestion to upgrade it looked like you did another install.

I see you are using sudo for the install - what happens if you don’t use sudo? Some googling seems to imply that the error is just a warning, and the new Jinja installs but it leaves the OS version in place.

Are you getting the same error?

I’ve tried so many iterations at this point, I’m not sure. So just to level set.

  1. I am on my HA machine in the HA virtual environment.
  2. This is the HA environment I have had for production since day 1 (well day 2 if you count that time I switched machines and re-installed everything).
  3. The Install I used for beta is on another machine and it upgraded fine.

So what other information can I get you. I’m in the process of going through all the pip3 installed components on the web instance and all the ones on the HA instance and upgrading the HA instance to be at or above the web instance whether they seem to be related to AD or not.

I use the main python env for AD and Hass has it’'s own venv. In my HASS venv, Jinja2 is at 2.9.6:

(hass_env) hass@Pegasus:/export/hass/hass_env/bin$ pip show Jinja2
Name: Jinja2
Version: 2.9.6
Summary: A small but fast and easy to use stand-alone template engine written in pure python.
Home-page: http://jinja.pocoo.org/
Author: Armin Ronacher
Author-email: [email protected]
License: BSD
Location: /export/hass/hass_env/lib/python3.5/site-packages
Requires: MarkupSafe
(hass_env) hass@Pegasus:/export/hass/hass_env/bin$

So yours should be the same- can you check for me?

Jinja is at 2.9.6. But I think I found it.

setuptools was several versions out of date. I updated it to current and now appdaemon starts.

1 Like

Excellent!

Hey, and now there is a new HA release… Not gonna happen this weekend. LOL

Hmm, states are trying to be loaded at the container IP and not the Host IP

i.e. loading http://0.0.0.0:5050/state/sensor.dark_sky_wind_speed rather than http://192.168.1.1885050/state/sensor.dark_sky_wind_speed

I’m assuming there is something I’m missing. Any guidance from someone with Docker working properly?