Raspbian + Aeon Z-Stick Setup errors

Hi,

I’ve followed all the guides on the website, looks at all the related posts and still unable to get Home Assistant to recognise the Z-Stick.

I’ve installed Home Assistant into a venv and following this guide : https://home-assistant.io/getting-started/installation-raspberry-pi/

Installed the Z-Wave stuff following this guide (at the bottom) : https://home-assistant.io/getting-started/installation-virtualenv/

I’ve verified my raspberry pi can see the z-stick by running OpenZwave Control Panel, so appears o be just an issue with Home Assistant.

Here is the log:

AttributeError: 'NoneType' object has no attribute '__context__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/bootstrap.py", line 151, in _async_setup_component
    None, component.setup, hass, config)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave/__init__.py", line 279, in setup
    CONF_CONFIG_PATH, default_zwave_config_path))
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pyozwweb-0.3.1-py3.4.egg/openzwave/option.py", line 81, in __init__
    raise ZWaveException(u"Error when retrieving device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))
openzwave.object.ZWaveException: 'Zwave Generic Exception : Error when retrieving device /dev/ttyACM0 : [\'Traceback (most recent call last):\\n\', \'  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pyozwweb-0.3.1-py3.4.egg/openzwave/option.py", line 75, in __init__\\n    raise ZWaveException(u"Can\\\'t write to device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))\\n\', \'  File "/usr/lib/python3.4/traceback.py", line 181, in format_exception\\n    return list(_format_exception_iter(etype, value, tb, limit, chain))\\n\', \'  File "/usr/lib/python3.4/traceback.py", line 146, in _format_exception_iter\\n    for value, tb in values:\\n\', \'  File "/usr/lib/python3.4/traceback.py", line 125, in _iter_chain\\n    context = exc.__context__\\n\', "AttributeError: \'NoneType\' object has no attribute \'__context__\'\\n"]'
INFO:homeassistant.loader:Loaded tts.google from homeassistant.components.tts.google
INFO:homeassistant.core:Bus:Handling <Event call_service[L]: domain=persistent_notification, service_data=title=Invalid config, notification_id=invalid_config, message=The following components and platforms could not be set up:
* [zwave](https://home-assistant.io/components/zwave/)
Please check your config, service=create, service_call_id=1979058416-1>
INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state persistent_notification.invalid_config=The following components and platforms could not be set up:
* [zwave](https://home-assistant.io/components/zwave/)
Please check your config; title=Invalid config @ 2017-01-17T14:39:25.108485+00:00>, old_state=None, entity_id=persistent_notification.invalid_config>

Also, I’ve validated my configuration.yml is correct syntax using the online yaml tool. Here is it’s content :

 zwave:
      usb_path: /dev/ttyACM0
      #config_path: /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/libopenzwave-0.3.1-py3.4-linux-armv7l.egg/config

Tried both with and without the config_path hased out.

I’m now at a dead end and don’t know how to proceed.

Thanks for your help.

If you type in the following at the command line on your Pi, what do you get as a response?

ls /dev/ttyACM

This will show where your stick is connected and should be used for your USB Path.

Also, check your config path and make sure it exists and then uncomment it. With that line commented (with the # in front of it) HA will ignore it so it won’t be able to find anything.

ls /dev/ttyACM returns /dev/ttyACM0 and this has also been tested with OZWCP, confirmed to work.

The part to the config file does exist, as I copied it form the command line and also as mentioned above, i’ve tried with and without the comment for the config path.

Thanks

Hmm, it looks like it can’t write to the configs but I’m no Zwave expert.

I’m going to move this into the ZWave section and see if someone can provide more help.

Thanks for your help. Just for completeness, I’ve included the log for when the config_path is not commented out :slight_smile:

INFO:homeassistant.bootstrap:Setting up zwave
ERROR:homeassistant.bootstrap:Error during setup of component zwave
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pyozwweb-0.3.1-py3.4.egg/openzwave/option.py", line 75, in __init__
    raise ZWaveException(u"Can't write to device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))
  File "/usr/lib/python3.4/traceback.py", line 181, in format_exception
    return list(_format_exception_iter(etype, value, tb, limit, chain))
  File "/usr/lib/python3.4/traceback.py", line 146, in _format_exception_iter
    for value, tb in values:
  File "/usr/lib/python3.4/traceback.py", line 125, in _iter_chain
    context = exc.__context__
AttributeError: 'NoneType' object has no attribute '__context__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/bootstrap.py", line 151, in _async_setup_component
    None, component.setup, hass, config)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave/__init__.py", line 279, in setup
    CONF_CONFIG_PATH, default_zwave_config_path))
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pyozwweb-0.3.1-py3.4.egg/openzwave/option.py", line 81, in __init__
    raise ZWaveException(u"Error when retrieving device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))
openzwave.object.ZWaveException: 'Zwave Generic Exception : Error when retrieving device /dev/ttyACM0 : [\'Traceback (most recent call last):\\n\', \'  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pyozwweb-0.3.1-py3.4.egg/openzwave/option.py", line 75, in __init__\\n    raise ZWaveException(u"Can\\\'t write to device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))\\n\', \'  File "/usr/lib/python3.4/traceback.py", line 181, in format_exception\\n    return list(_format_exception_iter(etype, value, tb, limit, chain))\\n\', \'  File "/usr/lib/python3.4/traceback.py", line 146, in _format_exception_iter\\n    for value, tb in values:\\n\', \'  File "/usr/lib/python3.4/traceback.py", line 125, in _iter_chain\\n    context = exc.__context__\\n\', "AttributeError: \'NoneType\' object has no attribute \'__context__\'\\n"]'
INFO:homeassistant.core:Bus:Handling <Event call_service[L]: service_call_id=1979476176-1, domain=persistent_notification, service=create, service_data=title=Invalid config, notification_id=invalid_config, message=The following components and platforms could not be set up:
* [zwave](https://home-assistant.io/components/zwave/)
Please check your config>
INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state persistent_notification.invalid_config=The following components and platforms could not be set up:
* [zwave](https://home-assistant.io/components/zwave/)
Please check your config; title=Invalid config @ 2017-01-17T15:59:02.946879+00:00>, entity_id=persistent_notification.invalid_config, old_state=None>
INFO:homeassistant.core:Bus:Handling <Event service_executed[L]: service_call_id=1979476176-1>
1 Like

I’m having a similar issue. Can you confirm for me where your configuration.yml is located that you have added the following to? I am alsong ttyACM0 as well.

zwave:
usb_path: /dev/ttyACM0

Also, how do I run the OpenZwave Control Panel? That is something I have not done yet.

I’m going to suggest this video to both of you - it’s what I used to get set up and watching it may lead to a discovery of something that was missed.

1 Like

Watching this right now! Thanks.

Okay, I watched the video and I have looked at the instructions on the zwave page again located here: https://home-assistant.io/getting-started/z-wave/

I believe there is an error in the instructions. The zwave page says that if you use this method to build python-openzwave…

$ git clone https://github.com/OpenZWave/python-openzwave.git
$ cd python-openzwave
$ git checkout python3
$ PYTHON_EXEC=$(which python3) make build
$ sudo PYTHON_EXEC=$(which python3) make install

That the config page is as following “If you followed along with setting up a virtual environment, your path will be:
/srv/hass/python-openzwave/openzwave/config”

I think that is incorrect. At no time is a hass director every created during the install of home assistant. If it is someone please proved me wrong. I am pretty sure the directory is 'homeassistant" is it not?

Yes; the AIO installer was modified in December from it’s original setup path of /hass to /homeassistant (still not sure why this was done as it is caused a LOT of confusion) and it’s notated here:

Ben’s video was done PRIOR to December 2016, so his instructions still use the old path of /hass.

The AIO never worked for me so I ended up doing the manual install. I then used the zwave page instructions to install it. After some searching this is my location of the config directory.

I following these instruction exactly: https://home-assistant.io/getting-started/z-wave/

/home/pi/python-openzwave/openzwave

Any idea why my path is completely different than what is on the zwave page?

Thanks.

I think I figured out what the issue is.

Type the follow to verify versions.

pi@raspberrypi:~ $ pip3 list | grep openzwave
libopenzwave (0.3.1)
openzwave (0.3.1)

Now get into your virtual venv and try that.

pi@raspberrypi:~ $ sudo su -s /bin/bash homeassistant
homeassistant@raspberrypi:/srv/homeassistant $ source /srv/homeassistant/homeassistant_venv/bin/activate

pip3 list | grep openzwave

I get nothing back and I think this tells me that the venv can’t access ibopenzwave
or openzwave. Does that sounds accurate?

I am guessing if the install or openzwave is run in the venv then it will work. I am off to try this now.

okay, we are a little bit close now. I check the following file outside the venv.

pi@raspberrypi:~ $ sudo nano /srv/homeassistant/homeassistant_venv/pyvenv.cfg

ome = /usr/bin
include-system-site-packages = false
version = 3.4.2

I am guessing this confirms why openzave isn’t found when in venv. I update that to true, saves, exited, then got back into the venv again.

pi@raspberrypi:~ $ sudo su -s /bin/bash homeassistant
homeassistant@raspberrypi:/home/pi $ cd /srv/homeassistant/
homeassistant@raspberrypi:/srv/homeassistant $ pip3 list | grep openzwave
libopenzwave (0.3.1)
openzwave (0.3.1)

They seem to be found now. I am about to reboot and see what shows up for errors when hass starts.

fingers crossed!

After a reboot I get the EXACT same errors as Dilby.

INFO:homeassistant.bootstrap:Setting up zwave
ERROR:homeassistant.bootstrap:Error during setup of component zwave
Traceback (most recent call last):
File “/usr/local/lib/python3.4/dist-packages/pyozwweb-0.3.1-py3.4.egg/openzwave/option.py”, line 78, in init
raise ZWaveException(u"Can’t find device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))
File “/usr/lib/python3.4/traceback.py”, line 181, in format_exception
return list(_format_exception_iter(etype, value, tb, limit, chain))
File “/usr/lib/python3.4/traceback.py”, line 146, in _format_exception_iter
for value, tb in values:
File “/usr/lib/python3.4/traceback.py”, line 125, in _iter_chain
context = exc.context
AttributeError: ‘NoneType’ object has no attribute ‘context

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/bootstrap.py”, line 151, in _async_setup_component
None, component.setup, hass, config)
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave/init.py”, line 279, in setup
CONF_CONFIG_PATH, default_zwave_config_path))
File “/usr/local/lib/python3.4/dist-packages/pyozwweb-0.3.1-py3.4.egg/openzwave/option.py”, line 81, in init
raise ZWaveException(u"Error when retrieving device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))
openzwave.object.ZWaveException: ‘Zwave Generic Exception : Error when retrieving device /dev/ttyACM0 : ['Traceback (most recent call last):\n', ' File “/usr/local/lib/python3.4/dist-packages/pyozwweb-0.3.1-py3.4.egg/openzwave/option.py”, line 78, in init\n raise ZWaveException(u"Can\'t find device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))\n', ' File “/usr/lib/python3.4/traceback.py”, line 181, in format_exception\n return list(_format_exception_iter(etype, value, tb, limit, chain))\n', ' File “/usr/lib/python3.4/traceback.py”, line 146, in _format_exception_iter\n for value, tb in values:\n', ' File “/usr/lib/python3.4/traceback.py”, line 125, in _iter_chain\n context = exc.context\n', “AttributeError: 'NoneType' object has no attribute 'context'\n”]’
INFO:homeassistant.core:Bus:Handling <Event call_service[L]: domain=persistent_notification, service_data=title=Invalid config, notification_id=invalid_config, message=The following components and platforms could not be set up:

  • zwave
    Please check your config, service=create, service_call_id=1978470352-1>
    INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state persistent_notification.invalid_config=The following components and platforms could not be set up:
  • zwave
    Please check your config; title=Invalid config @ 2017-01-17T20:36:10.132327-06:00>, entity_id=persistent_notification.invalid_config, old_state=None>
    INFO:homeassistant.core:Bus:Handling <Event service_executed[L]: service_call_id=1978470352-1>

Looks like it can’t find your Stick. Can you see the stick in OZWCP? (stop home assistant, start OZWCP, put device adress in the “Device Name” field and click “Initialize”.

If the stick works in OZWCP, please post the z-wave part of your configuration.yaml and the output of ls -l /dev/ttyA*

EDIT: try this first

In the end I did a fresh install of Rasbian and used the AIO installer - Seems to work fine now.

One omission I did notice is that I didn’t do this and sense is important for the USB device to be recognised :

$ sudo usermod -G dialout -a homeassistant

If i get time in the next couple of weeks, I’ll run through the whole process again and see if i can put together a guide that could possibly be used to update the one on this site ?

Thanks

Thanks; if you want to update the docs directly, you can always click on the “Edit this page in GitHub” link at the top right. Whatever edits you make will be held off line and approved by one of the core devs so you don’t have to worry about putting in something wrong. And the reviewer can correct and make suggestions.

Late to the party, but I encountered this same problem when plugging in my Z-stick into my pi, on which I did a manual installation with a virtual environment. I already had python-openzwave installed, so adding the homeassistant user to the tty and the dialout groups did the trick.