Coder Social home page Coder Social logo

Comments (16)

rockerest avatar rockerest commented on September 23, 2024 2

First of all, @pschroeder89, thank you very much for working on this and for being so active / responsive.
You're doing great work!

(My girlfriend wanted to use her LUH-D301S-WUSR and we've just skipped the Hubitat and gone straight through the Homebridge, thanks to your plugin!)

On that note, we are also having trouble with the night light, with the exact same error reported by @danfratamico.

I've enabled debug mode and - as I noted above - it's the LUH-D301S-WUSR model.
Could you help me understand what you mean by a caching issue? Yours was the first plugin we installed for this device, so there shouldn't (🤞) be any locally cached incorrect version.

(As a complication, however, we did install the other humidifer Homebridge plugin when we noticed that the light wasn't working - but that plugin doesn't work at all)

Here's the initial debug output when the Homebridge starts up and loads the plugin:

[30/12/2022, 06:04:14] [Levoit Humidifiers] [DEBUG]: [GET DEVICES] Device List -> JSON: [{"deviceRegion":"US","isOwner":true,"authKey":null,"deviceName":"Humidifier","deviceImg":"https://image.vesync.com/defaultImages/deviceDefaultImages/wfon_ahm_luh-d301s-wusr_us_240.png","cid":[This might be customer ID?? Seems sus. Redacted for safety],"deviceStatus":"on","connectionStatus":"online","connectionType":"WiFi+BTOnboarding+BTNotify","deviceType":"LUH-D301S-WUSR","type":"wifi-air","uuid":"0a0426e1-f845-49c6-a9ea-75fb95c99482","configModule":"WFON_AHM_LUH-D301S-WUSR_US","macID":"MA:CM:AC:MA:CM:AC","mode":null,"speed":null,"currentFirmVersion":null,"subDeviceNo":null,"subDeviceType":null,"deviceFirstSetupTime":"Dec 30, 2022 5:18:47 AM","subDeviceList":null,"extension":null,"deviceProp":null}]

(prettified)

[
  {
    "deviceRegion": "US",
    "isOwner": true,
    "authKey": null,
    "deviceName": "Humidifier",
    "deviceImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/wfon_ahm_luh-d301s-wusr_us_240.png",
    "cid": [This might be customer ID?? Seems sus. Redacted for safety],
    "deviceStatus": "on",
    "connectionStatus": "online",
    "connectionType": "WiFi+BTOnboarding+BTNotify",
    "deviceType": "LUH-D301S-WUSR",
    "type": "wifi-air",
    "uuid": "0a0426e1-f845-49c6-a9ea-75fb95c99482 [I generated this randomly to replace the real one]",
    "configModule": "WFON_AHM_LUH-D301S-WUSR_US",
    "macID": "MA:CM:AC:MA:CM:AC [this is a faked MAC]",
    "mode": null,
    "speed": null,
    "currentFirmVersion": null,
    "subDeviceNo": null,
    "subDeviceType": null,
    "deviceFirstSetupTime": "Dec 30, 2022 5:18:47 AM",
    "subDeviceList": null,
    "extension": null,
    "deviceProp": null
  }
]

from homebridge-levoit-humidifiers.

danfratamico avatar danfratamico commented on September 23, 2024 1

@pschroeder89 I enabled Homebridge debug mode and also deleted the accessory from the cache, but I did not see any lines in the log that listed my humidifier model. I also don't see a way to add debug mode just to your plugin. Am I missing something?

Edit: Just checked the model on the unit itself and mine is LUH-D301S-WUSR, so it looks like I may be having the same issue as @rockerest. As stated above, I removed my humidifier from the cache so that most likely is not the issue.

from homebridge-levoit-humidifiers.

rockerest avatar rockerest commented on September 23, 2024 1
"rgbNightLight":{
   "action":"off",
   "colorMode":"marquee",
   "speed":0,
   "brightness":91,
   "red":255,
   "green":255,
   "blue":255,
   "colorSliderLocation":61
}

we got 'em, folks

from homebridge-levoit-humidifiers.

pschroeder89 avatar pschroeder89 commented on September 23, 2024

Hey @danfratamico, can you provide me with the exact model? You can probably find it on the device, or enable debug mode in your plugin config and it will output the device model.

I recently added night light support to the LUH-D301S-WUSR model. If that's the model you have and you are seeing that error, it could be a cache issue.

from homebridge-levoit-humidifiers.

pschroeder89 avatar pschroeder89 commented on September 23, 2024

Thanks @danfratamico and @rockerest. I'll probably have to publish a debug version of the plugin for you guys to get some info for me.

Before I do that, I have some questions:

  1. Is the Night Light exposed in HomeKit as an accessory?
    a. If it is exposed, do you get the This plugin generated a warning from the characteristic 'Brightness' error when you attempt to change the brightness?
    b. If it's not exposed, is "night_light" set to true in your config?
  2. Do you see any other errors when debug mode is turned on for the plugin? You can find instructions on enabling debug mode here: https://github.com/pschroeder89/homebridge-levoit-humidifiers#enabling-debug-mode
  3. Does this model have a brightness level associated with the light (press the light button multiple times on the unit)? Or does it simply go On / Off? The other models have different brightness levels, but if this one does not, I'll need to add some logic to exclude that characteristic from the LUH-D301S-WUSR model.

from homebridge-levoit-humidifiers.

danfratamico avatar danfratamico commented on September 23, 2024

Here are the answers to your questions:

  1. The Night Light slider is exposed in HomeKit, but as expected, turning it on does not turn on the light. The error message does not appear when I use the slider in the Home app, it seems to display in the logs every minute or so. The "night_light" setting is set to "true" in config.

  2. There are no errors, below is the full log of the plugin during a full restart of Homebridge. The error seems to trigger every time the plugin is getting device info:

[12/30/2022, 5:05:45 PM] [Levoit Humidifiers] [DEBUG]: [LOGIN] The authentication success
[12/30/2022, 5:05:45 PM] [Levoit Humidifiers] Discovering devices...
[12/30/2022, 5:05:45 PM] [Levoit Humidifiers] [DEBUG]: [GET DEVICES] Device List -> JSON: [{"deviceRegion":"US","isOwner":true,"authKey":null,"deviceName":"Bedroom Humidifier","deviceImg":"https://image.vesync.com/defaultImages/deviceDefaultImages/wfon_ahm_luh-d301s-wusr_us_240.png","cid":"REMOVED","deviceStatus":"off","connectionStatus":"online","connectionType":"WiFi+BTOnboarding+BTNotify","deviceType":"LUH-D301S-WUSR","type":"wifi-air","uuid":"REMOVED","configModule":"WFON_AHM_LUH-D301S-WUSR_US","macID":"REMOVED","mode":null,"speed":null,"currentFirmVersion":null,"subDeviceNo":null,"subDeviceType":null,"deviceFirstSetupTime":"Dec 28, 2022 4:15:06 AM","subDeviceList":null,"extension":null,"deviceProp":null}]
[12/30/2022, 5:05:45 PM] [Levoit Humidifiers] [DEBUG]: [GET DEVICE INFO] Getting device info...
[12/30/2022, 5:05:45 PM] [Levoit Humidifiers] Restoring existing accessory from cache: Bedroom Humidifier
[12/30/2022, 5:05:46 PM] [homebridge-levoit-humidifiers] This plugin generated a warning from the characteristic 'Brightness': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info.
[12/30/2022, 5:06:01 PM] [Levoit Humidifiers] [DEBUG]: [GET DEVICE INFO] Getting device info...
[12/30/2022, 5:06:01 PM] [homebridge-levoit-humidifiers] This plugin generated a warning from the characteristic 'Brightness': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info.

  1. The humidifier night light button operates as follows when you tap on the button. The VeSync app lets you pick any color you want and allows you to adjust the dimmer:

Tap 1 - Auto color change mode
Tap 2 - Purple light
Tap 3 - Blue light
Tap 4 - Light blue light
Tap 5 - Cyan light
Tap 6 - Yellow/orange light

from homebridge-levoit-humidifiers.

pschroeder89 avatar pschroeder89 commented on September 23, 2024

Interesting, thanks for the info @danfratamico!

I actually just discovered that Levoit has locked down their app's SSL certificate, so I can no longer sniff the traffic from their app to their servers. This will make debugging and implementing this (and all future changes to this plugin) more difficult.

I have published version 1.8.4-debug, that will output a new [UPDATED INFO RESPONSE] log (you will not need to have debug mode enabled to see this log). It should look something like:

[UPDATED INFO RESPONSE]
{
  "traceId": "1672465495037",
  "code": 0,
  "msg": "request success",
  "module": null,
  "stacktrace": null,
  "result": {
    "traceId": "1672465495037",
    "code": 0,
    "result": {
      "enabled": false,
      "mist_virtual_level": 9,
      "mist_level": 3,
      "mode": "auto",
      "water_lacks": true,
      "water_tank_lifted": false,
      "humidity": 31,
      "humidity_high": false,
      "display": false,
      "automatic_stop_reach_target": false,
      "night_light_brightness": 0,
      "configuration": {
        "auto_target_humidity": 40,
        "display": true,
        "automatic_stop": true
      }
    }
  }
}

I'm expecting / hoping that your log will contain 2 new values in that response, maybe something like light_color and night_light (instead of night_light_brightness like on other models). I can then hopefully construct the correct API calls to control the light's color and power.

Thanks a lot for helping out on this!

from homebridge-levoit-humidifiers.

danfratamico avatar danfratamico commented on September 23, 2024

Thanks for your work on this! I installed the latest version of the plugin and here is my response:

 {
   "traceId":"1672494584478",
   "code":0,
   "msg":"request success",
   "module":null,
   "stacktrace":null,
   "result":{
      "traceId":"1672494584478",
      "code":0,
      "result":{
         "enabled":true,
         "mist_virtual_level":1,
         "mist_level":1,
         "mode":"auto",
         "water_lacks":false,
         "water_tank_lifted":false,
         "humidity":35,
         "humidity_high":false,
         "display":true,
         "automatic_stop_reach_target":true,
         "configuration":{
            "auto_target_humidity":40,
            "display":true,
            "automatic_stop":true
         },
         "extension":{
            "schedule_count":0,
            "timer_remain":0
         },
         "rgbNightLight":{
            "action":"off",
            "colorMode":"marquee",
            "speed":0,
            "brightness":91,
            "red":255,
            "green":255,
            "blue":255,
            "colorSliderLocation":61
         }
      }
   }
}

from homebridge-levoit-humidifiers.

pschroeder89 avatar pschroeder89 commented on September 23, 2024

1.8.4-debug2 has been pushed. I'd appreciate it if you both could test it out and let me know how things look.

There's a possibility that it won't work at all as this took a bit of guesswork and outdated info from other VeSync repos (and since I don't have this feature on my current models), but I am getting successful responses from VeSync when sending the current set of commands.

The current behaviors that should be supported:

  1. Turning the light on and off (not using the slider, but the lightbulb icon). Turning it on should go to 50% (check the slider to confirm, please).
  2. Turning the light on and off from the slider. Turning on from the slider will always go to 50%. Once it is on, you can adjust the brightness to any other %. That's the current behavior for the non-RGB night lights, too...it's more of a UI limitation in HomeKit than anything else.
  3. When turning on the lights, whatever color, colorMode, speed, and colorSliderLocation you had set in VeSync should be kept and respected by HomeKit. I attempted to just read and store these values from the initial get requests, and we just supply them when we turn the light on / off or change the brightness.

I did have some other questions too, to make sure my logic is ok:

  1. What different "actions" are there? Just on/off? There are some other vesync devices that appear to handle dim as an option as well, not sure if that applies here.
  2. What are the different color modes? If there are only a couple and people want it, we can probably make a few new switches for them.
  3. What does speed control, exactly? We could potentially add a slider in the future to change the speed.
  4. What does colorSliderLocation do?

Also, please test with debug mode turned on in the config. There should be logs for the Night Light Status request and response.

from homebridge-levoit-humidifiers.

danfratamico avatar danfratamico commented on September 23, 2024

@pschroeder89 Sure, here is how it's working for me:

  1. The device in the Home app defaults to 50% brightness and the slider is half way. I don't see a on/off switch for the light, there is only a slider. To turn off the night light, I need to drag the slider to the bottom and that shuts it off.

  2. Adjusting the brightness does not work from the slider.

  3. From what I can test, it does respect the color chosen in VeSync. The other values, I am not sure about.

To try and answer your other questions, I'm hoping the attached image can help. This shows the settings we can configure for the night light in the VeSync app. I'm guessing the "colorSliderLocation" lets you pick any RGB color.

Here's a log entry that may help. Changing the brightness in the Home app does show as being changed in the logs and it does change in VeSync but the humidifier brightness does not change. It only respects the dimmer slider in the VeSync app:

[1/3/2023, 11:21:41 AM] [Levoit Humidifiers] Setting Night Light Status to {"action":"off","speed":0,"green":113,"blue":127,"red":1,"brightness":50,"colorMode":"color","colorSliderLocation":54}

IMG_1516

from homebridge-levoit-humidifiers.

pschroeder89 avatar pschroeder89 commented on September 23, 2024

Thanks @danfratamico. To try to understand the brightness behavior a little more, I've published 1.8.4-debug3. This will output another log when getting the light info from VeSync. It should start with [GET LIGHT JSON].

Could you capture a GET log, then change (only) the Dimmer setting to another value in the VeSync app, then go back to Home and capture another GET log?

Also, for the on/off switch without the slider, you need to go to the Humidifier accessory in HomeKit (so all 5 or 6 accessories are showing), then scroll down to the Accessories item. You should then see the accessories in a smaller view, and you can tap the light to turn it on / off.

If all of this debugging is a lot for you and you'd be comfortable, you could add me as a Device User in the Share Device settings of the VeSync app ([email protected]). Let me know if that's an option, that way I could debug on your device. If not, let's see what the logs look like and see if we can figure this out.

We also have a Discord channel for faster comms, if needed: https://discord.com/channels/432663330281226270/1055705874460594247

Thanks again for the help!

from homebridge-levoit-humidifiers.

danfratamico avatar danfratamico commented on September 23, 2024

Thanks, I was able to find the accessories list. The night light button read 50% brightness and the light was off on the humidifier. I turned it on in Home and it did not turn on the humidifier light. It only turned on when I moved the slider. Here are the logs:

[1/3/2023, 7:59:32 PM] [Levoit Humidifiers] [GET LIGHT JSON] {"action":"on","speed":0,"green":154,"blue":173,"red":0,"brightness":50,"colorMode":"color","colorSliderLocation":54}
[1/3/2023, 7:59:38 PM] [Levoit Humidifiers] Setting Night Light Status to {"action":"on","speed":0,"green":154,"blue":173,"red":0,"brightness":75,"colorMode":"color","colorSliderLocation":54}

I also sent you an invitation for access to my device in VeSync. I would love to chat on Dkicord, but using your link displays a message "You don't have access to any text channels, or there are none on this server.".

from homebridge-levoit-humidifiers.

pschroeder89 avatar pschroeder89 commented on September 23, 2024

Ah, try this discord link first: https://discord.com/invite/Z8jmyvb

from homebridge-levoit-humidifiers.

danfratamico avatar danfratamico commented on September 23, 2024

Here are debug logs when I changed the brightness in the Home app:

[1/4/2023, 8:59:56 AM] [Levoit Humidifiers] [DEBUG]: [GET DEVICE INFO] Getting device info...

[1/4/2023, 8:59:56 AM] [Levoit Humidifiers] [DEBUG]: [DEVICE INFO] {"traceId":"*removed*","code":0,"msg":"request success","module":null,"stacktrace":null,"result":{"traceId":"*removed*","code":0,"result":{"enabled":true,"mist_virtual_level":1,"mist_level":1,"mode":"auto","water_lacks":false,"water_tank_lifted":false,"humidity":41,"humidity_high":false,"display":true,"automatic_stop_reach_target":true,"configuration":{"auto_target_humidity":40,"display":true,"automatic_stop":true},"extension":{"schedule_count":0,"timer_remain":0},"rgbNightLight":{"action":"off","colorMode":"color","speed":0,"brightness":50,"red":9,"green":255,"blue":115,"colorSliderLocation":42}}}}

[1/4/2023, 8:59:56 AM] [Levoit Humidifiers] [GET LIGHT JSON] {"action":"off","speed":0,"green":255,"blue":115,"red":9,"brightness":50,"colorMode":"color","colorSliderLocation":42}

[1/4/2023, 9:00:02 AM] [Levoit Humidifiers] Setting Night Light Status to {"action":"on","speed":0,"green":255,"blue":115,"red":9,"brightness":57,"colorMode":"color","colorSliderLocation":42}

[1/4/2023, 9:00:02 AM] [Levoit Humidifiers] [DEBUG]: [SEND COMMAND] Sending command setLightStatus to Bedroom Humidifier with ({"action":"on","speed":0,"green":255,"blue":115,"red":9,"brightness":57,"colorMode":"color","colorSliderLocation":42})...

[1/4/2023, 9:00:02 AM] [Levoit Humidifiers] Setting Night Light Status to {"action":"on","speed":0,"green":255,"blue":115,"red":9,"brightness":50,"colorMode":"color","colorSliderLocation":42}

[1/4/2023, 9:00:02 AM] [Levoit Humidifiers] [DEBUG]: [SEND COMMAND] Successfully sent command setLightStatus to Bedroom Humidifier with ({"action":"on","speed":0,"green":255,"blue":115,"red":9,"brightness":57,"colorMode":"color","colorSliderLocation":42})! Response: {"traceId":"*removed*","code":0,"msg":"request success","module":null,"stacktrace":null,"result":{"traceId":"*removed*","code":0}}

[1/4/2023, 9:00:02 AM] [Levoit Humidifiers] [DEBUG]: [SEND COMMAND] Sending command setLightStatus to Bedroom Humidifier with ({"action":"on","speed":0,"green":255,"blue":115,"red":9,"brightness":50,"colorMode":"color","colorSliderLocation":42})...

[1/4/2023, 9:00:03 AM] [Levoit Humidifiers] [DEBUG]: [SEND COMMAND] Successfully sent command setLightStatus to Bedroom Humidifier with ({"action":"on","speed":0,"green":255,"blue":115,"red":9,"brightness":50,"colorMode":"color","colorSliderLocation":42})! Response: {"traceId":"*removed*","code":0,"msg":"request success","module":null,"stacktrace":null,"result":{"traceId":"*removed*","code":0}}

[1/4/2023, 9:00:08 AM] [Levoit Humidifiers] Setting Night Light Status to {"action":"on","speed":0,"green":255,"blue":115,"red":9,"brightness":73,"colorMode":"color","colorSliderLocation":42}

[1/4/2023, 9:00:08 AM] [Levoit Humidifiers] [DEBUG]: [SEND COMMAND] Sending command setLightStatus to Bedroom Humidifier with ({"action":"on","speed":0,"green":255,"blue":115,"red":9,"brightness":73,"colorMode":"color","colorSliderLocation":42})...

[1/4/2023, 9:00:08 AM] [Levoit Humidifiers] [DEBUG]: [SEND COMMAND] Successfully sent command setLightStatus to Bedroom Humidifier with ({"action":"on","speed":0,"green":255,"blue":115,"red":9,"brightness":73,"colorMode":"color","colorSliderLocation":42})! Response: {"traceId":"*removed*","code":0,"msg":"request success","module":null,"stacktrace":null,"result":{"traceId":"*removed*","code":0}}

from homebridge-levoit-humidifiers.

pschroeder89 avatar pschroeder89 commented on September 23, 2024

Update: Thanks to @danfratamico for letting me test and debug on his LUH-D301S-WUSR!
1.8.5 has been pushed and fixes brightness and on / off for the light on this model.

We do not support changing the color from the plugin (yet).

from homebridge-levoit-humidifiers.

pschroeder89 avatar pschroeder89 commented on September 23, 2024

If new bugs are found against this feature, please raise them in a new ticket. Thanks!

from homebridge-levoit-humidifiers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.