HADashboard Venv install on raspberry pi and boot into kiosk mode on same pi as home assistant

I decided that I wanted to install HADashboard through Venv and found the instructions on the Appdaemon site less then helpful no real path as all the different types of installs are thrown onto one page. I asked for help on this site and found that information for Venv install of HADashboard is quite lacking a couple of people tried to help and I thank them for at least trying.

I mucked around on the internet found bits and pieces and finally found a path to get HADashboard to work and come up automatically into kiosk mode when the system restarted. I wrote down the steps into a copy and paste type of format in a .txt file.

this is what it will do:

  1. a clean install of Debian for raspberry image with desktop with SSH enable and updated.
  2. it sets up the system to boot into kiosk mode
  3. it sets of file sharing of folders on raspberry for dashboard and homeassistant along with root and pi user.
  4. it installs appdaemon so it works
  5. it builds a example dashboard to help give idea of what is involved to build the page
  6. it sets up home assistant to start on reboot of raspberry
  7. and finally install home assistant

I took the simple way out and used docker for appdaemon

Install raspberry Debian with desktop either for the raspberry pi or desktop PC depending on your hardware.
Initial setup of raspberry Debian is easier with monitor keyboard and mouse hooked up local to your device, enable SSH once you have enabled SSH then remote configuring is preferred for below instructions you can copy and paste below commands into the terminal, these instructions assume you have knowledge on SSH into your device, copy and paste is the easiest and putty allows right click paste.
These steps use the default install instructions of home assistant and the default user of pi, so if using different then what is default make changes as needed
(note some stuff will not work fully until all the steps have been done IE shared folders won’t connect until that directory is made.)

“DO NOT COPY AND PASTE STUFF IN QUOTES”

“LOG INTO THE TERMINAL”

sudo apt update

sudo apt upgrade -y

sudo apt autoremove -y

“STEPS BELOW ALLOWS SHARING OF FOLDERS OVER YOUR LOCAL NETWORK”

sudo apt install samba -y


sudo nano /etc/samba/smb.conf

“CLEAR SCREEN BY HOLDING DOWN THE CTRL AND K KEYS”

“COPY ALL BELOW THIS LINE DOWN TO NOT INCLUDING END”


[global]
netbios name = HomeAssistant
server string = The HA File Center
workgroup = WORKGROUP
hosts allow =
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
remote announce =
remote browse sync =

[HOME PI]
path = /home/pi
comment = No comment
browsable = yes
read only = no
valid users =
writable = yes
guest ok = yes
public = yes
create mask = 0777
directory mask = 0777
force user = root
force create mode = 0777
force directory mode = 0777
hosts allow =

[HOME ASSISTANT]
path = /home/homeassistant/.homeassistant/
comment = No comment
browsable = yes
read only = no
valid users =
writable = yes
guest ok = yes
public = yes
create mask = 0777
directory mask = 0777
force user = root
force create mode = 0777
force directory mode = 0777
hosts allow =

[DASHBOARD]
path = /home/pi/appdaemon/conf/dashboards
comment = No comment
browsable = yes
read only = no
valid users =
writable = yes
guest ok = yes
public = yes
create mask = 0777
directory mask = 0777
force user = root
force create mode = 0777
force directory mode = 0777
hosts allow =

[ROOT]
path = /
comment = No comment
browsable = yes
read only = no
valid users =
writable = yes
guest ok = yes
public = yes
create mask = 0777
directory mask = 0777
force user = root
force create mode = 0777
force directory mode = 0777
hosts allow =

“END”

“PRESS CRTL+O (write out), ENTER, CTRL+X (exit)”


sudo smbpasswd -a pi

“ENTER THE PASSWORD IT WILL ASK TWICE”


sudo service smbd restart

“STEPS BELOW MAKES THE RASPBERRY PI BOOT INTO KIOSK SKIP TO NEXT IF NOT USING”


cd .config

mkdir lxsession

cd lxsession

mkdir LXDE-pi

sudo nano ~/.config/lxsession/LXDE-pi/autostart

“COPY ALL BELOW THIS LINE DOWN TO NOT INCLUDING END”


lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
@point-rpi
@xset s off
@xset -dpms
@xset s noblank
@sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium-browser/Default/Preferences
@chromium-browser --noerrdialogs --disable-infobars --kiosk http://localhost:5050/main --incognito

“END”

“PRESS CRTL+O (write out), ENTER, CTRL+X (exit)”


cd

“STEPS BELOW MAKES HOME ASSISTANT START ON REBOOT”


sudo nano -w /etc/systemd/system/[email protected]

“COPY ALL BELOW THIS LINE DOWN TO NOT INCLUDING END”


[Unit]
Description=Home Assistant
After=network-online.target

[Service]
Type=simple
ExecStartPre=/bin/sleep 10
User=%i
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"

[Install]
WantedBy=multi-user.target

“END”

“PRESS CRTL+O (write out), ENTER, CTRL+X (exit)”


sudo systemctl --system daemon-reload

sudo systemctl enable home-assistant@homeassistant

“STEPS BELOW INSTALLS APPDAEMON FOR HADASHBOARD”

python3 -m venv appdaemon

cd appdaemon

source bin/activate	

python3 -m pip install wheel

python3 -m pip install appdaemon

mkdir conf

cd conf

nano appdaemon.yaml

“COPY ALL BELOW THIS LINE DOWN TO NOT INCLUDING END”


log:
  logfile: /home/pi/appdaemon/conf/appdaemon.log
  errorfile: /home/pi/appdaemon/conf/aderror.log
appdaemon:
  threads: 10
  app_dir: /home/pi/appdaemon/conf/apps
  plugins:
    HASS:
      type: hass
      ha_url: http://your.website.domain:8123
hadashboard:
  dash_url: http://localhost:5050
  dash_dir: /home/pi/appdaemon/conf/dashboards

“END”

“PRESS CRTL+O (write out), ENTER, CTRL+X (exit)”

mkdir apps

mkdir dashboards

sudo nano /etc/systemd/system/appdaemon.service

“COPY ALL BELOW THIS LINE DOWN TO NOT INCLUDING END”

[Unit]
Description=Appdaemon for HASS
After=network-online.target

[Service]
Type=simple
User=pi
ExecStart=/home/pi/appdaemon/bin/appdaemon -D DEBUG -c "/home/pi/appdaemon/conf"

[Install]
WantedBy=multi-user.target

“END”

“PRESS CRTL+O (write out), ENTER, CTRL+X (exit)”


sudo systemctl daemon-reload

sudo systemctl enable appdaemon.service

sudo systemctl start appdaemon.service

“STEPS BELOW BUILDS A EXAMPLE DASHBOARD”

cd dashboards

nano main.dash

“COPY ALL BELOW THIS LINE DOWN TO NOT INCLUDING END”

title: Main
widget_dimensions: [170,180]
widget_margins: [15,15]
columns: 11

clock:
  widget_type: clock

switch:
  widget_type: switch
  entity: switch.hasspower
  state_text: 1

reload:
  widget_type: reload

layout:
  - clock(4x2), switch(2x2)
  -
  -
  - reload(1x1)

“END”

“PRESS CRTL+O (write out), ENTER, CTRL+X (exit)”


sudo systemctl restart appdaemon.service

"You should be good to go now, you can view the new dashboard by going to…

http://192.xxx.xxx.xxx:5050 on your web browser"

sudo apt install xdotool unclutter sed

exit

“STEPS BELOW INSTALLS HOME ASSISTANT”

“Log back in and Load up Home assistant with below”


sudo apt install python3 python3-dev python3-venv python3-pip libffi-dev libssl-dev -y

sudo useradd -rm homeassistant -G dialout,gpio,i2c

cd /srv
sudo mkdir homeassistant
sudo chown homeassistant:homeassistant homeassistant

sudo -u homeassistant -H -s
cd /srv/homeassistant
python3 -m venv .
source bin/activate

python3 -m pip install wheel

pip3 install homeassistant

pip3 install home-assistant-frontend

hass

"GIVE IT ABOUT 10 MINS AND REBOOT THE SYSTEM AND YOU IF YOU HAVE A MONITOR CONNECTED TO THE RASPBERRY IT SHOULD DISPLAY THE HADASHBOARD WITH A COUPLE OF PANELS ON IT WHICH YOU CAN GO IN THROUGH THE NETWORK SHARE AND CONFIG

Some Trouble shooting

verify if appdaemon is working

"TO TEST APPDAEMON USE BELOW "

sudo systemctl status appdaemon.service

“VERIFY APPDAEMON IS ACTIVE AND RUNNING CLOSE TERMINAL AND LOG BACK IN”