OpenHAB unterstützt Sony-Beamer

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    • OpenHAB unterstützt Sony-Beamer

      Hi,
      im August habe ich im openHAB-Forum um die Implementierung eines Bindings für Sony-Beamer gebeten.
      community.openhab.org/t/binding-for-sony-beamers/49207

      Darauf hin wurde tatsächlich im Dezember mit der Umsetzung begonnen. Das Binding wird auf github gehostet.


      Es funktioniert soweit. Der Sony-Beamer lässt sich jetzt per Regel ein und ausschalten. Als Beispiel hier mein Rule (Regel):
      Somit wird bei einschalten des AVRs der Beamer eingeschaltet und viel wichtiger, bei Verlassen des Kinos ( AVR wird ausgeschaltet) wird der Beamer sauber runter gefahren, bevor ich dann 2 Minuten später die Stromzufuhr des Beamers kappe.

      Quellcode

      1. rule "AVR im Kino ist Online"
      2. when
      3. //Thing "yamahareceiver:yamahaAV:Yamaha_KNO" changed to ONLINE
      4. Item Yamaha_KNO_Power changed to ON
      5. then
      6. Beamer_pwr.sendCommand("ON")
      7. logInfo("yamaha.rules", "AVR im Kino ist ONLINE")
      8. end
      9. rule "AVR im Kino ist Offline"
      10. when
      11. //Thing "yamahareceiver:yamahaAV:Yamaha_KNO" changed to ONLINE
      12. Item Yamaha_KNO_Power changed to OFF
      13. then
      14. Beamer_pwr.sendCommand("OFF")
      15. logInfo("yamaha.rules", "AVR im Kino ist OFFLINE")
      16. end
      Alles anzeigen

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von DoXer ()

    • Ich klinke mich mal hier mit ein. Ich nutze auch OpenHAB zur Fernsteuerung u.a. von Kodi, VU+, Marantz AV7705, diversen Homematic-Komponenten, etc. Unter anderem steuere ich auch einen JVC X7900 damit an. 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):

      Quellcode

      1. String jvc_x7900 { tcp=">[IP:20554:]" }
      2. String jvc_x7900_send_command
      3. String jvc_x7900_power_state
      4. String jvc_x7900_input_source
      5. String jvc_x7900_lamp_power
      6. String jvc_x7900_anamorphic

      Rules:

      Quellcode

      1. rule "Send Command"
      2. when
      3. Item jvc_x7900_send_command received command
      4. then
      5. logInfo("Send Command", "Sending command '" + receivedCommand + "' to X7900")
      6. if(receivedCommand == "REQUEST_POWER_STATE")
      7. {
      8. jvc_x7900.sendCommand("PJREQ")
      9. createTimer(now.plusMillis(500))[|
      10. jvc_x7900.sendCommand('\u003F\u0089\u0001\u0050\u0057\u000A') // request power state
      11. createTimer(now.plusMillis(500))[|
      12. if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u0057\u000A\u0040\u0089\u0001\u0050\u0057\u0030\u000A") // 30 means off
      13. {
      14. logInfo("RequestPowerState", "State of X7900 is 'OFF'")
      15. jvc_x7900_power_state.postUpdate("OFF")
      16. }
      17. else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u0057\u000A\u0040\u0089\u0001\u0050\u0057\u0031\u000A") // 31 means on
      18. {
      19. logInfo("RequestPowerState", "State of X7900 is 'ON'")
      20. jvc_x7900_power_state.postUpdate("ON")
      21. }
      22. else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u0057\u000A\u0040\u0089\u0001\u0050\u0057\u0032\u000A") // 32 means cooling
      23. {
      24. logInfo("RequestPowerState", "State of X7900 is 'COOLING'")
      25. jvc_x7900_power_state.postUpdate("COOLING")
      26. }
      27. else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u0057\u000A\u0040\u0089\u0001\u0050\u0057\u0033\u000A") // 33 means starting
      28. {
      29. logInfo("RequestPowerState", "State of X7900 is 'STARTING'")
      30. jvc_x7900_power_state.postUpdate("STARTING")
      31. }
      32. else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u0057\u000A\u0040\u0089\u0001\u0050\u0057\u0034\u000A") // 34 means emergency
      33. {
      34. logInfo("RequestPowerState", "State of X7900 is 'EMERGENCY'")
      35. jvc_x7900_power_state.postUpdate("EMERGENCY")
      36. }
      37. else
      38. {
      39. logInfo("RequestPowerState", "State of X7900 is 'UNKNOWN'")
      40. jvc_x7900_power_state.postUpdate("UNKNOWN")
      41. }
      42. ]
      43. ]
      44. }
      45. else if(receivedCommand == "POWER_ON")
      46. {
      47. jvc_x7900.sendCommand("PJREQ")
      48. createTimer(now.plusMillis(500))[|
      49. jvc_x7900.sendCommand('\u0021\u0089\u0001\u0050\u0057\u0031\u000A') // power on
      50. createTimer(now.plusMillis(1000))[|
      51. jvc_x7900_send_command.sendCommand("REQUEST_POWER_STATE")
      52. ]
      53. ]
      54. }
      55. else if(receivedCommand == "POWER_OFF")
      56. {
      57. jvc_x7900.sendCommand("PJREQ")
      58. createTimer(now.plusMillis(500))[|
      59. jvc_x7900.sendCommand('\u0021\u0089\u0001\u0050\u0057\u0030\u000A') // power off
      60. createTimer(now.plusMillis(1000))[|
      61. jvc_x7900_send_command.sendCommand("REQUEST_POWER_STATE")
      62. ]
      63. ]
      64. }
      65. else if(receivedCommand == "REQUEST_INPUT_SOURCE")
      66. {
      67. jvc_x7900.sendCommand("PJREQ")
      68. createTimer(now.plusMillis(500))[|
      69. jvc_x7900.sendCommand('\u003F\u0089\u0001\u0049\u0050\u000A') // request input source
      70. createTimer(now.plusMillis(500))[|
      71. if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0049\u0050\u000A\u0040\u0089\u0001\u0049\u0050\u0036\u000A") // 36 means HDMI 1
      72. {
      73. logInfo("RequestInput", "Input Source of X7900 is 'HDMI 1'")
      74. jvc_x7900_input_source.postUpdate("HDMI 1")
      75. }
      76. else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0049\u0050\u000A\u0040\u0089\u0001\u0049\u0050\u0037\u000A") // 37 means HDMI 2
      77. {
      78. logInfo("RequestInput", "Input Source of X7900 is 'HDMI 2'")
      79. jvc_x7900_input_source.postUpdate("HDMI 2")
      80. }
      81. else
      82. {
      83. logInfo("RequestInput", "Input Source of X7900 is 'UNKNOWN'")
      84. jvc_x7900_input_source.postUpdate("UNKNOWN")
      85. }
      86. ]
      87. ]
      88. }
      89. else if(receivedCommand == "SET_INPUT_HDMI1")
      90. {
      91. jvc_x7900.sendCommand("PJREQ")
      92. createTimer(now.plusMillis(500))[|
      93. jvc_x7900.sendCommand('\u0021\u0089\u0001\u0049\u0050\u0036\u000A') // HMDI 1
      94. createTimer(now.plusMillis(1000))[|
      95. jvc_x7900_send_command.sendCommand("REQUEST_INPUT_SOURCE")
      96. ]
      97. ]
      98. }
      99. else if(receivedCommand == "SET_INPUT_HDMI2")
      100. {
      101. jvc_x7900.sendCommand("PJREQ")
      102. createTimer(now.plusMillis(500))[|
      103. jvc_x7900.sendCommand('\u0021\u0089\u0001\u0049\u0050\u0037\u000A') // HMDI 2
      104. createTimer(now.plusMillis(1000))[|
      105. jvc_x7900_send_command.sendCommand("REQUEST_INPUT_SOURCE")
      106. ]
      107. ]
      108. }
      109. else if(receivedCommand == "REQUEST_LAMP_POWER")
      110. {
      111. jvc_x7900.sendCommand("PJREQ")
      112. createTimer(now.plusMillis(500))[|
      113. jvc_x7900.sendCommand('\u003F\u0089\u0001\u0050\u004D\u004C\u0050\u000A') // request lamp power
      114. createTimer(now.plusMillis(500))[|
      115. if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u004D\u000A\u0040\u0089\u0001\u0050\u004D\u0030\u000A") // 30 means NORMAL
      116. {
      117. logInfo("RequestLampPower", "Lamp Power of X7900 is 'NORMAL'")
      118. jvc_x7900_lamp_power.postUpdate("normal")
      119. }
      120. else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0050\u004D\u000A\u0040\u0089\u0001\u0050\u004D\u0031\u000A") // 31 means HIGH
      121. {
      122. logInfo("RequestLampPower", "Lamp Power of X7900 is 'HIGH'")
      123. jvc_x7900_lamp_power.postUpdate("hoch")
      124. }
      125. else
      126. {
      127. logInfo("RequestLampPower", "Lamp Power of X7900 is 'UNKNOWN'")
      128. jvc_x7900_lamp_power.postUpdate("unbekannt")
      129. }
      130. ]
      131. ]
      132. }
      133. else if(receivedCommand == "SET_LAMP_POWER_NORMAL")
      134. {
      135. jvc_x7900.sendCommand("PJREQ")
      136. createTimer(now.plusMillis(500))[|
      137. jvc_x7900.sendCommand('\u0021\u0089\u0001\u0050\u004D\u004C\u0050\u0030\u000A') // Lamp Power Normal
      138. createTimer(now.plusMillis(1000))[|
      139. jvc_x7900_send_command.sendCommand("REQUEST_LAMP_POWER")
      140. ]
      141. ]
      142. }
      143. else if(receivedCommand == "SET_LAMP_POWER_HIGH")
      144. {
      145. jvc_x7900.sendCommand("PJREQ")
      146. createTimer(now.plusMillis(500))[|
      147. jvc_x7900.sendCommand('\u0021\u0089\u0001\u0050\u004D\u004C\u0050\u0031\u000A') // Lamp Power High
      148. createTimer(now.plusMillis(1000))[|
      149. jvc_x7900_send_command.sendCommand("REQUEST_LAMP_POWER")
      150. ]
      151. ]
      152. }
      153. else if(receivedCommand == "REQUEST_ANAMORPHIC")
      154. {
      155. jvc_x7900.sendCommand("PJREQ")
      156. createTimer(now.plusMillis(500))[|
      157. jvc_x7900.sendCommand('\u003F\u0089\u0001\u0049\u004E\u0056\u0053\u000A') // request anamorphic
      158. createTimer(now.plusMillis(500))[|
      159. if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0049\u004E\u000A\u0040\u0089\u0001\u0049\u004E\u0031\u000A") // 31 means anamorphic A
      160. {
      161. logInfo("RequestAnamorphic", "Anamorphic Mode of X7900 is 'A'")
      162. jvc_x7900_anamorphic.postUpdate("aktiv")
      163. }
      164. else if (jvc_x7900.state.toString() == "\u0006\u0089\u0001\u0049\u004E\u000A\u0040\u0089\u0001\u0049\u004E\u0030\u000A") // 30 means off
      165. {
      166. logInfo("RequestAnamorphic", "Anamorphic Mode of X7900 is 'OFF'")
      167. jvc_x7900_anamorphic.postUpdate("aus")
      168. }
      169. else
      170. {
      171. logInfo("RequestAnamorphic", "Anamorphic Mode of X7900 is 'UNKNOWN'")
      172. jvc_x7900_anamorphic.postUpdate("unbekannt")
      173. }
      174. ]
      175. ]
      176. }
      177. else if(receivedCommand == "SET_ANAMORPHIC_ON")
      178. {
      179. jvc_x7900.sendCommand("PJREQ")
      180. createTimer(now.plusMillis(500))[|
      181. jvc_x7900.sendCommand('\u0021\u0089\u0001\u0049\u004E\u0056\u0053\u0031\u000A') // Anamorphic A
      182. createTimer(now.plusMillis(1000))[|
      183. jvc_x7900_send_command.sendCommand("REQUEST_ANAMORPHIC")
      184. ]
      185. ]
      186. }
      187. else if(receivedCommand == "SET_ANAMORPHIC_OFF")
      188. {
      189. jvc_x7900.sendCommand("PJREQ")
      190. createTimer(now.plusMillis(500))[|
      191. jvc_x7900.sendCommand('\u0021\u0089\u0001\u0049\u004E\u0056\u0053\u0030\u000A') // Anamorphic OFF
      192. createTimer(now.plusMillis(1000))[|
      193. jvc_x7900_send_command.sendCommand("REQUEST_ANAMORPHIC")
      194. ]
      195. ]
      196. }
      197. else if(receivedCommand == "SELECT_LENS_MEMORY_1")
      198. {
      199. jvc_x7900.sendCommand("PJREQ")
      200. createTimer(now.plusMillis(500))[|
      201. jvc_x7900.sendCommand('\u0021\u0089\u0001\u0049\u004E\u004D\u004C\u0030\u000A') // Lens Memory 1
      202. ]
      203. }
      204. else if(receivedCommand == "SELECT_LENS_MEMORY_2")
      205. {
      206. jvc_x7900.sendCommand("PJREQ")
      207. createTimer(now.plusMillis(500))[|
      208. jvc_x7900.sendCommand('\u0021\u0089\u0001\u0049\u004E\u004D\u004C\u0031\u000A') // Lens Memory 2
      209. ]
      210. }
      211. 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
    Abonnement verwalten