Philips TV (2016+) Binding

@morph166955 I have done another test with WOL from network binding and without sending power on command to TV. Just to watch the status of the thing when TV goes out of deep sleep mode.

Enable GoogleTV = ON:

  1. TV in deep sleep mode (0.3W)
  2. Send wake up command to network binding:
 var wolAction = actions.Things.getActions("network","network:pingdevice:881e749a1e");
 wolAction.sendWakeOnLanPacketViaMac();
  1. TV wakes up immediately (~8W)
  2. Thing status does not go Online. The status stays somehow in:
    1

Trace:
WOL_OK_Thing_Offline_GTVProtON.log (144.2 KB)

2nd test with Enable GoogleTV = OFF:

  1. TV in deep sleep mode (0.3W)
  2. Send wake up command to network binding:
 var wolAction = actions.Things.getActions("network","network:pingdevice:881e749a1e");
 wolAction.sendWakeOnLanPacketViaMac();
  1. TV wakes up immediately (~8W)

  2. Thing status does not go Online. The status stays somehow in:
    2

  3. Disable/Enable Thing and status was immediately ONLINE

Trace:
WOL_OK_Thing_Offline_GTVProtOFF_DisableEnableThing.log (223.9 KB)

Maybe it helps to find the WOL issue we have.

Yup, exactly what I was expecting to see. The health monitor definitely saw you do the WOL and is firing off the connection when the port opens. It’s this “StandbyKeep” state. Not sure where that came from but it’s throwing the protocol from online to offline inside of a split second. I think if you were to send a power on once GTV comes up it would power up as expected and the thing would come online.
Everything looks fine from what I can see other than that. I think if I can tune up some of the timers and add StandbyKeep it should clean this up. I have a few ideas, just haven’t had the time to do the code yet. Maybe this afternoon, been a busy week.

2023-08-30 06:22:47.701 [DEBUG] [philipstv.PhilipsTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Device Health - Online: false - Logged In: false
2023-08-30 06:22:50.178 [DEBUG] [l.googletv.GoogleTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Device Health - Online: false - Logged In: false - Mode: NORMAL

2023-08-30 06:22:53.126 [DEBUG] [philipstv.PhilipsTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Device Health - Online: true - Logged In: false
2023-08-30 06:22:53.126 [DEBUG] [philipstv.PhilipsTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Device is back online.  Attempting reconnection.

2023-08-30 06:22:53.197 [TRACE] [philipstv.PhilipsTVConnectionManager] - postUpdateThing ONLINE NONE online.online
2023-08-30 06:22:53.198 [DEBUG] [philipstv.PhilipsTVConnectionManager] - Refresh Scheduler already started for Philips TV F00DBABE_AA5E_BABA_DADA_70af241424b4, terminating.
2023-08-30 06:22:53.200 [DEBUG] [philipstv.PhilipsTVConnectionManager] - Starting Refresh Scheduler for Philips TV F00DBABE_AA5E_BABA_DADA_70af241424b4 with refresh rate of 10.
2023-08-30 06:22:53.201 [TRACE] [nternal.AndroidTVTranslationProvider] - Translated: online.online as Online
2023-08-30 06:22:53.202 [TRACE] [philipstv.PhilipsTVConnectionManager] - setStatus to true online.online Online
2023-08-30 06:22:53.203 [DEBUG] [protocol.philipstv.ConnectionManager] - Target Uri is: https://192.168.1.57:1926/6/powerstate
2023-08-30 06:22:53.738 [DEBUG] [protocol.philipstv.ConnectionManager] - ----------------------------------------
2023-08-30 06:22:53.739 [DEBUG] [protocol.philipstv.ConnectionManager] - HTTP/1.1 200 OK
2023-08-30 06:22:53.739 [DEBUG] [protocol.philipstv.ConnectionManager] - {"powerstate":"StandbyKeep"}
2023-08-30 06:22:53.740 [TRACE] [philipstv.PhilipsTVConnectionManager] - postUpdateThing OFFLINE NONE 
2023-08-30 06:22:53.740 [DEBUG] [philipstv.PhilipsTVConnectionManager] - Stopping Refresh Scheduler for Philips TV: F00DBABE_AA5E_BABA_DADA_70af241424b4
2023-08-30 06:22:53.741 [TRACE] [philipstv.PhilipsTVConnectionManager] - Updating status to OFFLINE NONE 
2023-08-30 06:22:53.743 [TRACE] [nternal.AndroidTVTranslationProvider] - Failed to translate: 
2023-08-30 06:22:53.743 [TRACE] [philipstv.PhilipsTVConnectionManager] - setStatus to false  

2023-08-30 06:22:55.181 [DEBUG] [l.googletv.GoogleTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Device Health - Online: true - Logged In: false - Mode: NORMAL
2023-08-30 06:22:55.182 [DEBUG] [l.googletv.GoogleTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Device is back online.  Attempting reconnection.
2023-08-30 06:22:55.183 [DEBUG] [l.googletv.GoogleTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Attempting to reconnect to the GoogleTV

2023-08-30 06:22:55.272 [INFO ] [tocol.googletv.GoogleTVMessageParser] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Login Successful
2023-08-30 06:22:55.273 [TRACE] [nternal.AndroidTVTranslationProvider] - Translated: online.online as Online
2023-08-30 06:22:55.279 [DEBUG] [l.googletv.GoogleTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Setting power to false

2023-08-30 06:22:55.898 [DEBUG] [l.googletv.GoogleTVConnectionManager] - I/O error while reading from stream: Connection reset
2023-08-30 06:22:55.900 [TRACE] [nternal.AndroidTVTranslationProvider] - Translated: offline.io-error as I/O Error
2023-08-30 06:22:55.902 [DEBUG] [l.googletv.GoogleTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Message reader thread exiting 6466
2023-08-30 06:22:59.245 [DEBUG] [philipstv.PhilipsTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Device Health - Online: false - Logged In: false
2023-08-30 06:22:59.246 [DEBUG] [philipstv.PhilipsTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Device is offline.
2023-08-30 06:22:59.247 [TRACE] [philipstv.PhilipsTVConnectionManager] - postUpdateThing OFFLINE COMMUNICATION_ERROR offline.communication-error-will-try-to-reconnect
2023-08-30 06:22:59.248 [TRACE] [philipstv.PhilipsTVConnectionManager] - Updating status to OFFLINE COMMUNICATION_ERROR offline.communication-error-will-try-to-reconnect
2023-08-30 06:22:59.250 [TRACE] [nternal.AndroidTVTranslationProvider] - Translated: offline.communication-error-will-try-to-reconnect as Communication error, will try to reconnect
2023-08-30 06:22:59.251 [TRACE] [philipstv.PhilipsTVConnectionManager] - setStatus to false offline.communication-error-will-try-to-reconnect Communication error, will try to reconnect

2023-08-30 06:23:00.733 [DEBUG] [l.googletv.GoogleTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Device Health - Online: false - Logged In: false - Mode: NORMAL
2023-08-30 06:23:04.254 [DEBUG] [philipstv.PhilipsTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Device Health - Online: true - Logged In: false
2023-08-30 06:23:04.254 [DEBUG] [philipstv.PhilipsTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Device is back online.  Attempting reconnection.

2023-08-30 06:23:04.319 [TRACE] [philipstv.PhilipsTVConnectionManager] - postUpdateThing ONLINE NONE online.online
2023-08-30 06:23:04.320 [DEBUG] [philipstv.PhilipsTVConnectionManager] - Refresh Scheduler already started for Philips TV F00DBABE_AA5E_BABA_DADA_70af241424b4, terminating.
2023-08-30 06:23:04.321 [DEBUG] [philipstv.PhilipsTVConnectionManager] - Starting Refresh Scheduler for Philips TV F00DBABE_AA5E_BABA_DADA_70af241424b4 with refresh rate of 10.
2023-08-30 06:23:04.321 [TRACE] [nternal.AndroidTVTranslationProvider] - Translated: online.online as Online
2023-08-30 06:23:04.322 [TRACE] [philipstv.PhilipsTVConnectionManager] - setStatus to true online.online Online
2023-08-30 06:23:04.324 [DEBUG] [protocol.philipstv.ConnectionManager] - Target Uri is: https://192.168.1.57:1926/6/powerstate
2023-08-30 06:23:04.470 [DEBUG] [protocol.philipstv.ConnectionManager] - ----------------------------------------
2023-08-30 06:23:04.470 [DEBUG] [protocol.philipstv.ConnectionManager] - HTTP/1.1 200 OK
2023-08-30 06:23:04.471 [DEBUG] [protocol.philipstv.ConnectionManager] - {"powerstate":"StandbyKeep"}
2023-08-30 06:23:04.471 [TRACE] [philipstv.PhilipsTVConnectionManager] - postUpdateThing OFFLINE NONE 
2023-08-30 06:23:04.473 [DEBUG] [philipstv.PhilipsTVConnectionManager] - Stopping Refresh Scheduler for Philips TV: F00DBABE_AA5E_BABA_DADA_70af241424b4
2023-08-30 06:23:04.475 [TRACE] [philipstv.PhilipsTVConnectionManager] - Updating status to OFFLINE NONE 
2023-08-30 06:23:04.476 [TRACE] [nternal.AndroidTVTranslationProvider] - Failed to translate: 
2023-08-30 06:23:04.476 [TRACE] [philipstv.PhilipsTVConnectionManager] - setStatus to false 

2023-08-30 06:23:05.735 [DEBUG] [l.googletv.GoogleTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Device Health - Online: true - Logged In: false - Mode: NORMAL
2023-08-30 06:23:05.736 [DEBUG] [l.googletv.GoogleTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Device is back online.  Attempting reconnection.
2023-08-30 06:23:05.736 [DEBUG] [l.googletv.GoogleTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Attempting to reconnect to the GoogleTV

2023-08-30 06:23:05.804 [INFO ] [tocol.googletv.GoogleTVMessageParser] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Login Successful
2023-08-30 06:23:05.806 [TRACE] [nternal.AndroidTVTranslationProvider] - Translated: online.online as Online
2023-08-30 06:23:05.813 [DEBUG] [l.googletv.GoogleTVConnectionManager] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Setting power to false

Ok, let’s give this a shot for the power…

https://github.com/morph166955/openhab-addons/releases/download/androidtv-beta/org.openhab.binding.androidtv-4.1.0-SNAPSHOT-40ebd69.jar

Trace log please. What should happen now:

  1. We track “StandbyKeep” as the message received after it comes online from low power after a WOL. This should bring the thing online.
  2. We now track that the user requested a power on. In the event that the WOL takes more than the 10 second timer (which was observed in a few of the logs), when the device does come online we send an extra power on command.
  3. The moment a power-on is sent, if the device is in low power (basically if it’s offline), we change the health monitor from 5 seconds to 1 second to get a faster response time. In theory we should see that device come up much quicker now.

I could see different behaviour with latest jar and have done different trace logs. Sometimes Thing did go online and all good. But I could also see that Thing did go Online and then Offline again with GoogleTV Status “I/O:Error”:

status

Enable GoogleTV_Enabled_IOError.log (211.3 KB)

It also happened once that TV did not turn on at all:

Enable GoogleTV_Disabled_TVnotPoweredON.log (239.4 KB)

These two logs are with “Enable GoogleTV = Enabled” and “Enable GoogleTV = Disabled”:
Enable GoogleTV_Enabled.log (197.7 KB)
Enable GoogleTV_Disabled.log (224.3 KB)

I’m not sure why it went to I/O Error and stuck there. I see where it happened…

2023-09-03 11:27:52.446 [DEBUG] [l.googletv.GoogleTVConnectionManager] - I/O error while reading from stream: Connection reset
2023-09-03 11:27:52.447 [TRACE] [nternal.AndroidTVTranslationProvider] - Translated: offline.io-error as I/O Error

But then…

2023-09-03 11:28:19.037 [INFO ] [tocol.googletv.GoogleTVMessageParser] - F00DBABE_AA5E_BABA_DADA_70af241424b4 - Login Successful
2023-09-03 11:28:19.038 [TRACE] [nternal.AndroidTVTranslationProvider] - Translated: online.online as Online

So it should have gone online again. I’ll add some extra debug statements to see what’s happening.

Hello, I have several points to clarify

  1. is it works with OH 4
  2. is it merged in OH? (meaned is it searcheable from within interface)
  3. I can spent some time to develop (but with some preceeding explanations) any issues, if needed

Well, I install the addon, however on/off channel works, but the philips like (such as amblilight) not working

Did you install the last posted here or the AndroidTV binding from the marketplace?

Please don’t expect too much support with this little information. I’m working in a technical support role and the worst thing when people ask for help is “it does not work”.

Please also check how to ask for help:

Last posted here

Thanks for template, and even your posts was never like it i will try to fill it here:

  • Platform
    • Hardware: Orange Pi Zero LTS
    • Operating System: Armbian
    • OpenHAB Version: 4.0.2
    • Originating Issue: Philips TV Thing
  • Issue
    • Expected Behavior: (for example) Working of mute switch
    • Actual Behavior: not works
    • Steps:
      1. Add thing via inbox (Philips thing only)
      2. Pair via openhab console once as philips
      3. Enable google tv, pair again. Since then on/off switch works
  • What I have done so far
    • nothing
  • Details
    • Suppose like the “philips” protocol not work at all
  • Logs
    where can i get the right portion of logs?
    

Well, it’s not about strictly following the template line by line, but it’s about providing as much information as possible (detailed steps you did, screenshots, log files, etc).

I did quickly double check in my system and have re-added the PhilipsTV-Thing:

  • It should be OK to add PhilipsTV and do Pin-Process with this Setting:

For GoogleTV you don’t need to do the pin process separately.

But before you delete the thing and add it again, you should first delete the credentials and pin in the command line., e.g.:

sudo rm -R /var/lib/openhab/androidtv

Could be that path is different in your system.

If this does not work, you should definitively share TRACE or DEBUG log files. How to create log files is described in the documentation: Logging | openHAB

Console e.g.

log:set TRACE org.openhab.binding.androidtv

Last point: Not all models have beed tested in the past. What model do you have?

And good to know:
Some things to note:

Thanks for the support
which version I have to try exactly? Last posted as I try or from marketplace (official or community)?

My tv model is 55PUS7303/60 (russian);

I beleive I have to try all the channels from karaf console than I can be sure them work/not work independently of the gui structure

I have installed this version:

How to use (try to use) non-switch channels? Like keycode

The readme for the androidtv binding on the main marketplace thread discusses the non switch channels.

I reinstall thing from inside the HAB and it works.
However I have another one question - did the string channel (like searchContent) support the russian lang? At the moment when I try to send something on tv I receive only “???”

Sorry but we haven’t tested with other languages. The protocol stack only current accepts ASCII.

Is that restriction of OpenHab or Thing or Philips API?

Was the addon from marketplace ok for philipstv or?
Cause its not finding my tv atm, i deleted the androidtv folder, and restarted a couple of times, but still not finding the tv, also cannot add it manually or scan from the add things thingy.

Im on 4.1.0M2 btw.

2023-10-19 00:00:43.264 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/openhab/addons/org.openhab.binding.androidtv-4.1.0-SNAPSHOT-40ebd69.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.androidtv [307]
  Unresolved requirement: Import-Package: org.openhab.core.config.discovery.upnp

After installing the upnp binding, it installs, and i can scan for tv’s.

Still doesn’t find a philips tv, only a googletv, i can add it manually and pair it manually, but its not syncing between items and tv.

Deleted jar file, installed marketplace binding, deleted and unlinked all old items, and it seems to work now.