AndroidTV Binding [3.2.0;4.2.0)

So good news is, I don’t think you actually have to redo the PIN process. Where you see:

Notice it says Logged In: true. This means that PIN should be good. I’m confused that you have the thing offline if that says true. What is the thing status message being produced?

You are correct. I never tested any commands. I just ASSUMED I would have to do a PIN process with the new Thing. But it works. Sorry for the confusion.

Not sure why I had to create a new Thing in the first place, but I definitely should have tested it.

Not sure why you had to create a new thing either. The reason you didn’t have to do the PIN again is because we don’t regenerate the certificates unless they are actually missing. Otherwise they are stored in the userdata folder. Once the certificate is accepted by the device, it’s reused indefinitely (as long as the thing maintains the same name), unless the certificate is deleted. The moment that we get a successful login the PIN functions are locked out to prevent issues.

If it happens again, please grab a trace log and DM it to me and I can see where it’s failing. Those DirecTV boxes seem to be a headache for no real reason we can find yet.

Has anyone made a widget remote for this?

I’ve not heard of a specific one.

Universal Remote Widget or Harmony Hub Remote should work.

1 Like

This is working well for me.
I started with the key press Item/channel, but changed to using key code, which let me use more commands.

hi! i try to connect my googletv, but no success. bindind version 0.10.1 (a777e94) from marketplace. OH 3.2.0
after pin paring. debug log:
12:05:44.692 [DEBUG] [l.googletv.GoogleTVConnectionManager] - AABBCCDDEEFF - Opening GoogleTV SSL connection to 192.168.1.24:6466
12:05:44.798 [DEBUG] [l.googletv.GoogleTVConnectionManager] - Assuming server certificate is valid
12:05:44.799 [DEBUG] [l.googletv.GoogleTVConnectionManager] - Returning empty certificate for getAcceptedIssuers
12:05:44.827 [DEBUG] [l.googletv.GoogleTVConnectionManager] - AABBCCDDEEFF - Message reader thread started 6466
12:05:44.827 [DEBUG] [l.googletv.GoogleTVConnectionManager] - AABBCCDDEEFF - Command sender thread started 6466
12:05:44.833 [DEBUG] [tocol.googletv.GoogleTVMessageParser] - AABBCCDDEEFF - “SWTV-20AE” “skyworth” 10 com.google.android.tv.remote.service 5.2.473254133
12:05:44.840 [WARN ] [tocol.googletv.GoogleTVMessageParser] - AABBCCDDEEFF - GoogleTV Error Message: 1a47080312430a41087e123d0a08534d2d4739393855120773616d73756e671801220231332a19636f6d2e676f6f676c652e616e64726f69642e766964656f733207342e33382e3138
12:05:44.842 [DEBUG] [l.googletv.GoogleTVConnectionManager] - AABBCCDDEEFF - readerThreadJob received ffffffff. Disconnecting hard.
12:05:44.843 [DEBUG] [l.googletv.GoogleTVConnectionManager] - AABBCCDDEEFF - Attempting to reconnect to the GoogleTV
12:05:44.845 [DEBUG] [l.googletv.GoogleTVConnectionManager] - AABBCCDDEEFF - Disconnecting GoogleTV
12:05:44.847 [DEBUG] [l.googletv.GoogleTVConnectionManager] - AABBCCDDEEFF - Command sender thread exiting 6466
12:05:44.854 [DEBUG] [l.googletv.GoogleTVConnectionManager] - AABBCCDDEEFF - Opening GoogleTV SSL connection to 192.168.1.24:6466
12:05:44.927 [DEBUG] [l.googletv.GoogleTVConnectionManager] - Assuming server certificate is valid

and all repeat again…

what can i do to resolve the problem?

What kind of device is this that you are connecting to?

The error message you are getting:

Seems to indicate that it’s rejecting the login. The good news is, the fact that you’re getting that far means that PIN was successful. If it wasn’t, you wouldn’t even be allowed to connect and send the login message. We’ve seen this on a few random occasions and are not sure why it happens. Have you tried to power cycle your device or restart openhab?

yes, i have tried to reboot OH and TV, nothing changes

my device is skyworth tv - its Android TV 10.0
http://www.skyworth.net/global/android-tv.html

is it possible to see connection log on TV side? may be it will help debug why TV rejecting the login

If you would like to put the binding into trace and send the longer log to me via DM you are welcome to. We have seen this error message a few times before and it usually clears out as things are rebooted. You can also try to remove the thing, delete the files in userdata/androidtv/ (these are the certificates that were accepted during PIN), and recreate the thing, and redo the PIN process.

i tried remove/install binding, things, rebooted all. nothing new. switched log to trace

log is too big, where can i send it to you?

You should be able to put it in a text file and attach to a DM

I sent you a DM so you could reply to it.

Hello. First of all thanks for providing this!

I am having trouble, though, initially connecting to the TV. I wired the Pin channel to a new String-item “PIN” and then used this command in the console:

openhab:send PIN REQUEST

Although Openhab tells me that the command was successfully sent, nothing appears on the TV screen. Do I have to install anything on the TV, too? (GoogleTV is installed, I checked, and auto-discovery also worked.)

That should work. What kind of device is it? What does your log look like? What is the current status of the thing?

Hi there. The Thing shows “OFFLINE” - GoogleTV: PIN Process Incomplete". The device is a current Philipps Smart-TV, Model 65OLED707.

And here’s an excerpt of the log (through the log view on port 9001):

2023-05-23 14:54:19.345 [DEBUG] [e.osgi.LoggingCommandSessionListener] - Executing command: ‘openhab:send PIN REQUEST’

==> /var/log/openhab/events.log <==

2023-05-23 14:54:19.352 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘PIN’ received command REQUEST

==> /var/log/openhab/openhab.log <==

2023-05-23 14:54:19.358 [DEBUG] [e.osgi.LoggingCommandSessionListener] - Command: ‘openhab:send PIN REQUEST’ returned ‘null’

==> /var/log/openhab/events.log <==

2023-05-23 14:54:19.361 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘PIN’ predicted to become REQUEST

==> /var/log/openhab/openhab.log <==

2023-05-23 14:54:19.374 [DEBUG] [e.jetty.util.thread.QueuedThreadPool] - queue org.eclipse.jetty.server.AsyncContextState$1@3c0a496d startThread=0

2023-05-23 14:54:19.374 [DEBUG] [e.jetty.util.thread.QueuedThreadPool] - run org.eclipse.jetty.server.AsyncContextState$1@3c0a496d in QueuedThreadPool[qtp2096389068]@7cf45bcc{STARTED,2<=14<=50,i=3,r=-1,q=0}[ReservedThreadExecutor@76061b20{reserved=4/4,pending=0}]

2023-05-23 14:54:19.375 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array HeapByteBuffer@7e7dae51[p=0,l=7,c=7,r=7]={<<<event: >>>})

2023-05-23 14:54:19.375 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array) s=OPEN,api=BLOCKING,sc=false,e=null aggregated !flush DirectByteBuffer@5286e07b[p=0,l=7,c=32768,r=7]={<<<event: >>>alive\ndat…\x00\x00\x00\x00\x00\x00\x00}

2023-05-23 14:54:19.375 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array HeapByteBuffer@1e4bd5d4[p=0,l=7,c=7,r=7]={<<>>})

2023-05-23 14:54:19.376 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array) s=OPEN,api=BLOCKING,sc=false,e=null aggregated !flush DirectByteBuffer@5286e07b[p=0,l=14,c=32768,r=14]={<<<event: message>>>ata: {"ty…\x00\x00\x00\x00\x00\x00\x00}

2023-05-23 14:54:19.376 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array HeapByteBuffer@efd88d7[p=0,l=1,c=1,r=1]={<<<\n>>>})

2023-05-23 14:54:19.376 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array) s=OPEN,api=BLOCKING,sc=false,e=null aggregated !flush DirectByteBuffer@5286e07b[p=0,l=15,c=32768,r=15]={<<<event: message\n>>>ta: {"typ…\x00\x00\x00\x00\x00\x00\x00}

2023-05-23 14:54:19.376 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array HeapByteBuffer@18861e0c[p=0,l=6,c=6,r=6]={<<<data: >>>})

2023-05-23 14:54:19.377 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array) s=OPEN,api=BLOCKING,sc=false,e=null aggregated !flush DirectByteBuffer@5286e07b[p=0,l=21,c=32768,r=21]={<<<event: message\ndata: >>>type":"AL…\x00\x00\x00\x00\x00\x00\x00}

2023-05-23 14:54:19.377 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array HeapByteBuffer@b1a246b[p=0,l=201,c=201,r=201]={<<<{“topic”:"openhab/things/…“ThingStatusInfoEvent”}>>>})

2023-05-23 14:54:19.377 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array) s=OPEN,api=BLOCKING,sc=false,e=null aggregated !flush DirectByteBuffer@5286e07b[p=0,l=222,c=32768,r=222]={<<<event: message\ndata: {“to…“ThingStatusInfoEvent”}>>>el”:"Key …\x00\x00\x00\x00\x00\x00\x00}

2023-05-23 14:54:19.377 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - sendResponse info=null content=DirectByteBuffer@5286e07b[p=0,l=222,c=32768,r=222]={<<<event: message\ndata: {“to…“ThingStatusInfoEvent”}>>>el”:"Key …\x00\x00\x00\x00\x00\x00\x00} complete=false committing=false callback=Blocker@f2c1472{null}

2023-05-23 14:54:19.378 [DEBUG] [.eclipse.jetty.server.HttpConnection] - generate: NEED_CHUNK for SendCallback@802f731[PROCESSING][i=null,cb=org.eclipse.jetty.server.HttpChannel$SendCallback@4bbfb5a9] (null,[p=0,l=222,c=32768,r=222],false)@COMMITTED

2023-05-23 14:54:19.378 [DEBUG] [.eclipse.jetty.server.HttpConnection] - generate: FLUSH for SendCallback@802f731[PROCESSING][i=null,cb=org.eclipse.jetty.server.HttpChannel$SendCallback@4bbfb5a9] (null,[p=0,l=222,c=32768,r=222],false)@COMMITTED

2023-05-23 14:54:19.378 [DEBUG] [org.eclipse.jetty.io.WriteFlusher ] - write: WriteFlusher@48d38625{IDLE}->null [HeapByteBuffer@6a974b18[p=0,l=6,c=1024,r=6]={<<<\r\nDE\r\n>>>\n\x00\x00\x00\x00\x00\x00\x00\x00…\x00\x00\x00\x00\x00\x00\x00},DirectByteBuffer@5286e07b[p=0,l=222,c=32768,r=222]={<<<event: message\ndata: {“to…“ThingStatusInfoEvent”}>>>el”:"Key …\x00\x00\x00\x00\x00\x00\x00}]

2023-05-23 14:54:19.379 [DEBUG] [org.eclipse.jetty.io.WriteFlusher ] - update WriteFlusher@48d38625{WRITING}->null:IDLE–>WRITING

2023-05-23 14:54:19.379 [DEBUG] [org.eclipse.jetty.io.ChannelEndPoint] - flushed 228 SocketChannelEndPoint@26950ce{l=/192.168.178.100:80,r=/192.168.178.31:56400,OPEN,fill=-,flush=W,to=312/30000}{io=0/0,kio=0,kro=1}->HttpConnection@44b67349[p=HttpParser{s=CONTENT,0 of -1},g=HttpGenerator@497ba4f4{s=COMMITTED}]=>HttpChannelOverHttp@61876f9{s=HttpChannelState@1c1bc5f{s=WAITING rs=ASYNC os=COMMITTED is=IDLE awp=false se=false i=false al=2},r=1,c=false/false,a=WAITING,uri=//server/rest/events?topics=openhab/things//,openhab/links//,age=207224}

2023-05-23 14:54:19.379 [DEBUG] [org.eclipse.jetty.io.WriteFlusher ] - Flushed=true written=228 remaining=0 WriteFlusher@48d38625{WRITING}->null

2023-05-23 14:54:19.380 [DEBUG] [org.eclipse.jetty.io.WriteFlusher ] - update WriteFlusher@48d38625{IDLE}->null:WRITING–>IDLE

2023-05-23 14:54:19.380 [DEBUG] [.eclipse.jetty.server.HttpConnection] - generate: DONE for SendCallback@802f731[PROCESSING][i=null,cb=org.eclipse.jetty.server.HttpChannel$SendCallback@4bbfb5a9] (null,[p=222,l=222,c=32768,r=0],false)@COMMITTED

2023-05-23 14:54:19.380 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - onWriteComplete(false,null) s=OPEN,api=BLOCKED,sc=false,e=null->s=OPEN,api=BLOCKING,sc=false,e=null c=null cb=null w=false

2023-05-23 14:54:19.380 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array HeapByteBuffer@29e63739[p=0,l=1,c=1,r=1]={<<<\n>>>})

2023-05-23 14:54:19.380 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array) s=OPEN,api=BLOCKING,sc=false,e=null aggregated !flush DirectByteBuffer@5286e07b[p=0,l=1,c=32768,r=1]={<<<\n>>>vent: mes…\x00\x00\x00\x00\x00\x00\x00}

2023-05-23 14:54:19.381 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array HeapByteBuffer@1382a77[p=0,l=1,c=1,r=1]={<<<\n>>>})

2023-05-23 14:54:19.381 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array) s=OPEN,api=BLOCKING,sc=false,e=null aggregated !flush DirectByteBuffer@5286e07b[p=0,l=2,c=32768,r=2]={<<<\n\n>>>ent: mess…\x00\x00\x00\x00\x00\x00\x00}

2023-05-23 14:54:19.381 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - sendResponse info=null content=DirectByteBuffer@5286e07b[p=0,l=2,c=32768,r=2]={<<<\n\n>>>ent: mess…\x00\x00\x00\x00\x00\x00\x00} complete=false committing=false callback=Blocker@f2c1472{null}

2023-05-23 14:54:19.381 [DEBUG] [.eclipse.jetty.server.HttpConnection] - generate: NEED_CHUNK for SendCallback@802f731[PROCESSING][i=null,cb=org.eclipse.jetty.server.HttpChannel$SendCallback@5bdb6f47] (null,[p=0,l=2,c=32768,r=2],false)@COMMITTED

2023-05-23 14:54:19.382 [DEBUG] [.eclipse.jetty.server.HttpConnection] - generate: FLUSH for SendCallback@802f731[PROCESSING][i=null,cb=org.eclipse.jetty.server.HttpChannel$SendCallback@5bdb6f47] (null,[p=0,l=2,c=32768,r=2],false)@COMMITTED

2023-05-23 14:54:19.382 [DEBUG] [org.eclipse.jetty.io.WriteFlusher ] - write: WriteFlusher@48d38625{IDLE}->null [HeapByteBuffer@1eb15000[p=0,l=5,c=1024,r=5]={<<<\r\n2\r\n>>>\n\n\x00\x00\x00\x00\x00\x00\x00…\x00\x00\x00\x00\x00\x00\x00},DirectByteBuffer@5286e07b[p=0,l=2,c=32768,r=2]={<<<\n\n>>>ent: mess…\x00\x00\x00\x00\x00\x00\x00}]

2023-05-23 14:54:19.382 [DEBUG] [org.eclipse.jetty.io.WriteFlusher ] - update WriteFlusher@48d38625{WRITING}->null:IDLE–>WRITING

2023-05-23 14:54:19.382 [DEBUG] [org.eclipse.jetty.io.ChannelEndPoint] - flushed 7 SocketChannelEndPoint@26950ce{l=/192.168.178.100:80,r=/192.168.178.31:56400,OPEN,fill=-,flush=W,to=3/30000}{io=0/0,kio=0,kro=1}->HttpConnection@44b67349[p=HttpParser{s=CONTENT,0 of -1},g=HttpGenerator@497ba4f4{s=COMMITTED}]=>HttpChannelOverHttp@61876f9{s=HttpChannelState@1c1bc5f{s=WAITING rs=ASYNC os=COMMITTED is=IDLE awp=false se=false i=false al=2},r=1,c=false/false,a=WAITING,uri=//server/rest/events?topics=openhab/things//,openhab/links//,age=207227}

2023-05-23 14:54:19.383 [DEBUG] [org.eclipse.jetty.io.WriteFlusher ] - Flushed=true written=7 remaining=0 WriteFlusher@48d38625{WRITING}->null

2023-05-23 14:54:19.383 [DEBUG] [org.eclipse.jetty.io.WriteFlusher ] - update WriteFlusher@48d38625{IDLE}->null:WRITING–>IDLE

2023-05-23 14:54:19.383 [DEBUG] [.eclipse.jetty.server.HttpConnection] - generate: DONE for SendCallback@802f731[PROCESSING][i=null,cb=org.eclipse.jetty.server.HttpChannel$SendCallback@5bdb6f47] (null,[p=2,l=2,c=32768,r=0],false)@COMMITTED

2023-05-23 14:54:19.383 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - onWriteComplete(false,null) s=OPEN,api=BLOCKED,sc=false,e=null->s=OPEN,api=BLOCKING,sc=false,e=null c=null cb=null w=false

2023-05-23 14:54:19.384 [DEBUG] [e.jetty.util.thread.QueuedThreadPool] - ran org.eclipse.jetty.server.AsyncContextState$1@3c0a496d in QueuedThreadPool[qtp2096389068]@7cf45bcc{STARTED,2<=14<=50,i=3,r=-1,q=0}[ReservedThreadExecutor@76061b20{reserved=4/4,pending=0}]

2023-05-23 14:54:21.576 [DEBUG] [calimero.link.192.168.178.22:3671 ] - indication 1.1.91->0/0/20 L_Data.ind, low priority hop count 6, tpdu 00 80 00 d0

2023-05-23 14:54:23.575 [DEBUG] [calimero.link.192.168.178.22:3671 ] - indication 1.1.91->0/0/11 L_Data.ind, low priority hop count 6, tpdu 00 80 4f 0c

What does your thing and item configuration look like?

The thing:

UID: androidtv:googletv:TV
label: 65OLED707
thingTypeUID: androidtv:googletv
configuration:
ipAddress: 192.168.178.44

The item:

I think I see it. Put REQUEST in quotes when doing it on the command line. I just ran a test on my side to make sure Google didn’t update anything and it worked cleanly. If you put the binding logging into debug you should see something along the lines of:

openhab> openhab:send ShieldTV_THEATER_PINCODE "REQUEST"
Command has been sent successfully.
openhab> openhab:send ShieldTV_THEATER_PINCODE "D0F06D"
Command has been sent successfully.

2023-05-24 13:35:28.733 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Opening GoogleTV SSL connection to 10.0.0.1:6466
2023-05-24 13:35:28.765 [DEBUG] [l.googletv.GoogleTVConnectionManager] - Assuming server certificate is valid
2023-05-24 13:35:28.766 [DEBUG] [l.googletv.GoogleTVConnectionManager] - Returning empty certificate for getAcceptedIssuers
2023-05-24 13:35:28.771 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Message reader thread started 6466
2023-05-24 13:35:28.771 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Command sender thread started 6466
2023-05-24 13:35:28.811 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - GoogleTV PIN Process Incomplete
2023-05-24 13:35:28.811 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - startChildConnectionManager parent config: 6466 NORMAL false
2023-05-24 13:35:28.811 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - startChildConnectionManager child config: 6467 PIN false
2023-05-24 13:35:28.815 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Opening GoogleTV SSL connection to 10.0.0.1:6467
2023-05-24 13:35:28.815 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Message reader thread exiting 6466
2023-05-24 13:35:28.853 [DEBUG] [l.googletv.GoogleTVConnectionManager] - Assuming server certificate is valid
2023-05-24 13:35:28.853 [DEBUG] [l.googletv.GoogleTVConnectionManager] - Returning empty certificate for getAcceptedIssuers
2023-05-24 13:35:28.858 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Message reader thread started 6467
2023-05-24 13:35:28.858 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Command sender thread started 6467

2023-05-24 13:37:55.943 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Command received: pincode
2023-05-24 13:37:55.943 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Command received: pincode
2023-05-24 13:37:55.960 [DEBUG] [tocol.googletv.GoogleTVMessageParser] - theater - PIN Process Successful!
2023-05-24 13:37:55.960 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Disconnecting GoogleTV
2023-05-24 13:37:55.960 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Command sender thread exiting 6467
2023-05-24 13:37:55.961 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Disconnecting GoogleTV
2023-05-24 13:37:55.961 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Attempting to reconnect to the GoogleTV
2023-05-24 13:37:55.961 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Disconnecting GoogleTV
2023-05-24 13:37:55.961 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Opening GoogleTV SSL connection to 10.0.0.1:6466
2023-05-24 13:37:55.961 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Command sender thread exiting 6466

2023-05-24 13:37:56.001 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Message reader thread started 6466
2023-05-24 13:37:56.001 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Command sender thread started 6466
2023-05-24 13:37:56.052 [DEBUG] [tocol.googletv.GoogleTVMessageParser] - theater - 0a5b08ff041256 "SHIELD Android TV" "NVIDIA" 11 com.google.android.tv.remote.service 5.2.473254133
2023-05-24 13:37:56.053 [INFO ] [tocol.googletv.GoogleTVMessageParser] - theater - Login Successful
2023-05-24 13:37:56.057 [DEBUG] [l.googletv.GoogleTVConnectionManager] - theater - Setting power to true
2023-05-24 13:37:56.066 [DEBUG] [tocol.googletv.GoogleTVMessageParser] - theater - Device Update: 920319084a1009 "SHIELD Android TV" 01
2023-05-24 13:37:56.335 [DEBUG] [tocol.googletv.GoogleTVMessageParser] - theater - Current App: a201210a1f com.google.android.tvlauncher