homeassistant@Domo:~$ cat /etc/systemd/system/[email protected]
[Unit]
Description=Home Assistant
After=network.target
[Service]
Type=simple
User=homeassistant
#make sure the virtualenv python binary is used
Environment=VIRTUAL_ENV="/srv/homeassistant/homeassistant_venv"
Environment=PATH="$VIRTUAL_ENV/bin:$PATH"
ExecStart=/srv/homeassistant/homeassistant_venv/bin/hass -c "/home/homeassistant /.homeassistant"
[Install]
WantedBy=multi-user.target
but I get this error:
● [email protected] - Home Assistant
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2017-01-28 14:47:00 EST; 9min ago
Process: 2909 ExecStart=/srv/homeassistant/homeassistant_venv/bin/hass -c home/homeassistant/.homeassistant (code=exited, status=203/EXEC)
Main PID: 2909 (code=exited, status=203/EXEC)
Jan 28 14:47:00 Domo systemd[1]: Started Home Assistant.
Jan 28 14:47:00 Domo systemd[1]: [email protected]: Main process exited, code=exited, status=203/EXEC
Jan 28 14:47:00 Domo systemd[1]: [email protected]: Unit entered failed state.
Jan 28 14:47:00 Domo systemd[1]: [email protected]: Failed with result 'exit-code'.
As I’m not familiar with linux, I don’t really know what to look for.
Could you point me to the right direction?
I did the manual install with virtualenv (ubuntu server in hyper-v).
HA is in:
homeassistant) homeassistant@Domo:/srv/homeassistant$ ls
bin include lib pip-selfcheck.json
Yup, I followed the guide. I wasn’t expecting to change values that were not in “[… ]”.
Anyway, I was able to better understand how the service file is working. So after fixing the path I had to remove the double quote from ExecStart=/srv/homeassistant/homeassistant_venv/bin/hass -c “/home/homeassistant” to make it works. Now, service starts automatically.
Thank you for your help.
I just found that when using autostart HA is failing detecting presence (but it works nice when started manually). Checking the log, I found this:
homeassistant@Domo:~$ cat /home/homeassistant/.homeassistant/home-assistant.log
17-01-28 18:10:02 homeassistant.components.device_tracker: Error setting up platform asuswrt
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 158, in async_setup_platform
None, platform.get_scanner, hass, {DOMAIN: p_config})
File “/usr/lib/python3.5/asyncio/futures.py”, line 379, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 297, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 292, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/asuswrt.py”, line 93, in get_scanner
scanner = AsusWrtDeviceScanner(config[DOMAIN])
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/asuswrt.py”, line 134, in init
data = self.get_asuswrt_data()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/asuswrt.py”, line 261, in get_asuswrt_data
result = self.ssh_connection()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/asuswrt.py”, line 180, in ssh_connection
ssh.login(self.host, self.username, **self.ssh_secret)
File “/home/homeassistant/.homeassistant/deps/pexpect/pxssh.py”, line 279, in login
spawn._spawn(self, cmd)
File “/home/homeassistant/.homeassistant/deps/pexpect/pty_spawn.py”, line 267, in _spawn
‘executable: %s.’ % self.command)
pexpect.exceptions.ExceptionPexpect: The command was not found or was not executable: ssh.
When you past in multi-line output from commands, log entries etc, it makes it much easier to read if you use the code block.
The error about arp suggests that you’ve got a PATH issue. Can you provide your configuration.yaml please (either in a code block, or up on something like pastebin, so that the formatting is preserved).
As it is a test setup (waiting to receive a PI3), I only have one user: homeassistant.
homeassistant@Domo:~$ whoami
homeassistant
homeassistant@Domo:~$ echo $PATH
/home/homeassistant/bin:/home/homeassistant/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
homeassistant@Domo:~$ which ssh
/usr/bin/ssh
homeassistant@Domo:~$ which arp
/usr/sbin/arp
homeassistant@Domo:~$ /srv/homeassistant/bin/hass --script check_config
Testing configuration at /home/homeassistant/.homeassistant
my config, nothing fancy so far, I’m just testing features:
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: 45.4717
longitude: -73.6149
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 62
# metric for Metric, imperial for Imperial
unit_system: metric
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/Toronto
customize:
device_tracker.boba:
icon: mdi:windows
device_tracker.domo:
icon: mdi:raspberrypi
device_tracker.wii:
icon: mdi:wii
device_tracker.printer:
icon: mdi:printer
# Show links to resources in log and frontend
#introduction:
# Enables the frontend
frontend:
http:
# Uncomment this to add a password (recommended!)
# api_password: PASSWORD
# Uncomment this if you are using SSL or running in Docker etc
# base_url: example.duckdns.org:8123
# Checks for available updates
updater:
# Discover some devices automatically
#discovery:
# Allows you to issue voice commands from the frontend in enabled browsers
conversation:
# Enables support for tracking state changes over time.
history:
# View all events in a logbook
logbook:
# Track the sun
sun:
# Weather Prediction
#sensor:
# platform: yr
# Text to speech
tts:
platform: google
light:
- platform: lifx
broadcast: 192.168.1.255
device_tracker:
# - platform: nmap_tracker
# hosts: 192.168.1.2-255
- platform: asuswrt
host: 192.168.1.1
username: admin
password: ******
media_player:
- platform: kodi
host: yoda
name: Kodi
username: xbmc
password: *****
- platform: panasonic_viera
host: 192.168.1.125
sensor:
- platform: hydroquebec
username: ******
password: ******
monitored_variables:
- period_total_bill
- period_length
- period_total_days
- period_mean_daily_bill
- period_mean_daily_consumption
- period_total_consumption
- period_lower_price_consumption
- period_higher_price_consumption
- yesterday_total_consumption
- yesterday_lower_price_consumption
- yesterday_higher_price_consumption
group:
HydroQuebec:
entities:
- sensor.hydroquebec_period_total_bill
- sensor.hydroquebec_period_length
- sensor.hydroquebec_period_total_days
- sensor.hydroquebec_period_mean_daily_bill
- sensor.hydroquebec_period_mean_daily_consumption
- sensor.hydroquebec_period_total_consumption
- sensor.hydroquebec_period_lower_price_consumption
- sensor.hydroquebec_period_higher_price_consumption
- sensor.hydroquebec_yesterday_total_consumption
- sensor.hydroquebec_yesterday_lower_price_consumption
- sensor.hydroquebec_yesterday_higher_price_consumption
Réseau:
entities:
- device_tracker.boba
- device_tracker.christinepc
- device_tracker.domo
- device_tracker.jango
- device_tracker.r2d2
- device_tracker.yoda
- device_tracker.wii
- device_tracker.obi200
- device_tracker.printer
Famille:
entities:
- device_tracker.JP_Lumia
- device_tracker.christine
Services:
view: yes
name: Services
entities:
- group.HydroQuebec
“which” locate a command by searching the $PATH. This confirms the command (ssh and arp in this case) are available through the $PATH environment variable. Unless HASS doesn’t use PATH, it should be able to use those commands. It could be a permission issue, but to me, everything is fine. So it is above my limited skills.
Odd, I’ve no issues with nmap tracker. Of course, both the iPhone and recent Android versions (6.0 onwards) turn off the WiFi when they’re idle and not connected to power.
That error, combined with your other error, makes me wonder if your problem is with the install being broken, not the specific modules. Might be worth trying a fresh install.