Add the remote control for the projector screen

master
slopjong 2019-04-12 00:23:40 +02:00
parent 40e77b1fed
commit f70e47e415
3 changed files with 70 additions and 0 deletions

View File

@ -16,6 +16,7 @@ Switch engineering_table_lamps "Table Lamps" <lightbulb> (engineering)
Switch engineering_ceiling_lamps "Ceiling Lamps" <lightbulb> (engineering) { channel="mqtt:topic:engineering_ceiling_lamps:power" } Switch engineering_ceiling_lamps "Ceiling Lamps" <lightbulb> (engineering) { channel="mqtt:topic:engineering_ceiling_lamps:power" }
Switch engineering_status_lamp "Status Lamp" <lightbulb> (engineering) { channel="mqtt:topic:engineering_status_lamp:power" } Switch engineering_status_lamp "Status Lamp" <lightbulb> (engineering) { channel="mqtt:topic:engineering_status_lamp:power" }
// ----------------------------------------------------------------------------
// If ChromeCast doesn't work you have to link this item with the Chromecast channel manually // If ChromeCast doesn't work you have to link this item with the Chromecast channel manually
String chill_zone_chromecast_appid String chill_zone_chromecast_appid
@ -27,6 +28,22 @@ String chill_zone_chromecast_status
"Chromecast Status [%s]" "Chromecast Status [%s]"
{ channel="chromecast:chromecast:b000d809ccb35a409a3dd3d14e0fbf08:statustext" } { channel="chromecast:chromecast:b000d809ccb35a409a3dd3d14e0fbf08:statustext" }
// ----------------------------------------------------------------------------
Switch chill_zone_beamer Switch chill_zone_beamer
"Beamer" "Beamer"
(chill_zone) (chill_zone)
// ----------------------------------------------------------------------------
Switch chill_zone_screen_button_up
"Screen up"
{ channel="mqtt:topic:chill_zone_screen:up", autoupdate="false" }
Switch chill_zone_screen_button_stop
"Screen stop"
{ channel="mqtt:topic:chill_zone_screen:stop", autoupdate="false" }
Switch chill_zone_screen_button_down
"Screen down"
{ channel="mqtt:topic:chill_zone_screen:down", autoupdate="false" }

View File

@ -17,17 +17,51 @@ then
logInfo("beamer", "Beamer state: {}", beamerStatus) logInfo("beamer", "Beamer state: {}", beamerStatus)
end end
// ----------------------------------------------------------------------------
rule "Chromecast changed" rule "Chromecast changed"
when when
Item chill_zone_chromecast_status changed Item chill_zone_chromecast_status changed
then then
chill_zone_beamer.sendCommand("ON") chill_zone_beamer.sendCommand("ON")
chill_zone_screen_button_down.sendCommand("ON")
val app = chill_zone_chromecast_status.state.toString val app = chill_zone_chromecast_status.state.toString
if (app === null || app == UNDEF || app == 'UNDEF' || app == '' ) { if (app === null || app == UNDEF || app == 'UNDEF' || app == '' ) {
// set input to DVI - hackerspace video // set input to DVI - hackerspace video
sendHttpGetRequest("http://10.2.113.7/tgi/return.tgi?command=2a3109f6070566") sendHttpGetRequest("http://10.2.113.7/tgi/return.tgi?command=2a3109f6070566")
logInfo('beamer', 'Switch to input DVI')
} else { } else {
// set input to HDMI2 - chromecast // set input to HDMI2 - chromecast
sendHttpGetRequest("http://10.2.113.7/tgi/return.tgi?command=2a3109f6071576") sendHttpGetRequest("http://10.2.113.7/tgi/return.tgi?command=2a3109f6071576")
logInfo('beamer', 'Switch to input HDMI2')
} }
end end
// ----------------------------------------------------------------------------
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

View File

@ -15,6 +15,23 @@ Bridge mqtt:broker:mosquitto "Mosquitto" [
] ]
} }
// ----------------------------------------------------------------------------
Thing topic chill_zone_screen "Screen" @ "Chill Zone" {
Channels:
Type switch : up "Up" [
commandTopic="cmnd/chill_zone/screen/Power1"
]
Type switch : stop "Stop" [
commandTopic="cmnd/chill_zone/screen/Power2"
]
Type switch : down "Down" [
commandTopic="cmnd/chill_zone/screen/Power3"
]
}
Thing topic chill_zone_lamps "Lamps" @ "Chill zone" { Thing topic chill_zone_lamps "Lamps" @ "Chill zone" {
Channels: Channels:
Type switch : power "Power" [ Type switch : power "Power" [
@ -22,6 +39,8 @@ Bridge mqtt:broker:mosquitto "Mosquitto" [
] ]
} }
// ----------------------------------------------------------------------------
Thing topic engineering_table_lamps "Engineering Table Lamps" @ "Engineering" { Thing topic engineering_table_lamps "Engineering Table Lamps" @ "Engineering" {
Channels: Channels:
Type switch : power "Power" [ Type switch : power "Power" [