I can't install zWave on Home Assistant Windows installation in Virtual Environment

Hi,

I’m trying to set up my Aeotec Gen5 stick for Home Assistant on Windows 10 Pro 64 bit / Python 3.7 32-bit Virtual Environment and I’m running to this issue:

2019-03-14 22:27:32 INFO (SyncWorker_17) [homeassistant.util.package] Attempting install of homeassistant-pyozw==0.1.2
2019-03-14 22:27:34 INFO (MainThread) [homeassistant.setup] Setup of domain switch took 2.2 seconds.
2019-03-14 22:27:35 ERROR (SyncWorker_17) [homeassistant.util.package] Unable to install package homeassistant-pyozw==0.1.2: Command “python setup.py egg_info” failed with error code 1 in C:\Users\CARLOS~1.ACO\AppData\Local\Temp\pip-install-dle4lcfz\homeassistant-pyozw
2019-03-14 22:27:35 ERROR (MainThread) [homeassistant.requirements] Not initializing zwave because could not install requirement homeassistant-pyozw==0.1.2
2019-03-14 22:27:35 ERROR (MainThread) [homeassistant.setup] Setup failed for zwave: Could not install all requirements.

I also tryed to install with pip:
(homeassistant) C:\Users\carlos.acosta\homeassistant>pip3 install homeassistant-pyozw
Collecting homeassistant-pyozw
Using cached https://files.pythonhosted.org/packages/f8/f0/e45cbb4f4e834520dca221d6ed667235f239c96827d87c4bc140e423a533/homeassistant_pyozw-0.1.2.zip
Complete output from command python setup.py egg_info:
sysargv [’-c’, ‘egg_info’, ‘–egg-base’, ‘pip-egg-info’]
Found SETUP_DIR : C:\Users\CARLOS~1.ACO\AppData\Local\Temp\pip-install-s2xn6t08\homeassistant-pyozw
<pyozw_setup.EmbedTemplate object at 0x03C1D850>
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\CARLOS~1.ACO\AppData\Local\Temp\pip-install-s2xn6t08\homeassistant-pyozw\setup.py”, line 42, in
print(current_template.ctx)
File “C:\Users\CARLOS~1.ACO\AppData\Local\Temp\pip-install-s2xn6t08\homeassistant-pyozw\pyozw_setup.py”, line 225, in ctx
self._ctx = self.get_context()
File “C:\Users\CARLOS~1.ACO\AppData\Local\Temp\pip-install-s2xn6t08\homeassistant-pyozw\pyozw_setup.py”, line 804, in get_context
ctx = self.system_context(ctx, static=True)
File “C:\Users\CARLOS~1.ACO\AppData\Local\Temp\pip-install-s2xn6t08\homeassistant-pyozw\pyozw_setup.py”, line 144, in system_context
get_system_context(ctx, self.os_options, openzwave=os.path.abspath(self.openzwave), static=static)
File “C:\Users\CARLOS~1.ACO\AppData\Local\Temp\pip-install-s2xn6t08\homeassistant-pyozw\pyozw_win.py”, line 615, in get_system_context
) = setup_build_environment(openzwave, options[‘build_type’])
File “C:\Users\CARLOS~1.ACO\AppData\Local\Temp\pip-install-s2xn6t08\homeassistant-pyozw\pyozw_win.py”, line 251, in setup_build_environment
raise RuntimeError
RuntimeError


Command “python setup.py egg_info” failed with error code 1 in C:\Users\CARLOS~1.ACO\AppData\Local\Temp\pip-install-s2xn6t08\homeassistant-pyoziw\

It looks like it is looking for some kind of build environment. I’ve installed Windows 10 SDK but no success.

Any ideas how to move on?

Thanks,
Carlos

Additional info:

Earlier (not sure when, maybe before installing Windows SDK but I’m not sure) I got this when trying to manually install homeassistant-pyozw:

Collecting homeassistant-pyozw
Using cached https://files.pythonhosted.org/packages/f8/f0/e45cbb4f4e834520dca221d6ed667235f239c96827d87c4bc140e423a533/homeassistant_pyozw-0.1.2.zip
Complete output from command python setup.py egg_info:
sysargv [’-c’, ‘egg_info’, ‘–egg-base’, ‘pip-egg-info’]
Found SETUP_DIR : C:\Users\SZERVA~1\AppData\Local\Temp\pip-install-_z8gctbm\homeassistant-pyozw
<pyozw_setup.EmbedTemplate object at 0x04593730>
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\SZERVA~1\AppData\Local\Temp\pip-install-_z8gctbm\homeassistant-pyozw\setup.py”, line 42, in
print(current_template.ctx)
File “C:\Users\SZERVA~1\AppData\Local\Temp\pip-install-_z8gctbm\homeassistant-pyozw\pyozw_setup.py”, line 225, in ctx
self._ctx = self.get_context()
File “C:\Users\SZERVA~1\AppData\Local\Temp\pip-install-_z8gctbm\homeassistant-pyozw\pyozw_setup.py”, line 804, in get_context
ctx = self.system_context(ctx, static=True)
File “C:\Users\SZERVA~1\AppData\Local\Temp\pip-install-_z8gctbm\homeassistant-pyozw\pyozw_setup.py”, line 144, in system_context
get_system_context(ctx, self.os_options, openzwave=os.path.abspath(self.openzwave), static=static)
File “C:\Users\SZERVA~1\AppData\Local\Temp\pip-install-_z8gctbm\homeassistant-pyozw\pyozw_win.py”, line 615, in get_system_context
) = setup_build_environment(openzwave, options[‘build_type’])
File “C:\Users\SZERVA~1\AppData\Local\Temp\pip-install-_z8gctbm\homeassistant-pyozw\pyozw_win.py”, line 241, in setup_build_environment
target_platform = os.environ[‘WINDOWSSDKVERSION’].replace(’\’, ‘’)
File “C:\Users\szervacuser\AppData\Local\Programs\Python\Python37-32\lib\os.py”, line 678, in getitem
raise KeyError(key) from None
KeyError: ‘WINDOWSSDKVERSION’

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in C:\Users\SZERVA~1\AppData\Local\Temp\pip-install-_z8gctbm\homeassistant-pyozw\

What type of VM Environment are you using?

I’m not an expert on Virtual Environments so I’m not sure which type you are using. I followed this guide https://www.youtube.com/watch?v=vnie-PJ87Eg to get it up and running in VirtualBox. I was able to get my Aeotec Gen5 stick working with it. Don’t remember if I had to do anything with the VM’s USB settings or not. I did however revert back to my Pi installation as the USB stick would keep getting disconnected at night

[16075.886832] usb 2-2: USB disconnect, device number 3

I followed a few other steps to disable USB Power Saving in Windows itself but that didn’t seem to work.

Hi @yakman! Thanks for your reply. I’m not using a virtual machine but a python virtual environment on Windows. Created with this command (as described here ):

py -m venv honeassistant

This is a “copy” of the original environment as far as I understand still running on Windows OS. Serms like the problem is that homeassistant-pyozw should be built while installing but it is not working on Windows dispite I installed dev SDK and Visual Studio.

Finally I installed python-openzwave as it seemed to be the same ad homeasssitant-pyozw and renamed the folders and edited metadata files in the package so the system thinks I installed homeassistant-pyozw. And it worked!

My problem finally was that the communication to the devices is very slow and unrelyable which is not something me and my wife can accept in ‘production’ (home).
Do you also experience such issues?

I did have some communication issues. Although my PC was located much further from my ZWave devices than my Pi was. So I thought the issues were related to the distance. My plan was to get a old PC or laptop and move the VM to that and place it closer to my ZWave devices, but I never got that far due to my issues with the USB Zwave stick getting disconnected.

Thanks for sharing your experiences!
I have also reverted to using a separate controller (ZipaBox) and communicating it by MQTT. This is still faster and relyable than the USB stick directly connected to the PC which is sad as originally I tried to switch to the stick to improve zwave performanve.

Could you post specifically what you changed to make HASS recognize python-openzwave? I made a quick stab at it yesterday but must have missed something.

Hi,

I zipped the folders so you can download them from here. You should unzip to Lib/site-packages. I hope this helps

Awesome thanks!

That part seemed to work, but when I try to se up the stick I get an error:

Traceback (most recent call last):
  File "c:\python\home-assistant\lib\site-packages\aiohttp\web_protocol.py", line 418, in start
    resp = await task
  File "c:\python\Lib\asyncio\futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "c:\python\Lib\asyncio\tasks.py", line 250, in _wakeup
    future.result()
  File "c:\python\Lib\asyncio\futures.py", line 245, in result
    raise self._exception
  File "c:\python\Lib\asyncio\tasks.py", line 182, in _step
    result = coro.throw(exc)
  File "c:\python\home-assistant\lib\site-packages\aiohttp\web_app.py", line 458, in _handle
    resp = await handler(request)
  File "c:\python\home-assistant\lib\site-packages\aiohttp\web_middlewares.py", line 119, in impl
    return await handler(request)
  File "c:\python\home-assistant\lib\site-packages\homeassistant\components\http\real_ip.py", line 33, in real_ip_middleware
    return await handler(request)
  File "c:\python\home-assistant\lib\site-packages\homeassistant\components\http\ban.py", line 68, in ban_middleware
    return await handler(request)
  File "c:\python\home-assistant\lib\site-packages\homeassistant\components\http\auth.py", line 206, in auth_middleware
    return await handler(request)
  File "c:\python\home-assistant\lib\site-packages\homeassistant\components\http\view.py", line 112, in handle
    result = await result
  File "c:\python\home-assistant\lib\site-packages\homeassistant\components\config\config_entries.py", line 154, in post
    return await super().post(request, flow_id)
  File "c:\python\home-assistant\lib\site-packages\homeassistant\components\http\data_validator.py", line 46, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "c:\python\home-assistant\lib\site-packages\homeassistant\helpers\data_entry_flow.py", line 86, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "c:\python\home-assistant\lib\site-packages\homeassistant\data_entry_flow.py", line 80, in async_configure
    flow, step_id, user_input)
  File "c:\python\home-assistant\lib\site-packages\homeassistant\data_entry_flow.py", line 98, in _async_handle_step
    result = await getattr(flow, method)(user_input)  # type: Dict
  File "c:\python\home-assistant\lib\site-packages\homeassistant\components\zwave\config_flow.py", line 50, in async_step_user
    user_path=self.hass.config.config_dir)
  File "c:\python\Lib\asyncio\futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "c:\python\Lib\asyncio\tasks.py", line 250, in _wakeup
    future.result()
  File "c:\python\Lib\asyncio\futures.py", line 245, in result
    raise self._exception
  File "c:\python\Lib\concurrent\futures\thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "c:\python\home-assistant\lib\site-packages\openzwave\option.py", line 114, in __init__
    libopenzwave.PyOptions.__init__(self, config_path=config_path, user_path=user_path, cmd_line=cmd_line)
  File "src-lib\libopenzwave\libopenzwave.pyx", line 690, in libopenzwave.PyOptions.__init__
libopenzwave.LibZWaveException: "LibOpenZwave Generic Exception : Can't autoconfigure path to config

NM. I set it up through the config.yaml method and specified the path the config file. Seems to be working now!

1 Like