Philips TV (2016+) Binding

Hello @bennYx0x and @marcel_verpaalen, can you please also add my changes?
It changes volume, mute, power and player to system types. Also because system.volume is PercentType I have changed that too.
You can download the changed files here: Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.

Hi Daniel,

I noticed below in your log:

10:18:51.265 [DEBUG] [.philipstv.internal.ConnectionManager] - Target Uri is: https://192.168.168.14:1926/6/pair/request

What triggered me is the ip address: 192.168.168.14. Usually IP addresses for home LAN’s start with 192.168.1 or 192.168.2, I’ve even seen with 192.168.4. Netmasks usually are 255.255.255.0, so an ip address can only reach other ip’s in the same subnet (192.168.1.xxx).

So the following questions arise:

  1. is your assigned static ip 192.168.168.14 correct?
  2. is your openhab instance on the same subnet 192.168.168.xxx?
  3. if not on the same subnet, is your netmask configured such that your openhab instance and the tv can see each other?

Yep. Some years ago I set up a vpn to a friend of mine (primarily in order to access his Plex server which he didn’t want to expose on the wild) and our subnets collided so I changed and ever since then my home has been running 192.168.168.0/24. So that’s correct and both TV and HA server is on that same /24 net.

One thing I thought of is that I have UPnP completely disabled in my router (never really trusted it), could that affect any of this? I mean, the Android TV API isn’t dependent on UPnP, is it?

edit: I have now established the TV is reacheble over the network. When enabling debugging I can reach it via adb (port 5555), but still nothing over the API port. Guess next step is getting a logcat from it and start digging in that. Weird…

Thank’s for the binding!
Seems to work pretty much ok most times! I also have the problem that the thing reports “online - configuration pending” after a restart though. But that’s not the question really, i hope to figure that out.

What i wonder is regarding the source selection. I would love to be able to swith inputs which i think this is all about:

How do i do that? How do I use that channel?

I successfully got my Authorisation Key on my philips TV (OH 3), but did not get any hint of how to use username/passwort out of your description.

My error log now: Unexpected Error handling the PowerState command REFRESH for Channel power: The given username/password combination is invalid

I found in my openhab browser config to set username/password, but I do not know what to fill in there. Do I see this somewhere in my TV?

Thx for reply

Ok, I have now got an answer from Philips support about my problems (API port not being reachable at all). I got the following answer:

This is not support for the T32 platform.
T32 is the platform for this TV model.

(translated into english by me, I got the answer in swedish. It’s wording in swedish is kinda strange, tried to translate it as exactly as possible)

Does this answer make sense to anyone? Does this mean that not all new Phlips Android TV’s are supported? @bennYx0x?

Hi @Thedster, you simply create a String item that is linked to the searchContent channel. Afterwards you can update it like e.g. described here https://community.openhab.org/t/update-string-item-manually/18024/3vv , every input will be processed by Google Assistant of the TV. Setting the state of the String item to “HDMI 1” will then switch the input channel of your tv.

@eninaus username and password should be automatically filled into your config after you’ve set the shown PIN on tv into your config. These credentials cannot be seen in your tv settings.

@DanielMalmgren that sadly states that your TV does not support the technical endpoints that this binding here is using. Since the technical endpoints of PhilipsTvs are not public documented, it is hard to say what tv models are supported. Eventually all newer models use a new API that is not yet discovered by someone.

Yes, either that. Or there is just some problem with my TV and some lazy technician at Philips that can’t be arsed to try to find out what. If they had stopped using this API in their new models it feels strange that nobody else has reported problems yet. I guess there must be official products using the API as well?

Either way, maybe you should list my model as not working on your first post? It’s a 50PUS7906/12.

Hi,
love the binding, i run it in a docker instance without issues… until i updated openhab to from 3.2.0-M3 to 3.3.0-SNAPSHOT and it broke. Tried removing it and cleaning cache and tmp folder but the binding doesn’t show up anymore in the UI.

I get nothing in the log (but not sure if log is configured to tell me everything), no items from the old installation exists anymore as i removed them out of desperation.

File is located as per instructions in: /opt/openhab/addons
Output from ls -la:
-rw-r–r-- 1 openhab openhab 2049559 Jan 19 17:01 org.openhab.binding.philipstv-3.3.0-SNAPSHOT.jar

Any ideas what I can or should do?

Hey @Bjorn_Smedberg what are the logs saying if? You can increase them via the openhab-cli with the command

log:set DEBUG org.openhab.binding.philipstv

after afterwards back to normal logging level

log:set INFO org.openhab.binding.philipstv

Hey, unfortunately the log shows nothing… restarted and added the file multiple times but the log only shows the start up stuff… so hard to troubleshoot :confused:

what I had to do after installing: starting the karaf console and check the status of the philipstv Binding. It was (automatically?) set into status “resolved”. I started the TV Binding just once via console and since then it stays in a running state - even after restart. Exactly at this moment - when starting via console - I got my philips-tv binding logfiles in openhab.log.

Before that step the logs where just empty. Maybe this might help?

@bennYx0x: Username was automatically filled out but the password field is still empty. This is why I was asking for. Any idea of how to make the handshake again? do I have to reinstall the binding maybe? just stopping the bundle + restarting did not work

@eninaus thanks! It doesn’t show up in the list at all. bundle:list | grep -i philip yields no result. I have a feeling that openHab doesn’t notice that the file exist :thinking:

246 │ Active │  80 │ 3.3.0.202201190331    │ openHAB Add-ons :: Bundles :: Astro Binding
247 │ Active │  80 │ 3.3.0.202201190334    │ openHAB Add-ons :: Bundles :: Chromecast Binding
248 │ Active │  80 │ 3.3.0.202201190357    │ openHAB Add-ons :: Bundles :: Onkyo Binding
249 │ Active │  80 │ 3.3.0.202201190411    │ openHAB Add-ons :: Bundles :: Verisure Binding
250 │ Active │  80 │ 3.3.0.202201090338    │ openHAB Add-ons :: Bundles :: ZigBee Binding
251 │ Active │  80 │ 3.3.0.202201090342    │ openHAB Add-ons :: Bundles :: ZigBee CC2531 Bridge
252 │ Active │  80 │ 3.3.0.202201090342    │ openHAB Add-ons :: Bundles :: ZigBee Console
253 │ Active │  80 │ 3.3.0.202201090344    │ openHAB Add-ons :: Bundles :: ZigBee Console Ember
254 │ Active │  80 │ 3.3.0.202201090344    │ openHAB Add-ons :: Bundles :: ZigBee Console Telegesis
255 │ Active │  80 │ 3.3.0.202201090342    │ openHAB Add-ons :: Bundles :: ZigBee Ember Bridge
256 │ Active │  80 │ 3.3.0.202201090338    │ openHAB Add-ons :: Bundles :: ZigBee Serial Driver
257 │ Active │  80 │ 3.3.0.202201090342    │ openHAB Add-ons :: Bundles :: ZigBee Telegesis Bridge
258 │ Active │  80 │ 3.3.0.202201090343    │ openHAB Add-ons :: Bundles :: ZigBee XBee Bridge
259 │ Active │  80 │ 3.3.0.202201160348    │ openHAB Add-ons :: Bundles :: ZWave Binding

I placed the addon file at the following location/directory:

openhabian@openhab:/usr/share/openhab/addons $ ll
insgesamt 273M
drwxr-xr-x 2 openhab openhab 4,0K Jan  2 15:33 ./
drwxr-xr-x 4 openhab openhab 4,0K Dez 25 17:43 ../
-rw-r--r-- 1 openhab openhab 271M Dez 20 07:19 openhab-addons-3.2.0.kar
-rw-rw-rw- 1 root    root    2,0M Jan  2 15:33 org.openhab.binding.philipstv-3.3.0-SNAPSHOT.jar
-rw-r--r-- 1 openhab openhab   70 Dez 20 07:21 README
openhabian@openhab:/usr/share/openhab/addons $ pwd
/usr/share/openhab/addons

and after that I restarted my Openhab Service once.

Then I get the following result:

openhab> bundle:list
START LEVEL 100 , List Threshold: 50
 ID â State  â Lvl â Version               â Name
âââââ¼âââââââââ¼ââââââ¼ââââââââââââââââââââââââ¼ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
 29 â Active â  80 â 2.12.5                â Jackson-annotations
 30 â Active â  80 â 2.12.5                â Jackson-core
 31 â Active â  80 â 2.12.5                â jackson-databind
 32 â Active â  80 â 2.12.5                â Jackson-dataformat-YAML
 33 â Active â  80 â 2.12.5                â Jackson datatype: JSR310
 34 â Active â  80 â 6.2.6                 â Woodstox
...
292 â Active â  75 â 3.2.0                 â openHAB Add-ons :: Bundles :: Transformation Service :: RegEx
293 â Active â  80 â 3.2.0                 â openHAB UI :: Bundles :: Basic UI
294 â Active â  80 â 3.2.0                 â openHAB UI :: Bundles :: HABPanel UI
295 â Active â  80 â 3.2.0                 â openHAB UI :: Bundles :: Icon Set :: Classic
296 â Active â  80 â 1.0.3                 â reactive-streams
297 â Active â  80 â 3.3.0.202112261447    â openHAB Add-ons :: Bundles :: Philips TV Binding
openhab>

Hi @eninaus,
thanks for helping! Removed the file, restarted, redownloaded the file, fixed permissions, restarted, checked log and bundle:list without any trace of it, no errors or warnings either. There’s no need to add it to any config file right?

 wget https://github.com/mebe1012/openhab2-bindings/raw/philipstv/bundles/org.openhab.binding.philipstv/release/org.openhab.binding.philipstv-3.3.0-SNAPSHOT.jar -P /opt/openhab/addons/

/opt/openhab/addons# chown openhab:openhab org.openhab.binding.philipstv-3.3.0-SNAPSHOT.jar
/opt/openhab/addons# chmod +w org.openhab.binding.philipstv-3.3.0-SNAPSHOT.jar
/opt/openhab/addons# ll
total 2012
d-wx--x--x 2 openhab openhab    4096 Jan 20 23:20 ./
drwxr-xr-x 5 openhab openhab    4096 Jan 19 19:41 ../
-rw-r--r-- 1 openhab openhab 2049559 Jan 20 23:19 org.openhab.binding.philipstv-3.3.0-SNAPSHOT.jar
openhab> bundle:list | grep -i Add-on
152 │ Active │  80 │ 3.3.0.202201070311    │ openHAB Core :: Bundles :: Marketplace Add-on Services
153 │ Active │  80 │ 3.3.0.202201070311    │ openHAB Core :: Bundles :: Community Marketplace Add-on Service :: Karaf
246 │ Active │  80 │ 3.3.0.202201190331    │ openHAB Add-ons :: Bundles :: Astro Binding
247 │ Active │  80 │ 3.3.0.202201190334    │ openHAB Add-ons :: Bundles :: Chromecast Binding
248 │ Active │  80 │ 3.3.0.202201190357    │ openHAB Add-ons :: Bundles :: Onkyo Binding
249 │ Active │  80 │ 3.3.0.202201190411    │ openHAB Add-ons :: Bundles :: Verisure Binding
250 │ Active │  80 │ 3.3.0.202201090338    │ openHAB Add-ons :: Bundles :: ZigBee Binding
251 │ Active │  80 │ 3.3.0.202201090342    │ openHAB Add-ons :: Bundles :: ZigBee CC2531 Bridge
252 │ Active │  80 │ 3.3.0.202201090342    │ openHAB Add-ons :: Bundles :: ZigBee Console
253 │ Active │  80 │ 3.3.0.202201090344    │ openHAB Add-ons :: Bundles :: ZigBee Console Ember
254 │ Active │  80 │ 3.3.0.202201090344    │ openHAB Add-ons :: Bundles :: ZigBee Console Telegesis
255 │ Active │  80 │ 3.3.0.202201090342    │ openHAB Add-ons :: Bundles :: ZigBee Ember Bridge
256 │ Active │  80 │ 3.3.0.202201090338    │ openHAB Add-ons :: Bundles :: ZigBee Serial Driver
257 │ Active │  80 │ 3.3.0.202201090342    │ openHAB Add-ons :: Bundles :: ZigBee Telegesis Bridge
258 │ Active │  80 │ 3.3.0.202201090343    │ openHAB Add-ons :: Bundles :: ZigBee XBee Bridge
259 │ Active │  80 │ 3.3.0.202201160348    │ openHAB Add-ons :: Bundles :: ZWave Binding
269 │ Active │  80 │ 3.3.0.202201190416    │ openHAB Add-ons :: Bundles :: Persistence Service :: RRD4j

Well, the jar file must be placed at the right location.

see also: https://v2.openhab.org/docs/configuration/addons.html#through-manually-provided-add-ons

therefore my location matches this config: https://v2.openhab.org/docs/installation/linux.html#file-locations

Maybe this might help you?

I’m running the instance in docker using the suggested paths in accordance to the docker documentation. It did work from that path prior to updating openhab.

docker run \
--name openhab \
--net=host \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \
-v /opt/openhab/conf:/openhab/conf \
-v /opt/openhab/userdata:/openhab/userdata \
-v /opt/openhab/addons:/openhab/addons \
-d \
-e USER_ID=997 \
-e GROUP_ID=997 \
-e CRYPTO_POLICY=unlimited \
-e OPENHAB_HTTP_PORT=8081 \
-e OPENHAB_HTTPS_PORT=8444 \
-e EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/zwave:/dev/zigbee" \
--device=/dev/zwave \
--device=/dev/zigbee \
--restart=always \
openhab/openhab:3.3.0-snapshot

While most things work well, I have some issues with my Ambilight in lounge mode (i.e. when the TV is turned off). When I activate the Ambilight and set the mode to “Follow Color Hot Lava” the light turns on as expected. But from time to time (sometimes after 5 minutes, sometimes after 1) the light turns off shortly and then turns on again - basically its flickering.
This does however not happen when I activate the lounge mode using the remote.
Does anyone encounter the same issue?

Okay, finally found that the addons folder had wrong permissions set! :man_facepalming: