Ich steuere den X7900 direkt per OpenHab an. Im alten Forum hatte ich mal folgendes gepostet:
Da die Implementierung der Schnittstelle ein bisschen frickelig war, hier zur Info, vielleicht hilft es ja jemandem weiter:
Items (IP ist durch entsprechende Adresse zu ersetzen):
String jvc_x7900 { tcp=">[IP:20554:]" }
String jvc_x7900_send_command
String jvc_x7900_power_state
String jvc_x7900_input_source
String jvc_x7900_lamp_power
String jvc_x7900_anamorphic
Rules:
rule "Send Command"
when
Item jvc_x7900_send_command received command
then
logInfo("Send Command", "Sending command '" + receivedCommand + "' to X7900")
if(receivedCommand == "REQUEST_POWER_STATE")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u003F\u0089\u0001\u0050\u0057\u000A') // request power state
createTimer(now.plusMillis(500))[|
if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u0057\u000A\u0040\u0089\u0001\u0050\u0057\u0030\u000A") // 30 means off
{
logInfo("RequestPowerState", "State of X7900 is 'OFF'")
jvc_x7900_power_state.postUpdate("OFF")
}
else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u0057\u000A\u0040\u0089\u0001\u0050\u0057\u0031\u000A") // 31 means on
{
logInfo("RequestPowerState", "State of X7900 is 'ON'")
jvc_x7900_power_state.postUpdate("ON")
}
else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u0057\u000A\u0040\u0089\u0001\u0050\u0057\u0032\u000A") // 32 means cooling
{
logInfo("RequestPowerState", "State of X7900 is 'COOLING'")
jvc_x7900_power_state.postUpdate("COOLING")
}
else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u0057\u000A\u0040\u0089\u0001\u0050\u0057\u0033\u000A") // 33 means starting
{
logInfo("RequestPowerState", "State of X7900 is 'STARTING'")
jvc_x7900_power_state.postUpdate("STARTING")
}
else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u0057\u000A\u0040\u0089\u0001\u0050\u0057\u0034\u000A") // 34 means emergency
{
logInfo("RequestPowerState", "State of X7900 is 'EMERGENCY'")
jvc_x7900_power_state.postUpdate("EMERGENCY")
}
else
{
logInfo("RequestPowerState", "State of X7900 is 'UNKNOWN'")
jvc_x7900_power_state.postUpdate("UNKNOWN")
}
]
]
}
else if(receivedCommand == "POWER_ON")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u0021\u0089\u0001\u0050\u0057\u0031\u000A') // power on
createTimer(now.plusMillis(1000))[|
jvc_x7900_send_command.sendCommand("REQUEST_POWER_STATE")
]
]
}
else if(receivedCommand == "POWER_OFF")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u0021\u0089\u0001\u0050\u0057\u0030\u000A') // power off
createTimer(now.plusMillis(1000))[|
jvc_x7900_send_command.sendCommand("REQUEST_POWER_STATE")
]
]
}
else if(receivedCommand == "REQUEST_INPUT_SOURCE")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u003F\u0089\u0001\u0049\u0050\u000A') // request input source
createTimer(now.plusMillis(500))[|
if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0049\u0050\u000A\u0040\u0089\u0001\u0049\u0050\u0036\u000A") // 36 means HDMI 1
{
logInfo("RequestInput", "Input Source of X7900 is 'HDMI 1'")
jvc_x7900_input_source.postUpdate("HDMI 1")
}
else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0049\u0050\u000A\u0040\u0089\u0001\u0049\u0050\u0037\u000A") // 37 means HDMI 2
{
logInfo("RequestInput", "Input Source of X7900 is 'HDMI 2'")
jvc_x7900_input_source.postUpdate("HDMI 2")
}
else
{
logInfo("RequestInput", "Input Source of X7900 is 'UNKNOWN'")
jvc_x7900_input_source.postUpdate("UNKNOWN")
}
]
]
}
else if(receivedCommand == "SET_INPUT_HDMI1")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u0021\u0089\u0001\u0049\u0050\u0036\u000A') // HMDI 1
createTimer(now.plusMillis(1000))[|
jvc_x7900_send_command.sendCommand("REQUEST_INPUT_SOURCE")
]
]
}
else if(receivedCommand == "SET_INPUT_HDMI2")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u0021\u0089\u0001\u0049\u0050\u0037\u000A') // HMDI 2
createTimer(now.plusMillis(1000))[|
jvc_x7900_send_command.sendCommand("REQUEST_INPUT_SOURCE")
]
]
}
else if(receivedCommand == "REQUEST_LAMP_POWER")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u003F\u0089\u0001\u0050\u004D\u004C\u0050\u000A') // request lamp power
createTimer(now.plusMillis(500))[|
if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u004D\u000A\u0040\u0089\u0001\u0050\u004D\u0030\u000A") // 30 means NORMAL
{
logInfo("RequestLampPower", "Lamp Power of X7900 is 'NORMAL'")
jvc_x7900_lamp_power.postUpdate("normal")
}
else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u004D\u000A\u0040\u0089\u0001\u0050\u004D\u0031\u000A") // 31 means HIGH
{
logInfo("RequestLampPower", "Lamp Power of X7900 is 'HIGH'")
jvc_x7900_lamp_power.postUpdate("hoch")
}
else
{
logInfo("RequestLampPower", "Lamp Power of X7900 is 'UNKNOWN'")
jvc_x7900_lamp_power.postUpdate("unbekannt")
}
]
]
}
else if(receivedCommand == "SET_LAMP_POWER_NORMAL")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u0021\u0089\u0001\u0050\u004D\u004C\u0050\u0030\u000A') // Lamp Power Normal
createTimer(now.plusMillis(1000))[|
jvc_x7900_send_command.sendCommand("REQUEST_LAMP_POWER")
]
]
}
else if(receivedCommand == "SET_LAMP_POWER_HIGH")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u0021\u0089\u0001\u0050\u004D\u004C\u0050\u0031\u000A') // Lamp Power High
createTimer(now.plusMillis(1000))[|
jvc_x7900_send_command.sendCommand("REQUEST_LAMP_POWER")
]
]
}
else if(receivedCommand == "REQUEST_ANAMORPHIC")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u003F\u0089\u0001\u0049\u004E\u0056\u0053\u000A') // request anamorphic
createTimer(now.plusMillis(500))[|
if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0049\u004E\u000A\u0040\u0089\u0001\u0049\u004E\u0031\u000A") // 31 means anamorphic A
{
logInfo("RequestAnamorphic", "Anamorphic Mode of X7900 is 'A'")
jvc_x7900_anamorphic.postUpdate("aktiv")
}
else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0049\u004E\u000A\u0040\u0089\u0001\u0049\u004E\u0030\u000A") // 30 means off
{
logInfo("RequestAnamorphic", "Anamorphic Mode of X7900 is 'OFF'")
jvc_x7900_anamorphic.postUpdate("aus")
}
else
{
logInfo("RequestAnamorphic", "Anamorphic Mode of X7900 is 'UNKNOWN'")
jvc_x7900_anamorphic.postUpdate("unbekannt")
}
]
]
}
else if(receivedCommand == "SET_ANAMORPHIC_ON")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u0021\u0089\u0001\u0049\u004E\u0056\u0053\u0031\u000A') // Anamorphic A
createTimer(now.plusMillis(1000))[|
jvc_x7900_send_command.sendCommand("REQUEST_ANAMORPHIC")
]
]
}
else if(receivedCommand == "SET_ANAMORPHIC_OFF")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u0021\u0089\u0001\u0049\u004E\u0056\u0053\u0030\u000A') // Anamorphic OFF
createTimer(now.plusMillis(1000))[|
jvc_x7900_send_command.sendCommand("REQUEST_ANAMORPHIC")
]
]
}
else if(receivedCommand == "SELECT_LENS_MEMORY_1")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u0021\u0089\u0001\u0049\u004E\u004D\u004C\u0030\u000A') // Lens Memory 1
]
}
else if(receivedCommand == "SELECT_LENS_MEMORY_2")
{
jvc_x7900.sendCommand("PJREQ")
createTimer(now.plusMillis(500))[|
jvc_x7900.sendCommand('\u0021\u0089\u0001\u0049\u004E\u004D\u004C\u0031\u000A') // Lens Memory 2
]
}
end
Alles anzeigen
Das TCP Binding ist notwendig und muss installiert sein. In services\tcp.conf habe ich updatewithresponse auf true gesetzt, damit ich auch die Acknowledges des JVCs im Logging sehen kann.
Im HabPanel sind entsprechend der in den Rules verwendeten Strings Kommandos zu senden, z.B. sendCmd('jvc_x7900_send_command', 'POWER_ON'). Stati können entsprechend abgefragt und visualiert werden, z.B. itemValue('jvc_x7900_power_state'). Weitere erforderliche Befehle können natürlich beliebig ergänzt werden. Die Hex-Codes findet man im JVC D-ILA Remote Control Guide, der an diversen Stellen im Netz herunterladbar ist.
Ich habe nur rudimentäres OpenHAB-Wissen, daher kann ich nur sagen, dass es so funktioniert, aber schön ist vermutlich anders.
Gruß,
fincher