PanasonicTV / OH3

Thanks. I didn’t notice both services had different UDNs. I had to refactor a little bit, so you need todelete the thing and re-discover it.

Openhab 3.0.0.M4

START LEVEL 100 , List Threshold: 50
 ID β”‚ State  β”‚ Lvl β”‚ Version            β”‚ Name
────┼────────┼─────┼────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
217 β”‚ Active β”‚  80 β”‚ 3.0.0.202012012011 β”‚ openHAB Add-ons :: Bundles :: Panasonic TV Binding

deleted all items and things

18:08 start openhab with tv already on
OK: inbox discovers the thing
had to input the UIDs manually. I discovered them with gupnp and they are displayed in the thing properties as hostname (remote controller) and udn (media renderer).

UID: panasonictv:tv:4D454930_2D0100_2D1000_2D8001_2DA813742A3472
label: 40CX680_Series
thingTypeUID: panasonictv:tv
configuration:
  refreshInterval: 1000
  remoteControllerUdn: 4D454930-0200-1000-8001-A813742A3472
  mediaRendererUdn: 4D454930-0100-1000-8001-A813742A3472

08:13 adding items for channels
OK: volume, mute and hdmi switching is working
OK: volume, mute updates with the tv remote are detected

08:15 switch off tv
thing stays β€œonline”
later it changes to β€œerror: comm”
items volume, mute, hdmi switching not working

18:18 shutdown openhab; tv is off
start openhab
18:19 switch tv on
thing is β€œerror: comm”

events.log (8.2 KB) openhab.log (579.0 KB)

fixed

looks ok. it seems the TV is not sending an off message, so we only know it’s off if the polling fails. buttons not working if device is off is expected and can’t be fixed (unless we find a way to wakeup the TV. You could try with the network binding and Wake-On-LAN, if that works, we can implement it.)

It seems the device is not sending a presence announcement when it’s turned on again. I added a search if the device is not found.I’m not sure that’ll work but we can try. Updated the link.

START LEVEL 100 , List Threshold: 50
 ID β”‚ State  β”‚ Lvl β”‚ Version            β”‚ Name
────┼────────┼─────┼────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
217 β”‚ Active β”‚  80 β”‚ 3.0.0.202012031058 β”‚ openHAB Add-ons :: Bundles :: Panasonic TV Binding

13:23 tv is on
start openhab
OK: thing is discovered in inbox
OK: UDNs are inserted automatically
OK: created items from channels
NOT OK: items volume and mute not working
OK: keyCode item is switching hdmi

13:26 restart openhab; tv still on
OK: items volume, mute, keyCode now working

13:28 switch off tv
NOT OK: thing stays online
13:29 switch on tv
NOT OK: thing changes to β€œerror: comm”
NOT OK: item volume, mute not working
OK: item keyCode switches hdmi

The Media Renderer seems to stay offline or re-initialization failed.

I sometimes see these events with gupnp. But especially the shutdown seems not always be sent. Maybe the tv powers off faster than sending the events. After switching the tv on an already running gupnp does not pick up the services. Maybe the tv does not announce via upnp, if such a concept exists. I don’t know too much about upnp.

Switch off:
13:34 40CX680_Series urn:upnp-org:serviceId:p00NetworkControl X_ScreenState off

Switch on: 
13:31 40CX680_Series urn:upnp-org:serviceId:p00NetworkControl X_ScreenState on

events.log (11.4 KB) openhab.log (744.8 KB)

I fixed some of the bug, will upload a new version later today. The β€žno response receivedβ€œ errors look strange. I have the feeling that we are hunting unicorns here.

Can you describe your setup? Is the TV on the same subnet as the OH machine? Is OH directly connected to the network interface or are you using something like docker or another virtualization? The last time I have seen that was with my Sonos devices and a very short TTL on the packets which resulted in discarded packets.

Also please try 10s for polling interval (with the new version later). The order of the log entries makes me wonder if the polling in 1s intervals leads to overlapping requests.

Openhab is installed on my test fedora 33 notebook. Both notebook and tv are connected via wlan. In this case no switch in between, only the fritzbox router. Depending on the location of the notebook it may connect via another wlan access point. In this case packets are routed through the access point, a switch, the fritzbox and the tv.
Whole network is on the same subnet. Broadcasts and multicasts may be dropped on the switch. I have to check that. But then upnp should not work at all. And the Hue bridge is behind the switch and is found by the binding. So multicast should work.

No docker, no virtualization. Just OpenJDK 11.0.9.1 installed from package manager and openhab https://openhab.jfrog.io/openhab/libs-milestone-local/org/openhab/distro/openhab/3.0.0.M4/openhab-3.0.0.M4.zip unzipped to a directory in my user home.
I have to switch off the notebook firewalld. Otherwise no upnp is working as stated in the earlier posts. Had not figured out how to configure the firewalld to allow upnp but this does not bother me as the final system should be an openhabian raspberry.

Strange thing is that the binding is working fine, if the tv is on during openhab startup. As soon as the tv was switched off and on again the binding can not or only partially connect to the various upnp services.

The problem is that jupnp is not detecting the thing anymore and the service can’t be registered. Can you

tcpdump -i eth0 host 192.168.0.168 -v -A (of course, exchange network interface and IP of the TV with the correct values)

and check if there is really no answer from the device? You can also enable TRACE logging on org.jupnp and see if all packets that you see in the tcpdump also appear in the log. I have also updated the bundle.

Hi there,

luckily I found this post and I installed the binding. I have 2 Panasonic TV’s and I was a little bit frustrated that I lost the support for them with OH3 - although I knew it in advance.

I’ll try it with both …

What I found out so far:

Binding is not shown in the list of installed bindings (intentionally? - since it is not β€œofficial”)

It’s also not shown in the list of available bindings although it’s installed:

Nevertheless bot TV’s were detected an showed up in the inbox, things were created:

Remark: they showed up only after I turned them on although they are available on the network in standby. They were available with the old 1.x binding and they are available in the Panasonic Android app even if they are off.

For the rest I’ll see how it will work in the daily usage.

Thanks
Christoph

Manually installed bindings never show up in the list. Thatβ€˜s expected.

Unfortunately the binding will not make it into the distribution. At least not until someone picks it up and finishes it.

Just in case somebody’s OH3 migration is blocked due to the unfinished Panasonic TV binding…

I created a quick and dirty workaround mqtt-tools/vieramq at master Β· magcode/mqtt-tools Β· GitHub

You need to have MQTT set up and the functionality is limited to β€œsend commands” only.

I have very limited time but I’m willing to take a try on debugging and finishing the binding. Where can I grab the current source code?

Current workaround for the snapshot version is to change the tv settings to allow it to be switched on by app. Then the tv does not switch off completely and keeps its network stack running. Therefor the tv is not unreachable for the binding and upnp discovery finds it.

J-N-K/openhab-addons at panasonictv (github.com)

Happy if you take over. I’ll not finish this.

I had a look at this binding today and tried to make it get the state of my TV but didn’t succeed. Anyways, as I only need that feature I’ll just create a new binding for myself which allows turning the TV on and off and gets the state from the TV.

If you can solve this I’m very interested in the solution. After power off and on the binding can not register the tv again.

I have a working binding that most likely only works on 1 TV and only offers on/off status and commands, nothing else. Is that really what you want/need?

Yes I’m interested. Maybe I can use that code with the binding and finish it.

1 Like

@Flole any chance of posting your work in progress binding. all I need is the ability to turn a Panasonic tv on from a power off state so this would be perfect for me! having to get up to turn the master bedroom tv on when you are cosy in bed sucks since upgrading to OH3

1 Like

Found something in the code.
Scenario: TV is off. Openhab is running and tv is switched on.
Openhab (exactly the jupnp bundle) finds the newly started upnp device. Jupnp then tries to load the service descriptor via HTTP GET from the tv. But this request fails. Maybe the upnp notification is sent from the tv before it’s webserver is fully functional.
The failed request results in the jupnp AbstractStreamClient to wait for 10 minutes until it tries again to download the service descriptor. The device will not be registered until the service description was successfully loaded.
The binding is working fine if you can wait these 10 minutes after power on.

Now I have to figure out something to mitigate this.
Any idea?

Logs and hints: panasonic.txt (67.7 KB)

Thought I would weigh-in here to share my experience with Panasonic TV Binding. I’ve been using OH 2.5 (1.x Binding) and now OH3 (3.x binding) to control basic functions on my VT60 Plasma. I do find that it can take up to 30 seconds for the TV web server to fully come to life. I am using a ProxySwitch item to trigger a rule that toggles the TV OFF/ON. For starting the TV once the TV shutdowns I have no access to the web server to turn it on. What I do is test if the TV is OFF by pinging the IP. If I get favorable response then the TV is ON, otherwise it is OFF. If it is OFF I send a WOL to turn it ON. To turn it OFF I just send the KeyCode for NRC-OFF command to the TV. I am also able to select the video input through KeyCodes. I am also controlling Volume and Mute. I’m sure I could do more through KeyCodes and Rules, but that is all I really need from OH. It took me a long time to determine how to best handle the PowerON/PowerOFF cycle, but what I now have does work for my needs and the binding performs well. The Panasonic VT60 is a very peculiar device because unlike my Receiver it isn’t possible to access the TV web server when it is in StandBy/OFF state, so a work around is needed.

To test my theory I changed the retryAfterSeconds to 20 in the JUPNP library AbstractStreamClientConfiguration.java. The tv device is registered 20 seconds after power on.

A forum search shows other bindings have this problem too. e.g. Kodi takes sometimes up to 15 minutes to come online - #3 by djpsycho82 and Too much time before a Sonos thing becomes definitively ONLINE - #22 by morph166955. Someone even mentioned to restart the jupnp bundle with a rule.

@J-N-K Can you give me some tips on how to change this code? Where to create a issue? How to create a suitable pull request? Or someone to discuss a possible solution. I assume the 10 minute retry was set for a good reason.

1 Like