Closed jennergray closed 4 years ago
What is firmware version of your device? This looks like a case of miio deprecation https://github.com/rytilahti/python-miio/issues/543 although my device (za1) is running latest firmware and still usable with miio.
Please provide logs with following configuration:
logger:
default: info
logs:
homeassistant.components.climate: debug
miheater: debug
miio: debug
What is firmware version of your device? This looks like a case of miio deprecation rytilahti/python-miio#543 although my device (za1) is running latest firmware and still usable with miio.
Please provide logs with following configuration:
logger: default: info logs: homeassistant.components.climate: debug miheater: debug miio: debug
Hi there,sorry for using Chinese. My heater model is ZA2.And i run hassio on my Syno NAS.hassio version is 0.153...here are the logs about miheater part.Thanks a lot.
2020-02-13 18:49:07 INFO (MainThread) [custom_components.miheater.climate] Initializing Xiaomi heaters with host 192.168.50.15 (token 77ab8...)
2020-02-13 18:49:12 ERROR (MainThread) [custom_components.miheater.climate] Got exception while setting up device: Unable to discover the device 192.168.50.15
2020-02-13 18:49:12 WARNING (MainThread) [homeassistant.components.climate] Platform miheater not ready yet. Retrying in 30 seconds.
2020-02-13 18:49:43 INFO (MainThread) [homeassistant.components.climate] Setting up climate.miheater
2020-02-13 18:49:43 INFO (MainThread) [homeassistant.components.climate] Setting up climate.miheater
2020-02-13 18:49:43 INFO (MainThread) [custom_components.miheater.climate] Initializing Xiaomi heaters with host 192.168.50.15 (token 77ab8...)
2020-02-13 18:49:43 DEBUG (SyncWorker_1) [miio.protocol] Unable to decrypt, returning raw bytes: b''
2020-02-13 18:49:43 DEBUG (SyncWorker_1) [miio.device] Got a response: Container:
data = Container:
data = b'' (total 0)
value = b'' (total 0)
offset1 = 32
offset2 = 32
length = 0
header = Container:
data = b'!1\x00 \x00\x00\x00\x00\x07e\x7f\xd8\x00\x02\x92\x96' (total 16)
value = Container:
length = 32
unknown = 0
device_id = b'\x07e\x7f\xd8' (total 4)
ts = 1970-01-02 22:49:58
offset1 = 0
offset2 = 16
length = 16
checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
2020-02-13 18:49:43 DEBUG (SyncWorker_1) [miio.device] Discovered 07657fd8 with ts: 1970-01-02 22:49:58, token: b'ffffffffffffffffffffffffffffffff'
2020-02-13 18:49:43 DEBUG (SyncWorker_1) [miio.device] 192.168.50.15:54321 >>: {'id': 1, 'method': 'miIO.info', 'params': []}
2020-02-13 18:49:43 DEBUG (SyncWorker_1) [miio.device] 192.168.50.15:54321 (ts: 1970-01-02 22:49:58, id: 1) << {'id': 1, 'result': {'life': 168598, 'uid': 1992514, 'model': 'zhimi.heater.za2', 'token': '77ab858ef97f3404d63d440c51e19288', 'fw_ver': '2.0.5', 'mcu_fw_ver': '0022', 'miio_ver': '0.0.5', 'hw_ver': 'esp32', 'mmfree': 65056, 'mac': '04:CF:8C:18:F2:EF', 'wifi_fw_ver': 'v3.1.4-56-g8ffb04960', 'ap': {'ssid': 'Anning1206', 'bssid': '04:D4:C4:B8:07:E8', 'rssi': -50, 'primary': 7}, 'netif': {'localIp': '192.168.50.15', 'mask': '255.255.255.0', 'gw': '192.168.50.1'}}}
2020-02-13 18:49:43 INFO (MainThread) [custom_components.miheater.climate] zhimi.heater.za2 2.0.5 esp32 detected
2020-02-13 18:49:43 INFO (MainThread) [custom_components.miheater.climate] Initializing Xiaomi heaters with host 192.168.50.15 (token 77ab8...) object
2020-02-13 18:49:43 INFO (MainThread) [custom_components.miheater.climate] Initializing Xiaomi heaters with host 192.168.50.15 (token 77ab8...) done
2020-02-13 18:49:43 DEBUG (SyncWorker_2) [miio.device] 192.168.50.15:54321 >>: {'id': 2, 'method': 'get_prop', 'params': ['power']}
2020-02-13 18:49:43 DEBUG (SyncWorker_2) [miio.device] 192.168.50.15:54321 (ts: 1970-01-02 22:49:59, id: 2) << {'id': 2, 'error': {'code': -5001, 'message': 'command error'}}
2020-02-13 18:49:43 ERROR (MainThread) [custom_components.miheater.climate] Got exception while fetching the state: {'code': -5001, 'message': 'command error'}
2020-02-13 18:49:43 ERROR (MainThread) [homeassistant.components.climate] miheater: Error on device update!
2020-02-13 18:49:43 INFO (MainThread) [custom_components.miheater.climate] zhimi.heater.za2 2.0.5 esp32 detected
2020-02-13 18:49:43 INFO (MainThread) [custom_components.miheater.climate] Initializing Xiaomi heaters with host 192.168.50.15 (token 77ab8...) object
2020-02-13 18:49:43 INFO (MainThread) [custom_components.miheater.climate] Initializing Xiaomi heaters with host 192.168.50.15 (token 77ab8...) done
2020-02-13 18:49:43 DEBUG (SyncWorker_2) [miio.device] 192.168.50.15:54321 >>: {'id': 2, 'method': 'get_prop', 'params': ['power']}
2020-02-13 18:49:43 DEBUG (SyncWorker_2) [miio.device] 192.168.50.15:54321 (ts: 1970-01-02 22:49:59, id: 2) << {'id': 2, 'error': {'code': -5001, 'message': 'command error'}}
2020-02-13 18:49:43 ERROR (MainThread) [custom_components.miheater.climate] Got exception while fetching the state: {'code': -5001, 'message': 'command error'}
2020-02-13 18:49:43 ERROR (MainThread) [homeassistant.components.climate] miheater: Error on device update!
Traceback (most recent call last):
File "/config/custom_components/miheater/climate.py", line 224, 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/heater.py", line 191, in status
values.extend(self.send("get_prop", _props[:_props_per_request]))
File "/usr/local/lib/python3.7/site-packages/miio/device.py", line 291, in send
raise DeviceError(error)
miio.exceptions.DeviceError: {'code': -5001, 'message': 'command error'}
During handling of the above exception, another exception occurred:
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 (https://github.com/rytilahti/python-miio/issues/543).
Thu Feb 13 2020 17:36:09 GMT+0800 (CST)
miheater: Error on device update! Traceback (most recent call last): File "/config/custom_components/miheater/climate.py", line 224, 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/heater.py", line 191, in status values.extend(self.send("get_prop", _props[:_props_per_request])) File "/usr/local/lib/python3.7/site-packages/miio/device.py", line 291, in send raise DeviceError(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 304, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update await self.async_update() File "/config/custom_components/miheater/climate.py", line 228, in async_update raise PlatformNotReady homeassistant.exceptions.PlatformNotReady
日志显示这个 没办法使用,请问能支持1S 吗