PanasonicTV / OH3

Tags: #<Tag:0x00007efec53c0558>

Development stopped, branch left in place for someone to take it

By request I have picked up another binding that is only available as openhab1 version. Since I don’t have a Panasonic TV, this may be a stony road.

A test version is available. BEFORE installing the bundle, check if you have the UPnP extensions installed:

openhab> list | grep -i upnp
215 │ Active │  80 │ 2.5.2                   │ JUPnP Library
216 │ Active │  80 │ 3.0.0.202010250307      │ openHAB Core :: Bundles :: Configuration UPnP Discovery
217 │ Active │  80 │ 3.0.0.202010250307      │ openHAB Core :: Bundles :: UPnP Transport

If these bundles are not available, please install them via

feature:install openhab-transport-upnp

Then set the log-level of the binding to TRACE

log:set TRACE org.openhab.binding.panasonictv

and finally install the bundle:

install <Link removed>
start org.openhab.binding.panasonictv

In case you want to update to a new version

update org.openhab.binding.panasonictv https://janessa.me/esh/org.openhab.binding.panasonictv-3.0.0-SNAPSHOT.jar

If the bundle is not starting (i.e. the state is not Active but either Installed or Resolved), you can manually start it with

start org.openhab.binding.panasonictv

If you report problems, please report the exact bundle version;

openhab> list org.openhab.binding.panasonictv
START LEVEL 100 , List Threshold: 50
 ID │ State  │ Lvl │ Version            │ Name
────┼────────┼─────┼────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
214 │ Active │  80 │ 3.0.0.202011221150 │ openHAB Add-ons :: Bundles :: Panasonic TV Binding

Thanks.

The latest version is: 3.0.0.202012031058

4 Likes

At the moment the most interesting part is if the TV is discovered and if not, what the log says about it. “Thing stays offline” is not enough to debug that.

I will have a look, maybe on weekend. And I can spend more time in about a week or so. Will report.
Any idea how I can contribute to this binding? Maybe some ideas for mocking the tv for tests? Maybe wiremock? I have no experience writing openhab bindings but I know java :wink:
Is there any API documentaiton available? At first look it seems to use SOAP requests.

The „new“ version uses UPnP, there was a PR for that which was closed due to inactivity and I picked that up.

Most useful would be the services provided by the TV.
IIRC there is a tool which can display that. Unfortunately I forgot it‘s name.

Awesome I tried installing and on the first go the bundle state is Resolved

Start the bundle and now it is active.

Added 2 TV’s and both show online status.

1 Like

I have updated the version. Discovery should now be supported. I also made some simplification of the thing handler, hopefully that is still working.

Looking at the code, pressing keys on the remote, mute and volume should be implemented. Is that working?

There is a tool named “DeviceSpy” which can you you all UPnP devices in your local network. If you use that, you should see your TV with at least one device. With a right-click on the device, you can get the “Device XML”. It would be helpful to get these XMLs. Sine they are quite long, please send them via PN. Thanks.

My TH-65DX640A TV has 3 XML Files

ONE TH-65DX640A.xml (3.5 KB)
TWO TH-65DX640A.xml (2.3 KB)
THREE TH-65DX640A.xml (2.1 KB)

I also have a newer version of the panasonic tv that is not showing up.

1 Like

Thanks, will lokk into the files later.

They do not show up in the binding or in the DeviceSpy? If the latter, than they either don’t support UPnP or this has been disabled.

Thanks the files posted are for the tv that works and has worked with the old binding for ages.

The new tv doesn’t support UDP and I went through all setting to see if I could enable it without luck.
It doesn’t show up in Device Spy either.

Checked with my old Panasonic 40CX680 and binding version 3.0.0.202011131911.
The TV thing stays offline.

2020-11-14 11:58:23.573 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:88a1a72813' changed from UNINITIALIZED to INITIALIZING
2020-11-14 11:58:23.577 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:88a1a72813' changed from INITIALIZING to OFFLINE
2020-11-14 11:58:56.138 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:88a1a72813' changed from OFFLINE to UNINITIALIZED
2020-11-14 11:58:56.144 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:88a1a72813' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)
2020-11-14 11:58:57.536 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:88a1a72813' changed from UNINITIALIZED (DISABLED) to INITIALIZING
2020-11-14 11:58:57.540 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:88a1a72813' changed from INITIALIZING to OFFLINE
2020-11-14 12:00:55.617 [INFO ] [smarthome.event.ThingUpdatedEvent   ] - Thing 'panasonictv:tv:88a1a72813' has been updated.
2020-11-14 12:01:25.434 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:88a1a72813' changed from OFFLINE to UNINITIALIZED
2020-11-14 12:01:25.440 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:88a1a72813' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)
2020-11-14 12:01:26.908 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:88a1a72813' changed from UNINITIALIZED (DISABLED) to INITIALIZING
2020-11-14 12:01:26.912 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:88a1a72813' changed from INITIALIZING to OFFLINE
2020-11-14 11:58:23.569 [DEBUG] [.internal.handler.PanasonicTvHandler] - Create a Panasonic TV Handler for thing 'panasonictv:tv:88a1a72813'
2020-11-14 11:58:23.579 [DEBUG] [.internal.handler.PanasonicTvHandler] - Initializing Panasonic TV handler for uid 'panasonictv:tv:88a1a72813'
2020-11-14 11:58:23.580 [DEBUG] [.internal.handler.PanasonicTvHandler] - Check and create missing UPnP services
2020-11-14 11:58:56.141 [DEBUG] [.internal.handler.PanasonicTvHandler] - Shutdown all Panasonic TV services
2020-11-14 11:58:57.533 [DEBUG] [.internal.handler.PanasonicTvHandler] - Create a Panasonic TV Handler for thing 'panasonictv:tv:88a1a72813'
2020-11-14 11:58:57.539 [DEBUG] [.internal.handler.PanasonicTvHandler] - Initializing Panasonic TV handler for uid 'panasonictv:tv:88a1a72813'
2020-11-14 11:58:57.540 [DEBUG] [.internal.handler.PanasonicTvHandler] - Check and create missing UPnP services
2020-11-14 12:00:55.612 [DEBUG] [.internal.handler.PanasonicTvHandler] - Shutdown all Panasonic TV services
2020-11-14 12:00:55.617 [DEBUG] [.internal.handler.PanasonicTvHandler] - Initializing Panasonic TV handler for uid 'panasonictv:tv:88a1a72813'
2020-11-14 12:00:55.620 [DEBUG] [.internal.handler.PanasonicTvHandler] - Check and create missing UPnP services
2020-11-14 12:01:25.437 [DEBUG] [.internal.handler.PanasonicTvHandler] - Shutdown all Panasonic TV services
2020-11-14 12:01:26.906 [DEBUG] [.internal.handler.PanasonicTvHandler] - Create a Panasonic TV Handler for thing 'panasonictv:tv:88a1a72813'
2020-11-14 12:01:26.912 [DEBUG] [.internal.handler.PanasonicTvHandler] - Initializing Panasonic TV handler for uid 'panasonictv:tv:88a1a72813'
2020-11-14 12:01:26.912 [DEBUG] [.internal.handler.PanasonicTvHandler] - Check and create missing UPnP services

The tv was first configured with the hostname and later changed to ip. UPNP devicespy does not show the tv. Maybe it is too old to have upnp. Didn’t find any settings on the tv to enable it. DNLA ist available.

Trace log level was activated as shown in first post but does not show up in the logfile.

What is the thing option “The UDN of this device”? I left that blank.

This is optional at the moment. I’m working on better discovery which requires the UDN instead of the hostname.

If the TV does not support UPnP it will unfortunately not work with this binding. How “old” is the TV?

Not sure but +4 years old.

@denominator

Can you get the

/nrc/sdd_0.xml (the only service on p00RemoteController)
/dmr/sdd_0.xml, /dmr/sdd_1.xml and /dmr/sdd_2.xml (the services on Media Renderer)?

I think these contain the relevant informtion to enable more functionality. Can you use the keyCode channel to send commands to the TV? E.g. NRC_HDMI1-ONOFF or NRC_HDMI2-ONOFF?

/nrc/sdd_0.xml (the only service on p00RemoteController)
view-source_192.168.1.110_55000_nrc_sdd_0.xml (6.9 KB)

sdd_0.xml (12.3 KB) sdd_1.xml (5.2 KB) sdd_2.xml (16.7 KB)

I will have to test when kids not using tv

Can you use tha app to control tv

Setting looks like

This option is enabled and was enabled before. The v1 binding was working fine with these settings. I installed the Remote tv app Version 2 and Version 3. Both find the tv and I can use them.

edit 1:
Got the DeviceSpy working on a windows 10 machine. The tv shows up with following files. Now I suspect my fedora test host with openhab 3 to not allow upnp network packages. I will check that.

dmr_ddd.xml (2.7 KB) sdd_0.xml (12.3 KB) sdd_1.xml (5.2 KB) sdd_2.xml (16.7 KB) dms_ddd.xml (3.8 KB) dmr_ddd.xml (2.7 KB) sdd_0.xml (12.3 KB) sdd_1.xml (5.2 KB) sdd_2.xml (16.7 KB) dms_ddd.xml (3.8 KB) dms_sdd_0.xml (7.7 KB) dms_sdd_1.xml (3.3 KB) nrc_ddd.xml (2.5 KB) nrc_sdd_0.xml (6.9 KB) pac_ddd.xml (1.5 KB) pac_sdd_0.xml (1.3 KB)

edit 2:
Disabling the firewalld service does the trick. The thing is enabled and accepts volume and mute commands. Others not tested.
After enabling firewalld services “upnp-client” and “ssdp” packets the tv was online but takes minutes to get online. With disabled firewall is takes only a second. Seems to be a firewall issue.

edit 3:
keyCode works fine. tv switches hdmi ports

2020-11-15 13:42:46.344 [INFO ] [marthome.event.ItemStateChangedEvent] - Item 'PanasonicTV_Stummschalten' changed from NULL to OFF
2020-11-15 13:42:46.975 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:88a1a72813' changed from UNINITIALIZED to INITIALIZING
2020-11-15 13:42:46.985 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:88a1a72813' changed from INITIALIZING to OFFLINE
2020-11-15 13:42:47.178 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:88a1a72813' changed from OFFLINE to ONLINE
2020-11-15 13:44:48.434 [INFO ] [home.event.ItemChannelLinkAddedEvent] - Link 'PanasonicTV_Tastendruck-panasonictv:tv:88a1a72813:keyCode' has been added.
2020-11-15 13:45:13.697 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'PanasonicTV_Tastendruck' received command NRC_HDMI1-ONOFF
2020-11-15 13:45:13.697 [INFO ] [rthome.event.ItemStatePredictedEvent] - Item 'PanasonicTV_Tastendruck' predicted to become NRC_HDMI1-ONOFF
2020-11-15 13:45:13.701 [INFO ] [marthome.event.ItemStateChangedEvent] - Item 'PanasonicTV_Tastendruck' changed from NULL to NRC_HDMI1-ONOFF
2020-11-15 13:45:19.663 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'PanasonicTV_Tastendruck' received command NRC_HDMI2-ONOFF
2020-11-15 13:45:19.664 [INFO ] [rthome.event.ItemStatePredictedEvent] - Item 'PanasonicTV_Tastendruck' predicted to become NRC_HDMI2-ONOFF
2020-11-15 13:45:19.667 [INFO ] [marthome.event.ItemStateChangedEvent] - Item 'PanasonicTV_Tastendruck' changed from NRC_HDMI1-ONOFF to NRC_HDMI2-ONOFF
2020-11-15 13:45:25.458 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'PanasonicTV_Tastendruck' received command NRC_HDMI3-ONOFF
2020-11-15 13:45:25.459 [INFO ] [rthome.event.ItemStatePredictedEvent] - Item 'PanasonicTV_Tastendruck' predicted to become NRC_HDMI3-ONOFF
2020-11-15 13:45:25.462 [INFO ] [marthome.event.ItemStateChangedEvent] - Item 'PanasonicTV_Tastendruck' changed from NRC_HDMI2-ONOFF to NRC_HDMI3-ONOFF

There was a NullPointerException after restarting openhab.

2020-11-15 13:42:47.339 [DEBUG] [very.PanasonicTvDiscoveryParticipant] - Discovered a Panasonic TV '40CX680_Series' model 'Panasonic VIErA' thing with UDN '4D454930_0100_1000_8001_A813742A3472'
2020-11-15 13:42:47.340 [DEBUG] [.internal.handler.PanasonicTvHandler] - hostName=192.168.178.30 modelName=Panasonic VIErA, udn=4D454930-0100-1000-8001-A813742A3472, type=MediaRenderer
2020-11-15 13:42:47.342 [DEBUG] [nternal.service.MediaRendererService] - Create a Panasonic TV MediaRenderer service
2020-11-15 13:42:47.343 [DEBUG] [nternal.service.MediaRendererService] - Start refresh task, interval=1000
2020-11-15 13:42:47.341 [ERROR] [y.upnp.internal.UpnpDiscoveryService] - Participant 'org.openhab.binding.panasonictv.internal.discovery.PanasonicTvDiscoveryParticipant' threw an exception
java.lang.NullPointerException: null
        at org.openhab.binding.panasonictv.internal.discovery.PanasonicTvDiscoveryParticipant.createResult(PanasonicTvDiscoveryParticipant.java:54) ~[?:?]
        at org.openhab.core.config.discovery.upnp.internal.UpnpDiscoveryService.remoteDeviceAdded(UpnpDiscoveryService.java:158) [bundleFile:?]
        at org.jupnp.registry.RemoteItems$1.run(RemoteItems.java:114) [bundleFile:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]
2020-11-15 13:42:47.387 [DEBUG] [.internal.handler.PanasonicTvHandler] - Received value 'volume':'6' for thing 'panasonictv:tv:88a1a72813'
2020-11-15 13:42:47.406 [DEBUG] [.internal.handler.PanasonicTvHandler] - Received value 'mute':'OFF' for thing 'panasonictv:tv:88a1a72813'

There was another NullPointerException when I used the scan function in the binding to discover new devices. Nothing found. The tv was manually added before.

2020-11-15 13:46:11.800 [DEBUG] [very.PanasonicTvDiscoveryParticipant] - Discovered a Panasonic TV '40CX680_Series' model 'Panasonic VIErA' thing with UDN '4D454930_0100_1000_8001_A813742A3472'
2020-11-15 13:46:11.801 [ERROR] [y.upnp.internal.UpnpDiscoveryService] - Participant 'org.openhab.binding.panasonictv.internal.discovery.PanasonicTvDiscoveryParticipant' threw an exception
java.lang.NullPointerException: null
        at org.openhab.binding.panasonictv.internal.discovery.PanasonicTvDiscoveryParticipant.createResult(PanasonicTvDiscoveryParticipant.java:54) ~[?:?]
        at org.openhab.core.config.discovery.upnp.internal.UpnpDiscoveryService.remoteDeviceAdded(UpnpDiscoveryService.java:158) [bundleFile:?]
        at org.openhab.core.config.discovery.upnp.internal.UpnpDiscoveryService.startScan(UpnpDiscoveryService.java:139) [bundleFile:?]
        at org.openhab.core.config.discovery.AbstractDiscoveryService.startScan(AbstractDiscoveryService.java:194) [bundleFile:?]
        at org.openhab.core.config.discovery.internal.DiscoveryServiceRegistryImpl.startScan(DiscoveryServiceRegistryImpl.java:377) [bundleFile:?]
        at org.openhab.core.config.discovery.internal.DiscoveryServiceRegistryImpl.startScans(DiscoveryServiceRegistryImpl.java:362) [bundleFile:?]
        at org.openhab.core.config.discovery.internal.DiscoveryServiceRegistryImpl.startScan(DiscoveryServiceRegistryImpl.java:211) [bundleFile:?]
        at org.openhab.core.io.rest.core.internal.discovery.DiscoveryResource.scan(DiscoveryResource.java:105) [bundleFile:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) [bundleFile:1.0.9]
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) [bundleFile:1.0.9]
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) [bundleFile:1.0.9]
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) [bundleFile:1.0.9]
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) [bundleFile:1.0.9]
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) [bundleFile:1.0.9]
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [bundleFile:1.0.9]
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [bundleFile:1.0.9]
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) [bundleFile:1.0.9]
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [bundleFile:1.0.9]
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [bundleFile:1.0.9]
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [bundleFile:1.0.9]
        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) [bundleFile:1.0.9]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) [bundleFile:1.0.9]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:220) [bundleFile:1.0.9]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [bundleFile:3.1.0]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) [bundleFile:1.0.9]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:544) [bundleFile:9.4.20.v20190813]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [bundleFile:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307) [bundleFile:9.4.20.v20190813]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) [bundleFile:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [bundleFile:9.4.20.v20190813]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [bundleFile:?]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.server.Server.handle(Server.java:494) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) [bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) [bundleFile:9.4.20.v20190813]
        at java.lang.Thread.run(Thread.java:834) [?:?]
2020-11-15 13:46:11.929 [DEBUG] [.internal.handler.PanasonicTvHandler] - remoteDeviceAdded: device=(RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:2f402f80-da50-11e1-9b23-0017887065f4, Descriptor: http://192.168.178.20:80/description.xml, Root: true
2020-11-15 13:46:11.929 [DEBUG] [.internal.handler.PanasonicTvHandler] - hostName=192.168.178.20 modelName=Philips hue bridge 2015, udn=2f402f80-da50-11e1-9b23-0017887065f4, type=Basic
2020-11-15 13:46:11.929 [DEBUG] [.internal.handler.PanasonicTvHandler] - Ignore device=(RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:2f402f80-da50-11e1-9b23-0017887065f4, Descriptor: http://192.168.178.20:80/description.xml, Root: true
2020-11-15 13:46:12.457 [TRACE] [nternal.service.MediaRendererService] - Value '6' for CurrentVolume hasn't changed, ignoring update

2 Likes

That’s great news. I have updated the jar above, the NPE should be gone. Can you check whether discovered TVs have the UDN config-parameter set?

Tested successfully with binding version 3.0.0.202011161914. NullPointerException is gone.
Looks good to me.

Discovery shows tv in inbox.

Config after adding it as a thing:

UID: panasonictv:tv:4D454930_0100_1000_8001_A813742A3472
label: 40CX680_Series
thingTypeUID: panasonictv:tv
configuration:
  hostName: 192.168.178.30
  refreshInterval: 1000
  udn: 4D454930-0100-1000-8001-A813742A3472

Then I created new items via the thing channels. Had to restart openhab then they worked. A reason maybe not correctly deleting the old things and items.

Tested volume dimmer, mute switch and keycode hdmi1 successfully.
Found no exception in log and the volume polling is working.

event.log

2020-11-16 20:27:53.130 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:4D454930_0100_1000_8001_A813742A3472' changed from UNINITIALIZED to INITIALIZING
2020-11-16 20:27:53.134 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:4D454930_0100_1000_8001_A813742A3472' changed from INITIALIZING to UNKNOWN
2020-11-16 20:27:53.349 [INFO ] [me.event.ThingStatusInfoChangedEvent] - Thing 'panasonictv:tv:4D454930_0100_1000_8001_A813742A3472' changed from UNKNOWN to ONLINE
2020-11-16 20:28:15.594 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item '40CX680Series_Stummschalten' received command OFF
2020-11-16 20:28:15.594 [INFO ] [rthome.event.ItemStatePredictedEvent] - Item '40CX680Series_Stummschalten' predicted to become OFF
2020-11-16 20:28:15.599 [INFO ] [marthome.event.ItemStateChangedEvent] - Item '40CX680Series_Stummschalten' changed from ON to OFF
2020-11-16 20:28:16.705 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item '40CX680Series_Stummschalten' received command ON
2020-11-16 20:28:16.706 [INFO ] [rthome.event.ItemStatePredictedEvent] - Item '40CX680Series_Stummschalten' predicted to become ON
2020-11-16 20:28:16.710 [INFO ] [marthome.event.ItemStateChangedEvent] - Item '40CX680Series_Stummschalten' changed from OFF to ON
2020-11-16 20:28:19.039 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item '40CX680Series_Stummschalten' received command OFF
2020-11-16 20:28:19.039 [INFO ] [rthome.event.ItemStatePredictedEvent] - Item '40CX680Series_Stummschalten' predicted to become OFF
2020-11-16 20:28:19.043 [INFO ] [marthome.event.ItemStateChangedEvent] - Item '40CX680Series_Stummschalten' changed from ON to OFF
2020-11-16 20:28:25.902 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item '40CX680Series_Stummschalten' received command ON
2020-11-16 20:28:25.904 [INFO ] [rthome.event.ItemStatePredictedEvent] - Item '40CX680Series_Stummschalten' predicted to become ON
2020-11-16 20:28:25.908 [INFO ] [marthome.event.ItemStateChangedEvent] - Item '40CX680Series_Stummschalten' changed from OFF to ON
2020-11-16 20:28:29.360 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item '40CX680Series_Stummschalten' received command OFF
2020-11-16 20:28:29.361 [INFO ] [rthome.event.ItemStatePredictedEvent] - Item '40CX680Series_Stummschalten' predicted to become OFF
2020-11-16 20:28:29.365 [INFO ] [marthome.event.ItemStateChangedEvent] - Item '40CX680Series_Stummschalten' changed from ON to OFF
2020-11-16 20:28:34.144 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item '40CX680Series_Lautstarke' received command 13
2020-11-16 20:28:34.145 [INFO ] [rthome.event.ItemStatePredictedEvent] - Item '40CX680Series_Lautstarke' predicted to become 13
2020-11-16 20:28:34.150 [INFO ] [marthome.event.ItemStateChangedEvent] - Item '40CX680Series_Lautstarke' changed from 7 to 13
2020-11-16 20:28:36.460 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item '40CX680Series_Lautstarke' received command 6
2020-11-16 20:28:36.462 [INFO ] [rthome.event.ItemStatePredictedEvent] - Item '40CX680Series_Lautstarke' predicted to become 6
2020-11-16 20:28:36.466 [INFO ] [marthome.event.ItemStateChangedEvent] - Item '40CX680Series_Lautstarke' changed from 13 to 6
2020-11-16 20:28:38.907 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item '40CX680Series_Lautstarke' received command 9
2020-11-16 20:28:38.908 [INFO ] [rthome.event.ItemStatePredictedEvent] - Item '40CX680Series_Lautstarke' predicted to become 9
2020-11-16 20:28:38.911 [INFO ] [marthome.event.ItemStateChangedEvent] - Item '40CX680Series_Lautstarke' changed from 6 to 9

openhab.log; removed some of my other devices.

2020-11-16 20:27:44.731 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Berlin'.

removed

2020-11-16 20:27:44.766 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'de_DE'.
2020-11-16 20:27:51.323 [INFO ] [.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2020-11-16 20:27:52.476 [INFO ] [org.openhab.ui.internal.UIService   ] - Started UI on port 8080
2020-11-16 20:27:52.824 [INFO ] [ab.ui.habpanel.internal.HABPanelTile] - Started HABPanel at /habpanel
2020-11-16 20:27:53.053 [DEBUG] [.internal.handler.PanasonicTvHandler] - Create a Panasonic TV Handler for thing 'panasonictv:tv:4D454930_0100_1000_8001_A813742A3472'
2020-11-16 20:27:53.131 [DEBUG] [.internal.handler.PanasonicTvHandler] - Initializing Panasonic TV handler for uid 'panasonictv:tv:4D454930_0100_1000_8001_A813742A3472'

removed

2020-11-16 20:27:53.323 [DEBUG] [.internal.handler.PanasonicTvHandler] - Ignoring device=org.openhab.binding.panasonictv.internal.discovery.DeviceInformation@42e90197 (hostname not matching) in thing panasonictv:tv:4D454930_0100_1000_8001_A813742A3472

removed

2020-11-16 20:27:53.327 [DEBUG] [very.PanasonicTvDiscoveryParticipant] - Ignoring (RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:4D454930-0300-1000-8001-A813742A3472, Descriptor: http://192.168.178.30:55000/pac/ddd.xml, Root: true: No thing UID created, probably not a Panasonic TV
2020-11-16 20:27:53.334 [DEBUG] [.internal.handler.PanasonicTvHandler] - remoteDeviceAdded: device=(RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:4D454930-0300-1000-8001-A813742A3472, Descriptor: http://192.168.178.30:55000/pac/ddd.xml, Root: true
2020-11-16 20:27:53.335 [DEBUG] [.internal.handler.PanasonicTvHandler] - Checking modelName=Panasonic VIErA, udn=4D454930-0300-1000-8001-A813742A3472, service=p00ProAVController for thing panasonictv:tv:4D454930_0100_1000_8001_A813742A3472
2020-11-16 20:27:53.337 [DEBUG] [very.PanasonicTvDiscoveryParticipant] - Ignoring (RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:4D454930-0200-1000-8001-A813742A3472, Descriptor: http://192.168.178.30:55000/nrc/ddd.xml, Root: true: No thing UID created, probably not a Panasonic TV
2020-11-16 20:27:53.337 [DEBUG] [.internal.handler.PanasonicTvHandler] - remoteDeviceAdded: device=(RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:4D454930-0200-1000-8001-A813742A3472, Descriptor: http://192.168.178.30:55000/nrc/ddd.xml, Root: true
2020-11-16 20:27:53.338 [DEBUG] [.internal.handler.PanasonicTvHandler] - Checking modelName=Panasonic VIErA, udn=4D454930-0200-1000-8001-A813742A3472, service=p00RemoteController for thing panasonictv:tv:4D454930_0100_1000_8001_A813742A3472
2020-11-16 20:27:53.346 [DEBUG] [rnal.service.RemoteControllerService] - Create a Panasonic TV RemoteController service

removed

2020-11-16 20:27:53.357 [DEBUG] [.internal.handler.PanasonicTvHandler] - Ignoring device=org.openhab.binding.panasonictv.internal.discovery.DeviceInformation@12dc673f (hostname not matching) in thing panasonictv:tv:4D454930_0100_1000_8001_A813742A3472
2020-11-16 20:27:53.388 [DEBUG] [.internal.handler.PanasonicTvHandler] - remoteDeviceAdded: device=(RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:4D454930-0000-1000-8001-A813742A3472, Descriptor: http://192.168.178.30:55000/dms/ddd.xml, Root: true
2020-11-16 20:27:53.389 [DEBUG] [.internal.handler.PanasonicTvHandler] - Checking modelName=Panasonic VIErA, udn=4D454930-0000-1000-8001-A813742A3472, service=MediaServer for thing panasonictv:tv:4D454930_0100_1000_8001_A813742A3472
2020-11-16 20:27:53.391 [DEBUG] [very.PanasonicTvDiscoveryParticipant] - Ignoring (RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:4D454930-0000-1000-8001-A813742A3472, Descriptor: http://192.168.178.30:55000/dms/ddd.xml, Root: true: No thing UID created, probably not a Panasonic TV
2020-11-16 20:27:53.423 [DEBUG] [very.PanasonicTvDiscoveryParticipant] - Created a DiscoveryResult for device 'Panasonic VIErA' with UDN '4D454930-0100-1000-8001-A813742A3472'
2020-11-16 20:27:53.428 [DEBUG] [.internal.handler.PanasonicTvHandler] - remoteDeviceAdded: device=(RemoteDevice) Identity: (RemoteDeviceIdentity) UDN: uuid:4D454930-0100-1000-8001-A813742A3472, Descriptor: http://192.168.178.30:55000/dmr/ddd.xml, Root: true

removed

2020-11-16 20:27:53.432 [DEBUG] [.internal.handler.PanasonicTvHandler] - Checking modelName=Panasonic VIErA, udn=4D454930-0100-1000-8001-A813742A3472, service=MediaRenderer for thing panasonictv:tv:4D454930_0100_1000_8001_A813742A3472
2020-11-16 20:27:53.435 [DEBUG] [.internal.handler.PanasonicTvHandler] - Ignoring device=org.openhab.binding.panasonictv.internal.discovery.DeviceInformation@5814a1f2 (hostname not matching) in thing panasonictv:tv:4D454930_0100_1000_8001_A813742A3472
2020-11-16 20:27:53.435 [DEBUG] [nternal.service.MediaRendererService] - Create a Panasonic TV MediaRenderer service
2020-11-16 20:27:53.436 [DEBUG] [nternal.service.MediaRendererService] - Start refresh task, interval=1000
2020-11-16 20:27:53.481 [DEBUG] [.internal.handler.PanasonicTvHandler] - Received value 'volume':'6' for thing 'panasonictv:tv:4D454930_0100_1000_8001_A813742A3472'

removed

2020-11-16 20:27:53.497 [DEBUG] [.internal.handler.PanasonicTvHandler] - Received value 'mute':'OFF' for thing 'panasonictv:tv:4D454930_0100_1000_8001_A813742A3472'
2020-11-16 20:27:54.519 [TRACE] [nternal.service.MediaRendererService] - Value '6' for CurrentVolume hasn't changed, ignoring update
2020-11-16 20:27:54.545 [TRACE] [nternal.service.MediaRendererService] - Value 'false' for CurrentMute hasn't changed, ignoring update

removed

2020-11-16 20:27:55.568 [TRACE] [nternal.service.MediaRendererService] - Value '6' for CurrentVolume hasn't changed, ignoring update
2020-11-16 20:27:55.584 [TRACE] [nternal.service.MediaRendererService] - Value 'false' for CurrentMute hasn't changed, ignoring update
2020-11-16 20:27:56.599 [TRACE] [nternal.service.MediaRendererService] - Value '6' for CurrentVolume hasn't changed, ignoring update

Did you also find the (meanwhile closed) pull request on GitHub and my comments in that? That should be helpful for your implementation. Especially for the On/Off detection… You just need to implement it in a proper way and not spawn a random server on a random port :wink:

@Flole Do you mean that port 51218 needs to be used? Or is the port number arbitrary as long as the correct port number is send in the subscription message? Can you show me the full response message? Can we identify the TV from that?