1

I was wondering if anyone can help to figure out why my openhab rule does not identify the change in state of my xbmc player when playing a movie.

The openhab server correctly identifies the change in state enter image description here

But my rules do not trigger:

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

I want to diim the Philips hue lights when the movie starts to play.

Everything is configured ok in the openhab.cfg

4

1 に答える 1

0

定義しましたbrightnessBeforePauseか?最初の行(インポート後、必ずそれらを含めてください)は

var Number brightnessBeforePause

そして、何にLounge_Light_Dimm設定されていますか?UndefinedまたはUninitialized両方のルールが機能しない場合。これらのルールをテストする前に、ランプを特定の薄暗いレベルに設定してみてください。

于 2015-08-26T15:08:37.660 に答える