AndroidTV Binding [3.2.0;4.2.0)

All open PRs are now merged in time for 4.0.0M5. For the moment the marketplace is identical to whats available in 4.0.0 from snapshot 3540+ (with the exception of having 3.x compatibility added). There is currently one open issue I hope to have closed soon along with some tweaks to prevent log flooding in the future. Please report any and all issues through github. Thank you!

2 Likes

Before I report, is the event log part of this tweak?

Recall my wife unplugs the tv and the openhab log is fine. Just one message;

2023-07-15 20:17:58.490 [INFO ] [tocol.googletv.GoogleTVMessageParser] - E89EB43854BA - Login Successful
2023-07-15 22:14:33.840 [INFO ] [l.googletv.GoogleTVConnectionManager] - E89EB43854BA - Error opening SSL connection to 192.168.0.99:6466 No route to host

I don’t use event logging normally, so had not noticed this before, but briefly turned on the developer side bar Event Streaming for another reason and noticed repeated messages. I have the ThingStatusInfoEvent set to error, <Logger level="ERROR" name="openhab.event.ThingStatusInfoEvent"/> but maybe I’m missing something. I’m on the marketplace Version 1.04 (d23b28a)

* openhab/things/androidtv:googletv:E89EB43854BA/status
ThingStatusInfoEvent
{"status":"OFFLINE","statusDetail":"NONE","description":"GoogleTV: Error opening SSL connection. Check log."}
* openhab/things/androidtv:googletv:E89EB43854BA/status
ThingStatusInfoEvent
{"status":"OFFLINE","statusDetail":"NONE","description":"GoogleTV: Error opening SSL connection. Check log."}
* openhab/things/androidtv:googletv:E89EB43854BA/status
ThingStatusInfoEvent
{"status":"OFFLINE","statusDetail":"NONE","description":"GoogleTV: Error opening SSL connection. Check log."}
* openhab/things/androidtv:googletv:E89EB43854BA/status
ThingStatusInfoEvent
{"status":"OFFLINE","statusDetail":"NONE","description":"GoogleTV: Error opening SSL connection. Check log."}
* openhab/things/androidtv:googletv:E89EB43854BA/status
ThingStatusInfoEvent
{"status":"OFFLINE","statusDetail":"NONE","description":"GoogleTV: Error opening SSL connection. Check log."}
* openhab/things/androidtv:googletv:E89EB43854BA/status
ThingStatusInfoEvent
{"status":"OFFLINE","statusDetail":"NONE","description":"GoogleTV: Error opening SSL connection. Check log."}
* openhab/things/androidtv:googletv:E89EB43854BA/status
ThingStatusInfoEvent
{"status":"OFFLINE","statusDetail":"NONE","description":"GoogleTV: Error opening SSL connection. Check log."}

Sorry this isn’t going to impact that. The PR (which was just merged this morning) effectively disables the thing when an error message comes in over the GoogleTV protocol. This prevents a login/fail/reconnect loop from happening when there isn’t anything the end user can do (99.999% requires developer changes to resolve these).

How often are you getting those messages? I’m not seeing any time stamps to show frequency. We update thing status every 250ms (or less) so if you are monitoring for that then you should see it. In general you don’t see this in the event log. I suppose I could put something in to check for changes before making an update. If you’d like to open this as an issue on github I can see if I have time to resolve it.

EDIT: Don’t worry about creating an issue, I submitted [androidtv]Fixes log flood when physical device is not online by morph166955 · Pull Request #15258 · openhab/openhab-addons · GitHub to resolve that.

I do not get a time stamp on the developer side bar, stream events, but 250ms seems about right. For the record I tested with the TV ON and the same thing happens.

However, I also discovered there is a built-in filter on the side bar, so I can block these events, so not really an issue after all.

Gotcha. I’ll drop a jar in a bit to resolve the two log issues.

For anyone interested in setting the volume of the TV as an absolute value (0-100) instead of relative (+5/-5): I updated the rule I am using and edited my original post. Maybe something needs this too =)

I’ve pushed a new-ish jar (16816e3) to the main thread. This is mostly for the 3.x folks and gets everyone aligned with what is merged in at this point on the 4.0.0 side. I’m about to submit a few more PRs for features into 4.1.0 and will release an updated jar once I get some traction on those.

1 Like

I’m using a Xiaomi TV with android tv.
openHAB 4 as docker container with marketplace version of AndroidTV Binding.

Started pincode-process with openhab-cli
Entered displayed pin

Thing-State stopped at: “user forced pin process”

2023-07-31 17:09:40.497 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from OFFLINE: GoogleTV: Initializing to OFFLINE: GoogleTV: User Forced PIN Process

2023-07-31 17:19:23.585 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from OFFLINE: GoogleTV: User Forced PIN Process to UNINITIALIZED

2023-07-31 17:19:23.593 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)

2023-07-31 17:19:28.218 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from UNINITIALIZED (DISABLED) to INITIALIZING

2023-07-31 17:19:28.222 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from INITIALIZING to OFFLINE: Protocols Starting

2023-07-31 17:19:28.363 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from OFFLINE: Protocols Starting to OFFLINE: GoogleTV: Initializing

2023-07-31 17:19:28.393 [WARN ] [tocol.googletv.GoogleTVMessageParser] - B4C9B9D3ACE5 - GoogleTV Error Message: 1a5d080312590a5708fe0412520a08534d2d4739393855120773616d73756e671801220231332a19636f6d2e676f6f676c652e616e64726f69642e766964656f73321c342e33392e3634342e3533343836353739392e332d72656c65617365

2023-07-31 17:19:39.518 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from OFFLINE: GoogleTV: Initializing to OFFLINE: Protocols Starting

2023-07-31 17:19:39.639 [WARN ] [tocol.googletv.GoogleTVMessageParser] - B4C9B9D3ACE5 - GoogleTV Error Message: 1a5d080312590a5708fe0412520a08534d2d4739393855120773616d73756e671801220231332a19636f6d2e676f6f676c652e616e64726f69642e766964656f73321c342e33392e3634342e3533343836353739392e332d72656c65617365

restarted openHAB (TV off)

2023-07-31 17:26:09.593 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from UNINITIALIZED (HANDLER_MISSING_ERROR): Handler factory not found to UNINITIALIZED (NOT_YET_READY)

2023-07-31 17:26:11.404 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from UNINITIALIZED (NOT_YET_READY) to INITIALIZING

2023-07-31 17:26:11.413 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from INITIALIZING to OFFLINE: Protocols Starting

2023-07-31 17:26:11.832 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from OFFLINE: Protocols Starting to OFFLINE: GoogleTV: 

2023-07-31 17:28:21.311 [INFO ] [l.googletv.GoogleTVConnectionManager] - B4C9B9D3ACE5 - Error opening SSL connection to 192.168.10.72:6466 Connection timed out

2023-07-31 17:28:21.312 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from OFFLINE: GoogleTV:  to OFFLINE: GoogleTV: Error opening SSL connection. Check log.

2023-07-31 17:29:01.631 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from OFFLINE: GoogleTV: Error opening SSL connection. Check log. to OFFLINE: GoogleTV: Reconnecting

2023-07-31 17:29:01.762 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'androidtv:googletv:B4C9B9D3ACE5' changed from OFFLINE: GoogleTV: Reconnecting to OFFLINE: GoogleTV: Initializing

2023-07-31 17:29:01.779 [WARN ] [tocol.googletv.GoogleTVMessageParser] - B4C9B9D3ACE5 - GoogleTV Error Message: 1a5d080312590a5708fe0412520a08534d2d4739393855120773616d73756e671801220231332a19636f6d2e676f6f676c652e616e64726f69642e766964656f73321c342e33392e3634342e3533343836353739392e332d72656c65617365

do I need change something here:

Thank you for any help.

Michael

It looks like you are running into [androidtv] googletv.GoogleTVMessageParser GoogleTV Error Message · Issue #15153 · openhab/openhab-addons · GitHub

We’re still trying to figure out what is causing it. Are you getting a flood of that message or it just does it once and dies?

just one message and nothing else…

So they good news is that the update we did to prevent log flooding appears to work. The bad news is that we don’t have a fix for this bug yet as I can’t reproduce it here. I need someone to do some testing on a broken unit and send me the results so we can see what’s happening and get it resolved.

I could test or even let you take a look with teams screensharing if it helps…
(for me it would help for sure…)

Please take a look at the issue I linked above. There are instructions in there on what to do. Basically, the binding can be put into a mode where it acts as a man in the middle between a phone running the GoogleTV app and the device. If I can see what the app is doing to overcome the error, or somehow provide different information to avoid the error, I can adapt the binding. To note, I am worried about the ability for it to work in a docker scenario. If the container is configured in bridge mode it “may/should” work. If it’s not, then I’m not sure if AVAHI will be able to work with the mdns pieces. I have a PR open to address that, but it’s not working yet.

avahi isn’t available in my docker image.

AVAHI can actually be run on any device on the network as long as it points to the OH docker. The phone just needs to get the advertisement with the info.

I’m experience some strange behavior. I am controlling a DirecTV Stream box. The Thing is online and logs at debug level show the system health is good, and nothing else interesting. The Power channel updates the item when it is turned on and off. But the key code channel, that used to get updated when I did things like change the volume on the DirecTV Stream remote, now doesn’t do anything at all.

I was using that to pass along volume changes to my older Denon AVR.

I believe this change occurred somewhere along the way from OH 3.4.4 using the Marketplace binding to OH 4 using the official binding, but I don’t know for sure when or where. I am currently using OH 4.0.1 and AndriodTV Binding 4.0.1.

Any suggestions on how I can troubleshoot this?

Thanks

Hey @BigGeorgeTx. Im a little confused. We have never had the ability to monitor for key pressing from external remotes. The keycode and keypress channels are all one way. They are never updated. We only update power, volume, app info, etc.

Sorry for the confusion. Now I remember what I did. I have a UI Widgit remote that sends the key codes. My Denon AVR doesn’t communicate directly with the DirectTV Stream Box, so I have a rule that takes the key codes and converts them to commands for the denon. I got my virtual remote confused with the real one. Thanks for straightening me out.

No worries.

To give everyone an update, there are some changes coming in the next few days/weeks on this binding.

First, sooner than later PhilipsTV will be added in. There is a test jar floating around in a separate thread if anyone is interested, fair warning they are very alpha and not working properly just yet. Once it’s stable I’ll be posting it here.

Second, and probably more impactful, it looks like there were some upstream dependency changes which is going to make the hybrid jars really hard to build regularly. I’m going to fork off 3.x to a separate thread shortly and release much less frequently there (major bug fixes and security fixes only). It’s likely PhilipsTV and any new/emerging features will be a 4.x only a little sooner than I had thought.

2 Likes