Graph your Z-Wave mesh (Python, auto-update)

I see what is happening, but not why. I just pushed a version with a --debug flag. Please send me the output of that, PM is fine.

That works well for me, and now shows up the remotes again:

Itā€™s really interesting to see how some of my nodes move around.

This latest push worked for me. Did you make any changes around Python 3.5? It may have been the --ssl option not working in the last version that caused the error. Because this time, i got the same error without --ssl, but worked fine with it.

I must have messed up something during install last night. I pulled the latest version and it is working great. Thanks again.

Hello guys,

Iā€™m having a small issue when trying to setup this graph in my HA.
Running this command from prompt in virtual env :

(homeassistant) homeassistant@raspberrypi:~ $ python ~/bin/z-wave-graph.py --ssl --port 443

is okay (I get the json). When running the same thing in shell_command.yaml I get:

2018-01-28 18:20:01 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: python ~/bin/z-wave-graph.py --port 443 --ssl, return code: 1 NoneType: None

Any idea?

Maybe try putting the full path to python in the shell_command. /usr/bin/python maybe, or try /usr/bin/env python and then the rest.

Hello,

I tried both but still get:

2018-01-28 23:00:00 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: /usr/bin/python ~/bin/z-wave-graph.py --port 443 --ssl, return code: 1
NoneType: None

or

Error running command: /usr/bin/python ~/bin/z-wave-graph.py --port 443 --ssl, return code: 1
23:00 /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/shell_command.py (ERROR)

Your top and bottom messages are the same. Iā€™m not sure if that was a copy/paste error during testing, or during posting.

I guess the first question is: where is your Python: which python
Also, what version: python -V
And just to be sure: which env

Make sure you run all those logged in as the homeassistant user and with the virtual environment activated.

Well, everything works fine in cmd line:

pi@raspberrypi:~ $ sudo su -s /bin/bash homeassistant
homeassistant@raspberrypi:/home/pi $ source /srv/homeassistant/bin/activate
(homeassistant) homeassistant@raspberrypi:~ $ which python
/srv/homeassistant/bin/python
(homeassistant) homeassistant@raspberrypi:~ $ python -V
Python 3.5.3
(homeassistant) homeassistant@raspberrypi:~ $ which env
/usr/bin/env
(homeassistant) homeassistant@raspberrypi:~ $ python ~/bin/z-wave-graph.py --ssl --port 443
(homeassistant) homeassistant@raspberrypi:~ $ /usr/bin/env python ~/bin/z-wave-graph.py --ssl --port 443

as soon as I try any of the cmd in HA, they fail.

2018-01-29 18:30:00 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: `/usr/bin/python ~/bin/z-wave-graph.py --port 443 --ssl`, return code: 1
NoneType: None

2018-01-29 18:40:00 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: `/usr/bin/env python ~/bin/z-wave-graph.py --port 443 --ssl`, return code: 1
NoneType: None

It makes no sens to me but Iā€™m far from being python fluent.

I just got my usb module installed and working great. I wanted to try this out, and i am running into a strange issue that i am unable to figure out.

line 23 and 24 import homeassistant.config/remote. The script is failing here. Where should these be located? Did i miss something?

Home Assistant: 0.62.0
Custom UI: 20180126
Running in a docker container.
Python: 3.6.4
ENV: /usr/bin/env
using --ssl

the script itself is located in /config/bin as there is no access to any lower directories via samba. i can move if necessary.

The exact error: ModuleNotFoundError: No module named ā€˜homeassistantā€™

The installed modules:

It just occurred to me to try the full path instead of ~/bin/z-wave-graph.py, something like /srv/homeassistant/bin/z-wave-graph.py .

Is HA running under a virtual environment? Are you running the script from the same virtual environment? Sorry, I donā€™t use docker so I canā€™t comment on any specifics.

Yes, its a docker container. I am running the script in the container. The docker install doesnt seem to have the homeassistant module, even though it is running correctly. I am really curious what the differences are. Iā€™m scouring the new to see how to get it to work.

Just opened a support ticket.

I tried all the variations I could think of around your adviceā€¦no luck. However, running the command manually is okay and i get the graph in HA so itā€™s okay in the end. I can do an update once in a while (my z-wave network doesnā€™t move that much)

FYI - This breaks when the base_url is a full URL. Example: https://home.myurl.com - when trying to split out or remove the port.

I just pushed a new version that uses base_url for both the port and SSL, so it should work with your case. Just be sure to remove --ssl or --port if you used them.

BREAKING: The --ssl and --port flags have been removed. Set your base_url appropriately:

@e_jp: Itā€™s possible this will fix your issue. @Bigrob8181: same for you, plus I added a check to make sure the API connection happened and error out if it didnā€™t. If you get that error there may be a message which helps diagnose the issue.

does this support
https://home.url.com
and use default 443?

I tried different URLs but none did work.

However, I found that even if I defined an IP like
https://192.168.1.12:8123/local/z-wave-graph.html
the script will try to use the base URL in configuration.yaml.

requests.exceptions.ConnectionError: HTTPConnectionPool(host='my.domain.com', port=8123): Max retries exceeded with url: /api/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x758612f0>: Failed to establish a new connection: [Errno 111] Connection refused',))
Error, unable to connect to the API: cannot_connect

If I set
z_wave_graph_url: https://my.domain.com/local/z-wave-graph.html
I still get

requests.exceptions.ConnectionError: HTTPConnectionPool(host=ā€˜my.domain.comā€™, port=8123): Max retries exceeded with url: /api/ (Caused by NewConnectionError(ā€˜<urllib3.connection.HTTPConnection object at 0x75913250>: Failed to establish a new connection: [Errno 111] Connection refusedā€™,))
Error, unable to connect to the API: cannot_connect