Announcement: HADashboard v2 Beta!

I’m still having to run appdaemon under sudo. Any idea what the permissions are that are keeping me from running it as my pi user?

I can;t tell without the error - can you post please?

Never mind, running the version of AD that should let me run on startup, it works fine. I need lunch.

First of all, amazing work guys… I cant wait to get this working :slight_smile:

I’m also getting the same issue as @Gustafsson, however I followed a sequence of events to get there…

pi@raspberrypi:~/appdaemon_dashboard/appdaemon $ python3 -m appdaemon.appdaemon -c conf/appdaemon.cfg
Traceback (most recent call last):
  File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/pi/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 20, in <module>
    from sseclient import SSEClient
ImportError: No module named 'sseclient'

sudo pip3 install sseclient

pi@raspberrypi:~/appdaemon_dashboard/appdaemon $ python3 -m appdaemon.appdaemon -c conf/appdaemon.cfg
Traceback (most recent call last):
  File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/pi/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 28, in <module>
    import astral
ImportError: No module named 'astral'

sudo pip3 install astral

pi@raspberrypi:~/appdaemon_dashboard/appdaemon $ python3 -m appdaemon.appdaemon -c conf/appdaemon.cfg
Traceback (most recent call last):
  File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/pi/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 30, in <module>
    import appdaemon.homeassistant as ha
  File "/home/pi/appdaemon_dashboard/appdaemon/appdaemon/homeassistant.py", line 8, in <module>
    from requests.packages.urllib3.exceptions import InsecureRequestWarning
ImportError: cannot import name 'InsecureRequestWarning'

I have attempted to run “$ pip3 install requests>=2.6.0” as suggested by @aimc to @Gustafsson, unfortunately it still results in with the same error.

ImportError: cannot import name ‘InsecureRequestWarning’

I saw @aimc you suggested to comment out line 8 in homeassistant.py, are you able to give me the file location of this?

my platform is Raspberry Pi3 AIO Installer

Hi there - sorry for the run around there were some missing dependencies in my instructions which I just added in.

The location of the file you are looking for is under the repository root in the appdaemon subdirectory, called homeassistamt.py

You can see it in the error message:

File "/home/pi/appdaemon_dashboard/appdaemon/appdaemon/homeassistant.py", line 8

Commenting out the line with a # at the start ought to fix the error.

On my RPi I had to quote the parameter from
pip3 install requests>=2.6.0
to
pip3 install 'requests>=2.6.0'
else the > symbol was treated as a redirect to file named =2.6.0

1 Like

OK, If i comment out line 8 I get an error in line 9, so i proceeded to comment out line 9 also, unfortunately got something new now :frowning:

 pi@raspberrypi:~/appdaemon_dashboard/appdaemon $ python3 -m appdaemon.appdaemon -c conf/appdaemon.cfg
Traceback (most recent call last):
  File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/pi/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 30, in <module>
    import appdaemon.homeassistant as ha
  File "/home/pi/appdaemon_dashboard/appdaemon/appdaemon/homeassistant.py", line 9, in <module>
    requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
NameError: name 'InsecureRequestWarning' is not defined
pi@raspberrypi:~/appdaemon_dashboard/appdaemon $ python3 -m appdaemon.appdaemon -c conf/appdaemon.cfg
Traceback (most recent call last):
  File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/pi/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 1822, in <module>
    main()
  File "/home/pi/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 1586, in main
    config.read_file(open(config_file))
NotADirectoryError: [Errno 20] Not a directory: 'conf/appdaemon.cfg/appdaemon.cfg'

Here is my config

[AppDaemon]
ha_url = https://sub.domain.io:8000
ha_key = HassAPIKeyHere
logfile = STDOUT
errorfile = STDERR
threads = 10
latitude = 
longitude = 
elevation = 
time_zone = 
# Apps
[hello_world]
module = hello
class = HelloWorld

I’m using -c ./conf, i.e. just the dir not the filename…

1 Like

Perfect, thanks that’s fixed it :slight_smile:

Fixed - thanks!

Could you try putting line 8 back in and using cokelid’s fix above, e.g. quoting the requests version like he said:

$ pip3 install 'requests>=2.6.0'

Thanks I overlooked the comment by @cokelid, I have uncommented lines 8 and 9 and used pip3 install ‘requests>=2.6.0’ as suggested and it has fixed the error :smiley:

Cheers guys

1 Like

I will check things out this weekend! Thanks to aimc, ReneTode & rpitera for getting this out so quickly, hope to get my hands dirty soon.

2 Likes

I am getting

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/anilroy/tmp/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 35, in <module>
    import appdaemon.appdash as appdash
  File "/home/anilroy/tmp/appdaemon_dashboard/appdaemon/appdaemon/appdash.py", line 13, in <module>
    import appdaemon.dashboard as dashboard
  File "/home/anilroy/tmp/appdaemon_dashboard/appdaemon/appdaemon/dashboard.py", line 7, in <module>
    from jinja2 import Environment, BaseLoader, FileSystemLoader, select_autoescape
ImportError: cannot import name 'select_autoescape'

This is related to your version of Jinja being out of date - what does:

$ pip show Jinja2

show you ? Did you run the pip install of jinja with no errors?

 pip3 show Jinja2
---
Metadata-Version: 1.1
Name: Jinja2
Version: 2.8
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/lib/python3/dist-packages
Requires: MarkupSafe
Classifiers:
  Development Status :: 5 - Production/Stable
  Environment :: Web Environment
  Intended Audience :: Developers
  License :: OSI Approved :: BSD License
  Operating System :: OS Independent
  Programming Language :: Python
  Programming Language :: Python :: 2
  Programming Language :: Python :: 2.6
  Programming Language :: Python :: 2.7
  Programming Language :: Python :: 3
  Programming Language :: Python :: 3.3
  Topic :: Internet :: WWW/HTTP :: Dynamic Content
  Topic :: Software Development :: Libraries :: Python Modules
  Topic :: Text Processing :: Markup :: HTML
Entry-points:
  [babel.extractors]
  jinja2 = jinja2.ext:babel_extract[i18n]

I did try to install

pip3 install Jinja2==2.9.5
Collecting Jinja2==2.9.5
  Downloading Jinja2-2.9.5-py2.py3-none-any.whl (340kB)
    100% |████████████████████████████████| 348kB 2.8MB/s 
Collecting MarkupSafe>=0.23 (from Jinja2==2.9.5)
  Downloading MarkupSafe-0.23.tar.gz
Building wheels for collected packages: MarkupSafe
  Running setup.py bdist_wheel for MarkupSafe ... done
  Stored in directory: /home/anilroy/.cache/pip/wheels/a3/fa/dc/0198eed9ad95489b8a4f45d14dd5d2aee3f8984e46862c5748
Successfully built MarkupSafe
Installing collected packages: MarkupSafe, Jinja2
Successfully installed Jinja2-2.8 MarkupSafe-0.23

what am I missing?

I’m not sure - you are telling it to install 2.9.5 and it installs 2.8 which is too low a version. What platform are you running on?

WOW finally got ADD (AppDaemonDashboard) to start from systemctl. I fought with this for over an hour before I found a web page that basically said “oh, on a RPI you have to use systemctl instead of systemd to enable and control it”.

Never could get it working under the /etc/init.d method. Had to use the /etc/systemd/system method.

Also I’m running under a virtual environment so I had to do some additional tweaking to make sure it opened the virtual environment to run it from there.

Now on to the fun stuff.

For those interested,
You have to have the normal version of AD installed and here is my appdaemon.service file

(venv) pi@haweb:/etc/systemd/system$ cat appdaemon.service
#
# Sample unit file for systemd
#
# Edit top suit your environment, then copy to /etc/systemd/system
#
# run "sudo systemctl enable appdaemon.service" to make it start at boottime
#
[Unit]
Description=AppDaemon service for Home Assistant
# Add the following line to make sure network is up when you launch
After=network.target

[Service]
# Stole the next 4 lines from the HA install which runs in a virtual environment and then corrected the paths to match mine.
Type=simple
User=pi
Environment='VIRTUAL_ENV=/srv/hadashboard/venv'
Environment=PATH=/srv/hadashboard/venv/bin:/usr/sbin:$PATH'
# added the -c and -p arguements here
ExecStart=/usr/local/bin/appdaemon -c /home/pi/appdaemon_dashboard/appdaemon/conf -p /home/pi/appdaemon_dashboard/appdaemon/appdaemon.pid
#
# If you are not using a default path for the config file use this:
#
#ExecStart=/usr/local/bin/appdaemon -c <path to config file>
#
[Install]
WantedBy=multi-user.target
(venv) pi@haweb:/etc/systemd/system$
5 Likes

Success! I did the pip3 install (non-docker) on an older AiO HomeAssistant install on an RPi, and I now have the “Hello” dashboard up and running!

1 Like