syssi / xiaomi_fan

Xiaomi Mi Smart Fan integration for Home Assistant
Apache License 2.0
413 stars 117 forks source link

dmaker.fan.p39: Avoid polling the `motor_control` property to get rid of -4004 errors #230

Closed traysh closed 10 months ago

traysh commented 10 months ago

The motor_control property is write only, not readable, according to the spec. And the mapping variable is being used to construct the status request to the fan, so the request inappropriately includes this property, resulting in a response with nothing set and the -4004 error code.

I have no idea why it works for some people, maybe they have an earlier firmware in their fan that is not so picky with the request correctness.

This PR makes the integration work for me, and possibly for the other people having problems with this fan model.

syssi commented 10 months ago

Good catch and thanks for your contribution! Let's give it a try. I don't own the device and cannot test your change.

fv623 commented 10 months ago

Hi, I've tried this fix and it does something but doesn't fix it definitely. The error log just shows something different. Details in here: #213

traysh commented 10 months ago

Yes, I see there is an additional problem. Details in the bug report: #213 https://github.com/syssi/xiaomi_fan/issues/213

Em seg., 11 de set. de 2023 às 13:16, fv623 @.***> escreveu:

Hi, I've tried this fix and it does something but doesn't fix it definitely. The error log just shows something different. Details in here:

213 https://github.com/syssi/xiaomi_fan/issues/213

— Reply to this email directly, view it on GitHub https://github.com/syssi/xiaomi_fan/pull/230#issuecomment-1713674196, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH4QLUISYTTLPFYZXQ4UTLXZ3XHBANCNFSM6AAAAAA4SNDZ7Q . You are receiving this because you authored the thread.Message ID: @.***>