Skip to content

Conversation

@MangelSpec
Copy link

Summary

Adds RGB nightlight control support for the VeSyncHumid200300S device class, specifically for the LUH-O451S-WEU (OasisMist 4.5L) humidifier model.

This addresses missing nightlight functionality that prevents Home Assistant from creating light entities for humidifiers with RGB nightlight features. Related issue: home-assistant/core#160387

Changes

  • Added HumidifierFeatures.RGB_NIGHTLIGHT feature flag
  • Added supports_rgb_nightlight property to base class
  • Implemented set_rgb_nightlight(power, brightness, red, green, blue) method
  • Added RGB nightlight state attributes (status, brightness, r/g/b, color_mode)

API Quirks

  1. Brightness-adjusted RGB: API expects RGB values pre-multiplied by brightness via HSV conversion
  2. Color slider location: API requires a colorSliderLocation (0-100) mapped from an 8-color gradient
  3. !Stale API responses!: After setting values, API returns old data for several minutes - implemented timeout to prevent state drift. This is sadly not working perfectly yet, I didn't find out how to improve this behavior or force the getHumidifierStatus to return the values we just set before. Maybe someone with more insight or time can improve this as it's also causing issues when updating the nightlight via App and then using this library.

Known Limitations

  • Minimum brightness is 40% (enforced by VeSync app)
  • Other models with RGB nightlights (e.g., LUH-D301S-WUSR) may work by adding the feature flag - only tested on LUH-O451S-WEU

Testing

Tested on physical LUH-O451S-WEU device: power on/off, brightness, color changes, state refresh.

image

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

Successfully merging this pull request may close these issues.

1 participant