Z-Wave rgb broken after last update

I can no longer change the color on my zwave bulbs/light strips with the last update, any ideas?

Log Error:

17-04-17 22:45:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1014, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/__init__.py", line 246, in async_handle_light_service
    yield from light.async_turn_on(**params)
  File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/zwave.py", line 334, in turn_on
    self.values.color.data = rgbw
  File "/usr/local/lib/python3.6/site-packages/openzwave-0.3.2-py3.6.egg/openzwave/value.py", line 292, in data
    self._network.manager.setValue(self.value_id, value)
  File "src-lib/libopenzwave/libopenzwave.pyx", line 2827, in libopenzwave.PyManager.setValue (src-lib/libopenzwave/libopenzwave.cpp:21766)
TypeError: expected bytes, str found

I have the same problem, but it seems to be fixed in version 0.42.4. I haven’t upgraded and verified the fix yet, going to do it now and get back with the results.

Anyway, here was my error, it seems that I am running slightly different versions than you are.

17-04-18 07:30:26 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/core.py", line 1010, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/light/__init__.py", line 246, in async_handle_light_service
    yield from light.async_turn_on(**params)
  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/lib/python3.4/site-packages/homeassistant/components/light/zwave.py", line 288, in turn_on
    self.values.color.data = rgbw
  File "/srv/homeassistant/lib/python3.4/site-packages/openzwave-0.3.3-py3.4.egg/openzwave/value.py", line 292, in data
    self._network.manager.setValue(self.value_id, value)
  File "src-lib/libopenzwave/libopenzwave.pyx", line 2828, in libopenzwave.PyManager.setValue (src-lib/libopenzwave/libopenzwave.cpp:21788)
TypeError: Expected str, got bytes

Home assistant 0.41.0 running in virtualenv
Python v 3.4.2
openzwave 0.3.3
Cython 0.24.1

Upgraded Home-Assistant and it works better in this version (0.42.4). Colorpicker works again, but selecting a color using a scene does not.

Still, better than not working at all. Not sure what’s different with the scene and color picker, going to have to check that later though.

Strange. Nether Colorado picker works (but is showing in front-end) nor automations work with scenes . Seems like dead . I can just turn it on and of sorry no output of log ATM

Did u manually update openzwave?

Yes, in a way. I reinstalled it using the virtualenv installation instructions (Installation - Home Assistant) quite recently.

strage… it tells me my repo is up to date

I got my scenes working again.

For some reason I had used the channel light.sov_rgb_level_7_0_2 in my scenes before updating and it used to work (it probably shouldn’t have). Now I use light.sov_rgb_level_7_0 (without the _2) and it works as it should again.

I had some strange behaviour for a while even after changing my scene config, but restarting home assistant a second time fixed it for me.

OK, so unfortunately what happened here is python-openzwave changed their API under our feet with version 0.3.3. The people using Docker were automatically updated to the latest version, and this broke for them. We put out a fix with Home Assistant v0.42.4, but this broke it for people who have not yet updated python-openzwave.

If you’re seeing TypeError: expected bytes, str found, it means you need to updated python-openzwave to version 0.3.3.
If you’re seeing TypeError: Expected str, got bytes, it means you need to update home-assistant to version 0.42.4.

2 Likes

thanks mate! good info!

Thanks! Updating Openzwave worked.

For me it is throwing following error:

2017-05-13 13:16:32 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1015, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/__init__.py", line 248, in async_handle_light_service
    yield from light.async_turn_on(**params)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/zwave.py", line 321, in turn_on
    self._color_channels & COLOR_CHANNEL_WARM_WHITE or
TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'

I am running on hass.io with latest updates.

What should I do now?

I had that error for a bit. Pretty sure I just dumped the deps folder and then did a ha upgrade using sudo. I think I had some dependencies that didn’t install correctly.

Hey @azeroth12

So Im having the same issue with my Fibaro controller. Updating OZW and switching to the _0 entity caused the color picker to now show up in the front end again, but the picker doesnt actually seem to work (no color change) nor does turning it on via scene. Any ideas?

Do you have any errors? What version of hass are you on?

@azeroth12 So I just updated it via the following comands but Im wondering if it actualy updated because im getting these errors:

sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
cd /srv/homeassistant/src/python-openzwave
make uninstall
make clean
make update
make build
make install

Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/core.py", line 1015, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/light/__init__.py", line 246, in async_handle_light_service
    yield from light.async_turn_on(**params)
  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/lib/python3.4/site-packages/homeassistant/components/light/zwave.py", line 334, in turn_on
    self.values.color.data = rgbw
  File "/srv/homeassistant/lib/python3.4/site-packages/openzwave-0.3.2-py3.4.egg/openzwave/value.py", line 292, in data
    self._network.manager.setValue(self.value_id, value)
  File "src-lib/libopenzwave/libopenzwave.pyx", line 2827, in libopenzwave.PyManager.setValue (src-lib/libopenzwave/libopenzwave.cpp:21766)
TypeError: expected bytes, str found

Did you pull down the latest source .3.3? You need the get openzwave to .3.3. Looks like you are on .3.2

How do I do that?

Part with the git clone.

If I do git clone https://github.com/OpenZWave/python-openzwave.git,

I get:

(homeassistant) homeassistant@hassbian:/srv/homeassistant/src $ git clone https://github.com/OpenZWave/python-openzwave.gitfatal: destination path 'python-openzwave' already exists and is not an empty directory.
(homeassistant) homeassistant@hassbian:/srv/homeassistant/src $