Smartmi-smart-heater icon indicating copy to clipboard operation
Smartmi-smart-heater copied to clipboard

model zhimi.heater.za2 doesnt work

Open st-pavel opened this issue 4 years ago • 6 comments

model zhimi.heater.za2 doesnt work

st-pavel avatar Jul 15 '20 03:07 st-pavel

Errors in LOG 2020-07-16 16:07:55 WARNING (MainThread) [homeassistant.components.climate] Setup of climate platform miheater is taking over 10 seconds. 2020-07-16 16:07:55 ERROR (SyncWorker_1) [miio.miioprotocol] Unable to discover a device at address 192.168.1.174 2020-07-16 16:07:55 ERROR (MainThread) [custom_components.miheater-home-assistant-master.climate] Got exception while fetching the state: Unable to discover the device 192.168.1.174 2020-07-16 16:07:55 ERROR (MainThread) [homeassistant.components.climate] miheater: Error on device update! Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/miio/miioprotocol.py", line 182, in send data, addr = s.recvfrom(1024) socket.timeout: timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/config/custom_components/miheater-home-assistant-master/climate.py", line 218, in async_update data = await self.hass.async_add_executor_job(self._device.status) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/miheater-home-assistant-master/heater.py", line 202, in status values.extend(self.send("get_prop", _props[:_props_per_request])) File "/usr/local/lib/python3.7/site-packages/miio/device.py", line 147, in send command, parameters, retry_count, extra_parameters=extra_parameters File "/usr/local/lib/python3.7/site-packages/miio/miioprotocol.py", line 226, in send extra_parameters=extra_parameters, File "/usr/local/lib/python3.7/site-packages/miio/miioprotocol.py", line 150, in send self.send_handshake() File "/usr/local/lib/python3.7/site-packages/miio/miioprotocol.py", line 77, in send_handshake raise DeviceException("Unable to discover the device %s" % self.ip) miio.exceptions.DeviceException: Unable to discover the device 192.168.1.174 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 319, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 463, in async_device_update await self.async_update() # type: ignore File "/config/custom_components/miheater-home-assistant-master/climate.py", line 222, in async_update raise PlatformNotReady homeassistant.exceptions.PlatformNotReady

st-pavel avatar Jul 16 '20 13:07 st-pavel

My model is zhimi.heater.za2 and it doesn't work either

Traceback (most recent call last): File "/config/custom_components/miheater/climate.py", line 203, in async_update power = self._device.send('get_prop', ['power'])[0] File "/usr/local/lib/python3.8/site-packages/miio/device.py", line 146, in send "Hardware version: {result.hardware_version}\n" File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 213, in send self.__id += 100 File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 273, in _handle_error miio.exceptions.DeviceError: {'code': -5001, 'message': 'command error'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 335, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 454, in async_device_update await self.async_update() # type: ignore File "/usr/local/lib/python3.8/asyncio/coroutines.py", line 124, in coro res = func(*args, **kw) File "/config/custom_components/miheater/climate.py", line 233, in async_update except DeviceException: NameError: name 'DeviceException' is not defined

oxygen121 avatar Sep 27 '20 07:09 oxygen121

Try this:

sudo apt update sudo apt upgrade sudo apt install -y curl python3 jq libffi-dev libssl-dev sudo pip3 install python-miio

I have no way to check yet, but I think it should help.

chex01 avatar Oct 24 '20 18:10 chex01

Hi! I am using Hassio and homeassistant in docker. In docker miio latest version

bash-5.0# miiocli --version
miiocli, version 0.5.3

miio successful connect to heater

bash-5.0# miiocli device --ip 192.168.71.60  --token blablablablabla info
Model: zhimi.heater.za2
Hardware version: esp32
Firmware version: 2.0.5
Network: {'localIp': '192.168.71.60', 'mask': '255.255.255.0', 'gw': '192.168.71.1'}
AP: {'ssid': 'OXYGEN', 'bssid': 'E4:8D:8C:B5:4C:09', 'rssi': -75, 'primary': 3}

Logs from HA

Logger: homeassistant.components.climate
Source: custom_components/miheater/climate.py:233
Integration: Климат (documentation, issues)
First occurred: 9:43:54 (1 occurrences)
Last logged: 9:43:54

miheater: Error on device update!
Traceback (most recent call last):
  File "/config/custom_components/miheater/climate.py", line 203, in async_update
    power = self._device.send('get_prop', ['power'])[0]
  File "/usr/local/lib/python3.8/site-packages/miio/device.py", line 146, in send
    "Hardware version: {result.hardware_version}\n"
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 213, in send
    self.__id += 100
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 273, in _handle_error
miio.exceptions.DeviceError: {'code': -5001, 'message': 'command error'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/local/lib/python3.8/asyncio/coroutines.py", line 124, in coro
    res = func(*args, **kw)
  File "/config/custom_components/miheater/climate.py", line 233, in async_update
    except DeviceException:
NameError: name 'DeviceException' is not defined

oxygen121 avatar Oct 26 '20 06:10 oxygen121

Log confirms it, zhimi.heater.za2 is not supporting miio protocol and you'll have to wait till miot protocol will get supported by python-miio

chex01 avatar Oct 28 '20 20:10 chex01

zhimi.heater.zb1 - some issue in HA

devpitx avatar Nov 22 '20 22:11 devpitx