Philips TV (2016+) Binding

Hi, somehow the auto discovery process is not working, the binding does not find the TV on its own. Maybe it
s because openHAB and the TV are on different subnets? I have enabled mDNS repeater on my Edgerouter and it seems to be working for other devices (not totally sure though).

Can I add the TV manually, and how do I get username and password for it?

What I did to be able to control it always is to install https://play.google.com/store/apps/details?id=eu.thedarken.wldonate&hl=en&gl=US and set to keep CPU active in it.

After this, it is accessible always.

I have another problem with OH 2.5.9 and this binding.

I got this:

 2020-12-03 23:02:31.967 [WARN ] [ipstv.internal.service.VolumeService] - Error during handling the VolumeService command REFRESH for Channel volume: Value must be between 0 and 100

java.lang.IllegalArgumentException: Value must be between 0 and 100

at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:57) ~[?:?]

at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:52) ~[?:?]

at org.eclipse.smarthome.core.library.types.DecimalType.as(DecimalType.java:152) ~[?:?]

at org.eclipse.smarthome.core.internal.items.ItemStateConverterImpl.convertToAcceptedState(ItemStateConverterImpl.java:64) ~[?:?]

at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.sendUpdate(ProfileCallbackImpl.java:134) ~[?:?]

at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onStateUpdateFromHandler(SystemDefaultProfile.java:53) ~[?:?]

at org.eclipse.smarthome.core.thing.internal.CommunicationManager.lambda$9(CommunicationManager.java:467) ~[?:?]

at org.eclipse.smarthome.core.thing.internal.CommunicationManager.lambda$11(CommunicationManager.java:487) ~[?:?]

at java.lang.Iterable.forEach(Iterable.java:75) ~[?:1.8.0_265]

at org.eclipse.smarthome.core.thing.internal.CommunicationManager.handleCallFromHandler(CommunicationManager.java:483) ~[?:?]

at org.eclipse.smarthome.core.thing.internal.CommunicationManager.stateUpdated(CommunicationManager.java:465) ~[?:?]

at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl$1.stateUpdated(ThingManagerImpl.java:168) ~[?:?]

at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateState(BaseThingHandler.java:245) ~[?:?]

at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateState(BaseThingHandler.java:264) ~[?:?]

at org.openhab.binding.philipstv.internal.handler.PhilipsTvHandler.postUpdateChannel(PhilipsTvHandler.java:315) ~[?:?]

at org.openhab.binding.philipstv.internal.service.VolumeService.handleCommand(VolumeService.java:64) ~[?:?]

at org.openhab.binding.philipstv.internal.handler.PhilipsTvHandler.refreshTvProperties(PhilipsTvHandler.java:374) ~[?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_265]

at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_265]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_265]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_265]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]

at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]

Hi @bennYx0x,

will the binding support openHAB 3.0?

Thanks for a quick response!
HFM

Hello,

I have searched for a long time, but unfortunately I cannot find anything :frowning: .
I wanted to recreate the control arrows of the remote control. So up, down, left, right, ok and back. Therefore my question what exactly expects the item PhilipsKeyCode and where do I get the codes from?

Thanks a lot!

@Sebastian1 you can find the keyCodes in this source file:
https://github.com/mebe1012/openhab2-bindings/blob/philipstv/bundles/org.openhab.binding.philipstv/src/main/resources/ESH-INF/thing/channel-types.xml

The keyCode strings you want should be:

KEY_CURSOR_UP
KEY_CURSOR_DOWN
KEY_CURSOR_LEFT
KEY_CURSOR_RIGHT
KEY_CONFIRM
KEY_BACK or KEY_PREVIOUS

Hello,

thank you for the quick reply! Has also worked great. Say it is also possible to switch to a specific HDMI input? Because I could not find that either. As well as a sleep timer function.

If not also not so bad, the most important works.

best regards

Switching HDMI is not possible with the philips api. There are workarounds that are discussed early in this thread. See 204 and 205 and following.
Sleep timer function I don’t know.

Is there already a oh3 version of the binding available?

Hi Benjamin,
Thanks a lot for this binding!

Running openHAB v2.5.10 on Ubuntu in a LXD container
TV: 48OLED935/12 (API v6.4)

Auto discovery worked but I was to late with entering the code the first time it popped up. I tried again to pair the TV but this time the code was not send to the TV. Strange, later I discovered the TV had some network issue? Casting a video was also not working anymore. A hard reboot of the TV (power OFF/ON) did the trick. After applying the code (within 60 seconds) I was able to control the TV with the binding and did not alter any of the default settings from the binding.

I was surprised to see that I was able to switch on the TV (with the binding) the next day. It takes about 5 seconds but the TV does wake up. I leave the TV in standby overnight. WOWLAN setting in the TV is ā€œonā€.
I did reboot openHAB to test if the ā€œthingā€ will survive and YES it does :slight_smile:
At the moment my openHAB UI does control POWER/VOLUME/CHANNELS. The channel feedback is missing, but this is an known issue.

Sadly the ambilight control is not working for me. Perhaps I do not understand the controls in the binding. When I play with them it seems to stress the ambilight with random colors and brightness.
I would love to be able to flip ā€œONā€ ambilight with a preset color and brightness when the TV is in standby. I guess that will require to prevent the TV LAN nic from going into powersave.

Nevertheless I am happy with the binding as it is and hope it will find its way into the ā€œstandardā€ bindings from openHAB. That way we automatically keep our bindings always up to date.

Keep up the good work and happy holidays.

Hi all,

just a short notice:

I’ll port the binding definitely to version 3 in the next ~1-2 weeks and will announce it here. @HFM @marcel_verpaalen

Beside that I will also read through the comments and will answer them at a later time.

Best regards & happy xmas meanwhile

You are the best! :wink:

Have a great Christmas!
HFM

@bennYx0x That is great.
I’ll PM you a link to my GH current version. Did already most of the porting to OH3

I apologize for the very late response.
Thanks a lot for the experimental version, it works fine!

Just one remark : I noticed that the binding is always in discovery mode and every 10 minutes it is continuously discovering non-Philips things. Here is a relevant capture of the openhab.log:

2020-12-23 11:51:58.028 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:04ABAB2A, properties={cloudServer=cn, host=10.0.0.86, deviceId=04AE3B2A, token=84354538450d16a290e55b0cfafd1567}, representationProperty=deviceId, flag=NEW, label=Mi Control Hub 04ABAB2A (78427274) with token, bridgeUID=null, ttl=-1, timestamp=1608717118022]
2020-12-23 11:51:58.037 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:04ABABAE, properties={cloudServer=cn, host=10.0.0.110, deviceId=0489C3AE, token=345153845634644b384e49324c774172}, representationProperty=deviceId, flag=NEW, label=Mi Home Security Camera 360° 1080P 04ABABAE (76437390) with token, bridgeUID=null, ttl=-1, timestamp=1608717118023]
2020-12-23 11:51:58.042 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:06ABAB65, properties={cloudServer=cn, host=10.0.0.18, deviceId=06B04F65, token=9623e938455d6516ba0a8ef12d7618f7}, representationProperty=deviceId, flag=NEW, label=Wifi repeater kids 06ABAB65 (112417957) with token, bridgeUID=null, ttl=-1, timestamp=1608717118023]
2020-12-23 11:51:58.047 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:00ABABDD, properties={cloudServer=cn, host=10.0.0.106, deviceId=00BF3FDD, token=746b63845844e1514bb0c6998b787b5b}, representationProperty=deviceId, flag=NEW, label=Mi Wi-Fi Repeater 00ABABDD (12543725) with token, bridgeUID=null, ttl=-1, timestamp=1608717118022]
2020-12-23 11:52:44.232 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=chromecast:chromecast:37d9de40388ababc8f1a6219e46febad, properties={ipAddress=10.0.0.132, port=8009, deviceId=37d9de40388eabfc8f1a6219e46febad}, representationProperty=deviceId, flag=NEW, label=MIBOX3, bridgeUID=null, ttl=-1, timestamp=1608717164231]
2020-12-23 12:01:57.798 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:04ABABAE, properties={cloudServer=cn, host=10.0.0.110, deviceId=0489C3AE, token=34515654343124b384e49324c774172}, representationProperty=deviceId, flag=NEW, label=Mi Home Security Camera 360° 1080P 04ABABAE (76147390) with token, bridgeUID=null, ttl=-1, timestamp=1608717717793]
2020-12-23 12:01:57.807 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:04ABAB6D, properties={cloudServer=cn, host=10.0.0.184, deviceId=047DC56D, token=5390d5d0543127a7f9c4df59a8bc218}, representationProperty=deviceId, flag=NEW, label=Mi Bedside Lamp 04ABAB6D (75341405) with token, bridgeUID=null, ttl=-1, timestamp=1608717717800]
2020-12-23 12:01:57.813 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:03ABAB5C, properties={cloudServer=cn, host=10.0.0.240, deviceId=03D1695C, token=6a693342443126c6a58317464327169}, representationProperty=deviceId, flag=NEW, label=dafang 03ABAB5C (64045644) with token, bridgeUID=null, ttl=-1, timestamp=1608717717794]
2020-12-23 12:01:57.822 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:04ABAB2A, properties={cloudServer=cn, host=10.0.0.86, deviceId=04AE3B2A, token=8435457a334312290e55b0cfafd1567}, representationProperty=deviceId, flag=NEW, label=Mi Control Hub 04ABAB2A (78547274) with token, bridgeUID=null, ttl=-1, timestamp=1608717717793]
2020-12-23 12:01:57.827 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:06ABAB65, properties={cloudServer=cn, host=10.0.0.18, deviceId=06B04F65, token=9623e9045c43126ba0a8ef12d7618f7}, representationProperty=deviceId, flag=NEW, label=Wifi repeater kids 06ABAB65 (112417957) with token, bridgeUID=null, ttl=-1, timestamp=1608717717793]
2020-12-23 12:01:57.832 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:00ABABDD, properties={cloudServer=cn, host=10.0.0.106, deviceId=00BF3FDD, token=746b68d6d4312514bb0c6998b787b5b}, representationProperty=deviceId, flag=NEW, label=Mi Wi-Fi Repeater 00ABABDD (12543725) with token, bridgeUID=null, ttl=-1, timestamp=1608717717809]
2020-12-23 12:11:57.572 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:06ABAB65, properties={cloudServer=cn, host=10.0.0.18, deviceId=06B04F65, token=9623e9045c43126ba0a8ef12d7618f7}, representationProperty=deviceId, flag=NEW, label=Wifi repeater kids 06ABAB65 (112417957) with token, bridgeUID=null, ttl=-1, timestamp=1608718317569]
2020-12-23 12:11:57.579 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:04ABAB6D, properties={cloudServer=cn, host=10.0.0.184, deviceId=047DC56D, token=5390d5d0543127a7f9c4df59a8bc218}, representationProperty=deviceId, flag=NEW, label=Mi Bedside Lamp 04ABAB6D (75341405) with token, bridgeUID=null, ttl=-1, timestamp=1608718317571]
2020-12-23 12:11:57.586 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:04ABAB2A, properties={cloudServer=cn, host=10.0.0.86, deviceId=04AE3B2A, token=8435457a334312290e55b0cfafd1567}, representationProperty=deviceId, flag=NEW, label=Mi Control Hub 04ABAB2A (78547274) with token, bridgeUID=null, ttl=-1, timestamp=1608718317571]
2020-12-23 12:11:57.589 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:03ABAB5C, properties={cloudServer=cn, host=10.0.0.240, deviceId=03D1695C, token=6a693342443126c6a58317464327169}, representationProperty=deviceId, flag=NEW, label=dafang 03ABAB5C (64045644) with token, bridgeUID=null, ttl=-1, timestamp=1608718317570]
2020-12-23 12:11:57.594 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:04ABABAE, properties={cloudServer=cn, host=10.0.0.110, deviceId=0489C3AE, token=34515654343124b384e49324c774172}, representationProperty=deviceId, flag=NEW, label=Mi Home Security Camera 360° 1080P 04ABABAE (76147390) with token, bridgeUID=null, ttl=-1, timestamp=1608718317569]
2020-12-23 12:11:57.598 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=miio:generic:00ABABDD, properties={cloudServer=cn, host=10.0.0.106, deviceId=00BF3FDD, token=746b68d6d4312514bb0c6998b787b5b}, representationProperty=deviceId, flag=NEW, label=Mi Wi-Fi Repeater 00ABABDD (12543725) with token, bridgeUID=null, ttl=-1, timestamp=1608718317581]
2020-12-23 12:16:51.743 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=chromecast:chromecast:37d9de40388ababc8f1a6219e46febad, properties={ipAddress=10.0.0.132, port=8009, deviceId=37d9de54091eabfc8f1a6219e46febad}, representationProperty=deviceId, flag=NEW, label=MIBOX3, bridgeUID=null, ttl=-1, timestamp=1608718611741]
2020-12-23 12:20:35.850 [DEBUG] [tv.internal.handler.PhilipsTvHandler] - thingDiscovered: DiscoveryResult [thingUID=chromecast:chromecast:37d9de40388ababc8f1a6219e46febad, properties={ipAddress=10.0.0.132, port=8009, deviceId=37d9de54091eabfc8f1a6219e46febad}, representationProperty=deviceId, flag=NEW, label=MIBOX3, bridgeUID=null, ttl=-1, timestamp=1608718835849]

Is it possible to add a switch in the binding configuration that would allow enabling/disabling of the auto discovery mode?

thank you!

Hi Benjamin,

Here is the port I did for OH3. For me this got me going. Maybe it saves you bit of time. I also did some spotless:apply and fixed some null annotations which prevented maven from compiling it cleanly.

Only 1 issue I saw, (not sure if this related to OH3 version or it was there before): the TV channel name remained NA, though the response has a TV channel. Did not further dig into that yet.

Note: for the eager folks that want to get going, I also included the jar file in the releases folder like @bennYx0x did,

BTW, is there actually a reason for not submitting your binding for inclusion in the regular OH3 repository?

cool, trying this :+1:

Hi Marcel,

thanks for the migration job! I simply merged your changes into my repo and updated the initial post accordingly.

The reason I did not yet create an official PR is the lack of time + mainly due to the fact, that the used API is kinda hackish since it is not an official one. One year ago I did not know how many tv’s will work for sure with this binding. I’m happy that meanwhile a lot of people gave positive feedback - even though you can see that a lot of things do not work properly for everyone. I can currently only rely on the experiences with my tv’s API.

But I’ll definitely will have a second thought about submitting it and letting the maintainers decide if it’s sufficient the way it is.

Thanks a lot! Working with PUS8505.

Will check the next days for the mentioned connection losses…

However, some items seem not to be supported (like Sharpness, Brightness, Contrast and others).

@bennYx0x
Installed on my 65OLED804/12 and the connection is working.
The list of apps are also there and I can switch the apps.

But I don’t get the current app or the app icon image.
The Refresh Rate is at 10 seconds.

I see in the logs:
2021-01-04 15:21:45.959 [INFO ] [tv.internal.handler.PhilipsTvHandler] - Starting Refresh Scheduler for Philips TV PhilipsTV with refresh rate of 10.

So it seems all is working fine, but I don’t get any updates of the current state.

My configuration:

If it could help this is the system output of my TV with JointSpace API 6.4.0:
{"notifyChange":"http","menulanguage":"German","name":"65OLED804\/12","country":"Germany","serialnumber_encrypted":"xxx","softwareversion_encrypted":"JQwiCki5uG26YnTuC7D2Li7R6JDVF+R\/g7Ujr\/b5ratPdShb1MZ\/fRSJUl527RfG\n","model_encrypted":"RrkdPrjSlewmnuwWct0p501v917ec7StCF19E9rbofg=\n","deviceid_encrypted":"XrN3mJij4KT9S332\/AQ0s02DAIB26fYbYIyKXWVnRMI=\n","nettvversion":"9.0.0","epgsource":"broadcast","api_version":{"Major":6,"Minor":4,"Patch":0},"featuring":{"jsonfeatures":{"editfavorites":["TVChannels","SatChannels"],"recordings":["List","Schedule","Manage"],"ambilight":["LoungeLight","Hue","Ambilight","HueStreaming"],"menuitems":["Setup_Menu"],"textentry":["not_available"],"applications":["TV_Apps","TV_Games","TV_Settings"],"pointer":["not_available"],"inputkey":["key"],"activities":["intent"],"channels":["preset_string"],"mappings":["server_mapping"]},"systemfeatures":{"tvtype":"consumer","content":["dmr","pvr"],"tvsearch":"intent","pairing_type":"digest_auth_pairing","secured_transport":"true","companion_screen":"true"}},"os_type":"MSAF_2019_P"}

Hey guys,

For those who want to switch between the input sources, there are two solutions for Android models: adb and using the API.

  1. Using adb. In the example below the last digit in HdmiService%2FHW9 indicates an input source (for me HdmiService%2FHW9 is HDMI 2 and HdmiService%2FHW10 is HDMI 1; SCART uses a different service, but works the same way. You can find the service name and params by checking the syslog on your device after switching to the needed input source):
adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/org.droidtv.hdmiService%2F.HdmiService%2FHW9 -n org.droidtv.zapster/.playtv.activity.PlayTvActivity -f 0x10000000
  1. I’ve tried using the activities/launch endpoint in the Philips API to run the command above, but unfortunately the API strips out ā€œdataā€ and ā€œflagā€ parameters (ā€œ-dā€ and ā€œ-fā€ in the example above), so I could not make it work. I’ve checked the source code for the API and it indeed does not pass these parameters, so there is no way to run this command through the API. But I was able to call Google Assistant and pass a query - apparently, passing input name as a query (ā€œHDMI 1ā€, ā€œHDMI 2ā€, ā€œSCARTā€, etc.) will result in Google Assistant switching the TV to that input. Just post the following to activities/launch:
{ "intent": {"extras":{"query":"HDMI 1"}, "action": "Intent {  act=android.intent.action.ASSIST cmp=com.google.android.katniss/com.google.android.apps.tvsearch.app.launch.trampoline.SearchActivityTrampoline flg=0x10200000 }", "component":{"packageName":"com.google.android.katniss","className":"com.google.android.apps.tvsearch.app.launch.trampoline.SearchActivityTrampoline"} } }

Hope it helps!