Announcement: HADashboard v2 Beta!

Happy Saturday! Today is the first day of the HADasboard v2 Open Beta!

After a phenomenal amount of coding, and huge assistance from @ReneTode and @rpitera I am now ready to roll this out to a wider audience of testers. The goal of this stage of the Beta is functional: can you get it installed and configured, do things work, are you seeing the demo dash correctly, can you easily configure a basic dashboard. We have skins in place but at this time I would prefer they take a backseat for now - feel free to play, we’ll get to skinning a little later in the Beta process once we are sure the basics are in place and working.

So, with that in mind I want to hear about any installation and configuration issues. I especially want to know about anything that happens that leaves you with a blank screen or a 500 response code. When that happens please be sure to capture the output from the logfile and provide information on what you were doing and also your configuration files to help me track down any issues.

Any and all questions are welcome on this thread and we will do our best to keep up.

Also, I am excited to see any screenshots of your dashboards as you get them up and running.

We don’t yet have complete support for all the widgets and entity types, but I expect to add a lot more during the beta.

Feature requests are welcome but don’t expect them to be acted on immediately - I maintain a list and will add your request and get to it when I have the cycles.

So, with that said, on to the fun part!

As beta testers I am recommending a slightly different install process to the one that might be familiar to existing AppDaemon users…

You need to get hold of the specific beta code instead of the existing released code, which is placed on a separate branch on GitHub called hadashboard_beta. I suggest you put this in a completely different place from any existing AppDaemon installation - you can update that when HADashboard beta is over and I have moved it to the main repository.

Installation

Installation is normally either by pip3 or Docker. The Docker install is unchanged for the Beta, but for pip3 installers we will be running directly from the repository and not actually performing the pip install - this is to avoid overwriting any existing AppDaemon installs. Although for the Beta I am recommending a separate instance, ultimately it will all run together as a single install, and in fact, through the development process I have been running Beta code as my main install and it has worked fine, both Apps and Dashboards, however I suggest caution as this is still a beta.

Installation has been run through successfully on Ubuntu 16 and Raspbian. If you require any additional steps on different platforms please report back here so we can capture them and add to the docs.

Clone the Repository

For either method you will need to clone the AppDaemon repository to the current local directory on your machine. For the beta as suggested, make this a new directory so you don’t overwrite your existing AppDaemon install, e.g. appdaemon_dashboard.

$ cd <base path>
$ mkdir appdaemon_dashboard
$ cd appdaemon_dashboard
$ git clone -b hadashboard_beta https://github.com/home-assistant/appdaemon.git

Change your working directory to the repository root. Moving forward, we will be working from this directory.

$ cd appdaemon

Non Docker Install

Since we aren’t doing a pip install we will need to manually install some modules that would normally be added vis pip:

$ 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

Docker Install

To build the Docker image run the following:

$ docker build -t appdaemon .

(Note the period at the end of the above command)

#Configuration

When you have appdaemon installed by either method, copy the conf/appdaemon.cfg.example file to conf/appdaemon.cfg, then edit the [AppDaemon] section to reflect your environment:

[AppDaemon]
ha_url = <some_url>
ha_key = <some key>
logfile = STDOUT
errorfile = STDERR
threads = 10
cert_path = <path/to/root/CA/cert>
# Apps
[hello_world]
module = hello
class = HelloWorld
  • ha_url is a reference to your home assistant installation and must include the correct port number and scheme (http:// or https:// as appropriate)
  • ha_key should be set to your key if you have one, otherwise it can be removed.
  • logfile (optional) is the path to where you want AppDaemon to keep its main log. When run from the command line this is not used - log messages come out on the terminal. When running as a daemon this is where the log information will go. In the example above I created a directory specifically for AppDaemon to run from, although there is no reason you can’t keep it in the appdaemon directory of the cloned repository. If logfile = STDOUT, output will be sent to stdout instead of stderr when running in the foreground, if not specified, output will be sent to STDOUT.
  • errorfile (optional) is the name of the logfile for errors - this will usually be errors during compilation and execution of the apps. If errorfile = STDERR errors will be sent to stderr instead of a file, if not specified, output will be sent to STDERR.
  • threads - the number of dedicated worker threads to create for running the apps. Note, this will bear no resembelance to the number of apps you have, the threads are re-used and only active for as long as required to tun a particular callback or initialization, leave this set to 10 unless you experience thread starvation
  • cert_path (optional) - path to root CA cert directory - use only if you are using self signed certs.

Optionally, you can place your apps in a directory other than under the config directory using the app_dir directive.

e.g.:

app_dir = /etc/appdaemon/apps

When AppDaemon is configured you can run it from the command line directly against the repository with the following steps. Make sure you are still in the repository directory, e.g. appdaemon_dasboard/appdaemon

$ cd <base path>/appdaemon_dasboard/appdaemon
$ python3 -m appdaemon.appdaemon -c <path to configuration directory>

If all is well you should see something like:

2017-02-20 08:07:34.985296 INFO AppDaemon Version 2.0.0beta starting
2017-02-20 08:07:34.985685 INFO Apps are disabled
2017-02-20 08:07:40.141165 INFO Got initial state
2017-02-20 08:07:40.141522 INFO Starting dashboard
2017-02-20 08:07:40.156139 INFO Listening on ('192.168.1.20', 5050)
2017-02-20 08:07:40.158829 INFO Connected to Home Assistant 0.38.3

At this point you are ready to start configuring your dashboards - read DASHBOARD.md for full instructions on how to configure them.

For docker users, just follow the usual full install process. Docker support hasn’t been extensively tested but is reported as working.

$ docker create --name appdaemon --restart always -p 5050:5050 -v /etc/localtime:/etc/localtime:ro -v [/local/conf]/folder:/conf appdaemon
$ docker start appdaemon
$ docker logs -f appdaemon

For Docker on Raspberry PI, follow @quadportnick’s steps here.

When you need to update to a new version of the code, just simply run:

$ git pull origin

Then restart from the command line without running the pip install.

That’s it for now - lets see who can be the first to get a new dash up and running - pics or it didn’t happen!

10 Likes

Recusing myself from this! :stuck_out_tongue_closed_eyes:

Enjoy!!!

2 Likes

Minor Typo! Missing an “h” in dashboard in the “Clone the Repository” section…

$ mkdir appdaemon_dasboard

2 Likes

Cheers for all these efforts, looking forward to trying it out :slight_smile:

I’ve just ran:

sudo python -m appdaemon.appdaemon -c ~/appdaemon_dashboard/appdaemon/conf

and encountered this message:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/server/appdaemon_dashboard/appdaemon/appdaemon/appdaemon.py", line 6, in <module>
    from importlib.machinery import SourceFileLoader
ImportError: No module named machinery

Where have I gone wrong?

Also, the latitude, longitude, elevation and timezone are in the example config - should I complete them or ignore them?

Not that I think they’re related, but I saw the same message when I commented them out, and completed them.

That should be python3 - and I didn’t have to use sudo.

Should be python3 not python.

Just delete them, they shouldn’t be there.

Cheers, python3 did the trick for the other issue too :slight_smile:

I had to do one install:

sudo pip3 install aiohttp_jinja2

And now I’m up & running with:

2017-03-04 16:02:21.849637 INFO AppDaemon Version 2.0.0beta1 starting
/home/server/appdaemon_dashboard/appdaemon/conf/apps
2017-03-04 16:02:26.996253 INFO Got initial state
2017-03-04 16:02:26.997089 INFO Loading Module: /home/server/appdaemon_dashboard/appdaemon/conf/apps/hello.py
2017-03-04 16:02:26.998356 INFO Loading Object hello_world using class HelloWorld from module hello
2017-03-04 16:02:27.083868 INFO hello_world: Hello from AppDaemon
2017-03-04 16:02:27.085985 INFO hello_world: You are now ready to run Apps!
2017-03-04 16:02:27.086231 INFO App initialization complete
2017-03-04 16:02:27.095053 INFO Connected to Home Assistant 0.38.2

I should be seeing more dashboard related items shouldn’t I?

2 Likes

You now need to run through the dashboard setup in DASHBOARD.md, you won’t see any messages until you do that.

At the least, you will have to set up your dash_url.

Yep, to save resources, the dashboard code isn’t activated until you do that.

Is there a particular websocket that needs to be installed. I’m getting

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 17, in
from websocket import create_connection
ImportError: cannot import name ‘create_connection’

Before that it couldn’t find the websocket module so I did sudo pip3 install websocket. It seemed to go ok, but now I am getting this.

Did you install websock-client like the docs said?

Duuuh, I saw the word docker and skipped past it. :flushed:

1 Like

Hi guys,

I installed it as the docs said and when I’m about to start everything I get this error,

  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/haDashboard/appdaemon/appdaemon/appdaemon.py", line 30, in <module>
import appdaemon.homeassistant as ha
File "/home/pi/haDashboard/appdaemon/appdaemon/homeassistant.py", line 8, in <module>
from requests.packages.urllib3.exceptions import InsecureRequestWarning
ImportError: cannot import name 'InsecureRequestWarning'

I tried to google it but with no luck. Any suggestions?

Saw this once before but never got any details back from the reporter.

It’s ok to comment out that line in the Python code - line 8 in homeassistant.py and you should be up and running.

What platform and version of Python are you running on?

Also are you using a self-signed cert for HA?

evidently it is used. All I get when I run from the command line is a line with my apps directory. However, my log file has the expected output.

I’m running Hassbian and Python 3.4.2 on this RPi