AndroidTV Binding [3.2.0;4.2.0)

Thank you for the suggestion, but I too prefer IP. There is documentation on line about the TCP/IP protocal that can be found here: https://www.stormaudio.com/wp-content/uploads/2021/12/Stormaudio_isp_tcpip_api_protocol_fw4.3r0_v20.pdf

If you do make the binding for it I will gladly offer you a dinner.

So “unfortunately” I doubt anyone is going to make the binding without personal benefit. And that’s not to say anything bad about the developers here to be absolutely clear. Simply put, this is a free platform, no one is paid, so generally bindings get created when someone wants one for their personal use and shares it with the community. Also, it’s very hard to develop a binding without access to a test device so reality is, whomever were to write it needs to be an owner of one. That all said, you’re absolutely welcome to make one for your receiver. You’re welcome to reuse any of the code from this binding to build it as well.

Thank you. Unfortunately, I am totally deprived of any programming knowledge when it comes to modern computing. I learnt Basic when I was 10 (1985) and went on to Pascal at 12/13 years old. Was going to transition to C+, but did not have the hardware. Did a lillte bit of html in 1999/2000, but did not go on as I had no further use for it. Now I am having fun using Blockly to design rules in openHab. Creating a binding? I don’t think so. I could have a look at the Anthem one and see if I can figure out how it works. But then I need to learn how to compile etc etc etc…

I feel you. This is the first time I’m doing any major work in any coding language in almost 15 years. I got lucky that I did c++ and java in college. Your best bet is to try to post up on the addons section and see if anyone else is interested and would be willing. Otherwise, I still agree with @mhilbush that the GC IR2IP systems are a great intermediary step so you at least get the functionality of sending the commands while you wait for a binding.

Hi again, I tried to install your latest version. Stopped openhab, deleted old jar in addons folder, put the new one in, deleted the old
shield thing…Created a new one with different name, but ssl connection was refused. PIN didn’t work either…Even deleted the keystore files in /var/lib…
How can I use your .jar again?
Thx for your help!

For an inexpensive alternative (or a receiver that doesn’t have an IR input port), I’d suggest the BroadLink RM4 Mini.

Development stalled on the unofficial binding, but it still works in 3.4. You can use it to record the IR codes and send them directly from openHAB (all on local network).

More recently, the RM4 devices have been merged into the official Broadlink binding in 3.4. I haven’t tried it, but here’s a post about getting the IR codes.

I’m using an RM4 Mini to control a humidifier. Amusingly, the ON/OFF IR code also turns on my Geneva Labs Model XL sound system, so I made a cover to restrict the beam (tape works just as well).

Feel free to ping me directly when it’s ready for testing (but don’t rush on my account). I’m excited to be your first Chromecast with Google TV customer. :wink:

Thank you for the suggestion, but I really want to have a solution using commands over IP. I am wondering if it can be done through the HTTP binding.

That’s definitely not expected behavior. A few questions:

  1. does the nvidia shield app work on your phone?

  2. are you using text or ui config?

  3. was it autodiscovered or manually entered?

  4. is OH and the device on the same VLAN?

  5. can you please do “log:set TRACE org.openhab.binding.androidtv” and send me the output?

  6. what year, model, and software version is your shield?

I get that, but if your priority is to gain control over your preamplifier then the IR solutions will work right now. As @morph166955 wrote:

It’s like when something breaks and you do a quick, temporary fix to keep it going until you can properly repair it. Sometimes you don’t get to the repairs for weeks or months, and sometimes the quick fix works so well that you just leave it as is. :wink:

Thank you. I prefer to wait or to learn how to do it myself. The other solution is not an option for me :slightly_smiling_face:

You may be waiting a while. That’s a VERY nice preamp, but I doubt many, if any, openHAB developers have one. If a developer did have one, there probably would be a binding already.

It looks like it could be a fairly straightforward adaptation of the Anthem binding, but I have a huge backlog of stuff that accumulated in 2022 when I had virtually no time to develop. That Anthem binding had been on my ToDo list for the better part of a year.

If you can put something together, as I wrote, dinner is on me :grin:

installed the app on the phone, restarted the shield and the app worked. OH (3.4.2) showed the shield again in autodiscovery, same vlan, used ui config. Created the thing, sent “REQUEST”, numbers appeared. Sent numbers and got this:

2023-02-17 11:49:10.231 [TRACE] [l.shieldtv.ShieldTVConnectionManager] - Raw ShieldTV command decodes as: 0801121a0801121073616d73756e6720534d2d4739393855180128fbff04
2023-02-17 11:49:10.235 [TRACE] [tocol.shieldtv.ShieldTVMessageParser] - Received ShieldTV message from: SHIELD - Message: 080a121308e807120e08011206534849454c4418d7fd04180a
2023-02-17 11:49:10.236 [TRACE] [tocol.shieldtv.ShieldTVMessageParser] - Shield Hostname: 534849454c44 12
2023-02-17 11:49:10.237 [TRACE] [tocol.shieldtv.ShieldTVMessageParser] - Shield Hostname Encoded: SHIELD
2023-02-17 11:49:15.234 [TRACE] [l.shieldtv.ShieldTVConnectionManager] - Sending ShieldTV keepalive query
2023-02-17 11:49:15.236 [TRACE] [l.shieldtv.ShieldTVConnectionManager] - Raw ShieldTV command decodes as: 080028fae0a6c0d130
2023-02-17 11:49:15.237 [TRACE] [l.shieldtv.ShieldTVConnectionManager] - Raw ShieldTV command decodes as: 08ec0712020806
2023-02-17 11:49:15.238 [TRACE] [tocol.shieldtv.ShieldTVMessageParser] - Received ShieldTV message from: SHIELD - Message: 080028fae0a6c0d130
2023-02-17 11:49:15.240 [TRACE] [l.shieldtv.ShieldTVConnectionManager] - Canceling ShieldTV scheduled reconnect job.
2023-02-17 11:49:15.241 [DEBUG] [l.shieldtv.ShieldTVConnectionManager] - Attempting to reconnect to the ShieldTV
2023-02-17 11:49:15.242 [DEBUG] [l.shieldtv.ShieldTVConnectionManager] - Disconnecting ShieldTV
2023-02-17 11:49:15.243 [DEBUG] [l.shieldtv.ShieldTVConnectionManager] - Command sender thread exiting
2023-02-17 11:49:15.245 [DEBUG] [l.shieldtv.ShieldTVConnectionManager] - Opening ShieldTV SSL connection to 192.168.188.141:8987
2023-02-17 11:49:15.274 [DEBUG] [l.shieldtv.ShieldTVConnectionManager] - Assuming server certificate is valid
2023-02-17 11:49:15.275 [TRACE] [l.shieldtv.ShieldTVConnectionManager] - Subject DN: C=US, O=Nvidia, OU=Nvidia, CN=nvbeyonder/mdarcy/mdarcy/SHIELD Android TV
2023-02-17 11:49:15.276 [TRACE] [l.shieldtv.ShieldTVConnectionManager] - Issuer DN: C=US, O=Nvidia, OU=Nvidia, CN=nvbeyonder/mdarcy/mdarcy/SHIELD Android TV
2023-02-17 11:49:15.277 [TRACE] [l.shieldtv.ShieldTVConnectionManager] - Serial number: 1668178686194
2023-02-17 11:49:15.318 [DEBUG] [l.shieldtv.ShieldTVConnectionManager] - Starting ShieldTV keepalive job with interval 5
2023-02-17 11:49:15.318 [DEBUG] [l.shieldtv.ShieldTVConnectionManager] - Message reader thread started
2023-02-17 11:49:15.319 [DEBUG] [l.shieldtv.ShieldTVConnectionManager] - Command sender thread started
2023-02-17 11:49:15.320 [TRACE] [l.shieldtv.ShieldTVConnectionManager] - Raw ShieldTV command decodes as: 0801121a0801121073616d73756e6720534d2d4739393855180128fbff04
2023-02-17 11:49:15.320 [DEBUG] [l.shieldtv.ShieldTVConnectionManager] - Message reader thread exiting

Thing keeps being offline, “initializing”

Shield asks to connect with a Samsung…Is it your phone?
Can I borrow it? :grinning:

It’s probably my phone :grinning:
I installed the app on my Samsung. But why does it
want to connect with the phone and not openhab?

Interesting. I’m betting there’s a regression caused by the app bug fix. When the keepalive fires it sends two messages as you can see in your debug. The long one is the keepalive, the short one is the request for the current app. The keepalive replies as expected and then it looks like the shield dumps the connection (I need to add a message for that). I’d bet that it’s a privileged command and since we’re not logged in yet it’s dumping you out. Good news, easy fix. Ill try to push a jar later today or this weekend to add a new message and fix that. Thank you for the logs it was helpful!

Try this jar out @Knut_Petersen
https://github.com/morph166955/openhab-addons/releases/download/androidtv-beta/org.openhab.binding.androidtv-3.2.0-4.0.0-SNAPSHOT-1fd00be.jar

If nothing else, it should alert that the shield hard dropped the link now. Best case, it should fix the regression. If you report that this worked I’ll publish the update.

It’s online! :grinning:
Now I’m checking the items. I’ll report when something weird is going on. Thank you!

Awesome! That one’s on me. I didn’t think to regression test the pin process when I added the app query to the keepalive. I’ll add that onto my list for next time. I’ll update the original thread with the jar for everyone.

Checked the items. Work like charm! And I don’t see any warnings etc
in the logs! Wonderfull work! I got rid of my former android debug binding :grinning:
And as long as I have my “POWERON” Button in my rules e.g. switch input sources in my av receiver openhab doesn’t need to know wether the shield is on or not. Again, thanks a lot!