So I just updated to 0.51.1 from 0.43 and now my Zwave thermost fan doesn’t work anymore. All other Zwave devices and the thermostat itself are working with the exception of being able to set the fan state. Here’s an automation that worked fine before upgrading:
- alias: Turn off House Fan with B5 or B8
trigger:
- platform: mqtt
topic: '/X10/B5'
payload: 'Off'
- platform: mqtt
topic: '/X10/B8'
payload: 'Off'
action:
service: climate.set_fan_mode
entity_id: climate.trane_model_tzemt400ab32maa_cooling_1
data:
fan_mode: 'Auto Low'
when this automation runs, I see this in my logs:
TypeError: expected bytes, str found
2017-08-19 12:11:42 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 1025, in _event_to_service_call
yield from service_handler.func(service_call)
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/climate/__init__.py", line 359, in async_fan_mode_set_service
yield from climate.async_set_fan_mode(fan)
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/climate/zwave.py", line 191, in set_fan_mode
self.values.fan_mode.data = fan
File "/srv/homeassistant/lib/python3.4/site-packages/openzwave-0.3.1-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 2825, in libopenzwave.PyManager.setValue (src-lib/libopenzwave/libopenzwave.cpp:21717)
TypeError: expected bytes, str found
Basicly this is saying that it’s expecting another type of input other than “Auto Low” that is being sent to the device. Updating openzwave might resolve it. Doesn’t hurt to try the latest dev build of openzwave.
Thanks for the information. I’m wondering if I send it a ‘0’ or ‘1’ if it will work. This is really strange. Unfortunately this is a show stopper for me as I rely on a couple fan automations to help keep the humidity balanced in the house.
Can you tell me how to check the version of openzwave and how to update it? I’m running Hassbian and am uncertain on how to go about doing this. I thought that OZW was updated automatically when updating to 0.51 or 0.50? Thanks again for your time and efforts to help get this resolved.
Thanks… I’ll swap out the card and check it out. Can you tell me how I might upgrade? I only have the one RPi3 so my time troubleshooting is small due to needing it to run HASS full time. Thank you again.
There’s a script on this post you can run that should upgrade openzwave for you. Please note you have to turn off HASS before running it. It can take 30-45 mins to complete.
Hey Chris, I just used Hasbian install script. I’m running OpenZwave Version 1.4.2384 … Should I use the script you linked to get to a different version than that?
I’m thinking that this may be a bug as I had no problems with my thermostat fan mode before upgrading. It was passing a string then as well. I also tried changing my script to pass a 1 and 0 but it still complained that I was providing a string. Note that I get this exact same error when using the thermostat device from the web gui when trying to set the fan mode.
I’ve attached my zwcfg file. Perhaps if you have time you might check my device and see if you see anything odd?
I just used ‘OpenZWave Control Panel’ and am able to change ‘Fan Mode’ without problem. This seems to definitely be a bug in HASS. Do you have any idea how long something like this might take to be resolved? I know there’s lots of open tickets but this one concerns me the most I’d dig into this and see if I can fix it if it’s fairly simple. I’m a hacker more than a programmer though.
In trying to work through this issue it appears that it might be because my python-openzwave could be the problem. Despite my attempts at updating python-openzwave, HASS continues to try to look at my old version 0.3.1 … I’ve tried using the HASSBian install-openzwave.sh but get the same error. I then go into my venv and do a pip install update python-openzwave and again the same error. Each time the error contains a reference to 0.3.1. I just don’t know how to get around this. Here’s the latest error:
2017-09-16 15:16:01 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 1025, in _event_to_service_call
yield from service_handler.func(service_call)
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/climate/__init__.py", line 359, in async_fan_mode_set_service
yield from climate.async_set_fan_mode(fan)
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/climate/zwave.py", line 191, in set_fan_mode
self.values.fan_mode.data = fan
File "/srv/homeassistant/lib/python3.4/site-packages/openzwave-0.3.1-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 2825, in libopenzwave.PyManager.setValue (src-lib/libopenzwave/libopenzwave.cpp:21717)
TypeError: expected bytes, str found
I think I may lose my mind before I stumble on a solution. Any help is most appreciated. Thanks!
Yes. However I did not modify the __init__.py file as I didn’t know it’s location and because I was able to run the OZWCP from the /srv/homeassistant/src/open-zwave-control-panel directory. Is that correct?
EDIT Did I need to run that script in my venv as user homeassistant? I certainly did not do it that way.
It’s in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave/ if you don’t modify it HA redownloads the old version, re-run the script and then modify the file and start HA back up.
Will do. Can you tell me how I need to modify the file? I didn’t see anything besides it needs to be modified. Or will it be pretty obvious? It does take a while to run the script so hoping to get it all done this next go round. Thanks again.
if you run this command it’ll fix it for you: sed -i "s/'python_openzwave==.*'//" /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave/__init__.py
Of course assuming your directory structure is the same, you might need to change to python3.5 if you’re running raspbian strech.