8000 support for z-wave usb sticks · Issue #20 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

support for z-wave usb sticks #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
edgimar opened this issue Jan 19, 2015 · 31 comments
Closed

support for z-wave usb sticks #20

edgimar opened this issue Jan 19, 2015 · 31 comments

Comments

@edgimar
Copy link
edgimar commented Jan 19, 2015

Controlling and reading z-wave devices via a z-wave USB stick (e.g. the Aeotec Z-Stick Series 2 -- but there are several others which appear to use the same serial-based protocol) would be great -- maybe it would be possible to integrate something like https://code.google.com/p/python-openzwave/ ?

@balloob
Copy link
Member
balloob commented Jan 19, 2015

It would be indeed really great to have. The library you linked would be a way to go. It just has one big blocker: it does not support Python 3. Since it is partly implemented as a C extension adding support for Python 3 wouldn't be straight forward.

If there was Python 3 support I would get myself a stick and add it to Home Assistant :-)

@edgimar
Copy link
Author
edgimar commented Jan 25, 2015

Are you sure it doesn't support Python 3? The C interfacing appears to be done via Cython, which as far as I know supports python 3.2+. I'll give it a try at some point (if you don't get to it before me! ;), and let you know.

@bakkerv
Copy link
bakkerv commented Feb 9, 2015

Any progress on the z-wave python lib?

@balloob
Copy link
Member
balloob commented Feb 9, 2015

Not from my side.

@edgimar
Copy link
Author
edgimar commented Feb 10, 2015

Haven't done anything with it yet -- I guess it shouldn't be too much work if you want to try to see if it works with Python 3. Might be a couple of weeks before I get to it, so if you are able to confirm that the python-zwave code runs with Python 3, that would probably be the first step to getting it integrated into home-assistant.

@edgimar
Copy link
Author
edgimar commented Feb 13, 2015

Ok, I found some time (needed an excuse to procrastinate) -- I've created a clone of python-openzwave that seems to be working with Python 3 and a Z-Stick Series 2 device. Details on how to compile / install are in the PYTHON3.txt file. Please feel free to submit patches/pull-requests (or I'd be happy to give those interested push access to the repo).

The repo is here: https://bitbucket.org/edgimar/python3-openzwave

@balloob
Copy link
Member
balloob commented Feb 13, 2015

Awesome ! I just ordered a Z-Wave Series 2 stick and a Multi-Sensor so I can start playing with it.

The next step is going to be incorporating your instructions in the Dockerfile so people will be able to easily setup a dev environment. And then let's see how we can connect it to Home Assistant 😎

@balloob
Copy link
Member
balloob commented Feb 22, 2015

I've updated the Dockerfile and you can test it out in the branch feature-openzwave.

To test it:

  • adjust scripts/dev_docker to point at your Z-Wave usb stick
  • run scripts/dev_docker
  • This will open a bash shell inside the docker container
  • Go to /usr/src/python-openzwave/examples/, adjust hello_world.py to:
    • point at /usbstick
    • on line 80, 81: append .encode("UTF-8") to the strings
  • run python hello_world.py

It currently fails because in api/option.py on line 70 it is running os.join on the passed in path (which is in UTF-8 bytes) with a string. It seems like the files in the api folder need work to be made Python 3 compatible.

@edgimar
Copy link
Author
edgimar commented Feb 22, 2015

When I try running the docker script, I get the following:

Executing 3 build triggers

Step onbuild-0 : COPY requirements.txt /usr/src/app/
---> cf022d84cc69
Step onbuild-1 : RUN pip install -r requirements.txt
---> Running in f0bc99b547ff
2015/02/22 03:10:42 exec format error
2015/02/21 22:10:43 The command [/bin/sh -c pip install -r
requirements.txt] returned a non-zero code: 1
Unable to find image 'home-assistant-dev' locally
Pulling repository home-assistant-dev
2015/02/21 22:10:44 HTTP code: 404

On Sat, Feb 21, 2015 at 9:17 PM, Paulus Schoutsen notifications@github.com
wrote:

I've updated the Dockerfile and you can test it out in the branch
feature-openzwave
https://github.com/balloob/home-assistant/tree/feature-openzwave.

To test it:

  • adjust scripts/dev_docker to point at your Z-Wave usb stick
  • run scripts/dev_docker
  • This will open a bash shell inside the docker container
  • Go to /usr/src/python-openzwave/examples/, adjust hello_world.py to:
    • point at /usbstick
    • on line 80, 81: append .encode("UTF-8") to the strings
      • run python hello_world.py

It currently fails because in api/option.py on line 70
https://bitbucket.org/edgimar/python3-openzwave/src/7833dbd8f088fc349652d5a98622f8a3c8861754/api/option.py?at=default#cl-70
it is running os.join on the passed in path (which is in UTF-8 bytes)
with a string. It seems like the files in the api folder need work to be
made Python 3 compatible.


Reply to this email directly or view it on GitHub
#20 (comment)
.

@balloob
Copy link
Member
balloob commented Feb 22, 2015

Looks like building the local image fails:
2015/02/21 22:10:43 The command [/bin/sh -c pip install -r requirements.txt] returned a non-zero code: 1

Do you have access to any more logs ?

@edgimar
Copy link
Author
edgimar commented Feb 22, 2015

Do you mean logs from the container? If so, the only contents of the
container log is: 2015/02/22 03:16:56 exec format error.

On Sat, Feb 21, 2015 at 10:17 PM, Paulus Schoutsen <notifications@github.com

wrote:

Looks like building the local image fails:
2015/02/21 22:10:43 The command [/bin/sh -c pip install -r
requirements.txt] returned a non-zero code: 1

Do you have access to any more logs ?


Reply to this email directly or view it on GitHub
#20 (comment)
.

@balloob
Copy link
Member
balloob commented Feb 22, 2015

Hmm, weird. I am using OS X 10.10 with boot2docker v1.4.1. I just tried removing all images and follow my instructions and it works.

@edgimar
Copy link
Author
edgimar commented Feb 22, 2015

I'm using 32-bit Ubuntu 14.04, with the docker.io package from the standard
Ubuntu repositories. Perhaps you can reproduce what I'm seeing by
installing/running a 14.04 VM?
On Feb 21, 2015 10:47 PM, "Paulus Schoutsen" notifications@github.com
wrote:

Hmm, weird. I am using OS X 10.10 with boot2docker v1.4.1.


Reply to this email directly or view it on GitHub
#20 (comment)
.

@balloob
Copy link
Member
balloob commented Feb 22, 2015

I'll try it right now.

The requirements.txt file did not change between this branch and the master or dev branch. And both seem to be building fine on the docker registry: master, dev

@balloob
Copy link
Member
balloob commented Feb 22, 2015

Can confirm, get same error running Ubuntu 14.04 32-bit in a VM 😞

@balloob
Copy link
Member
balloob commented Feb 22, 2015

I have made some changes to get it working on Python 3. Keeping my changes on Google Code in a cloned repo: find it here

@balloob
Copy link
Member
balloob commented Feb 22, 2015

Please note, these changes will allow Python 3 to interface with python-openzwave cython code. I have not been able to interface with my USB stick yet.

@edgimar
Copy link
Author
edgimar commented Feb 22, 2015

apparently docker only officially supports 64-bit images, so that's where the "exec format error" was coming from. There are unsupported 32-bit images available, so if you wanted home-assistant to support 32-bit architectures, you'd need to make a Dockerfile that depends on these 32-bit images -- see https://bugs.launchpad.net/ubuntu/+source/docker.io/+bug/1366509 .

@balloob
Copy link
Member
balloob commented Feb 23, 2015

I have just pushed changes to the feature-openzwave branch that will take your Z-Wave sensors and show them in Home Assistant. One card per sensor.

Since you can't use Docker, you can use the new script scripts/build_python_openzwave which should work on any Linux environment that has the build dependencies installed.

Outstanding issues:

  • not all values populated when Z-Wave fires the network ready event, sensors get setup with incomplete data.
  • Sensor values are not being updated yet.

Imgur

@balloob
Copy link
Member
balloob commented Feb 23, 2015

Just pushed changes that will have the controller register for updates from the sensor and pushes them to Home Assistant.

Issue for not having the correct data on launch is still there. I might want to add in a refresh.

I am also having an issue with the temperature sensor:

  • it is not reliable in which unit it is reporting (I can set that, will try that)
  • when it is reporting in celsius the value is x1000 (ie 20132.72131) (might be some documentation I am missing).

@balloob
Copy link
Member
balloob commented Feb 26, 2015

So I found some resources online that stated that there is a firmware bug with my Aeon Labs multi sensor that will report the wrong values for temperature when it is polled. And indeed, when run in a mode where I do not poll but get updates whenever the sensor sees fit it works.

It works but since there are a lot of moving parts I don't feel confident yet to push it out to the dev branch just yet. @edgimar , would you be able to test it? It currently only supports sensors.

@edgimar
Copy link
Author
edgimar commented Feb 27, 2015

Can you provide a working config example that works with zwave devices? The current example config doesn't contain any zwave specific content, from what I can tell.

@balloob
Copy link
Member
balloob commented Feb 27, 2015
[zwave]
usb_path=/dev/ttyUSB0

@edgimar
Copy link
Author
edgimar commented Feb 28, 2015

When I've done nothing but add the zwave section to the config file, the following are some of the debug messages that get printed when running home-assistant (and it doesn't find any devices):

INFO:homeassistant:Bus:Handling <Event service_registered[L]: service=turn_off, domain=homeassistant>
INFO:homeassistant:Bus:Handling <Event service_registered[L]: service=turn_on, domain=homeassistant>
INFO:homeassistant.bootstrap:Home Assistant core initialized
INFO:homeassistant.loader:Loaded group from homeassistant.components.group
INFO:homeassistant.loader:Loaded recorder from homeassistant.components.recorder
INFO:homeassistant.loader:Loaded zwave from homeassistant.components.zwave
INFO:homeassistant.loader:Loaded frontend from homeassistant.components.frontend
INFO:homeassistant.loader:Loaded api from homeassistant.components.api
INFO:homeassistant.loader:Loaded http from homeassistant.components.http
INFO:homeassistant.loader:Loaded history from homeassistant.components.history
ERROR:homeassistant.loader:Error loading homeassistant.components.discovery. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/home/useruser/git_repositories/home-assistant/homeassistant/loader.py", line 116, in get_component
    module = importlib.import_module(path)
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1448, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/user/git_repositories/home-assistant/homeassistant/components/discovery.py", line 14, in <module>
    from homeassistant.external.netdisco.netdisco import DiscoveryService
  File "/home/user/git_repositories/home-assistant/homeassistant/external/netdisco/netdisco/__init__.py", line 5, in <module>
    from .mdns import MDNS
  File "/home/user/git_repositories/home-assistant/homeassistant/external/netdisco/netdisco/mdns.py", line 2, in <module>
    import zeroconf
ImportError: No module named 'zeroconf'
ERROR:homeassistant.loader:Unable to find component discovery
INFO:homeassistant:Bus:Handling <Event component_loaded[L]: component=recorder>
ERROR:homeassistant.bootstrap:component zwave failed to initialize
INFO:homeassistant:Bus:Handling <Event component_loaded[L]: component=http>
INFO:homeassistant:Bus:Handling <Event component_loaded[L]: component=api>
INFO:homeassistant:Bus:Handling <Event component_loaded[L]: component=frontend>
INFO:homeassistant:Bus:Handling <Event component_loaded[L]: component=history>
INFO:homeassistant:Starting Home Assistant (7 threads)
INFO:homeassistant:Bus:Handling <Event homeassistant_start[L]>
INFO:homeassistant:Bus:Handling <Event service_registered[L]: service=stop, domain=homeassistant>
INFO:homeassistant:Timer:starting
INFO:homeassistant.components.http:Starting web interface at http://0.0.0.0:8123
INFO:homeassistant.components.recorder:Running query UPDATE recorder_runs SET end=?, closed_incorrect=1
                      WHERE end IS NULL
INFO:homeassistant.components.recorder:Running query INSERT INTO recorder_runs (start, created) VALUES (?, ?)
INFO:root:Driver ready using library b'Static Controller' version b'Z-Wave 2.78'
INFO:root:home_id 0x01850955, controller node id is 1
Exception ignored in: 'libopenzwave.notif_callback'
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/python_openzwave_api-0.2.6-py3.4.egg/openzwave/network.py", line 777, in zwcallback
  File "/usr/local/lib/python3.4/dist-packages/python_openzwave_api-0.2.6-py3.4.egg/openzwave/network.py", line 1299, in _handle_value_added
  File "/usr/local/lib/python3.4/dist-packages/Louie-1.2a1dev-py3.4.egg/louie/dispatcher.py", line 351, in send
    **named
  File "/usr/local/lib/python3.4/dist-packages/Louie-1.2a1dev-py3.4.egg/louie/robustapply.py", line 36, in robust_apply
    signature, code_object, startIndex = function(signature)
  File "/usr/local/lib/python3.4/dist-packages/Louie-1.2a1dev-py3.4.egg/louie/robustapply.py", line 27, in function
    'unknown reciever type %s %s' % (receiver, type(receiver)))
ValueError: unknown reciever type <function setup.<locals>.value_added at 0xb633a26c> <class 'function'>

The last traceback is repeated 30 more times.

To reproduce:

  1. run build_python_openzwave as root (necessary in order to install python packages -- this might be better to modify so things all get installed locally, not as root, when running this script, and used locally if they were installed there)
  2. run python3 -m homeassistant --config ./config with the configuration specifying the correct usb_path.

Of course the usb stick is inserted, and there is at least one device added to its zwave network. The stick is being communicated with (e.g. flashes sometimes when home-assistant is run to indicate this).

@balloob
Copy link
Member
balloob commented Feb 28, 2015

Ah yes, the problem with the build scripts is that they expect that python points at python3. Running python3 setup.py install in the louie directory should help with the error you're getting.

I'll fix the scripts later today.

@edgimar
Copy link
Author
edgimar commented Feb 28, 2015

I was already running setup with python3 -- the error is the same. One other thing to improve with the script is to clone the external repositories to somewhere beneath the home-assistant tree -- currently they get cloned as siblings of the home-assistant directory, which can possibly conflict with other existing directories.

@balloob
Copy link
628C
Member
balloob commented Feb 28, 2015

I have just pushed an update to the scripts so it will create and use a build directory inside the home assistant directory.

I am fairly sure that the error you are getting is related to not running my patched version of louie. As that is the exact error why I had to fork louie. I was under the impression that python3 setup.py install would overwrite any current installation but maybe I was wrong. Could you run python3 setup.py install --force from a clone of https://github.com/balloob/louie.git?

@edgimar
Copy link
Author
edgimar commented Mar 1, 2015

Here's a full (stdout) log, after using the --force flag for installing louie and running home-assistant. Are discovered zwave devices supposed to be logged?

INFO:homeassistant:Bus:Handling <Event service_registered[L]: service=turn_off, domain=homeassistant>
INFO:homeassistant:Bus:Handling <Event service_registered[L]: service=turn_on, domain=homeassistant>
INFO:homeassistant.bootstrap:Home Assistant core initialized
INFO:homeassistant.loader:Loaded group from homeassistant.components.group
INFO:homeassistant.loader:Loaded recorder from homeassistant.components.recorder
ERROR:homeassistant.loader:Error loading homeassistant.components.discovery. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/home/user/git_repositories/home-assistant/homeassistant/loader.py", line 116, in get_component
    module = importlib.import_module(path)
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1448, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/user/git_repositories/home-assistant/homeassistant/components/discovery.py", line 14, in <module>
    from homeassistant.external.netdisco.netdisco import DiscoveryService
  File "/home/user/git_repositories/home-assistant/homeassistant/external/netdisco/netdisco/__init__.py", line 5, in <module>
    from .mdns import MDNS
  File "/home/user/git_repositories/home-assistant/homeassistant/external/netdisco/netdisco/mdns.py", line 2, in <module>
    import zeroconf
ImportError: No module named 'zeroconf'
ERROR:homeassistant.loader:Unable to find component discovery
INFO:homeassistant.loader:Loaded zwave from homeassistant.components.zwave
INFO:homeassistant.loader:Loaded history from homeassistant.components.history
INFO:homeassistant.loader:Loaded http from homeassistant.components.http
INFO:homeassistant.loader:Loaded frontend from homeassistant.components.frontend
INFO:homeassistant.loader:Loaded api from homeassistant.components.api
INFO:homeassistant:Bus:Handling <Event component_loaded[L]: component=recorder>
ERROR:homeassistant.bootstrap:component zwave failed to initialize
INFO:homeassistant:Bus:Handling <Event component_loaded[L]: component=http>
INFO:homeassistant:Bus:Handling <Event component_loaded[L]: component=history>
INFO:homeassistant:Bus:Handling <Event component_loaded[L]: component=api>
INFO:homeassistant:Bus:Handling <Event component_loaded[L]: component=frontend>
INFO:homeassistant:Starting Home Assistant (7 threads)
INFO:homeassistant:Bus:Handling <Event homeassistant_start[L]>
INFO:homeassistant:Bus:Handling <Event service_registered[L]: service=stop, domain=homeassistant>
INFO:homeassistant:Timer:starting
INFO:homeassistant.components.http:Starting web interface at http://0.0.0.0:8123
INFO:homeassistant.components.recorder:Running query UPDATE recorder_runs SET end=?, closed_incorrect=1
                      WHERE end IS NULL
INFO:homeassistant.components.recorder:Running query INSERT INTO recorder_runs (start, created) VALUES (?, ?)
INFO:root:Driver ready using library b'Static Controller' version b'Z-Wave 2.78'
INFO:root:home_id 0x01850955, controller node id is 1
ERROR:homeassistant.loader:Error loading homeassistant.components.sensor. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/home/user/git_repositories/home-assistant/homeassistant/loader.py", line 116, in get_component
    module = importlib.import_module(path)
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1448, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/user/git_repositories/home-assistant/homeassistant/components/sensor/__init__.py", line 13, in <module>
    from homeassistant.components import discovery, wink, zwave
  File "/home/user/git_repositories/home-assistant/homeassistant/components/discovery.py", line 14, in <module>
    from homeassistant.external.netdisco.netdisco import DiscoveryService
  File "/home/user/git_repositories/home-assistant/homeassistant/external/netdisco/netdisco/__init__.py", line 5, in <module>
    from .mdns import MDNS
  File "/home/user/git_repositories/home-assistant/homeassistant/external/netdisco/netdisco/mdns.py", line 2, in <module>
    import zeroconf
ImportError: No module named 'zeroconf'
ERROR:homeassistant.loader:Unable to find component sensor
ERROR:homeassistant.bootstrap:Error during setup of component sensor
Traceback (most recent call last):
  File "/home/user/git_repositories/home-assistant/homeassistant/bootstrap.py", line 42, in setup_component
    if component.setup(hass, config):
AttributeError: 'NoneType' object has no attribute 'setup'
INFO:homeassistant:Bus:Handling <Event platform_discovered[L]: discovered=value_id=72057594160349184, node_id=7, service=zwave.sensors>
ERROR:homeassistant.loader:Error loading homeassistant.components.sensor. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/home/user/git_repositories/home-assistant/homeassistant/loader.py", line 116, in get_component
    module = importlib.import_module(path)
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1448, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/user/git_repositories/home-assistant/homeassistant/components/sensor/__init__.py", line 13, in <module>
    from homeassistant.components import discovery, wink, zwave
  File "/home/user/git_repositories/home-assistant/homeassistant/components/discovery.py", line 14, in <module>
    from homeassistant.external.netdisco.netdisco import DiscoveryService
  File "/home/user/git_repositories/home-assistant/homeassistant/external/netdisco/netdisco/__init__.py", line 5, in <module>
    from .mdns import MDNS
  File "/home/user/git_repositories/home-assistant/homeassistant/external/netdisco/netdisco/mdns.py", line 2, in <module>
    import zeroconf
ImportError: No module named 'zeroconf'
ERROR:homeassistant.loader:Unable to find component sensor
ERROR:homeassistant.bootstrap:Error during setup of component sensor
Traceback (most recent call last):
  File "/home/user/git_repositories/home-assistant/homeassistant/bootstrap.py", line 42, in setup_component
    if component.setup(hass, config):
AttributeError: 'NoneType' object has no attribute 'setup'
INFO:homeassistant:Bus:Handling <Event platform_discovered[L]: discovered=value_id=72057594160365586, node_id=7, service=zwave.sensors>
ERROR:homeassistant.loader:Error loading homeassistant.components.sensor. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/home/user/git_repositories/home-assistant/homeassistant/loader.py", line 116, in get_component
    module = importlib.import_module(path)
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1448, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/user/git_repositories/home-assistant/homeassistant/components/sensor/__init__.py", line 13, in <module>
    from homeassistant.components import discovery, wink, zwave
  File "/home/user/git_repositories/home-assistant/homeassistant/components/discovery.py", line 14, in <module>
    from homeassistant.external.netdisco.netdisco import DiscoveryService
  File "/home/user/git_repositories/home-assistant/homeassistant/external/netdisco/netdisco/__init__.py", line 5, in <module>
    from .mdns import MDNS
  File "/home/user/git_repositories/home-assistant/homeassistant/external/netdisco/netdisco/mdns.py", line 2, in <module>
    import zeroconf
ImportError: No module named 'zeroconf'
ERROR:homeassistant.loader:Unable to find component sensor
ERROR:homeassistant.bootstrap:Error during setup of component sensor
Traceback (most recent call last):
  File "/home/user/git_repositories/home-assistant/homeassistant/bootstrap.py", line 42, in setup_component
    if component.setup(hass, config):
AttributeError: 'NoneType' object has no attribute 'setup'
INFO:homeassistant:Bus:Handling <Event platform_discovered[L]: discovered=value_id=72057594160365618, node_id=7, service=zwave.sensors>
INFO:homeassistant.components.recorder:Running query INSERT INTO events (event_type, event_data, origin, created) VALUES (?, ?, ?, ?)
ERROR:homeassistant.loader:Error loading homeassistant.components.sensor. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/home/user/git_repositories/home-assistant/homeassistant/loader.py", line 116, in get_component
    module = importlib.import_module(path)
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1448, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/user/git_repositories/home-assistant/homeassistant/components/sensor/__init__.py", line 13, in <module>
    from homeassistant.components import discovery, wink, zwave
  File "/home/user/git_repositories/home-assistant/homeassistant/components/discovery.py", line 14, in <module>
    from homeassistant.external.netdisco.netdisco import DiscoveryService
  File "/home/user/git_repositories/home-assistant/homeassistant/external/netdisco/netdisco/__init__.py", line 5, in <module>
    from .mdns import MDNS
  File "/home/user/git_repositories/home-assistant/homeassistant/external/netdisco/netdisco/mdns.py", line 2, in <module>
    import zeroconf
ImportError: No module named 'zeroconf'
ERROR:homeassistant.loader:Unable to find component sensor
ERROR:homeassistant.bootstrap:Error during setup of component sensor
Traceback (most recent call last):
  File "/home/user/git_repositories/home-assistant/homeassistant/bootstrap.py", line 42, in setup_component
    if component.setup(hass, config):
AttributeError: 'NoneType' object has no attribute 'setup'
INFO:homeassistant:Bus:Handling <Event platform_discovered[L]: discovered=value_id=72057594160365650, node_id=7, service=zwave.sensors>
INFO:homeassistant.components.recorder:Running query INSERT INTO events (event_type, event_data, origin, created) VALUES (?, ?, ?, ?)
INFO:homeassistant.components.recorder:Running query INSERT INTO events (event_type, event_data, origin, created) VALUES (?, ?, ?, ?)
INFO:homeassistant.components.recorder:Running query INSERT INTO events (event_type, event_data, origin, created) VALUES (?, ?, ?, ?)
INFO:homeassistant.components.recorder:Running query INSERT INTO events (event_type, event_data, origin, created) VALUES (?, ?, ?, ?)
INFO:homeassistant.components.recorder:Running query INSERT INTO events (event_type, event_data, origin, created) VALUES (?, ?, ?, ?)
INFO:homeassistant.components.recorder:Running query INSERT INTO events (event_type, event_data, origin, created) VALUES (?, ?, ?, ?)
INFO:homeassistant.components.recorder:Running query INSERT INTO events (event_type, event_data, origin, created) VALUES (?, ?, ?, ?)
INFO:homeassistant.components.recorder:Running query INSERT INTO events (event_type, event_data, origin, created) VALUES (?, ?, ?, ?)
INFO:homeassistant.components.recorder:Running query INSERT INTO events (event_type, event_data, origin, created) VALUES (?, ?, ?, ?)
INFO:homeassistant.components.recorder:Running query INSERT INTO events (event_type, event_data, origin, created) VALUES (?, ?, ?, ?)
127.0.0.1 - - [28/Feb/2015 21:20:46] "GET /api/stream?api_password=... HTTP/1.1" 200 -
127.0.0.1 - - [28/Feb/2015 21:20:46] "GET /api/events HTTP/1.1" 200 -
127.0.0.1 - - [28/Feb/2015 21:20:46] "GET /api/states HTTP/1.1" 200 -
127.0.0.1 - - [28/Feb/2015 21:20:46] "GET /api/services HTTP/1.1" 200 -
127.0.0.1 - - [28/Feb/2015 21:20:46] "GET /api/components HTTP/1.1" 200 -

@balloob
Copy link
Member
balloob commented Mar 1, 2015

This looks like a new error: you don't have the dependency zeroconf installed. You can probably get it working now by running pip3 install zeroconf. Or you can wait a bit, I'll put it on my to do to make sure that discovery will only import zeroconf when it is needed. As for this use case it is actually not needed.

Thanks for helping me test this btw !

@balloob
Copy link
Member
balloob commented Mar 1, 2015

I have rebased the zwave branch on the dev branch. Added the fix that the discovery component does not need zeroconf anymore unless it is being setup.

@balloob
Copy link
Member
balloob commented Mar 1, 2015

I have just merged it into the dev branch to allow more people to have a look at it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants
0