Pleg with XBMC state plugin

Hi Guys,

I’m pretty new here but have been doing lots of reading and learning. Up until now I have installed a DSC alarm in my house and 1 fibaro dimmer module.

What I’m looking to achieve is this. I have a cinema room that id like for the light to come on via a motion sensor but only when im not using my cinema with the projector on. The plugin XBMC state can do things like turning lights on and off when the player state changes - play, pause, stop, resume etc. It also has a ping state function ‘up’ meaning player on ‘down’ being player off.

Now im not sure if my logic is wrong or the plugin is broken so any help would be appreciated, here is my pleg:

Triggers
ItsNight - Day or Night indicates Night time.
LightOn - _Dimmable Light is turned on
Motion - Hallway Motion is tripped
XbmcOff - Down

Schedule
Timer - Self ReTrigger Interval 05:00

Conditions
AutoOn - !LightOn and ItsNight and Motion and XbmcOff and (!LightOn; Motion > 30)
KeepOn - (LightOn and Motion and (LightOn; Motion)) or AutoOn
AutoOff - LightOn and !Timer and (LightOn; !Timer) and (!LightOn; LightOn > 5)

Actions
AutoOn - Turn Light on
KeepOn - PLEG StartTimer timerName=Timer
AutoOff - Turn Light off

Thanks in advance for any help.

This logic will have problems if the MOTION sensor keeps the tripped state longer than 5 minutes.
You may need to adjust the device settings.
A STATUS report should help you understand what is happening with your logic.

The actual pleg itself seems to be working ok until I add the xbmc trigger and condition so I’m a bit stumped to be honest. Do you know of any other way to monitor a computer in the on or off state?