HADashboard is a very cool dashboard for use with Home Assistant. I’ve tested the installation process on a Raspberry Pi1 version B (yes I know) and although it took nearly a whole day to get working, work it does and by golly, does it look good. More info on GitHub here https://github.com/home-assistant/hadashboard
Installing HADashboard for Home Assistant on Jessie
“I personally prefer docker-compose to create and run the images:
This is my docker-compose.yaml file for hadashboard:”
---
home-assistant:
build: Dockerfile-rpi
restart: always
net: "host"
volumes:
- '/etc/localtime:/etc/localtime:ro'
- '/etc/timezone:/etc/timezone:ro'
- '/etc/home-assistant/hadashboard/dashboards:/app/dashboards
- '/etc/home-assistant/hadashboard/config/:/app/lib/
- '/etc/home-assistant/hadashboard/hapush/:/app/hapush/
Good luck and may the force be with you.
Post your issues in GitHub here https://github.com/home-assistant/hadashboard/issues
- First step is to install docker on your Raspberry Pi if you have never done that before:
curl -sSL get.docker.com | sh - If you would like to use Docker as a non-root user, you should now consider adding your user to the "docker" group with something like:
sudo usermod -aG docker pi - Set Docker to auto-start:
sudo systemctl enable docker
Installing HADashboard for Home Assistant on Jessie
- Clone the Repository:
Clone the hadashboard repository to the current local directory on your machine.
git clone https://github.com/home-assistant/hadashboard.git - Change your working directory to the repository root. Moving forward, we will be working from this directory:
cd hadashboard - Install the hadashboard docker file:
Raspberry pi needs to use a different docker build file so the build command is slightly different:
docker build -f Docker-raspi/Dockerfile -t hadashboard . (Don’t forget the full stop (.) at the end. N.B This took 5hrs on a Pi1 B so be prepared to wait). - Next, in the ./lib directory, copy the ha_conf.rb.example file to ha_conf.rb and edit its settings to reflect your installation, pointing to the machine Home Assistant is running on and adding your api_key.
$ha_url = "http://10.0.2.17:8123"
$ha_apikey = "your key"
$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_apikey should be set to your key if you have one, otherwise it can remain blank.
The file also contains example newsfeeds for the News widget:
$news_feeds = {
"Traffic" => "http://api.sr.se/api/rss/traffic/2863",
"News" => http://feeds.bbci.co.uk/news/rss.xml,
}
You can leave these alone for now or if you prefer customize them as described in the News widget section here https://github.com/home-assistant/hadashboard#news. - Make a copy of dashboards/example.erb and call it 'main.erb', then edit this file to reference the items you want to display and control and to get the layout that you want. Leave the original example.erb intact and unchanged so that you don't run into problems when trying to update using the git commands mentioned later in "Updating the Dashboard". Full instructions here https://github.com/home-assistant/hadashboard#configuring-the-dashboard-all-installations.
- In the directory /home/pi/hadashboard/hapush, copy the hapush.cfg.example file to hapush.cfg then edit it to reflect your environment. This is what mine looks like.
ha_url = "http://10.0.2.17:8123"
ha_key =
dash_host = "10.0.2.17:3030"
dash_dir="/app/dashboards"
logfile = "/app/hapush/hapush.log" - You are now ready to run the docker image.
docker run --name="hadashboard" -d -v /home/pi/hadashboard/dashboards:/app/dashboards -v /home/pi/hadashboard/lib/ha_conf.rb:/app/lib/ha_conf.rb -v /home/pi/hadashboard/hapush:/app/hapush --net=host hadashboard (all in one line)
You may need to double check your paths are correct for mapping to the dashboards, ha_conf.rb and hapush locations? These are for my Pi with a standard Jessie install. - You should get back something like this meaning your container has at least started:
0aac704f2093dd10ff0413f0e77c50769c5c569ee25fd57cb67ee1d338e51f3b - You should now be able to go to <ipaddressofyourPi>:3030/main to see the example hadashboard. By default, if you do not append the /main it will load the example file <ipaddressofyourPi>:3030/example
- Test your docker instance:
docker ps -a - This should return:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0aac704f2093 hadashboard "/bin/sh -c '/app/hap" About an hour ago Up 59 minutes hadashboard
You need the “Container ID” for the next step. - Using the container ID, inspect the logs:
docker logs xxxxxxx (Transpose xxxxxxx with your container ID). - To restart your docker container:
docker restart <yourcontainerID> - To check all of your file mappings and to make sure everything is supposed to be where it supposed to be, try this:
docker exec -t -i <yourcontainerID> /bin/bash then,
ls /app/hapush/ should give you:
root@raspberrypi:/app# ls /app/hapush/
hapush.cfg hapush.cfg.example hapush.log hapush.py
root@raspberrypi:/app#
ls /app/dashboards should give you:
root@raspberrypi:/app# ls /app/dashboards
example.erb layout.erb main.erb
root@raspberrypi:/app# - Navigate to /home/pi/hadashboard/hapush/hapush.log using WinSCP to see what is going on. If everything is OK, there should only be two lines:
2016-10-18 21:48:27,891 INFO Reading dashboard: /app/dashboards/main.erb
2016-10-18 21:48:27,948 INFO Reading dashboard: /app/dashboards/example.erb
“I personally prefer docker-compose to create and run the images:
This is my docker-compose.yaml file for hadashboard:”
---
home-assistant:
build: Dockerfile-rpi
restart: always
net: "host"
volumes:
- '/etc/localtime:/etc/localtime:ro'
- '/etc/timezone:/etc/timezone:ro'
- '/etc/home-assistant/hadashboard/dashboards:/app/dashboards
- '/etc/home-assistant/hadashboard/config/:/app/lib/
- '/etc/home-assistant/hadashboard/hapush/:/app/hapush/
Good luck and may the force be with you.
Post your issues in GitHub here https://github.com/home-assistant/hadashboard/issues
I'm looking to do this and don't really know what I'm doing so I was looking for a guy to like this. Issue I'm having is with the following step:
ReplyDeleteInstall the hadashboard docker file:
Raspberry pi needs to use a different docker build file so the build command is slightly different:
docker build -f Docker-raspi/Dockerfile -t hadashboard . (Don’t forget the full stop (.) at the end. N.B This took 5hrs on a Pi1 B so be prepared to wait)
When I type that in my response back is cannot connect to the docker Daemon is the doctor Damon running on this host? Any idea what's going on there?
Do you install Docker per steps 1, 2 and 3?
DeleteThis is a bit old, but for others in the future the docker commands must be run with sudo. Otherwise you will get the above error.
DeleteHey, thanks for the credit :)
ReplyDeleteHmmm, Step 7 crashes for me, and of course, I don't know what I'm doing:
ReplyDeleteUnable to find image 'hadashboard:latest' locally
Pulling repository docker.io/library/hadashboard
docker: Error: image library/hadashboard:latest not found.
See 'docker run --help'.