Philips Hue Lux カラー ランプを OpenHAB で制御したいと考えています。だから私は何をすべきか、何かが足りないのだろうかと思います。
のpi@raspberrypi:/opt/openhab/configurations/rules $ sudo vi demo.rules
rule "Select scene"
when
Item scene received command
then
switch(receivedCommand) {
/*alles uit */
case 0 : {
sendCommand(Toggle_7, OFF);
sendCommand(Toggle_3, OFF);
sendCommand(Toggle_1, OFF);
sendCommand(Toggle_10, OFF);
sendCommand(Toggle_11, OFF);
sendCommand(Toggle_5, OFF);
sendCommand(Toggle_9, OFF);
}
/*sfeer */
case 1 : {
sendCommand(LWD_3, 90);
sendCommand(Color_7, "45.584415,86.033516,70.19608");
sendCommand(Color_1, "45.584415,86.033516,70.19608");
sendCommand(Color_10, "45.584415,86.033516,70.19608");
sendCommand(Color_11, "45.584415,86.033516,70.19608");
sendCommand(Color_5, "45.584415,86.033516,70.19608");
sendCommand(LWD_9,10);
}
/*Alles aan */
case 2 : {
sendCommand(Toggle_7, ON);
sendCommand(Toggle_3, ON);
sendCommand(Toggle_1, ON);
sendCommand(Toggle_10, ON);
sendCommand(Toggle_11, ON);
sendCommand(Toggle_5, ON);
sendCommand(LWD_9,100);
}
/*eten */
case 3 : {
sendCommand(Toggle_3, OFF);
sendCommand(Color_7, "42.391304,73.6,100.0");
sendCommand(Color_1, "42.391304,73.6,100.0");
sendCommand(Color_10, "42.391304,73.6,100.0");
sendCommand(Color_11, "60,42,100");
sendCommand(Color_5, "60,42,100");
sendCommand(LWD_9,10);
}
case 4 : {
/*nacht */
sendCommand(LWD_9, 50);
sendCommand(Color_7, "46.25,37.64706,100.0");
sendCommand(Color_10, "46.25,37.64706,100.0");
sendCommand(Toggle_1, OFF);
sendCommand(Toggle_3, OFF);
sendCommand(Toggle_11, OFF);
sendCommand(Toggle_5, OFF);
}
case 5 : {
/* Sunset */
sendCommand(Color_7, "42.391304,73.6,100.0");
sendCommand(Color_1, "42.391304,73.6,100.0");
sendCommand(Color_10, "42.391304,73.6,100.0");
sendCommand(Color_11, "42.391304,73.6,100.0");
sendCommand(Color_5, "42.391304,73.6,100.0");
sendCommand(Toggle_3, OFF);
sendCommand(LWD_9,10);
}
case 6 : {
/* Aqua */
sendCommand(Color_7, "230.82353,100.0,100.0");
sendCommand(Color_1, "230.82353,100.0,100.0");
sendCommand(Color_10, "230.82353,100.0,100.0");
sendCommand(Color_11, "230.82353,100.0,100.0");
sendCommand(Color_5, "230.82353,100.0,100.0");
sendCommand(Toggle_3, OFF);
sendCommand(LWD_9,10);
}
case 7 : {
/* Duo */
sendCommand(Color_7, "272,100.0,100.0");
sendCommand(Color_5, "272,100.0,100.0");
sendCommand(Color_1, "330,100.0,100.0");
sendCommand(Color_10, "330,100.0,100.0");
sendCommand(Color_11, "330,100.0,100.0");
sendCommand(Toggle_3, OFF);
sendCommand(LWD_9,10);
}
case 8 : {
/* Duo ambilight play */
sendCommand(Color_7, "272,100.0,30.0");
sendCommand(Color_5, "272,100.0,30.0");
sendCommand(Color_1, "330,100.0,30.0");
sendCommand(Color_10, "330,100.0,30.0");
sendCommand(Color_11, "330,100.0,30.0");
}
case 9 : {
/* Duo ambilight pauze*/
sendCommand(Color_7, "272,100.0,100.0");
sendCommand(Color_5, "272,100.0,100.0");
sendCommand(Color_1, "330,100.0,100.0");
sendCommand(Color_10, "330,100.0,100.0");
sendCommand(Color_11, "330,100.0,100.0");
}
}
end
のpi@raspberrypi:/opt/openhab/configurations/items $ vi demo.items
私は持っています
:
/* Hue */
Switch Toggle_1 "left bulb" (Switching) {hue="1"}
Switch Toggle_2 "center bulb" (Switching) {hue="2"}
Switch Toggle_3 "right bulb" (Switching) {hue="3"}
Color Color_1 "left bulb" (Colorize) {hue="1"}
Color Color_2 "center bulb" (Colorize) {hue="2"}
Color Color_3 "right bulb" (Colorize) {hue="3"}
Dimmer Dimm_1 "left bulb" (WhiteDimmer) {hue="1;brightness;30"}
Dimmer Dimm_2 "center bulb" (WhiteDimmer) {hue="2;brightness;30"}
Dimmer Dimm_3 "right bulb" (WhiteDimmer) {hue="3;brightness;30"}
Dimmer CT_Dimm_1 "left bulb" (CTDimmer) {hue="1;colorTemperature;30"}
Dimmer CT_Dimm_2 "center bulb" (CTDimmer) {hue="2;colorTemperature;30"}
Dimmer CT_Dimm_3 "right bulb" (CTDimmer) {hue="3;colorTemperature;30"}
でpi@raspberrypi:/opt/openhab/configurations $ vi openhab.cfg
:
私は持っている:
############################### Philips Hue Binding ###################################
#
# IP address of Hue Bridge (optional, default is auto-discovery)
hue:ip=192.168.1.117
hue:secret=openHABRuntime
hue:refresh=10000
を使用して実行しsudo ./start.sh
、Hue ハブを OpenHAB とペアリングしました。まだ OpenHAB で Hue を制御できないため、不足しているものではありません。
私の主な苦労は、web UI を openHAB のコードに接続することです。どんなポインタでも本当に感謝しています!また、さまざまなチュートリアルから上記のコードをステッチしたので、まったく意味がありません!