HA auto starts on boot or, “sudo systemctl start [email protected]”
What does /etc/systemd/system/[email protected] say?
Does it contain the line
user=%i
If so, you are running HA as user homeassistant, but /home/homeassistant/.homeassistant/www is owned by root.
You probably want to do:
sudo chown -R homeassistant /home/homeassistant/.homeassistant
sudo chgrp -R homeassistant /home/homeassistant/.homeassistant
to get everything under your config directory changed to ownership (and group, but not as critical) by the user that runs HA.
Hi Bigrob8181,
I’ve the hass.io installation.
And I added the line sys.path.append('/usr/src/app')
and unfortunately I got the same error :
core-ssh:/usr/bin# python3 z-wave-graph.py --debug
Traceback (most recent call last):
File "z-wave-graph.py", line 31, in <module>
import homeassistant.config
ModuleNotFoundError: No module named 'homeassistant'
I take a look at the path and I didn’t have a path “/usr/src” in my hass.io installation
This is really cool. Just ordered my first z-wave based pieces (should be here in a week or two; a aeotec usb z-wave stick and some motion sensors) and this looks like something I will be using, thanks for creating this
Still won’t run with the automation
Changed the Shell Command to : “z_wave_graph: /home/homeassistant/.homeassistant/python_scripts/z_wave_graph.py”
And put “z_wave_graph.py” in > z_wave_graph: /home/homeassistant/.homeassistant/python_scripts/
And now get: “2018-02-05 13:10:00 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: /home/homeassistant/.homeassistant/python_scripts/z_wave_graph.py
, return code: 1
NoneType: None”
Any ideas?
I wish I knew where in the code it was throwing that so I could put in proper error checking. Do you have base_url
set in the http:
section of your configuration.yaml
?
Yes:
configuration.yaml=
z_wave_graph:
title: 'Z-Wave Graph'
icon: mdi:vector-square
url: !secret z_wave_graph_url
secrets.yaml
z_wave_graph_url: http://192.168.200.210:8123/local/z-wave-graph.html
That’s z_wave_graph_url
. I asked about base_url
. The script uses base_url
to figure out how to login to your HA API. z_wave_graph_url
is used to point HA to the HTML used to show you the results.
No I do not.
configuration.yaml:
http:
api_password: !secret http_password
I’m stumped. It will default to http://localhost:8123
and pull the API password to connect, which seems like it should work for you.
I know, it’s weird because, if I run "/home/homeassistant/.homeassistant/python_scripts/z_wave_graph.py
" manually in shell from within my venv, it works, it just won’t run with the automation.
“2018-02-05 14:55:00 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: /home/homeassistant/.homeassistant/python_scripts/z_wave_graph.py
, return code: 1
NoneType: None”
Does the above error mean it can’t find z_wave_graph.py?
The instructions were specifically for the docker build of home assistant. Are you using a docker? Just looking at your command line, you might try /usr/bin instead. What you would be looking for is the location of the homeassistant folder, where ever that is located, that path is what needs to go in between the single quotes.
Another thing to do would be to call the script from cron every hour, or even every day. You would just have to make sure the script run in the venv if you use one.
I haven’t actually animated it or anything, but I think my network is pretty static until I add more devices.
I had the same error “NoneType: None” when I put the script into the subfolder “python_scripts”. I didn’t get the error, when I but the script into another subfolder inside the configuration folder like “bin” . I think this comes from home-assistant who calls the python_scripts in another way.
I had the same error “NoneType: None” when I put the script into the subfolder “python_scripts”. I didn’t get the error, when I but the script into another subfolder inside the configuration folder like “bin” . I think this comes from home-assistant who calls the python_scripts in another way. With the location of the script inside “bin” I have no problems so far.
As I written, I use the hass.io installation which is “an operating system based on ResinOS and Docker”.
Not sure exactly what this means, can you explain?
I tried moving it to /srv/homeassistant/bin, and when i run the automation it still doesn’t update, no errors in log.
So here is what I did.
I moved the python script to “/home/homeassistant/bin/z_wave_graph.py”, there was no “bin” directory, so I created it.
When I run the script from shell with “~/bin/z_wave_graph.py” it creates the “z-wave-graph.json”, but there isn’t any graph when I go to “http://localhost:8123/z_wave-graph”, and no errors in log, any ideas?
If I run the script from shell a second time, I get the following error:
“2018-02-06 11:55:01 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: /home/homeassistant/.homeassistant/python_scripts/z_wave_graph.py
, return code: 1
NoneType: None”
The automation seem to be working now, if I trigger the automation I get the same error.