pschroeder89 / homebridge-levoit-humidifiers

Levoit Humidifiers Plugin for Apple HomeKit via Homebridge
Apache License 2.0
70 stars 9 forks source link

Problem with deviceType of Dual 200s #11

Closed IrgendSoEtwas closed 2 years ago

IrgendSoEtwas commented 2 years ago

Describe The Bug:

After installing the plugin, no devices were added to the accessories section of HomeBridge. I am using correct VeSync account credentials and the Dual 200s is registered and linked with the account. With enabled debug mode, I can see that the API call can find the device but it won't get added.

Expected behavior:

As the Dual 200s should be supported by the plugin, the device should be added by HomeBridge.

Logs:

[30/12/2021, 20:20:53] Homebridge v1.3.9 (HAP v0.9.8) (Homebridge 8A12) is running on port 51919.
[30/12/2021, 20:20:57] [Levoit Humidifiers] Launched child bridge with PID 16291
[30/12/2021, 20:20:57] Registering platform 'homebridge-levoit-humidifiers.LevoitHumidifiers'
[30/12/2021, 20:20:57] [Levoit Humidifiers] Loaded homebridge-levoit-humidifiers v1.3.0 child bridge successfully
[30/12/2021, 20:20:57] Loaded 0 cached accessories from cachedAccessories.0E5D1A92D560.
[30/12/2021, 20:20:57] [Levoit Humidifiers] [DEBUG]: [PLATFORM] Debug mode enabled
[30/12/2021, 20:20:57] [Levoit Humidifiers] Connecting to the servers...
[30/12/2021, 20:20:57] [Levoit Humidifiers] [DEBUG]: [START SESSION] Starting auth session...
[30/12/2021, 20:20:57] [Levoit Humidifiers] [DEBUG]: [LOGIN] Logging in...
[30/12/2021, 20:20:58] Homebridge v1.3.9 (HAP v0.9.8) (Levoit Humidifiers) is running on port 55588.
[30/12/2021, 20:20:58] [Levoit Humidifiers] [DEBUG]: [LOGIN] The authentication success
[30/12/2021, 20:20:59] [Levoit Humidifiers] Discovering devices...
[30/12/2021, 20:21:00] [Levoit Humidifiers] [DEBUG]: [GET DEVICES] Device List -> JSON: [{"deviceRegion":"EU","isOwner":true,"authKey":null,"deviceName":"levoit Dual 200s","deviceImg":"https://image.vesync.com/defaultImages/Dual_200S_Series/icon_dual200s_humidifier_160.png","cid":"...","deviceStatus":"on","connectionStatus":"online","connectionType":"WiFi+BTOnboarding+BTNotify","deviceType":"LUH-D301S-WEU","type":"wifi-air","uuid":"...","configModule":"WFON_AHM_LUH-D301S-WEU_EU","macID":"...","mode":null,"speed":null,"extension":null,"currentFirmVersion":null,"subDeviceNo":null,"subDeviceType":null,"deviceFirstSetupTime":"Dec 29, 2021 1:33:16 PM","deviceProp":null}]

Environment:

Suggestion:

I already fixed it locally for myself as I noticed that the deviceType of my Dual 200s got reported as "deviceType": "LUH-D301S-WEU" and I simply changed the corresponding enum DeviceName in the deviceTypes.ts file. However I do know that this is not a general purpose solution and thus is not feasible for a PR. I just wanted to inform about this. Maybe the device type check can also consider the "deviceName": "levoit Dual 200s", property or something.

joshrdavis commented 2 years ago

Also experiencing this and the above fix works. Thanks @IrgendSoEtwas

pschroeder89 commented 2 years ago

Interesting, I wonder if the EU and US models use different naming conventions. We should probably check for both device types and put them in an array, or just use device name.

I'm on vacation until 1/2. I can fix it after that unless someone else gets to it before then. Thanks for reporting!

pschroeder89 commented 2 years ago

@joshryandavis @IrgendSoEtwas So I wound up just adding a new device called Dual200S_EU that looks for LUH-D301S-WEU as the deviceType. I also found that there is a LUH-D301S-WUK model as well, so that's been added too.

Just to make sure...there are only 2 mist levels and an auto mode on this model, right? If so, 1.3.1-beta3 should work for you. Please test it if you can. Thanks!

IrgendSoEtwas commented 2 years ago

Thanks @pschroeder89 for looking into it!

Just to make sure...there are only 2 mist levels and an auto mode on this model, right? If so, 1.3.1-beta3 should work for you. Please test it if you can. Thanks!

Correct, it still has a low, high and an auto mode on the model. I will try to test the beta3 version when I got time and let you know!

IrgendSoEtwas commented 2 years ago

Just downloaded the 1.3.1-beta3 and works for me as intended @pschroeder89!

pschroeder89 commented 2 years ago

Pushed version 1.3.1 to npm. Thanks for reporting and testing!