jghaanstra / com.xiaomi-miio

Homey app to control Mi Home devices that implement the miIO protocol and Xiaomi gateway child devices
GNU General Public License v3.0
455 stars 85 forks source link

Support for dmaker.fan.p15 #166

Closed nerdtechse closed 1 year ago

nerdtechse commented 1 year ago

Added a dmaker.fan.p15 with the selection of "Dmaker Mi Fan Generic" when added. Which was successfully added to my homey. But the name was set to "Unknown model" and when i try to turn off or on it gives me the error "this.miio.setPower is not a function"

The model of fan is Xiaomi Mi Smart Standing Fan Pro

Diag report d522486c-3a0c-4cf5-b768-12ae5b9d6be5

jghaanstra commented 1 year ago

Your model is dmaker.fan.p15 which currently isnt supported by the app. You could try and pair it as any of the other fan models in the app to see if that works (for instance as Mi Smart Standing Fan 3. Perhaps I'll add this model in the future if I can find documentation about it and the new version of the app is stable.

Related log:

[log] 2023-03-07 21:32:59 [XiaomiMiioApp] Initializing Xiaomi Mi Home app ...
[log] 2023-03-07 21:32:59 [XiaomiMiioApp] Please insert gateway mac address and password in settings on Manager Settings
[log] 2023-03-08 09:04:33 [XiaomiMiioApp] Discovered device on 172.16.17.192 with device id 242360861
[log] 2023-03-08 09:06:39 [ManagerDrivers] [Driver:dmaker-fan] [Device:d1317a43-aa86-47bf-a7a6-aea99b004dcd] WiFi Device Init: Unknown model (dmaker.fan.p15) with ip 172.16.17.192 and capabilities onoff and model dmaker.fan.p15 and store values  model
[log] 2023-03-08 10:09:02 [XiaomiMiioApp] Discovered device on 172.16.17.192 with device id 242360861

---- stderr ----
[err] 2023-03-08 09:06:04 [ManagerDrivers] [Driver:dmaker-fan] [Device:d1317a43-aa86-47bf-a7a6-aea99b004dcd] TypeError: this.miio.setPower is not a function
    at DmakerFanDevice.onCapabilityOnoff (/drivers/wifi_device.js:66:32)
    at DmakerFanDevice._onSetCapabilityValue (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/lib/Device.js:1:2140)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
jghaanstra commented 1 year ago

Added it with the DMaker miio device class. Please test it with release 3.1.12 when it's release in the upcoming days. Might not work perfect or even at all. This is just a quick experiment.

jghaanstra commented 1 year ago

Update released, please test and post the outcome here.

nerdtechse commented 1 year ago

Thanks for trying but.. No, sorry didnt work gets the error message "Busy"

Do you want a new diag report?

jghaanstra commented 1 year ago

Yes please, this doesnt sound like an error message coming from the driver.

nerdtechse commented 1 year ago

Ok! Here it is!

c2cdf46a-f314-456b-94d3-1fd3584c815a

jghaanstra commented 1 year ago

You seem to have added it with the Mi Smart Standing Fan 3 driver. Please test the Dmaker Mi Fan Generic driver.

nerdtechse commented 1 year ago

Have readded it again as a Dmaker Mi Fan Genric But the same thing happends..

143ee172-420f-47e6-bb47-e33895450e02

jghaanstra commented 1 year ago

According to the log you send me you have the same device paired 4 times. The message busy is a result of overflowing the device with traffic. Remove all but one and test again.

[log] 2023-03-14 20:41:25 [ManagerDrivers] [Driver:zhimi_fan_za5] [Device:d145ad3b-e4fa-4c04-92ed-6c88579a914a] WiFi Device Init: Unknown model (dmaker.fan.p15) with ip 172.16.17.192 and capabilities onoff,onoff.swing,dim,dim.angle,zhimi_fan_za5_mode,measure_humidity,measure_temperature and model dmaker.fan.p15 and store values  model,power,modes
[log] 2023-03-14 20:42:58 [ManagerDrivers] [Driver:dmaker-fan] [Device:51b8748c-4346-4d04-91a1-342dc844c9b1] WiFi Device Init: Mi Smart Standing Fan Pro (dmaker.fan.p15) with ip 172.16.17.192 and capabilities onoff and model dmaker.fan.p15 and store values  model,power,modes
[log] 2023-03-15 01:34:29 [ManagerDrivers] [Driver:dmaker-fan] [Device:d98b2e14-f10c-4849-9621-c6063c7f1834] WiFi Device Init: Mi Smart Standing Fan Pro (dmaker.fan.p15) with ip 172.16.17.192 and capabilities onoff and model dmaker.fan.p15 and store values  model,power,modes
[log] 2023-03-15 08:53:18 [ManagerDrivers] [Driver:dmaker-fan] [Device:a9fbfb11-cba8-4beb-8db6-14dc7ef2cb95] WiFi Device Init: Mi Smart Standing Fan Pro (dmaker.fan.p15) with ip 172.16.17.192 and capabilities onoff and model dmaker.fan.p15 and store values  model,power,modes
nerdtechse commented 1 year ago

image

There is just one paired. The others in the log is when i tried earlier pairings. I could try to reboot the homey if that is still doing something with the deleted devices.

jghaanstra commented 1 year ago

I could try to reboot the homey if that is still doing something with the deleted devices.

Please do, just to be sure.

nerdtechse commented 1 year ago

Have rebooted the homey but it seams like fan is being flooded of the device becuase when the device is connected to homey its not possible to control it from the orginal app on phone. But after a while of remove the device from homey it works again.

jghaanstra commented 1 year ago

Ok, too bad for now. Perhaps support will be added in the future.

jghaanstra commented 1 year ago

I published a new release to the test channel which contains support for this device. Please test.

nerdtechse commented 1 year ago

Sorry for late answer been away some days.

Tried the new version and same thing the fan gets flooded so even the orginal app dont work. This time i also reseted the fan before trying and got a new token. (Just to rule out the fan as a problem) :)

jghaanstra commented 1 year ago

Could you send me diagnostic report

Do you have the device paired with other integrations as well? If so, this can cause issues. This unofficial API is not made to be used by multiple integrations besides the official smartphone app.

nerdtechse commented 1 year ago

Of course! :) 78422e3d-0e73-440a-ab33-65245d74ed84

No, homey is the only 3rd party connected to the fan..

jghaanstra commented 1 year ago

It seems you paired it with a 10 seconds polling frequency. Could you re-move and re-pair it maintaining the default 60 seconds polling frequency.

nerdtechse commented 1 year ago

Strange didnt change that.. Reseted the fan again.. Tested with official smartphone app.. worked.. Installed on homey with new token. Wont work and official app isnt working.. I double checked it was now set to 60sec in polling.

Also did a new report cf149c84-0724-4511-a946-ae0dc9061f71

jghaanstra commented 1 year ago

I made some changes in release 3.1.18. Not sure if this helps your issue but please retest and let me know the outcome.

jghaanstra commented 1 year ago

@nerdtechse I added a new driver for various Dmaker models including the dmaker.fan.p15. Could you test your device with the Advanced Mi Smart Standing Fan driver and let me know the outcome.

nerdtechse commented 1 year ago

@jghaanstra Sorry for late answer have been away working alot. But now im home and had time to test it!

You are a real star and it works really good! Great work!