Open RavenKong opened 5 years ago
Sorry to raise this issue with the duplicated title. The previous one does not provide logs.
Also wonder if components support 1A as well? If not, any possible to update it? Or if you need any data to support it.
Thank you. BTW it has been work great with my gen 1. Thanks for the great work.
1A error 1A
Sun Dec 02 2018 16:10:20 GMT+0800 (CST)
Error while setting up platform mi_water_purifier Traceback (most recent call last): File "/config/custom_components/sensor/mi_water_purifier.py", line 159, in parse_data status = self._device.send('get_prop', []) File "/usr/local/lib/python3.6/site-packages/miio/device.py", line 263, in send self.__id = m.data.value["id"] TypeError: 'NoneType' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=hass.loop) File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for return fut.result() File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/sensor/mi_water_purifier.py", line 34, in setup_platform waterPurifier = XiaomiWaterPurifier(device, name) File "/config/custom_components/sensor/mi_water_purifier.py", line 116, in init self.parse_data() File "/config/custom_components/sensor/mi_water_purifier.py", line 177, in parse_data except DeviceException: NameError: name 'DeviceException' is not defined
Sun Dec 02 2018 16:10:20 GMT+0800 (CST)
unable to parse json '{"result":[net],"id":1}': Expecting value: line 1 column 12 (char 11)
@RavenKong @bluefoxlee @ptlinzx
name 'DeviceException' is not defined
This is a weird error message since I saw it sometimes when the component can't get data from device and try to raise an exception. I also confused why we saw this error message since DeviceException is already imported in code.
But I think the main problem of the logs you pasted is the miio library which this component uses to fetch data from xiaomi IOT devices can't get data from water purifier. I guess there are two possible reasons:
I just updated code and try to solve the weird issue that raised "name 'DeviceException' is not defined" when device isn't reachable. If you are using 1A model, you should just see the error message raised from miio library.
@bit3725 I will download the updated one and report here.
Update: Still got "TypeError: 'NoneType' object is not subscriptable." Will check miio tool to see if I can get more info from there. Still thanks,
I'm using hass.io version 0.82.1 My device model is Xiaomi water purifier 1A. It seems the setup of the platform failed due to a "name error" which could possibly be caused by mismatching versions of the python dependencies. Below is the error logs:
`018-11-25 00:18:42 ERROR (SyncWorker_7) [miio.protocol] unable to parse json '{"result":[net],"id":1}': Expecting value: line 1 column 12 (char 11) 2018-11-25 00:18:42 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform mi_water_purifier Traceback (most recent call last): File "/config/custom_components/sensor/mi_water_purifier.py", line 159, in parse_data status = self._device.send('get_prop', []) File "/usr/local/lib/python3.6/site-packages/miio/device.py", line 263, in send self.__id = m.data.value["id"] TypeError: 'NoneType' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=hass.loop) File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for return fut.result() File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/sensor/mi_water_purifier.py", line 34, in setup_platform waterPurifier = XiaomiWaterPurifier(device, name) File "/config/custom_components/sensor/mi_water_purifier.py", line 116, in init self.parse_data() File "/config/custom_components/sensor/mi_water_purifier.py", line 177, in parse_data except DeviceException: NameError: name 'DeviceException' is not defined`