AndroidTV Binding [3.2.0;4.2.0)

Hi!
I have successfully used this binding with my Shield TV for over a year. However since a couple of weeks there seems to be a bug:

The IP of my thing (Shield) changes automatically.
It gets changed to the IP of my Philips Android TV for which I haven’t configured a Google-TV thing.
If I change the IP manually back the Thing comes back online immediately. But after some time the IP gets reset again.

Any ideas what’s causing this? Maybe some autodiscovery issue?
An already configured thing should never change the IP by itself in my opinion.

Hey @shere. That sounds like an issue on the network or the device more than an issue with the binding. You may want to check your local DHCP server (normally on the router) to see what’s going on and try to assign it a static assignment. It definitely shouldn’t be getting the IP of another device either. Autodiscovery only really plays into account during initial setup. It doesn’t track the device beyond that. Some other bindings (Sonos for example) use UPNP which can track the device instead of using the IP however we don’t use that in this case. May be an interesting feature to add down the line though.

Thanks for your reply, @morph166955 !
The only thing that changes is the IP of the “Thing” in Openhab. The actual physical device (the shield) never changes the IP address (it has a static IP configuration).
So if the binding isn’t automatically trying to track the device or altering the IP configuration of the thing maybe it’s some underlying issue in openhab itself.

I will try to delete the thing and re-add it.

That’s very odd. Ive not seen that behavior before. The thing shouldn’t update the IP like that. The code isnt even in the binding to do it.

Got an error like @zsbagyura with a Philips TV
First pincode request worked.
But I’ve got this status in OH: “GoogleTV: PIN Process Incomplete | PhilipsTV: Online”
Can’t request the pincode another time: the TV is not showing anything when sending a new “REQUEST”.
Tried with a Google TV instead of Philips TV, no success at all.
IP is static and I’ve scanned the ports and I can see 6466 and 6467 as being open.

Note : My OH instance is also running in a Docker container.

Just to confirm, you only have one thing created for the TV. You dont have a googletv and a philipstv correct?

Sorry for the delay. Yes, I’ve got one thing. I’ve tried with both GoogleTV and PhilipsTV. Also tried to uninstall the plugin then reinstall and re-create a thing. No luck.

[philipstv.PhilipsTVConnectionManager] - Pairing code is available, but username and/or password is missing. Therefore we try to grant authorization and retrieve username and password.

For me it was solved magically. Maybe a complete reboot was the key…

Finally I was able to make it work. I’ve deactivated UPnP and GoogleTV protocol.

Maybe a suggestion, not related to my previous issue:

I saw this warning message in the log file and I think a full stacktrace is not relevant for a warning:

2024-05-17 17:28:45.899 [WARN ] [l.philipstv.service.TvChannelService] - Error occurred during handling of command for TV Channels: No route to host
java.net.NoRouteToHostException: No route to host
	at sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]
	at sun.nio.ch.Net.pollConnectNow(Net.java:672) ~[?:?]
[...]

Hi there, I have a shiledtv pro and openhab 4.1.3 My error is ShieldTV: I/O Error whenever I send a command from a player item, volume item, or even the power item. Here is the trace, can you help me ?
Thank you so much

6e64726f6964747618ec07
19:18:57.663 [DEBUG] [otocol.shieldtv.ShieldTVMessageParser] - c2e44552d0 - Current App: org.jellyfin.androidtv
19:19:02.646 [DEBUG] [ol.googletv.GoogleTVConnectionManager] - c2e44552d0 - Device Health - Online: true - Logged In: true - Mode: NORMAL
19:19:02.650 [DEBUG] [ol.shieldtv.ShieldTVConnectionManager] - c2e44552d0 - Device Health - Online: true - Logged In: true
19:19:02.659 [TRACE] [ol.shieldtv.ShieldTVConnectionManager] - c2e44552d0 - Sending ShieldTV keepalive query
19:19:02.660 [TRACE] [ol.shieldtv.ShieldTVConnectionManager] - c2e44552d0 - Raw ShieldTV command decodes as: 080028fae0a6c0d130
19:19:02.660 [TRACE] [ol.shieldtv.ShieldTVConnectionManager] - c2e44552d0 - Raw ShieldTV command decodes as: 08ec0712020806
19:19:02.661 [TRACE] [otocol.shieldtv.ShieldTVMessageParser] - c2e44552d0 - Received ShieldTV message from: SHIELD - Message: 080028fae0a6c0d130
19:19:02.661 [TRACE] [ol.shieldtv.ShieldTVConnectionManager] - c2e44552d0 - Canceling ShieldTV scheduled reconnect job.
19:19:02.661 [TRACE] [otocol.shieldtv.ShieldTVMessageParser] - c2e44552d0 - Keepalive Reply
19:19:02.663 [TRACE] [otocol.shieldtv.ShieldTVMessageParser] - c2e44552d0 - Received ShieldTV message from: SHIELD - Message: 08ec0712230807221f220566725f465242166f72672e6a656c6c7966696e2e616e64726f6964747618ec07
19:19:02.663 [DEBUG] [otocol.shieldtv.ShieldTVMessageParser] - c2e44552d0 - Current App: org.jellyfin.androidtv
19:19:07.647 [DEBUG] [ol.googletv.GoogleTVConnectionManager] - c2e44552d0 - Device Health - Online: true - Logged In: true - Mode: NORMAL
19:19:07.652 [DEBUG] [ol.shieldtv.ShieldTVConnectionManager] - c2e44552d0 - Device Health - Online: true - Logged In: true
19:19:07.660 [TRACE] [ol.shieldtv.ShieldTVConnectionManager] - c2e44552d0 - Sending ShieldTV keepalive query
19:19:07.660 [TRACE] [ol.shieldtv.ShieldTVConnectionManager] - c2e44552d0 - Raw ShieldTV command decodes as: 080028fae0a6c0d130
19:19:07.660 [TRACE] [ol.shieldtv.ShieldTVConnectionManager] - c2e44552d0 - Raw ShieldTV command decodes as: 08ec0712020806
19:19:07.661 [TRACE] [otocol.shieldtv.ShieldTVMessageParser] - c2e44552d0 - Received ShieldTV message from: SHIELD - Message: 080028fae0a6c0d130
19:19:07.661 [TRACE] [ol.shieldtv.ShieldTVConnectionManager] - c2e44552d0 - Canceling ShieldTV scheduled reconnect job.
19:19:07.662 [TRACE] [otocol.shieldtv.ShieldTVMessageParser] - c2e44552d0 - Keepalive Reply
19:19:07.663 [TRACE] [otocol.shieldtv.ShieldTVMessageParser] - c2e44552d0 - Received ShieldTV message from: SHIELD - Message: 08ec0712230807221f220566725f465242166f72672e6a656c6c7966696e2e616e64726f6964747618ec07
19:19:07.663 [DEBUG] [otocol.shieldtv.ShieldTVMessageParser] - c2e44552d0 - Current App: org.jellyfin.androidtv
19:19:11.914 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'ShieldTV_Player' received command PAUSE
19:19:11.915 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'ShieldTV_Player' predicted to become PAUSE
19:19:11.920 [INFO ] [openhab.event.ItemStateUpdatedEvent  ] - Item 'ShieldTV_Player' updated to PAUSE
19:19:11.920 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'ShieldTV_Player' changed from PLAY to PAUSE
19:19:11.924 [TRACE] [g.androidtv.internal.AndroidTVHandler] - c2e44552d0 - Command received at handler: player PAUSE
19:19:11.925 [DEBUG] [ol.googletv.GoogleTVConnectionManager] - c2e44552d0 - Command received: player
19:19:11.925 [TRACE] [ol.googletv.GoogleTVConnectionManager] - c2e44552d0 - Raw GoogleTV command decodes as: 065204087f1003
19:19:11.927 [TRACE] [ol.googletv.GoogleTVConnectionManager] - c2e44552d0 - readerThreadJob message length 12
19:19:11.928 [TRACE] [ol.googletv.GoogleTVConnectionManager] - c2e44552d0 - GoogleTV Message: 12 0c1a0a080512065204087f1003
19:19:11.928 [TRACE] [otocol.googletv.GoogleTVMessageParser] - c2e44552d0 - Received GoogleTV message - Length: 12 Message: 1a0a080512065204087f1003
19:19:11.928 [WARN ] [otocol.googletv.GoogleTVMessageParser] - c2e44552d0 - GoogleTV Error Message: 1a0a080512065204087f1003
19:19:11.928 [DEBUG] [ol.shieldtv.ShieldTVConnectionManager] - c2e44552d0 - Disconnecting ShieldTV
19:19:11.929 [DEBUG] [ol.shieldtv.ShieldTVConnectionManager] - c2e44552d0 - Command sender thread exiting
19:19:11.929 [DEBUG] [ol.shieldtv.ShieldTVConnectionManager] - I/O error while reading from stream: Socket closed
19:19:11.929 [DEBUG] [ol.googletv.GoogleTVConnectionManager] - c2e44552d0 - Disconnecting GoogleTV
19:19:11.929 [TRACE] [internal.AndroidTVTranslationProvider] - Translated: offline.io-error as I/O Error
19:19:11.929 [DEBUG] [ol.shieldtv.ShieldTVConnectionManager] - c2e44552d0 - Message reader thread exiting
19:19:11.929 [DEBUG] [ol.googletv.GoogleTVConnectionManager] - c2e44552d0 - Command sender thread exiting 6466
19:19:11.929 [DEBUG] [ol.googletv.GoogleTVConnectionManager] - c2e44552d0 - Message reader thread exiting 6466
19:19:11.930 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:shieldtv:c2e44552d0' changed from ONLINE to OFFLINE: GoogleTV: Online | ShieldTV: I/O Error

Can you please open a bug on github for this and attach the longer log of the device coming up and the volume/power failing as well? Thank you!

Good afternoon all,

With 4.2 about to drop I have made the decision to depreciate 3.x and the marketplace in general. I’m going to leave this post up but adjusted to be 3.2.0 through 4.1.0 for those who need it as soon as 4.2 is released. As the binding has been merged now for a long period of time, and we’re not looking at any major features right now, I’m going to be relying on the committed binding directly now from 4.2 and beyond. If there are any issues please report them through github and we can address them directly. Thank you to all who have helped to get this binding to this point!

1 Like

Hi All,
I have TELEKOM MagentaTV One (first generation) Boxes. You can add these Boxes as GoogleTV things. The device supports only the channels keypress, power, mute and volume (read only). But thats all you need to control your device using an universal remote widget and Alexa basic commands.
If you want I can share setup, rules and widget.

Hi All,

I’m struggling with the following problem with this binding.

I’m running openhab 4.2.1 and the binding is also 4.2.1. Sometimes the binding doesn’t see my Nvidia Shield Pro anymore. Last night the Shield was powered off but unresponsive, so I had to unplug it from the power, plug it back in and it was working again. But the binding wasn’t able to connect to it anymore:

The log is showing this at that moment:

2024-11-22 10:09:44.154 [INFO ] [openhab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:shieldtv:ShieldWoonkamer' changed from OFFLINE: GoogleTV: Error opening SSL connection. Check log. | ShieldTV: Initializing to OFFLINE: GoogleTV: Error opening SSL connection. Check log. | ShieldTV: Reconnecting
2024-11-22 10:09:44.156 [INFO ] [openhab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:shieldtv:ShieldWoonkamer' changed from OFFLINE: GoogleTV: Error opening SSL connection. Check log. | ShieldTV: Reconnecting to OFFLINE: GoogleTV: Error opening SSL connection. Check log. | ShieldTV: I/O Error
2024-11-22 10:09:44.268 [INFO ] [openhab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:shieldtv:ShieldWoonkamer' changed from OFFLINE: GoogleTV: Error opening SSL connection. Check log. | ShieldTV: I/O Error to OFFLINE: GoogleTV: Error opening SSL connection. 

So I rebooted the shield, restarted the binding (via Karaf) but that doesn’t do anything. So I tried to get another pincode to force a new handshake.

 openhab:androidtv androidtv:shieldtv:ShieldWoonkamer pincode REQUEST

I got very short the pincode on my screen, but it was about a second, so I couldn’t remember it. After that, the code never showed up again.

After that, the log shows a different error:

2024-11-22 10:24:54.983 [INFO ] [openhab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:shieldtv:ShieldWoonkamer' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to UNINITIALIZED (NOT_YET_READY)
2024-11-22 10:24:56.007 [INFO ] [openhab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:shieldtv:ShieldWoonkamer' changed from UNINITIALIZED (NOT_YET_READY) to INITIALIZING
2024-11-22 10:24:56.015 [INFO ] [openhab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:shieldtv:ShieldWoonkamer' changed from INITIALIZING to OFFLINE: Protocols Starting
2024-11-22 10:24:56.182 [INFO ] [openhab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:shieldtv:ShieldWoonkamer' changed from OFFLINE: Protocols Starting to OFFLINE: GoogleTV: Initializing | ShieldTV: 
2024-11-22 10:24:56.192 [INFO ] [openhab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:shieldtv:ShieldWoonkamer' changed from OFFLINE: GoogleTV: Initializing | ShieldTV:  to OFFLINE: GoogleTV: PIN Process Incomplete | ShieldTV: 
2024-11-22 10:24:56.196 [INFO ] [openhab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:shieldtv:ShieldWoonkamer' changed from OFFLINE: GoogleTV: PIN Process Incomplete | ShieldTV:  to OFFLINE: GoogleTV: PIN Process Incomplete | ShieldTV: Initializing

And after these errors, the log doesn’t show anything regarding to the binding. Not even when I stop and start it, the log stays clean. So i’m unable to fix anything regarding the connection. So I stopped the openhab service, cleaned it cache and restarted openhab again.

After this, certain items work / ShieldTV_APP and ShieldTV_APPNAME, but others don’t work: ShieldTV_PLAYER and ShieldTV_POWER, they stay NULL.

So I tried the pin process again, and now I got the screen with the pin code. Entered it, requested again and entered it (I think the manual isn’t clear about this, the second time looks necessary but I don’t see any pincode on the screen at a next request, and no confirmation after the second pin input).

The problem at my case is, it is impossible to force another pincode to force a new authentication if it is lost somehow, and unfortunately this does happen sometimes because of certain software bugs on the shield I guess.

Are the devices both on the same network? Is there a firewall or anything in between?

Also, PIN will not run if a keystore already exists and is validated. This prevents users from accidentally zapping the peering once it’s locked on the device. If you want to reset, remove the keystores at /var/lib/openhab/androidtv and at a minimum restart the binding (restarting OH is better).

I’m having problems executing the PIN Code Process on my openHAB 4.2.2 (running on Raspi 5 / Docker) with my Xiaomi Laser Projector 150’’ (running Android TV version 9). When executing the process, no code shows up on the screen . Does anyone have an idea?

I‘ve included more details here (just noticed that all issues regarding the binding appear to go in here).

Hi. I have an issue which i described here [AndroidTV] PhilipsTV power channel change values after thing thing got offline · Issue #18159 · openhab/openhab-addons · GitHub

Anybody seen the same issue?