HomeAssistant AutoStart issues on Fedora 27

Hello
I am new to linux and new to Homeassistant. I followd the Fedora guide to setup HAS on Fedora 27. the manual stops at go to autostart section. I configured HomeAssistant in /opt/HomeAssistant and followed the manual for setting up a virtual environment. Now I am trying to setup the autostart option using systemd and .service pointer but I can not get this to work. startup fails :
stemd[1]: Started Home Assistant.
ss[1868]: Fatal Error: Specified configuration directory does not exist /home/ho
stemd[1]: [email protected]: Main process exited, code=exited, status=
stemd[1]: [email protected]: Unit entered failed state.
stemd[1]: [email protected]: Failed with result β€˜exit-code’.

A: Can i do a manual start using Homeassistant in Venv in Fedora to see if i can at least access the web Ui?
B: What script for service do i need to create when using Fedora installation manual that points HOmeassistant tot /opt/Homeassistant ?

In the browser I receive connection refused errors but I assume this is because the HAS service is not starting correctly.

Thanks in advance!

Extra steps: rebooted Fedora system and asked service status
login as: hass
[email protected]’s password:
Last login: Thu Feb 8 05:26:47 2018
[hass@localhost ~]$ systemctl status [email protected]
● [email protected] - Home Assistant
Loaded: loaded (/etc/systemd/system/[email protected]; disabled; ve
Active: inactive (dead)
lines 1-3/3 (END)

Does this mean the service is loaded but inactive / dead?

GJ

Came a littlebit further down the process. configuration.yaml was missing, created one as admin user starting hass --open-ui. After that the web UI came alive. Now checking config and see how the system will do. The strange bit is that under the setup user homeassistant , It was missing /home/has/.homeassistant/configuration.yaml. But I am using /opt/homeassistant as location ? So why is the installation looking for my home folder? Do not understand that bit as noob :frowning:

Did a new install based on fedora document, now started in /home directory for hass user. But I can not start HAS, Has command not found, nor is the service autostarting at boot. Why is this so hard to get this up and running. The user is a normal user acount. When running things under root it works. SO what am i missing from the documentation?

If you created the venv as specified, then you should be able to do

$ source /opt/homeassistant/bin/activate
$ hass --open-ui

Until you can do that, don’t worry about autostart.

Hi

Thanks, I think I do not understand where the installation needs to be. I have /opt/Homeassistant from the fedora instructions. Following your steps (/opt/homeassistant/bin/activate) I could startup hass but receive below errors.

IT thus also seems to point to /home/hass user Homeassistant.

Config directory: /home/hass/.homeassistant
2018-02-08 09:00:56 ERROR (MainThread) [homeassistant.bootstrap] Unable to setup error log /home/hass/.homeassistant/home-assistant.log (access denied)
2018-02-08 09:00:56 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/hass/.homeassistant/configuration.yaml: Config file not found: /home/hass/.homeassistant/customize.yaml

The config file is there , I checked. I think it is a permission thing? My user is a basic user.

Thanks in advance!

login as: hass
[email protected]’s password:
Last login: Thu Feb 8 08:07:09 2018 from 192.168.178.33
[hass@localhost ~]$ hass --open-ui
bash: hass: command not found…
[hass@localhost ~]$ pip3 install homeassistant colorlog
Collecting homeassistant
Using cached homeassistant-0.62.1-py2.py3-none-any.whl
Requirement already satisfied: colorlog in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: aiohttp==2.3.7 in /usr/local/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: pyyaml<4,>=3.11 in /usr/local/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: requests==2.18.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: chardet==3.0.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: pip>=8.0.3 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: typing<4,>=3 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: voluptuous==0.10.5 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: yarl==0.18.0 in /usr/local/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: astral==1.4 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: async-timeout==2.0.0 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: pytz>=2017.02 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: jinja2>=2.9.6 in /usr/local/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: multidict>=3.0.0 in /usr/local/lib64/python3.6/site-packages (from aiohttp==2.3.7->homeassistant)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python3.6/site-packages (from requests==2.18.4->homeassistant)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python3.6/site-packages (from requests==2.18.4->homeassistant)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib64/python3.6/site-packages (from jinja2>=2.9.6->homeassistant)
Installing collected packages: homeassistant
Exception:
Traceback (most recent call last):
File β€œ/usr/lib/python3.6/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File β€œ/usr/lib/python3.6/site-packages/pip/commands/install.py”, line 365, in run
strip_file_prefix=options.strip_file_prefix,
File β€œ/usr/lib/python3.6/site-packages/pip/req/req_set.py”, line 784, in install
**kwargs
File β€œ/usr/lib/python3.6/site-packages/pip/req/req_install.py”, line 854, in install
strip_file_prefix=strip_file_prefix
File β€œ/usr/lib/python3.6/site-packages/pip/req/req_install.py”, line 1069, in move_wheel_files
strip_file_prefix=strip_file_prefix,
File β€œ/usr/lib/python3.6/site-packages/pip/wheel.py”, line 345, in move_wheel_files
clobber(source, lib_dir, True)
File β€œ/usr/lib/python3.6/site-packages/pip/wheel.py”, line 316, in clobber
ensure_dir(destdir)
File β€œ/usr/lib/python3.6/site-packages/pip/utils/init.py”, line 83, in ensure_dir
os.makedirs(path)
File β€œ/usr/lib64/python3.6/os.py”, line 220, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: β€˜/usr/local/lib/python3.6/site-packages/homeassistant-0.62.1.dist-info’
[hass@localhost ~]$ sudo pip3 install homeassistant
[sudo] password for hass:
Sorry, try again.
[sudo] password for hass:
WARNING: Running pip install with root privileges is generally not a good idea. Try pip3 install --user instead.
Requirement already satisfied: homeassistant in /root/.local/lib/python3.6/site-packages
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: jinja2>=2.9.6 in /usr/local/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: async-timeout==2.0.0 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: typing<4,>=3 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: voluptuous==0.10.5 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: requests==2.18.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: pyyaml<4,>=3.11 in /usr/local/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: chardet==3.0.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: aiohttp==2.3.7 in /usr/local/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: pytz>=2017.02 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: astral==1.4 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: pip>=8.0.3 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: yarl==0.18.0 in /usr/local/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib64/python3.6/site-packages (from jinja2>=2.9.6->homeassistant)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python3.6/site-packages (from requests==2.18.4->homeassistant)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python3.6/site-packages (from requests==2.18.4->homeassistant)
Requirement already satisfied: multidict>=3.0.0 in /usr/local/lib64/python3.6/site-packages (from aiohttp==2.3.7->homeassistant)
[hass@localhost ~]$ python3 -m pip install homeassistant
Collecting homeassistant
Using cached homeassistant-0.62.1-py2.py3-none-any.whl
Requirement already satisfied: requests==2.18.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: astral==1.4 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: pytz>=2017.02 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: async-timeout==2.0.0 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: chardet==3.0.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: jinja2>=2.9.6 in /usr/local/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: pyyaml<4,>=3.11 in /usr/local/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: aiohttp==2.3.7 in /usr/local/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: yarl==0.18.0 in /usr/local/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: pip>=8.0.3 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: voluptuous==0.10.5 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: typing<4,>=3 in /usr/local/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python3.6/site-packages (from requests==2.18.4->homeassistant)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python3.6/site-packages (from requests==2.18.4->homeassistant)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib64/python3.6/site-packages (from jinja2>=2.9.6->homeassistant)
Requirement already satisfied: multidict>=3.0.0 in /usr/local/lib64/python3.6/site-packages (from aiohttp==2.3.7->homeassistant)
Installing collected packages: homeassistant
Exception:
Traceback (most recent call last):
File β€œ/usr/lib/python3.6/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File β€œ/usr/lib/python3.6/site-packages/pip/commands/install.py”, line 365, in run
strip_file_prefix=options.strip_file_prefix,
File β€œ/usr/lib/python3.6/site-packages/pip/req/req_set.py”, line 784, in install
**kwargs
File β€œ/usr/lib/python3.6/site-packages/pip/req/req_install.py”, line 854, in install
strip_file_prefix=strip_file_prefix
File β€œ/usr/lib/python3.6/site-packages/pip/req/req_install.py”, line 1069, in move_wheel_files
strip_file_prefix=strip_file_prefix,
File β€œ/usr/lib/python3.6/site-packages/pip/wheel.py”, line 345, in move_wheel_files
clobber(source, lib_dir, True)
File β€œ/usr/lib/python3.6/site-packages/pip/wheel.py”, line 316, in clobber
ensure_dir(destdir)
File β€œ/usr/lib/python3.6/site-packages/pip/utils/init.py”, line 83, in ensure_dir
os.makedirs(path)
File β€œ/usr/lib64/python3.6/os.py”, line 220, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: β€˜/usr/local/lib/python3.6/site-packages/homeassistant-0.62.1.dist-info’
[hass@localhost ~]$ sudo python3 -m pip install homeassistant
WARNING: Running pip install with root privileges is generally not a good idea. Try __main__.py install --user instead.
Requirement already satisfied: homeassistant in /root/.local/lib/python3.6/site-packages
Requirement already satisfied: pytz>=2017.02 in /usr/lib/python3.6/site-packages (from homeassistant)
Collecting pyyaml<4,>=3.11 (from homeassistant)
Using cached PyYAML-3.12.tar.gz
Collecting certifi>=2017.4.17 (from homeassistant)
Using cached certifi-2018.1.18-py2.py3-none-any.whl
Requirement already satisfied: requests==2.18.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: chardet==3.0.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: pip>=8.0.3 in /usr/lib/python3.6/site-packages (from homeassistant)
Collecting async-timeout==2.0.0 (from homeassistant)
Using cached async_timeout-2.0.0-py3-none-any.whl
Collecting typing<4,>=3 (from homeassistant)
Using cached typing-3.6.4-py3-none-any.whl
Collecting aiohttp==2.3.7 (from homeassistant)
Using cached aiohttp-2.3.7-cp36-cp36m-manylinux1_x86_64.whl
Collecting yarl==0.18.0 (from homeassistant)
Using cached yarl-0.18.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting voluptuous==0.10.5 (from homeassistant)
Using cached voluptuous-0.10.5.tar.gz
Collecting jinja2>=2.9.6 (from homeassistant)
Using cached Jinja2-2.10-py2.py3-none-any.whl
Collecting astral==1.4 (from homeassistant)
Using cached astral-1.4-py2.py3-none-any.whl
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python3.6/site-packages (from requests==2.18.4->homeassistant)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python3.6/site-packages (from requests==2.18.4->homeassistant)
Collecting multidict>=3.0.0 (from aiohttp==2.3.7->homeassistant)
Using cached multidict-4.1.0-cp36-cp36m-manylinux1_x86_64.whl
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib64/python3.6/site-packages (from jinja2>=2.9.6->homeassistant)
Installing collected packages: pyyaml, certifi, async-timeout, typing, multidict, yarl, aiohttp, voluptuous, jinja2, astral
Running setup.py install for pyyaml … done
Running setup.py install for voluptuous … done
Successfully installed aiohttp-2.3.7 astral-1.4 async-timeout-2.0.0 certifi-2018.1.18 jinja2-2.10 multidict-4.1.0 pyyaml-3.12 typing-3.6.4 voluptuous-0.10.5 yarl-0.18.0
[hass@localhost ~]$ hass --open-ui
bash: hass: command not found…
[hass@localhost ~]$ source /bin/activate
-bash: /bin/activate: No such file or directory
[hass@localhost ~]$ cd homeassistant
-bash: cd: homeassistant: No such file or directory
[hass@localhost ~]$ ls
Desktop Documents Downloads Music Pictures Public Templates Videos
[hass@localhost ~]$ cd /home
[hass@localhost home]$ ls
hass homeassistant lost+found
[hass@localhost home]$ cd homeassistant
[hass@localhost homeassistant]$ source bin/activate
(homeassistant) [hass@localhost homeassistant]$ sudo python3 -m pip install homeassistant
WARNING: Running pip install with root privileges is generally not a good idea. Try __main__.py install --user instead.
Requirement already satisfied: homeassistant in /root/.local/lib/python3.6/site-packages
Requirement already satisfied: pyyaml<4,>=3.11 in /usr/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: pip>=8.0.3 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: aiohttp==2.3.7 in /usr/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: voluptuous==0.10.5 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: pytz>=2017.02 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: yarl==0.18.0 in /usr/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: async-timeout==2.0.0 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: chardet==3.0.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: jinja2>=2.9.6 in /usr/lib64/python3.6/site-packages (from homeassistant)
Requirement already satisfied: typing<4,>=3 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: astral==1.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: requests==2.18.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already satisfied: multidict>=3.0.0 in /usr/lib64/python3.6/site-packages (from aiohttp==2.3.7->homeassistant)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3.6/site-packages (from yarl==0.18.0->homeassistant)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib64/python3.6/site-packages (from jinja2>=2.9.6->homeassistant)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python3.6/site-packages (from requests==2.18.4->homeassistant)
(homeassistant) [hass@localhost homeassistant]$ hass --open-ui
bash: hass: command not found…
(homeassistant) [hass@localhost homeassistant]$ ls
bin include lib lib64 pyvenv.cfg
(homeassistant) [hass@localhost homeassistant]$ cd /srv
(homeassistant) [hass@localhost srv]$ ls
(homeassistant) [hass@localhost srv]$ ls
(homeassistant) [hass@localhost srv]$ cd homeassistant
-bash: cd: homeassistant: No such file or directory
(homeassistant) [hass@localhost srv]$ hass
bash: hass: command not found…
(homeassistant) [hass@localhost srv]$ su
Password:
(homeassistant) [root@localhost srv]# hass
bash: hass: command not found…
(homeassistant) [root@localhost srv]# su hass
(homeassistant) [hass@localhost srv]$ python3 -m pip install --upgrade homeassistant
Collecting homeassistant
Using cached homeassistant-0.62.1-py2.py3-none-any.whl
Collecting chardet==3.0.4 (from homeassistant)
Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 143kB 3.3MB/s
Collecting jinja2>=2.9.6 (from homeassistant)
Downloading Jinja2-2.10-py2.py3-none-any.whl (126kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 133kB 3.1MB/s
Collecting requests==2.18.4 (from homeassistant)
Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 92kB 3.7MB/s
Collecting typing<4,>=3 (from homeassistant)
Downloading typing-3.6.4-py3-none-any.whl
Collecting yarl==0.18.0 (from homeassistant)
Downloading yarl-0.18.0-cp36-cp36m-manylinux1_x86_64.whl (157kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 163kB 3.1MB/s
Collecting astral==1.4 (from homeassistant)
Downloading astral-1.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from homeassistant)
Downloading certifi-2018.1.18-py2.py3-none-any.whl (151kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 153kB 3.6MB/s
Requirement already up-to-date: pip>=8.0.3 in /home/homeassistant/lib/python3.6/site-packages (from homeassistant)
Collecting pyyaml<4,>=3.11 (from homeassistant)
Downloading PyYAML-3.12.tar.gz (253kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 256kB 2.7MB/s
Collecting voluptuous==0.10.5 (from homeassistant)
Downloading voluptuous-0.10.5.tar.gz (41kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 51kB 4.2MB/s
Collecting async-timeout==2.0.0 (from homeassistant)
Downloading async_timeout-2.0.0-py3-none-any.whl
Collecting aiohttp==2.3.7 (from homeassistant)
Downloading aiohttp-2.3.7-cp36-cp36m-manylinux1_x86_64.whl (663kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 665kB 1.2MB/s
Collecting pytz>=2017.02 (from homeassistant)
Downloading pytz-2017.3-py2.py3-none-any.whl (511kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 512kB 1.8MB/s
Collecting MarkupSafe>=0.23 (from jinja2>=2.9.6->homeassistant)
Downloading MarkupSafe-1.0.tar.gz
Collecting idna<2.7,>=2.5 (from requests==2.18.4->homeassistant)
Downloading idna-2.6-py2.py3-none-any.whl (56kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 61kB 5.1MB/s
Collecting urllib3<1.23,>=1.21.1 (from requests==2.18.4->homeassistant)
Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 133kB 4.0MB/s
Collecting multidict>=2.0 (from yarl==0.18.0->homeassistant)
Downloading multidict-4.1.0-cp36-cp36m-manylinux1_x86_64.whl (482kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 491kB 1.8MB/s
Installing collected packages: chardet, MarkupSafe, jinja2, certifi, idna, urllib3, requests, typing, multidict, yarl, pytz, astral, pyyaml, voluptuous, async-timeout, aiohttp, homeassistant
Exception:
Traceback (most recent call last):
File β€œ/home/homeassistant/lib64/python3.6/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File β€œ/home/homeassistant/lib64/python3.6/site-packages/pip/commands/install.py”, line 365, in run
strip_file_prefix=options.strip_file_prefix,
File β€œ/home/homeassistant/lib64/python3.6/site-packages/pip/req/req_set.py”, line 784, in install
**kwargs
File β€œ/home/homeassistant/lib64/python3.6/site-packages/pip/req/req_install.py”, line 854, in install
strip_file_prefix=strip_file_prefix
File β€œ/home/homeassistant/lib64/python3.6/site-packages/pip/req/req_install.py”, line 1069, in move_wheel_files
strip_file_prefix=strip_file_prefix,
File β€œ/home/homeassistant/lib64/python3.6/site-packages/pip/wheel.py”, line 345, in move_wheel_files
clobber(source, lib_dir, True)
File β€œ/home/homeassistant/lib64/python3.6/site-packages/pip/wheel.py”, line 316, in clobber
ensure_dir(destdir)
File β€œ/home/homeassistant/lib64/python3.6/site-packages/pip/utils/init.py”, line 83, in ensure_dir
os.makedirs(path)
File β€œ/usr/lib64/python3.6/os.py”, line 220, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: β€˜/home/homeassistant/lib/python3.6/site-packages/chardet-3.0.4.dist-info’
(homeassistant) [hass@localhost srv]$ sudo python3 -m pip install --upgrade homeassistant
[sudo] password for hass:
WARNING: Running pip install with root privileges is generally not a good idea. Try __main__.py install --user instead.
Requirement already up-to-date: homeassistant in /root/.local/lib/python3.6/site-packages
Requirement already up-to-date: aiohttp==2.3.7 in /usr/lib64/python3.6/site-packages (from homeassistant)
Requirement already up-to-date: yarl==0.18.0 in /usr/lib64/python3.6/site-packages (from homeassistant)
Requirement already up-to-date: chardet==3.0.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already up-to-date: jinja2>=2.9.6 in /usr/lib64/python3.6/site-packages (from homeassistant)
Requirement already up-to-date: pip>=8.0.3 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already up-to-date: typing<4,>=3 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already up-to-date: certifi>=2017.4.17 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already up-to-date: pyyaml<4,>=3.11 in /usr/lib64/python3.6/site-packages (from homeassistant)
Requirement already up-to-date: requests==2.18.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already up-to-date: voluptuous==0.10.5 in /usr/lib/python3.6/site-packages (from homeassistant)
Collecting pytz>=2017.02 (from homeassistant)
Using cached pytz-2017.3-py2.py3-none-any.whl
Requirement already up-to-date: async-timeout==2.0.0 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already up-to-date: astral==1.4 in /usr/lib/python3.6/site-packages (from homeassistant)
Requirement already up-to-date: multidict>=3.0.0 in /usr/lib64/python3.6/site-packages (from aiohttp==2.3.7->homeassistant)
Collecting idna>=2.0 (from yarl==0.18.0->homeassistant)
Using cached idna-2.6-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from jinja2>=2.9.6->homeassistant)
Using cached MarkupSafe-1.0.tar.gz
Requirement already up-to-date: urllib3<1.23,>=1.21.1 in /usr/lib/python3.6/site-packages (from requests==2.18.4->homeassistant)
Installing collected packages: pytz, idna, MarkupSafe
Found existing installation: pytz 2017.2
Uninstalling pytz-2017.2:
Successfully uninstalled pytz-2017.2
Found existing installation: idna 2.5
Uninstalling idna-2.5:
Successfully uninstalled idna-2.5
Found existing installation: MarkupSafe 0.23
Uninstalling MarkupSafe-0.23:
Successfully uninstalled MarkupSafe-0.23
Running setup.py install for MarkupSafe … done
Successfully installed MarkupSafe-1.0 idna-2.6 pytz-2017.3
(homeassistant) [hass@localhost srv]$ hass
bash: hass: command not found…
(homeassistant) [hass@localhost srv]$ start home assistant
bash: start: command not found…
(homeassistant) [hass@localhost srv]$ cd …
(homeassistant) [hass@localhost /]$ whereis homeassistant
homeassistant:
(homeassistant) [hass@localhost /]$ ls
bin dev home lib64 media opt root sbin sys usr
boot etc lib lost+found mnt proc run srv tmp var
(homeassistant) [hass@localhost /]$ cd home
(homeassistant) [hass@localhost home]$ ls
hass homeassistant lost+found
(homeassistant) [hass@localhost home]$ cd homeassistant
(homeassistant) [hass@localhost homeassistant]$ cd bin
(homeassistant) [hass@localhost bin]$ cd activate
bash: cd: activate: Not a directory
(homeassistant) [hass@localhost bin]$ ls
activate activate.fish easy_install-3.6 pip3 python python3.6
activate.csh easy_install pip pip3.6 python3
(homeassistant) [hass@localhost bin]$ source activate
(homeassistant) (homeassistant) [hass@localhost bin]$ hass --open-ui
bash: hass: command not found…
(homeassistant) (homeassistant) [hass@localhost bin]$ source activate
(homeassistant) (homeassistant) [hass@localhost bin]$ ls
activate activate.fish easy_install-3.6 pip3 python python3.6
activate.csh easy_install pip pip3.6 python3
(homeassistant) (homeassistant) [hass@localhost bin]$ hass
bash: hass: command not found…
(homeassistant) (homeassistant) [hass@localhost bin]$ cd /opt
(homeassistant) (homeassistant) [hass@localhost opt]$ ls
homeassistant
(homeassistant) (homeassistant) [hass@localhost opt]$ cd …
(homeassistant) (homeassistant) [hass@localhost /]$ source /opt/homeassistant/bin/activate
(homeassistant) (homeassistant) [hass@localhost /]$ hass
Config directory: /home/hass/.homeassistant
2018-02-08 09:00:56 ERROR (MainThread) [homeassistant.bootstrap] Unable to setup error log /home/hass/.homeassistant/home-assistant.log (access denied)
2018-02-08 09:00:56 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/hass/.homeassistant/configuration.yaml: Config file not found: /home/hass/.homeassistant/customize.yaml
(homeassistant) (homeassistant) [hass@localhost /]$ ^C
(homeassistant) (homeassistant) [hass@localhost /]$ hass --open-ui
Config directory: /home/hass/.homeassistant
2018-02-08 09:11:01 ERROR (MainThread) [homeassistant.bootstrap] Unable to setup error log /home/hass/.homeassistant/home-assistant.log (access denied)
2018-02-08 09:11:01 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/hass/.homeassistant/configuration.yaml: Config file not found: /home/hass/.homeassistant/customize.yaml
(homeassistant) (homeassistant) [hass@localhost /]$ hass --open-ui
Config directory: /home/hass/.homeassistant
2018-02-08 09:21:00 ERROR (MainThread) [homeassistant.bootstrap] Unable to setup error log /home/hass/.homeassistant/home-assistant.log (access denied)
2018-02-08 09:21:00 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/hass/.homeassistant/configuration.yaml: Config file not found: /home/hass/.homeassistant/customize.yaml
(homeassistant) (homeassistant) [hass@localhost /]$

When I start hass --open-ui using root it works.

The python virtual environment can be anywhere on the system. I suspect /opt was chosen because of a convention on Fedora, but I’ve never used that, so I can’t be sure.

It certainly looks that way. If you previously started HA using sudo it may have given root permisssions to the directory. I suggest removing the directory and start again (assuming you don’t have anything to want to keep yet)

$ cd $HOME
$ sudo rm -rf .homeassistant
$ source /opt/homeassistant/bin/activate
$ hass --open-ui

which should create the directory with your user permissions.

You are the master ! :wink: That worked, has is initialized and I am able to get to the web gui.

1 Like

Sorry for being a noob at this, Learning Curve :frowning_face: I will continue from here to see If I can add my Aeotec Zwave stick and see if it will work again. Hope to have a working system by the end of the day.

A check for the autostart setup, is the below correct?

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

[Service]
Type=simple
User=%i
ExecStart=/opt/homeassistant/bin/hass -c β€œ/home/hass/.homeassistant”

[Install]
WantedBy=multi-user.target

That looks correct, In your case, the file should be called [email protected] as the part after the @ in the name fills in the %i in the user= line.

OK , than it is not working when rebooting the machine. Homeassistant is not starting up. What I also notice is that running HAS under the user account HAS is throwing errors in the web ui config check. It shows invalid configuration. When i run Hass under root account , Configuration is valid in the web ui. Are there specific permissions that I need to set for the Hass user account? It looks like it does not have permissions on all the python directories:

Configuration invalidCHECK CONFIG
INFO:homeassistant.util.package:Attempting install of colorlog==3.0.1
ERROR:homeassistant.util.package:Unable to install package colorlog==3.0.1: Exception:
Traceback (most recent call last):
File β€œ/usr/lib64/python3.6/shutil.py”, line 544, in move
os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: β€˜/opt/homeassistant/lib/python3.6/site-packages/colorlog-3.1.2.dist-info/DESCRIPTION.rst’ -> β€˜/tmp/pip-nalo3vah-uninstall/opt/homeassistant/lib/python3.6/site-packages/colorlog-3.1.2.dist-info/DESCRIPTION.rst’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File β€œ/opt/homeassistant/lib64/python3.6/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File β€œ/opt/homeassistant/lib64/python3.6/site-packages/pip/commands/install.py”, line 365, in run
strip_file_prefix=options.strip_file_prefix,
File β€œ/opt/homeassistant/lib64/python3.6/site-packages/pip/req/req_set.py”, line 778, in install
requirement.uninstall(auto_confirm=True)
File β€œ/opt/homeassistant/lib64/python3.6/site-packages/pip/req/req_install.py”, line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File β€œ/opt/homeassistant/lib64/python3.6/site-packages/pip/req/req_uninstall.py”, line 115, in remove
renames(path, new_path)
File β€œ/opt/homeassistant/lib64/python3.6/site-packages/pip/utils/init.py”, line 267, in renames
shutil.move(old, new)
File β€œ/usr/lib64/python3.6/shutil.py”, line 559, in move
os.unlink(src)
PermissionError: [Errno 13] Permission denied: β€˜/opt/homeassistant/lib/python3.6/site-packages/colorlog-3.1.2.dist-info/DESCRIPTION.rst’
Aborting script, could not install dependency colorlog==3.0.1

[hass@localhost ~]$ sudo systemctl status [email protected]
● [email protected] - Home Assistant
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vend
Active: failed (Result: exit-code) since Thu 2018-02-08 11:58:17 EST; 1min 8s
Process: 1416 ExecStart=/opt/homeassistant/bin/hass -c β€œ/home/hass/.homeassist
Main PID: 1416 (code=exited, status=1/FAILURE)

If the virtual environment was created with the hass user, it should have all the correct permissions, as only hass user writes to it.

This is not something I’ve seen before. The virtual environment should link to /usr/lib, so I don’t know why it is pointing at /tmp. I would suggest deleting it and starting again. and avoid running anything as root as it isn’t necessary and is likely to create incorrect permissions on files.