These instructions assume that you know how to install and navigate your OS on your device.
Install Raspberry Raspbian with desktop either for the raspberry pi or desktop PC depending on your hardware.
Initial setup of Raspberry Raspbian is easier with monitor keyboard and mouse hooked up local to your device.
Enable SSH in configuration, 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 the ability to 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:
-
Will allow network shares of certain folders for editing and backing up your configuration of Home assistant files and access to root directory.
((WARNING MESSING AROUND IN ROOT DIR CAN BREAK YOUR INSTALL)) -
Will allow Home assistant to restart after a reboot.
-
Will boot into Kiosk mode for using Lovelace in touchscreen on the same device as home assistant.
(does not effect headless operation so can use the same instructions)
Use this Link to install Python Install before starting this Instruction below.
"DO NOT COPY AND PASTE STUFF IN QUOTES"
âLOG INTO THE TERMINAL.â
âUPDATE THE OPERATING SYSTEM.â
sudo apt update
sudo apt upgrade -y
sudo apt autoremove -y
" INSTALL DEPENDENCIES."
sudo apt-get install python3 python3-dev python3-venv python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5 -y libturbojpeg0 tzdata
sudo apt install libbluetooth-dev -y
sudo pip3 install PyBluez
âSTEPS BELOW INSTALLS HOME ASSISTANT.â
sudo useradd -rm homeassistant -G dialout,gpio,i2c
sudo mkdir /srv/homeassistant
sudo chown homeassistant:homeassistant /srv/homeassistant
sudo -u homeassistant -H -s
cd /srv/homeassistant
curl https://sh.rustup.rs -sSf | sh
âWAIT FOR PROMPT PRESS 1 WHEN ASKED AT THE PROMPTâ
source "$HOME/.cargo/env"
âCOPY AND PASTE THE VERSION OF PYTHON YOU UPDATED TO BY CHANGING THE NUMBER BEFORE PRESSING ENTER ON BELOW COPY.â
version=3.10
python$version -m venv .
python3 -m pip install wheel
source bin/activate
pip3 install homeassistant
exit
â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
WorkingDirectory=/home/%i/.homeassistant
ExecStart=/srv/homeassistant/bin/hass -c "/home/%i/.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 ARE OPTIONAL SKIP THE STUFF YOU DONâT WANT UNTILL YOU GET TO MANUALLY START THE HOME ASSISTANTâ
"ALLOWS THE USE OF REMOTE DESKTOP THIS IS A OPTIONAL INSTALL
sudo apt install xrdp -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 DOES NOT AFFECT NORMAL INSTALL.â
sudo apt install sshpass
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
sudo apt-get install bluetooth bluez blueman -y
sudo apt install xdotool unclutter sed -y
âMANUALLY START HOME ASSISTANTâ
sudo -u homeassistant -H -s
cd /srv/homeassistant
âTHE VERSION OF PYTHON YOU UPDATED TO BY CHANGING THE NUMBER BEFORE PRESSING ENTER ON BELOW COPY.â
version=3.10
python$version -m venv .
source bin/activate
hass
âGIVE IT ABOUT 10 MINS AND REBOOT THE SYSTEM, IF YOU HAVE A MONITOR CONNECTED TO THE RASPBERRY IT SHOULD DISPLAY THE HOME ASSISTANT PAGE.â
Turning on and off the Touch Screen through Home Assistant if installed on device
Do this after you rebooted your machine and logged back into SSH
sudo -u homeassistant -H -s
ssh [email protected] âexport DISPLAY=:0 && xset dpms force onâ
âIT WILL ASK IF YOU WANT TO PERMANENTLY ADD IT TYPE YESâ
âENTER YOUR PASSWORDâ
âIT WILL COME BACK WITH A ERROR IGNORE THE ERRORâ
âTHIS IS THE SWITCH CONFIGURATION IN HOME ASSISTANT TO ADD THE SWITCHâ
âENTER YOUR PASSWORD TO ENABLE CONTROL OF KIOSK SCREEN.â
password=
- platform: command_line
switches:
touch_screen:
friendly_name: Touch Screen
command_on: sshpass -p $password ssh [email protected] 'export DISPLAY=:0 && xset dpms force on'
command_off: sshpass -p $password ssh [email protected] 'export DISPLAY=:0 && xset dpms force off'
command_state: sshpass -p $password ssh [email protected] 'export DISPLAY=:0 && xset -q | grep "Monitor is" | cut -c14-17' | grep "On" > /dev/null
Testing for your Zwave hub if using Zwave
ls -1tr /dev/tty*|tail -n 1
âNote the exact address may be different then below if it is then edit below to matchâ
ls -l /dev/ttyACM0
âShould return crw-rw---- 1 root dialout 166, todayâs date /dev/ttyACM0â
" END OF STEPS."