Installing Home Assistant on Raspberry pi with touchscreen kiosk mode

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.)

This instruction will do the following

  1. Will allow network shares of certain folders for editing Home assistant files and access to root directory
  2. Will allow Home assistant to restart after a reboot
  3. Will boot into Kiosk mode for using Lovelace in touchscreen on the same device as home assistant

“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 =

[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:8123

“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 [email protected]

sudo apt install xdotool unclutter sed

“STEPS BELOW INSTALLS HOME ASSISTANT”

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 HOME ASSISTANT PAGE

This is a very bad idea.

There is no need to share out /

the option is there you can delete that section in the config if you don’t want to access it

I understand it’s optional, but people tend to just copy and paste the entirety of “how-to” threads and completely ignore understanding what they are doing. You should not recommend it for the sake of all the users that will simply not understand.

well I found it really helps when looking for locations of directorys that is called for in other how to’s that is more vague on where stuff is nice thing is it is easy enough to redo the whole thing when somebody breaks their install

It’s easy for someone that understands what they are doing…

It’s not easy for those people that didn’t backup their config, and they completely broke their system because they were modifying files and changing permissions on files they shouldn’t.

I guess I voiced my concern for the newbies and you don’t really care, so, aside from that, good tutorial. I’m sure there are plenty of people that will get a lot of use out of this. By the way, you could install hassio on docker instead if you wanted add-ons and snapshots.

I understand where you are coming from,
part of the learning curve in what not to do as well,
bet after the first major crash from messing around the idea of backing up sounds a lot better

also understand I could install hassio but prefer Venv as it makes me think and figure stuff out

and thanks on the compliment