dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.9k stars 503 forks source link

Additional special effects for Hue lights #7922

Closed ebaauw closed 1 month ago

ebaauw commented 2 months ago

With the 1.116.3 / 67.116.3 firmware upgrade from May 2024, most Hue lights get additional special effects (see https://www.philips-hue.com/en-us/support/release-notes/lamps). There's also a new (undocumented) "sunset" effect, which basically is the reverse of the "sunrise" effect.

Most of these changes should be reflected by the API automatically when, the attributes from the Hue Effects cluster are re-read after the firmware update.

This PR adds support for the new "sunset" effect. It also brings the GUI up to date with the API ("opal" and "glisten" were missing and "prism" was still called "loop"). It enables the Hue-specific Startup Current X and Startup Current Y attributes, now that the GUI bug handling attributes with the same ID but different manufacturer codes has been fixed. Finally, it removes the values for state/effect from the DDFs for the Hue lights, as these are exposed through capabilities/color/effects, and as they depend on the firmware revision.

While changing the C++ code, I also fixed the handling of special effects for (white and/or white ambiance) lights that don't support colorloop, see #7451.

github-actions[bot] commented 2 months ago

Hey @ebaauw, thanks for your pull request!

[!TIP] Modified bundles can be downloaded here. Relative expire date

DDB changes

Modified

Validation

[!TIP] Everything is fine !

:clock630: Updated for commit 07febedb438c41f507f4250333970984dfb9bab6

hanskroner commented 1 month ago

@ebaauw - Apologies if this is only tangentially related to the PR. Have you come across any indication in the (extensive!) research you've been doing on the 0xFC03 cluster that would hint at effects like "sunrise" and "sunset" having a configurable duration?

ebaauw commented 1 month ago

@hanskroner: No, I have not. The only writeable attributes I've discovered in the Hue Effects cluster are related to gradient lights, and I'm not aware of any additional parameters to the Set Effect command.

You can probably simulate sunrise (sunset) by setting bri and ct to minimum (maximum) values followed by setting these to maximum (minimum) with a long transitiontime. I've been using a 10-minute transitiontime (raw value 6000) for my wakeup routine, albeit only for bri.

hanskroner commented 1 month ago

@ebaauw - Thanks for the tip. I've started with a similar approach and then complicated it a bit by adding xy/ct transitions along with the bri increases, as stages (individual scenes executed in sequence). This works well until the sequence is interrupted - for example by someone turning off the lights.

The Q&A section in the marketing page for the wake-up feature mentions the sunrise duration (and brightness) being configurable through the Hue app: "Use the Hue app to customize how you want to wake up — how long your sunrise lasts, when it rises, and the intensity of the light. It’s a personal wake-up light designed by our lighting experts, and then customized by you." It might just be a separate feature not related to this sunrise effect. It's made me curious enough to go look for my Hue bridge and see what it's about.

EDIT: After dusting off my Hue bridge and experimenting a little, it seems that 0xfc03 uses command 0x00 to start the sunrise effect with configurable duration and max. brightness. Sample payloads I observed:

B3 00 01 FE 04 00 09 7D Sunrise effect, 10 minute duration, 100% max. brightness B3 00 01 FE 04 00 09 65 Sunrise effect, 20 minute duration, 100% max. brightness B3 00 01 82 04 00 09 7D Sunrise effect, 10 minute duration, 51% max. brightness

Is there a better place to discuss this (if there's interest)?

manup commented 1 month ago

Perfect thanks :+1:

github-actions[bot] commented 1 month ago

This pull request is now merged. The new DDB files have been uploaded to the store.

DDB Files

Modified

:clock130: Updated for commit f601a6ccf359607f4c37b9322af4d43ffc6c9fb6