OH3 & panasonictv Binding

Hi there

since the upgrade to OH3 I “lost” the support for my 2 Panasonic TV’s. I knew it in advance but now I found this thread:

PanasonicTV / OH3

I tried it and it seems to work basically.

My question: are there any plans to officially update the old 1.x binding for Panasonic for OH3?

Greetz,
Christoph

If the maintainer/owner of the original 1.x binding doe not contribute a new oh3 binding, there is a very low chance.
Sometimes other contributors step in, like @J-N-K did for the PanasonicTV binding.
But don‘t expect this for all old bindings.
As a temporary solution, setup a second openHAB 2.x instance and connect it to openHAB 3 via the remoteopenhab binding.

The Snapshot version above seems to work at least basically… I’ll give it a try :slight_smile:
Honestly, I don’t really want to setup and maintain a second OH just due to one missing Binding… especially since the old one was also not “perfect” (problematic detection of on / off state which made it difficult to use the items in rules…)

Panasonic will not be finished. I stopped the development of new bindings.

1 Like

That is a pity. :cry:

2 Likes

:frowning: Sorry to hear that. Didn’t find any actual .jar to try out. And I’m not familiar with github and java, so no idea to make a snapshot from source :frowning:

I was also looking for Panasonic TV binding on openHAB 3, but as it’s discontinued so far I’ve ended up with replacement for sending key events implemented in HTTP binding. It does not include discovery, but with making TV IP static works for me.

See here for details
  • http.things:

      Thing http:url:panasonictv "HTTP: Panasonic TV - keys" [
          baseURL="http://10.0.0.118:55000/nrc/control_0/",
          commandMethod="POST",
          contentType="text/xml;charset=utf-8",
          headers="Accept=text/xml",
                  "SOAPAction=\"urn:panasonic-com:service:p00NetworkControl:1#X_SendKey\""] {
    
              Channels:
                  Type string:send_key "Key" [
                      mode="WRITEONLY",
                      commandTransformation="JS:panasonictv_keyevent_body.js"
                  ]
      }
    

where of course 10.0.0.118 need to be replaced with IP of your TV and transformation file ‘panasonictv_keyevent_body.js’ looks as follows:

(function(key) {
    var NRC_KEY_CODES_MAPPING = {
        "POWER"         : "NRC_POWER-ONOFF", // power off only (on tested TV)
        "MUTE"          : "NRC_MUTE-ONOFF",
        "TV_INPUT"      : "NRC_AD_CHANGE-ONOFF", // dvbt input change
        "AV_INPUT"      : "NRC_CHG_INPUT-ONOFF", // hdmi input change

        "VOLDOWN"       : "NRC_VOLDOWN-ONOFF",
        "VOLUP"         : "NRC_VOLUP-ONOFF",
        "VOLUP_ON"      : "NRC_VOLUP-ON",
        "VOLUP_OFF"     : "NRC_VOLUP-OFF",

        "CH_DOWN"       : "NRC_CH_DOWN-ONOFF",
        "CH_UP"         : "NRC_CH_UP-ONOFF",

        "APPS"          : "NRC_APPS-ONOFF",
        "HOME"          : "NRC_HOME-ONOFF",
        "EXIT"          : "NRC_CANCEL-ONOFF",

        "RIGHT"         : "NRC_RIGHT-ONOFF",
        "LEFT"          : "NRC_LEFT-ONOFF",
        "DOWN"          : "NRC_DOWN-ONOFF",
        "UP"            : "NRC_UP-ONOFF",

        "OK"            : "NRC_ENTER-ONOFF", // return button
        "BACK"          : "NRC_RETURN-ONOFF",
        "OPTION"        : "NRC_SUBMENU-ONOFF",

        "3D"            : "NRC_3D-ONOFF",
        "ASPECT"        : "NRC_DISP_MODE-ONOFF", // aspect ratio button
        "MENU"          : "NRC_MENU-ONOFF",
        "GUIDE"         : "NRC_EPG-ONOFF",
        "TEXT"          : "NRC_TEXT-ONOFF",
        "STTL"          : "NRC_STTL-ONOFF",
        "INFO"          : "NRC_INFO-ONOFF",
        "EHELP"         : "NRC_GUIDE-ONOFF", // e-help button

        "1"            : "NRC_D1-ONOFF",
        "2"            : "NRC_D2-ONOFF",
        "3"            : "NRC_D3-ONOFF",
        "4"            : "NRC_D4-ONOFF",
        "5"            : "NRC_D5-ONOFF",
        "6"            : "NRC_D6-ONOFF",
        "7"            : "NRC_D7-ONOFF",
        "8"            : "NRC_D8-ONOFF",
        "9"            : "NRC_D9-ONOFF",
        "0"            : "NRC_D0-ONOFF",

        "LAST_VIEW"    : "NRC_R_TUNE-ONOFF",

        "BLUE"         : "NRC_BLUE-ONOFF",
        "YELLOW"       : "NRC_YELLOW-ONOFF",
        "GREEN"        : "NRC_GREEN-ONOFF",
        "RED"          : "NRC_RED-ONOFF",

        "REW"           : "NRC_REW-ONOFF",
        "PLAY"          : "NRC_PLAY-ONOFF",
        "FF"            : "NRC_FF-ONOFF",
        "SKIP_PREV"     : "NRC_SKIP_PREV-ONOFF",
        "PAUSE"         : "NRC_PAUSE-ONOFF",
        "SKIP_NEXT"     : "NRC_SKIP_NEXT-ONOFF",
        "STOP"          : "NRC_STOP-ONOFF",
        "REC"           : "NRC_REC-ONOFF"
    }
    var soapBody =
        '<?xml version="1.0" encoding="utf-8"?>' +
        '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' +
        '<s:Body>' +
        '<u:X_SendKey xmlns:u="urn:panasonic-com:service:p00NetworkControl:1">'+
        '<X_KeyEvent>'+NRC_KEY_CODES_MAPPING[key]+'</X_KeyEvent>' +
        '</u:X_SendKey>'+
        '</s:Body>'+
        '</s:Envelope>'
    return soapBody
})(input)

Then item declaration:

String PanasonicTV_Remote "TV remote" { channel="http:url:panasonictv:send_key", autoupdate="false"}

and used as follows in the sitemap:

Switch item=PanasonicTV_Remote label="" mappings=["LEFT"="◄","UP"="▲", "DOWN"="▼", "RIGHT"="►"] icon="none"
Switch item=PanasonicTV_Remote label="" mappings=["OK"="OK", "BACK"="Back"] icon="none"
Switch item=PanasonicTV_Remote label="" mappings=["APPS"="APPS", "HOME"="HOME", "EXIT"="EXIT","MENU"="Menu"] icon="none"

or in rules:

PanasonicTV_Remote.sendCommand("AV_INPUT")
PanasonicTV_Remote.sendCommand("OK")
3 Likes

It’s amazing. Thank you so much. Just one additional question: After hit a Button in Sitemap, this button got stuck colored, until in same row another button pressed. Any idea to solve this? I’m not so familiar with http binding. A sendCommand(REFRESH) with a rule doesnt work :frowning:

I have the same issue, but i think it’s more related to:
autoupdate=“false”
not working as expected in item definition in openHAB 3.0, than HTTP binding.

Well, in basic UI it only stays colored, but in App, there is no way to hit same button twice. Can anyone confirm this behavior so we are sure before opening an issue on guthub?

I just did some tries and found a solution working in Basic UI and App too:

  • Change autoupdate in Item-Configuration from RemoteKey to true (> with true you got a trigger for rules, it’s the only qay, because the channel is WRITEONLY)
  • Add rule with trigger RemoteKey changed and RemoteKey.sendCommand(“”) to reset key.

If you like a user experience showing you some better the key got pressed, you can add a Thread::sleep(200) to let openhab wait 0,2 seconds before reset button.

Hope this helps.

1 Like

For me for issue:

no way to hit same button twice

also works expire binding as follows:

String PanasonicTV_Remote "TV remote" { channel="http:url:panasonictv:send_key", autoupdate="false", expire="1s"}

but in Basic UI key remains colored, till reload.

So you have this issue in Web Ort in App? In the App I have this sometimes too, but Never in Web.

I think in App there is a preference for behavior of reloading. Maybe try to change this switch?