Maybe this will help some of you as I am getting some progress. Summary of my understanding so far (being dummy trying to understand as official instructions do not explain any background, so if something does not work as per them, it’s challenge to debug)
If you install Home Assistant manually using -venv method as described in the instructions, the Home Assistant is installed under Python Virtual environment
Now when you restart Raspberry Pi the Home Assistant code under Python environment is not running.
If you try to run Home Assistant using command hass directly after logging in to Pi using user: pi password: raspberry, it will not run as it should be run under python virtual environment
To activate Python you need to first run command sudo -u homeassistant -H -s as otherwise although Home Assistant runs, it seems it does not have access rights to add integrations
Then to activate python virtual environment you can use command first activate Python venv source /src/homeassistant/bin/activate. This runs the activate shell script under folder /srv/homeassistant/bin folder (activating python).
-Then running command hassio the home assistant will start (but it takes ages on raspberry pi
Now if in the Raspberry Linux console you want to do some modifications, the console is not running as the Python Home Assistant code is running. What I don’t know yet, if Mosquitto server can run on the background at the same time.
- On the Raspberry console, if you want to stop Home Assistant to access console again press Ctrl + C
- This will then take you to the Python Virtual Environment e.g (homeassistant) [email protected]:~$ This means that you are running inside Python Virtual Environment and I believe it is not possible to run Linux command. Now write exit and it takes you back to Linux root.
Modifying the configuration.yaml file after -venv istallation
The next challenge I had how to modify the configuration.yaml file. The instruction videos all refer to install the text editor in the web-browser. But apparently you cannot do that if you used -venv environment (which I had to use as hassio image did not install on the Raspberry Pi 3 B+).
You can do this by
- Enabling the SSH Access on the Raspberry Pi
sudo systemctl enable ssh
sudo systemctl start ssh
- Then connecting from PC using SSH console such as putty.exe by entering the IP ADDRESS of the raspberry Pi and logging is using the raspberry pi username and password
- Now you can find the configuration.yaml file under default directory
[email protected]:/ $ cd /home/homeassistant/.homeassistant
- And then using text editor such as nano. Sudo command in front means that SuperUser access rights are used (without it it is not possible to save the changes).
[email protected]:/home/homeassistant/.homeassistant $ sudo nano configuration.yaml