[REQUEST] Add full hue_native_control option for native control of Philips Hue lights

オープン
#756 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
api, backend

調査の方向性

Start by reading the linked Bifrost format specification and the referenced ZHA Device Handlers issue; the requested work spans ZHA, zigpy, device handlers, and the ZHA UI. Identify where manufacturer specific cluster commands are handled in each project, then assess how to encode and decode cluster 0xFC03 and expose the effects. Done means Philips Hue native effects and related controls work across those layers, but the issue does not identify files or tests to guide implementation.

索引モデルが issue の本文から書いたものです。

説明

For reference also see this feature request for ZHA Device Handlers which asking about custom device support for this cluster:

Request add full support Philips Hue native control (a.k.a. "Hue Dynamic Scenes" or "Dynamic Lighting Scenes") with decode/encode of binary format used by Philips Hue Zigbee devices which can be used to command custom "Bifrost effects" (atomic Bifrost frames on cluster 0xFC03 to control different firmware-supported special animated scene effect like example "Candle", "Fireplace", and "Colorloop" animation) supported by a few Philips Hue lighting products and support Zigbee frames in a manufacturer specific cluster implementation format on cluster 0xFC03 to zha, zigpy, zha-quirks/zha-device-handlers, and the ZHA integration UI:

Philips Hue lights supports this via Zigbee frames in a manufacturer specific cluster implementation format, on cluster 0xFC03.

This is already supported by Zigbee2MQTT and is needed if want to achieve feature-parity with Z2M and zigbee-herdsman, and more importantlly really needed if want to encurage users of the official Philips Hue Bridge and app to move/migrate to ZHA:

Zigbee2MQTT supports these Hue Effects / animations (effect names):

  • candle (Soft, flickering yellow/orange glow)
  • fireplace (Dynamic flickering orange/red colors)
  • colorloop (Cycles endlessly through the color spectrum)
  • blink
  • breathe
  • okay
  • sunset
  • sunrise
  • sparkle
  • opal
  • glisten
  • underwater
  • cosmos
  • sunbeam
  • enchant
  • none, finish_effect, stop_hue_effect or stop_effect (Returns the light to its standard state)

These are supported by most Philips Hue series light products with color temperature, but see example these supported devices:

These dynamic scenes animations are also supported by deCONZ (Zigbee gateway from Dresden Elektronik) too:

This type of specialized message is necessary to support many of the advanced features in Hue lights, such as:

  • Multiple colors ("gradient") in LED strips.
  • Light Effects ("Candle", "Fireplace", "Fireplace", "Colorloop", etc.).
  • Combining effects with color settings.

The use case for this is not only to add feature-parity with the support for this manufacturer specific cluster previously only avalable via a proprietary Philips Hue Bridge, but also to allow users to fully replace their Philips Hue Bridge to instead get a better user experience when only using Zigbee2MQTT for their Philips Hue lighting Zigbee devices.

Note! This new feature requested for zha is directly related to fact that a developer named Mihonarium has this week now added hue_native_control option for native control of Philips lights to zigbee-herdsman-converters in an implementation where he has rewritted zigbee-herdsman's existing Philips manufacturer specific cluster encoder/decoder handling and adds full feature-parity support for Philips Hue native control with encode/decode of custom effects, with improved effect UX and configurable color wheel/effect interaction in Zigbee2MQTT UI with now now report state, support color+speed in a single command, and the color wheel/effect interaction is configurable.

Summary

Adds a hue_native_control option for native control of Philips lights.

Rewrites the Philips manuSpecificPhilips2 encoder/decoder drafted by LaurentvdBos based on the Bifrost spec, fixing several data corruption bugs and adding missing functionality. Also improves effect UX: effects now report state, support color+speed in a single command, and the color wheel/effect interaction is configurable.

Opt-in

By default, standard ZCL converters handle on/off, brightness, color, and color temperature. The behavior is unchanged from before this PR. The manuSpecificPhilips2 cluster can send all of these in a single atomic command, which is required for full effect support: changing color while an effect is running, stopping effects by changing color, and setting an effect with a specific color in one command. However, native control also changes some user-facing behavior (e.g., no simulated fade-to-off transition), so it is opt-in.

Users can enable it per-device in Z2M Settings → Settings (Specific), or globally via device_options: { hue_native_control: true } in configuration.yaml.

New features

  • All Bifrost effects — Added sunset, sparkle, opal, glisten, underwater, cosmos, sunbeam, enchant (13 total including no_effect, candle, fireplace, prism/colorloop, sunrise)

  • effect + color in one command — {"effect": "candle", "color": "#FF4400"} activates the effect at that color atomically. Also supports effect_speed in the same payload.

  • effect_color (new expose) — Sets the base color of the active effect without stopping it. Accepts hex or XY.

  • effect_color_mode (new per-device option) — Controls what happens when the regular color wheel is used while an effect is active:

    • "stop" (default): color change stops the effect (matches Hue app)
    • "update": color change re-sends the effect with the new color
  • Deferred brightness on effect re-send — When re-sending an effect (via effect_color or "update" mode) with an explicit brightness, the brightness is sent as a separate command after the effect, since effects reset brightness on activation.

  • effect and effect_speed access changed to STATE_SET — Current values are now visible in the Z2M frontend and HA.

  • effect_speed — Settable via both the new path (philipsLightTz) and the effect converter.

  • gradient_scale / gradient_offset — Settable. Fixed-point 5.3 format exposed as float.

  • gradient_style — Fully settable (linear, scattered, mirrored). Was decoded but not writable.

  • gradient_xy — Lossless XY coordinates published alongside RGB hex gradient.

  • philips2_raw — Raw hex blob published for advanced clients (e.g. Bifrost) to decode independently.

  • HSV→XY conversion — HSV colors are now converted correctly instead of being silently dropped.

  • transition → fadeSpeed — Mapped to the Bifrost spec's per-message fade speed field.

  • Delayed state read after effect activation — Reads device state 1s after activating an effect to sync actual brightness.

(Feel free to remove or ask me to remove the effect_color, effect_color_mode, and related stuff if it goes against the overall philosophy.)

Encoder/decoder rewrite

Replaced the ad-hoc hex string parsing with structured Encode/DecodeManuSpecificPhilips2 functions using DataView for proper binary field handling. The wire order follows the Bifrost spec (gradient colors before effect speed before gradient params — reversed relative to flag bit order). Each field type is defined as a HueTypeDetails struct with encode/decode/flag/maxLength, iterated in wire order.

Limitations

After activating an effect, we sync the device state via a 1-second setTimeout, as some Hue effects change light color/brightness. If the device goes offline in the window, the error is silently caught. There could be more robust approaches.

Other

I made a very cool hass dashboard card (inspired by the Hue app, but better than it)! See #12008 (comment)

PS: I also think it is relevant to Open Home Foundation's roadmap discussion about shaping ZHA to have feature-parity with Z2M:

As well as being related to this guide for migrating from a Philips Hue Bridge to the ZHA (Zigbee Home Automation) integration in Home Assistant:

PPS: Another device that could also use native control of effect commands via quirks is Lidl Christmas led string HG0646:

Lidl Christmas led string HG0646 uses cluster 0x00FC to invoke invoked native effects commands for their device:

主要言語
Python
スター
96
フォーク
84
平均マージ
3日 1時間
マージ済み PR(30日)
13

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

zigpy/zha のほかの issue

zigpy/zha の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。