2019-04-11 22:25:05 +02:00
|
|
|
|
|
|
|
rule "Beamer Power"
|
|
|
|
when
|
|
|
|
Item chill_zone_beamer received command
|
|
|
|
then
|
|
|
|
val state = chill_zone_beamer.state.toString
|
|
|
|
var beamerResponse
|
|
|
|
|
|
|
|
if (state == 'ON') {
|
|
|
|
// turn the beamer on
|
|
|
|
beamerResponse = sendHttpGetRequest("http://10.2.113.7/tgi/return.tgi?command=2a3101fe0660")
|
|
|
|
} else {
|
|
|
|
// turn the beamer off
|
|
|
|
beamerResponse = sendHttpGetRequest("http://10.2.113.7/tgi/return.tgi?command=2a3102fd0660")
|
|
|
|
}
|
|
|
|
val beamerStatus = transform("XPATH", "/return/text()", beamerResponse).replace("\n", '')
|
|
|
|
logInfo("beamer", "Beamer state: {}", beamerStatus)
|
|
|
|
end
|
|
|
|
|
2019-04-12 00:23:40 +02:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2019-04-11 22:25:05 +02:00
|
|
|
rule "Chromecast changed"
|
|
|
|
when
|
|
|
|
Item chill_zone_chromecast_status changed
|
|
|
|
then
|
|
|
|
chill_zone_beamer.sendCommand("ON")
|
2019-04-12 00:23:40 +02:00
|
|
|
chill_zone_screen_button_down.sendCommand("ON")
|
2019-04-11 22:25:05 +02:00
|
|
|
val app = chill_zone_chromecast_status.state.toString
|
|
|
|
if (app === null || app == UNDEF || app == 'UNDEF' || app == '' ) {
|
|
|
|
// set input to DVI - hackerspace video
|
|
|
|
sendHttpGetRequest("http://10.2.113.7/tgi/return.tgi?command=2a3109f6070566")
|
2019-04-12 00:23:40 +02:00
|
|
|
logInfo('beamer', 'Switch to input DVI')
|
2019-04-11 22:25:05 +02:00
|
|
|
} else {
|
|
|
|
// set input to HDMI2 - chromecast
|
|
|
|
sendHttpGetRequest("http://10.2.113.7/tgi/return.tgi?command=2a3109f6071576")
|
2019-04-12 00:23:40 +02:00
|
|
|
logInfo('beamer', 'Switch to input HDMI2')
|
2019-04-11 22:25:05 +02:00
|
|
|
}
|
|
|
|
end
|
2019-04-12 00:23:40 +02:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
rule "Screen up"
|
|
|
|
when
|
|
|
|
Item chill_zone_screen_button_up received command ON
|
|
|
|
then
|
|
|
|
logInfo('screen', 'Screen up')
|
|
|
|
Thread::sleep(2000)
|
|
|
|
chill_zone_screen_button_up.sendCommand(OFF)
|
|
|
|
end
|
|
|
|
|
|
|
|
rule "Screen stop"
|
|
|
|
when
|
|
|
|
Item chill_zone_screen_button_stop received command ON
|
|
|
|
then
|
|
|
|
logInfo('screen', 'Screen stop')
|
|
|
|
Thread::sleep(2000)
|
|
|
|
chill_zone_screen_button_stop.sendCommand(OFF)
|
|
|
|
end
|
|
|
|
|
|
|
|
rule "Screen down"
|
|
|
|
when
|
|
|
|
Item chill_zone_screen_button_down received command ON
|
|
|
|
then
|
|
|
|
logInfo('screen', 'Screen down')
|
|
|
|
Thread::sleep(2000)
|
|
|
|
chill_zone_screen_button_down.sendCommand(OFF)
|
|
|
|
end
|