Getting the error xiaomi_miio: Error on device update!
More Info:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 397, in _async_add_entity
yield from entity.async_device_update(warning=False)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 306, in async_device_update
yield from self.async_update()
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/fan/xiaomi_miio.py", line 240, in async_update
self._air_purifier.status)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/miio/airpurifier.py", line 215, in status
properties[0:13]
File "/srv/homeassistant/lib/python3.5/site-packages/miio/device.py", line 216, in send
m = Message.build(msg, ctx)
TypeError: build() takes 2 positional arguments but 3 were given
This has only been fixed for now in the git version of python-miio (https://github.com/rytilahti/python-miio/pull/192), for the time being you can manually downgrade construct package to version 2.9.22 (pip install construct==2.9.22) or wait until a fixed version gets released later on.
I tried both installing construct in v2.8.22 (2.9.22 not found), and installing python-miio from master, but still get the same error.
2018-02-04 14:47:55 ERROR (MainThread) [homeassistant.components.vacuum] xiaomi_miio: Error on device update!
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 397, in _async_add_entity
yield from entity.async_device_update(warning=False)
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 308, in async_device_update
yield from self.hass.async_add_job(self.update)
File "/usr/local/lib/python3.6/asyncio/futures.py", line 331, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
future.result()
File "/usr/local/lib/python3.6/asyncio/futures.py", line 244, in result
raise self._exception
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/vacuum/xiaomi_miio.py", line 368, in update
state = self._vacuum.status()
File "/config/deps/lib/python3.6/site-packages/miio/vacuum.py", line 108, in status
return VacuumStatus(self.send("get_status")[0])
File "/config/deps/lib/python3.6/site-packages/miio/device.py", line 216, in send
m = Message.build(msg, ctx)
TypeError: build() takes 2 positional arguments but 3 were given
.
root@blop:/# pip show construct
Name: construct
Version: 2.8.22
What other solution can I try?
After installing python-mioo from master, it still shows version 0.3.4, is that the expected result?
root@blop:/# pip3 show python-miio
Name: python-miio
Version: 0.3.4
The version information is correct as there has been no 0.3.5 yet, you will require a newer (>2.9.23) version of construct to use with the master branch.
Same problem here, 2.9.27 and installed the linked master.zip without error, still have this error for fan and vacuum:
xiaomi_miio: Error on device update!
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 397, in _async_add_entity
yield from entity.async_device_update(warning=False)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 308, in async_device_update
yield from self.hass.async_add_job(self.update)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/vacuum/xiaomi_miio.py", line 368, in update
state = self._vacuum.status()
File "/srv/homeassistant/lib/python3.5/site-packages/miio/vacuum.py", line 108, in status
return VacuumStatus(self.send("get_status")[0])
File "/srv/homeassistant/lib/python3.5/site-packages/miio/device.py", line 216, in send
m = Message.build(msg, ctx)
TypeError: build() takes 2 positional arguments but 3 were given
Also, there was a problem with Xiaomi smartmi fresh air (similar to Purifier 2 / Pro) after upgrading to 0.80
At 0.79 it worked like zhimi.airpurifier.v6, now it gives an error:
2018-10-22 18:16:07 ERROR (MainThread) [homeassistant.components.fan] xiaomi_miio: Error on device update!
Traceback (most recent call last): File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py”, line 251, in _async_add_entity await entity.async_device_update(warning=False)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 347, in async_device_update await self.async_update()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/fan/xiaomi_miio.py”, line 569, in async_update key, value in self._available_attributes.items()})
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/fan/xiaomi_miio.py”, line 569, in <dictcomp> key, value in self._available_attributes.items()})
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/fan/xiaomi_miio.py”, line 447, in _extract_value_from_attribute value = getattr(state, attribute)
File “/srv/homeassistant/lib/python3.5/site-packages/miio/airpurifier.py”, line 142, in mode return OperationMode(self.data[“mode”]) File “/usr/lib/python3.5/enum.py”, line 241, in call return cls.new(cls, value) File “/usr/lib/python3.5/enum.py”, line 476, in new raise
ValueError(“%r is not a valid %s” % (value, cls.name)) ValueError: ‘middle’ is not a valid OperationMode
update python-mio to the current master did not help: (