DeConz integration fail: "No module named 'pydeconz'"

You can certainly update the venv to the newest version, but you’ll need to work through every update (around 50 updates) and read the breaking changes and adapt your system. That’s what you get when you don’t keep beta software updated.
Robban and I only wanted to give you an advice that it’s easier and less time consuming to start from scratch. And you may have a lot of experience with Linux, but it seems not soo much with Python. Therefore a docker install might be a better fit for you, especially when you are running docker anyways for deconz (I don’t underatand why you don’t install deconz directly on the Pi and instead add the docker “overhead” just for deconz).

If you run 0.67 you most certainly have a too old python version (probably 3.4/3.5) anyway, so you’re gonna need to upgrade python along as you bump hass version. You would not need to bother with that compatibility running in docker.

I have never used Python. My installed Python version is 3.7.3.

I did initially install Deconz directly from Phoscon, but it didn’t work. I was following instructions on the web site which recommended installing it in Docker. Since I had no Docker experience either and the process looked too complicated, I gave up. The fact that Home Assistant was recommending hardware (ConBee II) which I then bought but turned out to be too complicated to actually deploy was one of the reasons I decided at the time that HomeAssistant was not yet for me.

As I said, I am evaluating HomeAssistant as a deployment option and some of my constraints are that (i) I must be able to use it, (ii) I must be able to upgrade and maintain a live system once deployed, without having to reinstall everything any time I need to change something e.g. in order to add new hardware (iii) I am not interested in this becoming my full time job - although I have other computer experience, when it comes to Home Assistant, I am, and wish only to remain, a mere end user. I need to satisfy myself I can deploy within these constraints, otherwise the system is not for me.

I evaluated it a year ago and concluded that it was not yet ready for me to use. I am trying again now, prompted by the fact that the marthoc/deconz image is now available. If you have any suggestions as to how to get my system to work with the ConBee II (it does not need to be the latest version, it just needs to work), I would be grateful. I may also give up again, because it all does not look ready for use by end users like me yet.


pip3 install --upgrade homeassistant says:

Requirement already up-to-date: homeassistant in /usr/local/lib/python3.7/site-packages (0.116.2)

So 0.116.2 appears already to be installed, but the Home Assistant web server is showing 0.67.1.

Yes, because you’re not updating in the proper place, look up how you update packages in virtual environment

Take a look here on how to upgrade home assistant in a venv.

Thanks for the suggestion.

I don’t want to mess up my existing setup, so I made a fresh new installation in a venv as per these instructions but in a new virtual machine (VirtualBox, Linux host, Linux(Debian x86_64) guest) rather than overwriting my Raspberry Pi installation. I have version 0.116.2 running. But when I try to add the Z-Wave integration, it fails with homeassistant.requirements.RequirementsNotFound: Requirements for zwave not found: ['homeassistant-pyozw=0.1.10']. I’m using an Aeotec Gen5 Z-Stick in the VM as opposed to a Razberry board on the Pi.

I then tried python3 -m pip install homeassistant-pyozw and that failed with a ton of errors.

So it looks like I can’t get the new version to work at all, I’m glad I did not try to overwrite my existing installation, as badly as that works.

When you are not so familiar with pyton and venvs, why did you again use a venv install for the fresh install and not one of the more user friendly installs like home assistant Container or Home Assistant Supervised, here’s an excellent overview of the available install methods. With the other install types you don’t need to worry about dependencies this will be handled automatically by docker.

Did you execute this inside the venv? I don’t think you should need to add this anyway, this should be already included.

I haven’t use a venv install of HA for a long time. I don’t like to tag people, and I hope @Tinkerer will forgive me. But he uses a venv and was always helpful in regards to venv questions here on the forum.

1 Like

Yeah, HA should auto-install almost everything. There’s some exceptions, but that’s not one of them.

However, Python 3.7.3 is about to be unsupported, time to move to 3.8.6 :wink:

Honestly then, Docker (aka Home Assistant Container) is 100% the way you want to go. It removes the need for you to worry about things like this, or Python versions, or many other things that running in a venv brings.

Or, if you’re using VMs, consider Home Assistant OS. That moves the dial even further over, though it does remove some of your ability to “fiddle” under the hood - but it sounds like you don’t want to do that anyway.

1 Like

Is there way to get either my original installation, or the new virtual machine installation I just installed using venv to work well enough so I can evaluate it? I.e. at this stage, is there a way for me to either get pyozw to work in 0.116.2, or to get deconz to work in 0.67.1? Presumably at least the former must be possible, since 0.116.2 is the latest version. I used Python 3.8.6, not 3.7.3, to do the venv install. I used venv because this was recommended by Burningstone. It may be that homeassistant-pyozw should already be installed, but it doesn’t seem to be.

At this point, I am just evaluating which option (HomeAssistant, OpenHAB, etc.) to spend more time on and then deploy to run parts of a house and then spend more effort becoming familiar with and eventually run the whole house, if it proves stable enough. I just spent many hours installing 0.116.2 and it’s not a good investment of my time to keep installing more and more new versions, only to find out that each new version I install breaks in a different way which can’t be fixed. Is there a way to fix the venv installation so it works with pyozw? If it’s too difficult even to get HomeAssistant to work with my Zigbee and Z-Wave controllers, it’s probably not ready for prime time yet.

Thanks for all your advice.

Docker based install, or Home Assistant OS based install. That removes any issues with your Python build or venv.

You unfortunately used the second most complicated/advanced install method. If you’d gone with something simpler you’d be up and running by now :man_shrugging:

I’ve been running Z-Wave with HA since about 0.32, and Zigbee for over a year now, no issues with either :wink:

The recommendation is for you to use one of the easier installs which in it self will leave you with less issues regarding future upgrading.

Deconz was introduced with 0.61 but it was handled in a different way back then, so the integration documentation does not reflect the way it used to be working, so you’d have to delve into the GitHub history of the documentation to find the corresponding version.

Sorry, I apparently did not phrase my question clearly enough. I tried to fix my original install. I was advised to do a new install using vdev on this forum, which I did. Is there a way to fix either of those installs? I’m not interested in doing yet another install. I’ve got enough on my hands installing OpenHAB as well and then comparing the two solutions. Thanks.

Sunk costs fallacy

You can either:

  1. Get up and running quickly using another install method
  2. Spend longer trying to fix your current install

However, fixing your current install will require you explain what that failed with a ton of errors actually means. Share those errors, or we’re just guessing.

Thanks. I tried to paste the output from python3 -m pip install homeassistant-pyozw==0.1.10, but it’s 110kB and the forum only allows me to paste 32kB, or upload images. So I’m just pasting an extract:

Collecting homeassistant-pyozw==0.1.10
  Using cached (147 kB)
Requirement already satisfied: six in /root/homeassistant/lib/python3.8/site-packages (from homeassistant-pyozw==0.1.10) (1.15.0)
Requirement already satisfied: PyDispatcher>=2.0.5 in /root/homeassistant/lib/python3.8/site-packages (from homeassistant-pyozw==0.1.10) (2.0.5)
Using legacy ' install' for homeassistant-pyozw, since package 'wheel' is not installed.
Installing collected packages: homeassistant-pyozw
    Running install for homeassistant-pyozw: started
    Running install for homeassistant-pyozw: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /root/homeassistant/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/'"'"'; __file__='"'"'/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);'"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-xlo42l1n/install-record.txt --single-version-externally-managed --compile --install-headers /root/homeassistant/include/site/python3.8/homeassistant-pyozw
         cwd: /tmp/pip-install-jhi3l_7r/homeassistant-pyozw/
    Complete output (776 lines):
    ImportError in : from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
    sysargv ['/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/', 'install', '--record', '/tmp/pip-record-xlo42l1n/install-record.txt', '--single-version-externally-managed', '--compile', '--install-headers', '/root/homeassistant/include/site/python3.8/homeassistant-pyozw']
    Found SETUP_DIR : /tmp/pip-install-jhi3l_7r/homeassistant-pyozw
    NameError in : class bdist_wheel(_bdist_wheel) - Use bdist_egg instead
    <pyozw_setup.EmbedTemplate object at 0x7f8de6f6a070>
    {'name': 'libopenzwave', 'sources': ['openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp'], 'include_dirs': ['src-lib/libopenzwave/', 'openzwave-embed/open-zwave-hass/cpp/src', 'openzwave-embed/open-zwave-hass/cpp/src/value_classes', 'openzwave-embed/open-zwave-hass/cpp/src/platform', 'openzwave-embed/open-zwave-hass/cpp/build/linux'], 'define_macros': [('PY_LIB_VERSION', '0.1.10'), ('PY_SSIZE_T_CLEAN', 1), ('PY_LIB_FLAVOR', 'embed'), ('PY_LIB_BACKEND', 'cpp')], 'libraries': ['udev', 'stdc++', 'resolv'], 'extra_objects': ['openzwave-embed/open-zwave-hass/libopenzwave.a'], 'extra_compile_args': [], 'extra_link_args': [], 'language': 'c++'}
    ['six', 'PyDispatcher>=2.0.5']
    running install


    Build openzwave ... be patient ...
    b'/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/openzwave-embed/open-zwave-hass/cpp/hidapi/linux/hid.c:46:10: fatal error: libudev.h: No such file or directory\n'
    b'/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/openzwave-embed/open-zwave-hass/cpp/hidapi/linux/hid.c:46:10: fatal error: libudev.h: No such file or directory\n'
    b' #include <libudev.h>\n'
    b' #include <libudev.h>\n'
    b'          ^~~~~~~~~~~\n'
    b'          ^~~~~~~~~~~\n'
    b'compilation terminated.\n'
    b'compilation terminated.\n'
    b'make[1]: *** [/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/openzwave-embed/open-zwave-hass/cpp/build/ /tmp/pip-install-jhi3l_7r/homeassistant-pyozw/openzwave-embed/open-zwave-hass/.lib/hid.o] Error 1\n'
    b'make[1]: *** [/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/openzwave-embed/open-zwave-hass/cpp/build/ /tmp/pip-install-jhi3l_7r/homeassistant-pyozw/openzwave-embed/open-zwave-hass/.lib/hid.o] Error 1\n'
    b'make: *** [Makefile:20: all] Error 2\n'
    b'make: *** [Makefile:20: all] Error 2\n'


    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_LIB_VERSION=0.1.10 -DPY_SSIZE_T_CLEAN=1 -DPY_LIB_FLAVOR=embed -DPY_LIB_BACKEND=cpp -Isrc-lib/libopenzwave/ -Iopenzwave-embed/open-zwave-hass/cpp/src -Iopenzwave-embed/open-zwave-hass/cpp/src/value_classes -Iopenzwave-embed/open-zwave-hass/cpp/src/platform -Iopenzwave-embed/open-zwave-hass/cpp/build/linux -I/root/homeassistant/include -I/usr/local/include/python3.8 -c openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp -o build/temp.linux-x86_64-3.8/openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.o
    openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp:3: warning: "PY_SSIZE_T_CLEAN" redefined
     #define PY_SSIZE_T_CLEAN
    <command-line>: note: this is the location of the previous definition
    openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp: In function ‘PyObject* __pyx_pf_12libopenzwave_9PyManager_272beginControllerCommand(__pyx_obj_12libopenzwave_PyManager*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*)’:
    openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp:31718:204: warning: ‘bool OpenZWave::Manager::BeginControllerCommand(uint32, OpenZWave::Driver::ControllerCommand, OpenZWave::Driver::pfnControllerCallback_t, void*, bool, uint8, uint8)’ is deprecated [-Wdeprecated-declarations]
       __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->manager->BeginControllerCommand(__pyx_t_1, __pyx_t_2, __pyx_f_12libopenzwave_ctrl_callback, ((void *)__pyx_v_pythonfunc), __pyx_t_3, __pyx_t_4, __pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4207, __pyx_L1_error)
    In file included from openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp:628:
    openzwave-embed/open-zwave-hass/cpp/src/Manager.h:1732:19: note: declared here
       DEPRECATED bool BeginControllerCommand( uint32 const _homeId, Driver::ControllerCommand _command, Driver::pfnControllerCallback_t _callback = NULL, void* _context = NULL, bool _highPower = false, uint8 _nodeId = 0xff, uint8 _arg = 0 );
    g++ -pthread -shared build/temp.linux-x86_64-3.8/openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.o openzwave-embed/open-zwave-hass/libopenzwave.a -ludev -lstdc++ -lresolv -o build/lib.linux-x86_64-3.8/
    g++: error: openzwave-embed/open-zwave-hass/libopenzwave.a: No such file or directory
    error: command 'g++' failed with exit status 1
ERROR: Command errored out with exit status 1: /root/homeassistant/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/'"'"'; __file__='"'"'/tmp/pip-install-jhi3l_7r/homeassistant-pyozw/'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);'"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-xlo42l1n/install-record.txt --single-version-externally-managed --compile --install-headers /root/homeassistant/include/site/python3.8/homeassistant-pyozw Check the logs for full command output.

The rest of the output looks normal to me, this is the only error output as far as I can tell. Happy to post the entire output, but it may require three or four separate posts and I don’t want to spam.

You can use code sharing sites :wink:

The problem looks like a missing library - libopenzwave.a

Maybe instead switch to ozw, which is the new Z-Wave integration that will fully replace zwave in the near future.

Thanks. Running

apt install libopenzwave1.5
apt install libopenzwave1.5-dev
apt install libudev-dev

before installing homeassistant-pyozw seems to have fixed it (cf. also Let’s see if I get any further now.

No one here in the thread advised you to do a fresh install in a venv, in contrary Tinkerer, Robban and I all said multiple times that you should choose a different install method. I merely pointed you to the docs on how to update a venv.

If you would have followed this advice, you’d be up and running already. I’d say with your background in linux, the whole install including setting up Z-Wave will take you less than 1 hour (+ time to download and install, which depends on your bandwidth and power of the machine).

1 Like

You’ll continue running into problems like this and other dependency issues and then you need to upgrade python and so on.
I say you won’t get happy with a venv install, because you said that you don’t want to fiddle with it all the time and it should just work. Also now when you get this running, you’ll discover some new stuff in home assistant, like add-ons, automatic snapshots etc., which is not available in a venv, in a venv you need to do all this stuff yourself, which is of course possible, but it’s more complicated and will make you fiddle way more with your system than you planned to.

1 Like

The venv install seems to work fine and well enough for me to be able to evaluate it. I’ve been able to get Z-Wave now to work, and in the new version, DeConz also seems to work for me (after some fiddling - although I installed it as root, it made the deconz service run as a regular user, which I had to add to the dialout group, and the documentation for that was well hidden, but it works now).

The system seems to work well enough for me to be able to see how it works, and to be able to read sensors and control actuators via both Z-Wave and Zigbee, but now I’m finding I can’t configure Z-Wave parameters of some configurable devices, but that’s perhaps a question for another thread.

Thanks for helping me get it sorted out this far.