Skip to content

Commit 66e7014

Browse files
authored
Even more additional special effects for Hue lights (dresden-elektronik#7956)
1 parent 2b890ee commit 66e7014

File tree

5 files changed

+114
-12
lines changed

5 files changed

+114
-12
lines changed

devices/philips/bridge.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"schema": "devcap1.schema.json",
3+
"manufacturername": "$MF_PHILIPS",
4+
"modelid": "IPC002",
5+
"vendor": "Philips",
6+
"product": "Hue bridge",
7+
"sleeper": false,
8+
"status": "Gold",
9+
"subdevices": [
10+
{
11+
"type": "$TYPE_RANGE_EXTENDER",
12+
"restapi": "/lights",
13+
"uuid": [
14+
"$address.ext",
15+
"0x01"
16+
],
17+
"items": [
18+
{
19+
"name": "attr/id"
20+
},
21+
{
22+
"name": "attr/lastannounced"
23+
},
24+
{
25+
"name": "attr/lastseen"
26+
},
27+
{
28+
"name": "attr/manufacturername"
29+
},
30+
{
31+
"name": "attr/modelid"
32+
},
33+
{
34+
"name": "attr/name"
35+
},
36+
{
37+
"name": "attr/swversion"
38+
},
39+
{
40+
"name": "attr/type"
41+
},
42+
{
43+
"name": "attr/uniqueid"
44+
},
45+
{
46+
"name": "cap/groups/not_supported"
47+
},
48+
{
49+
"name": "state/reachable"
50+
}
51+
]
52+
}
53+
]
54+
}

devices/philips/fc03_state.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ if (attrid === 0x0002) {
4646
R.item('state/effect').val = 'candle'
4747
break
4848
case 0x8002:
49-
R.item('state/effect').val = 'fireplace'
49+
R.item('state/effect').val = 'fire'
5050
break
5151
case 0x8003:
5252
R.item('state/effect').val = 'prism'
@@ -66,6 +66,18 @@ if (attrid === 0x0002) {
6666
case 0x800D:
6767
R.item('state/effect').val = 'sunset'
6868
break
69+
case 0x800E:
70+
R.item('state/effect').val = 'underwater'
71+
break
72+
case 0x800F:
73+
R.item('state/effect').val = 'cosmos'
74+
break
75+
case 0x8010:
76+
R.item('state/effect').val = 'sunbeam'
77+
break
78+
case 0x8011:
79+
R.item('state/effect').val = 'enchant'
80+
break
6981
default:
7082
R.item('state/effect').val = '0x' + effect.toString(16)
7183
break

devices/philips/light_zb3_white_ambiance.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"$MF_PHILIPS",
1212
"$MF_PHILIPS",
1313
"$MF_PHILIPS",
14+
"$MF_PHILIPS",
15+
"$MF_SIGNIFY",
1416
"$MF_SIGNIFY",
1517
"$MF_SIGNIFY",
1618
"$MF_SIGNIFY",
@@ -26,6 +28,7 @@
2628
"LTA009",
2729
"LTE002",
2830
"LTG002",
31+
"LTG005",
2932
"LTU001",
3033
"LTV001",
3134
"LTV002",
@@ -35,6 +38,7 @@
3538
"LTA009",
3639
"LTE002",
3740
"LTG002",
41+
"LTG005",
3842
"LTU001",
3943
"LTV001",
4044
"LTV002",

general.xml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5130,6 +5130,8 @@ These devices can operate on either battery or mains power, and can have a wide
51305130
</payload>
51315131
</command>
51325132
</server>
5133+
<client>
5134+
</client>
51335135
</cluster>
51345136

51355137
<cluster id="0xfc01" name="Hue Entertainment" mfcode="0x100b">
@@ -5156,22 +5158,25 @@ These devices can operate on either battery or mains power, and can have a wide
51565158
</cluster>
51575159

51585160
<cluster id="0xfc03" name="Hue Effects" mfcode="0x100b">
5159-
<description>Hue-specific cluster for Hue white and color ambiance lights.</description>
5161+
<description>Hue-specific cluster for Hue lights.</description>
51605162
<server>
51615163
<command id="0x00" dir="recv" name="Set Effect" vendor="0x100b" required="m">
51625164
<payload>
5163-
<attribute id="0x0000" type="u16" name="Command" showas="hex" default="0x0021" required="o"></attribute>
5164-
<attribute id="0x0001" type="bool" name="Enable" required="m"></attribute>
5165-
<attribute id="0x0002" type="enum8" name="Effect" required="m">
5165+
<attribute id="0x0000" type="u16" name="Command" showas="hex" default="0x0020" required="o"></attribute>
5166+
<attribute id="0x0001" type="enum8" name="Effect" required="m">
51665167
<value name="None" value="0x00"/>
51675168
<value name="Candle" value="0x01"/>
5168-
<value name="Fireplace" value="0x02"/>
5169+
<value name="Fire" value="0x02"/>
51695170
<value name="Prism" value="0x03"/>
51705171
<value name="Sunrise" value="0x09"/>
51715172
<value name="Sparkle" value="0x0a"/>
51725173
<value name="Opal" value="0x0b"/>
51735174
<value name="Glisten" value="0x0c"/>
51745175
<value name="Sunset" value="0x0d"/>
5176+
<value name="Underwater" value="0x0e"/>
5177+
<value name="Cosmos" value="0x0f"/>
5178+
<value name="Sunbeam" value="0x10"/>
5179+
<value name="Enchant" value="0x11"/>
51755180
</attribute>
51765181
</payload>
51775182
</command>
@@ -5187,13 +5192,17 @@ These devices can operate on either battery or mains power, and can have a wide
51875192
</attribute>
51885193
<attribute id="0x0011" name="Effects" type="bmp64" mfcode="0x100b" access="r" required="o">
51895194
<value name="Candle" value="0x01"/>
5190-
<value name="Fireplace" value="0x02"/>
5195+
<value name="Fire" value="0x02"/>
51915196
<value name="Prism" value="0x03"/>
51925197
<value name="Sunrise" value="0x09"/>
51935198
<value name="Sparkle" value="0x0a"/>
51945199
<value name="Opal" value="0x0b"/>
51955200
<value name="Glisten" value="0x0c"/>
51965201
<value name="Sunset" value="0x0d"/>
5202+
<value name="Underwater" value="0x0e"/>
5203+
<value name="Cosmos" value="0x0f"/>
5204+
<value name="Sunbeam" value="0x10"/>
5205+
<value name="Enchant" value="0x11"/>
51975206
</attribute>
51985207
<attribute id="0x0012" name="Gradient Unknown 12" type="bmp32" mfcode="0x100b" access="r" required="o">
51995208
<value name="Unknown 00" value="0x00"/>
@@ -5214,6 +5223,24 @@ These devices can operate on either battery or mains power, and can have a wide
52145223
<attribute id="0x0035" name="Gradient Unknown 35" type="u8" mfcode="0x100b" access="r" required="o"></attribute>
52155224
<attribute id="0x0036" name="Gradient Max Segments" type="u8" mfcode="0x100b" access="r" required="o"></attribute>
52165225
</server>
5226+
<client>
5227+
</client>
5228+
</cluster>
5229+
5230+
<cluster id="0xfc04" name="Hue Unknown" mfcode="0x100b">
5231+
<description>Hue-specific cluster.</description>
5232+
<server>
5233+
</server>
5234+
<client>
5235+
</client>
5236+
</cluster>
5237+
5238+
<cluster id="0xfc06" name="Hue Unknown" mfcode="0x100b">
5239+
<description>Hue-specific cluster.</description>
5240+
<server>
5241+
</server>
5242+
<client>
5243+
</client>
52175244
</cluster>
52185245

52195246
<!-- Hue for Lutron Aurora -->

hue.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ struct code {
1616

1717
code effects[] = {
1818
{ 0x01, QLatin1String("candle") },
19-
{ 0x02, QLatin1String("fireplace") },
19+
{ 0x02, QLatin1String("fire") },
2020
{ 0x03, QLatin1String("prism") },
2121
{ 0x09, QLatin1String("sunrise") },
2222
{ 0x0a, QLatin1String("sparkle") },
2323
{ 0x0b, QLatin1String("opal") },
2424
{ 0x0c, QLatin1String("glisten") },
25-
{ 0x0d, QLatin1String("sunset") }
25+
{ 0x0d, QLatin1String("sunset") },
26+
{ 0x0e, QLatin1String("underwater") },
27+
{ 0x0f, QLatin1String("cosmos") },
28+
{ 0x10, QLatin1String("sunbeam") },
29+
{ 0x11, QLatin1String("enchant") }
2630
};
2731

2832
quint8 effectNameToValue(QString &effectName)
@@ -122,8 +126,9 @@ bool DeRestPluginPrivate::addTaskHueEffect(TaskItem &task, QString &effectName)
122126
QDataStream stream(&task.zclFrame.payload(), QIODevice::WriteOnly);
123127
stream.setByteOrder(QDataStream::LittleEndian);
124128

125-
stream << (quint16) 0x0021; // set effect (with on/off)
126-
stream << (quint8) 1; // on
129+
stream << (quint16) 0x0020; // set effect
130+
// stream << (quint16) 0x0021; // set effect (with on/off)
131+
// stream << (quint8) 1; // on
127132
if (effectName == "none")
128133
{
129134
stream << (quint8) 0; // none
@@ -304,7 +309,7 @@ bool DeRestPluginPrivate::addTaskHueGradient(TaskItem &task, QVariantMap &gradie
304309
stream.setByteOrder(QDataStream::LittleEndian);
305310

306311
stream << (quint16) 0x0150; // set gradient
307-
stream << (quint16) 0x0004; // unknown
312+
stream << (quint16) 0x0004; // transitiontime
308313

309314
const quint8 nPoints = points.length();
310315
stream << (quint8) (1 + 3 * (nPoints + 1));

0 commit comments

Comments
 (0)