我想知道是否有人可以帮助弄清楚为什么我的 openhab 规则不能识别我的 xbmc 播放器在播放电影时的状态变化。
但我的规则不会触发:
rules:
val Functions$Function1 dimLiving = [ int dimlevel |
//var boolean scene = (Scene_Living.state == 11);
// Only dim lights when a certain scene is selected
//if(scene) {
// sendCommand(Lamp_Living_Small, dimlevel)
//s sendCommand(Lamp_Living_Floor, dimlevel)
sendCommand(Lounge_Light_Dimm, dimlevel)
// }
]
rule "Lights on when paused"
when
Item htpc_state changed from Play to Pause
then
brightnessBeforePause = Lounge_Light_Dimm.state as DecimalType
if ( brightnessBeforePause < 50){
logInfo("Light", "Play to pause 2")
dimLiving.apply(50)
}
end
rule "Lights off when pause end"
when
Item htpc_state changed from Pause to Play
then
if (Lounge_Light_Dimm.state == 50){
logInfo("Light", "Pause to play 1")
dimLiving.apply(brightnessBeforePause)
}
end
我想在电影开始播放时调暗飞利浦色调灯。
一切都在 openhab.cfg 中配置好