Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

home assistant 0.60 not compatible #15

Closed
tyjtyj opened this issue Dec 18, 2017 · 4 comments
Closed

home assistant 0.60 not compatible #15

tyjtyj opened this issue Dec 18, 2017 · 4 comments

Comments

@tyjtyj
Copy link

tyjtyj commented Dec 18, 2017

This module stopped working.

`
2017-12-18 14:53:38 ERROR (Thread-9) [miio.device] Got error when receiving: timed out
2017-12-18 14:53:38 ERROR (MainThread) [homeassistant.components.fan.xiaomi_miio] Got exception while fetching the state:
2017-12-18 14:53:38 ERROR (Thread-13) [miio.device] Got error when receiving: timed out
2017-12-18 14:53:38 ERROR (MainThread) [homeassistant.components.fan.xiaomi_miio] Got exception while fetching the state:

`

Debug
2017-12-18 14:55:21 DEBUG (Thread-11) [miio.device] 192.168.x.x:54321 >>: {'id': 3649, 'params': ['power', 'aqi', 'humidity', 'temp_dec', 'mode', 'led', 'led_b', 'buzzer', 'child_lock', 'bright', 'favorite_level', 'filter1_life', 'f1_hour_used', 'use_time', 'motor1_speed'], 'method': 'get_prop'} 2017-12-18 14:55:27 DEBUG (Thread-11) [miio.device] 192.168.x.x:54321 >>: {'id': 3750, 'params': ['power', 'aqi', 'humidity', 'temp_dec', 'mode', 'led', 'led_b', 'buzzer', 'child_lock', 'bright', 'favorite_level', 'filter1_life', 'f1_hour_used', 'use_time', 'motor1_speed'], 'method': 'get_prop'} 2017-12-18 14:55:32 DEBUG (Thread-11) [miio.device] 192.168.x.x:54321 >>: {'id': 3851, 'params': ['power', 'aqi', 'humidity', 'temp_dec', 'mode', 'led', 'led_b', 'buzzer', 'child_lock', 'bright', 'favorite_level', 'filter1_life', 'f1_hour_used', 'use_time', 'motor1_speed'], 'method': 'get_prop'}

@tyjtyj
Copy link
Author

tyjtyj commented Dec 18, 2017

Update:

Not sure what when wrong.
2 days a go, I update the air purifier firmware to 1.2.4_60 and hass (v0.58) was working fine.
Today, i update hass to (v0.60) and air purifier stopped responding.
I downgrade hass to v0.58 and still not working.

Do anything change on the firmware or the token changed ?

@tyjtyj
Copy link
Author

tyjtyj commented Dec 18, 2017

more logs

2017-12-18 15:21:55 DEBUG (Thread-21) [miio.device] Discovered default 47623 with ts: 1970-01-02 17:07:25, token: b'removed' 2017-12-18 15:21:55 DEBUG (Thread-21) [miio.device] 192.168.x.x:54321 >>: {'id': 912, 'params': ['power', 'aqi', 'humidity', 'temp_dec', 'mode', 'led', 'led_b', 'buzzer', 'child_lock', 'bright', 'favorite_level', 'filter1_life', 'f1_hour_used', 'use_time', 'motor1_speed'], 'method': 'get_prop'} 2017-12-18 15:21:55 ERROR (Thread-5) [miio.device] Got error when receiving: timed out 2017-12-18 15:21:55 WARNING (Thread-5) [miio.device] Retrying with incremented id, retries left: 1 2017-12-18 15:21:55 DEBUG (Thread-5) [miio.device] Got a response: Container: data = Container: length = 0 value = (total 0) offset1 = 32 offset2 = 32 data = (total 0) header = Container: length = 16 value = Container: length = 32 unknown = 0 devtype = default (total 7) serial = 35192 ts = 1970-01-02 15:10:45 offset1 = 0 offset2 = 16 data = !1\x00 \x00\x00\x00\x00\x00\xc0\x89x\x00\x02&\xf5 (total 16) checksum = \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 (total 16)

@syssi
Copy link
Owner

syssi commented Dec 18, 2017

The underlying library was fixed recently: rytilahti/python-miio#142

I hope the next home assistant release will include the fix.

@syssi syssi closed this as completed Dec 18, 2017
@tyjtyj
Copy link
Author

tyjtyj commented Dec 18, 2017

Thanks @syssi

Here is the posted temporary fix until it got integrated to hass

Edit /srv/homeassistant/lib/python3.5/site-packages/miio/protocol.py

For a temporary fix one can replace:

        "devtype" / Enum(Default(Int16ub, 0x02f2),
                         default=Pass, **xiaomi_devices),

in miio/protocol.py with:

        "devtype" / Int16ub,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants