CorneliousJD Posted January 8, 2021 Share Posted January 8, 2021 (edited) User @Barny made a modification of a container that has really helped me (and at least a few others out) but it wasn't a template for it. I decided to create one along with a support thread. The main purpose for this container is to connect to Android TV or FireTV devices so you can control them and automate them with HomeAssistant. See here: https://www.home-assistant.io/integrations/androidtv/ The actual usage of the container should be fairly straight forward, just make sure to set static IPs or DHCP reservations for your Android TV devices so they don't change. NOTE: @Barny had this is --privileged in the DockerHub, however I am running it without that flag and it's functioning so I've left that out of my template, unless there's a need for it, it will remain excluded here. Edited January 8, 2021 by CorneliousJD Quote Link to comment
Natcoso9955 Posted January 9, 2021 Share Posted January 9, 2021 Hi, I'm trying to workout how to add this integration with the home assistant core unraid app. When I read the official documentation mentions adding via supervisor add-ons. I'm going to try the hassio supervisor, but is there another proper way to use this integration? Quote Link to comment
CorneliousJD Posted January 9, 2021 Author Share Posted January 9, 2021 15 hours ago, Natcoso9955 said: Hi, I'm trying to workout how to add this integration with the home assistant core unraid app. When I read the official documentation mentions adding via supervisor add-ons. I'm going to try the hassio supervisor, but is there another proper way to use this integration? So what you would need to do is install this container, and put your devices you're connecting to via IP in the list, like 192.168.1.111:5555,192.168.1.222:5555 on the template (it should have some in there as an example already) You are ideally not using the supervisor, instead you're using HA Core and then you run this as a separate docker container, and you would just use this https://www.home-assistant.io/integrations/androidtv/ When it asks for ADB server, you pulg in your unraid server IP. # Use an ADB server for sending ADB commands - platform: androidtv name: Office TV host: 192.168.1.222 adb_server_ip: 192.168.1.10 Where 192.168.1.10 is the unraid server IP running this ADB container. Then where 192.168.1.222 is the android TV that you've got the ADB container connected to. HA will send the commands to the ADB server container and it will pass them along to the destination. The ADB server will keep the connections alive in perpituity as long as the IP address doesn't change. Quote Link to comment
Natcoso9955 Posted January 10, 2021 Share Posted January 10, 2021 Okay figured out what it needs. Strangely after getting prompt on firetv logs repeat the following and HA log says device isnt connected which is confirmed with below. Static ip setup and confirmed is still correct. adb I 01-10 13:06:39 8 8 auth.cpp:437] adb_auth_init... adb I 01-10 13:06:39 8 8 auth.cpp:412] adb_auth_inotify_init... adb I 01-10 13:06:49 8 17 transport.cpp:283] 192.168.1.222:8009: read thread spawning adb I 01-10 13:06:49 8 18 transport.cpp:296] 192.168.1.222:8009: write thread spawning failed to connect to 192.168.1.222:8009 adb I 01-10 13:07:29 8 23 transport.cpp:271] BlockingConnectionAdapter(): destructing adb I 01-10 13:07:29 8 23 transport.cpp:346] BlockingConnectionAdapter(): not started already connected to 192.168.1.222:8009 adb I 01-10 13:07:49 8 17 transport.cpp:287] 192.168.1.222:8009: read failed: Success adb I 01-10 13:07:49 8 17 transport.cpp:695] 192.168.1.222:8009: connection terminated: read failed adb I 01-10 13:07:49 8 8 adb.cpp:110] 192.168.1.222:8009: already offline adb I 01-10 13:07:49 8 8 transport.cpp:779] destroying transport 192.168.1.222:8009 adb I 01-10 13:07:49 8 8 transport.cpp:359] BlockingConnectionAdapter(192.168.1.222:8009): stopping adb I 01-10 13:07:49 8 8 transport.cpp:377] BlockingConnectionAdapter(192.168.1.222:8009): stopped adb I 01-10 13:07:50 8 9 transport.cpp:271] BlockingConnectionAdapter(192.168.1.222:8009): destructing adb I 01-10 13:07:50 8 9 transport.cpp:351] BlockingConnectionAdapter(192.168.1.222:8009): already stopped adb I 01-10 13:07:50 8 26 transport.cpp:296] 192.168.1.222:8009: write thread spawning adb I 01-10 13:07:50 8 25 transport.cpp:283] 192.168.1.222:8009: read thread spawning adb I 01-10 13:07:59 8 30 transport.cpp:271] BlockingConnectionAdapter(): destructing adb I 01-10 13:07:59 8 30 transport.cpp:346] BlockingConnectionAdapter(): not started already connected to 192.168.1.222:8009 Quote Link to comment
CorneliousJD Posted January 10, 2021 Author Share Posted January 10, 2021 1 hour ago, Natcoso9955 said: Okay figured out what it needs. Strangely after getting prompt on firetv logs repeat the following and HA log says device isnt connected which is confirmed with below. Static ip setup and confirmed is still correct. adb I 01-10 13:06:39 8 8 auth.cpp:437] adb_auth_init... adb I 01-10 13:06:39 8 8 auth.cpp:412] adb_auth_inotify_init... adb I 01-10 13:06:49 8 17 transport.cpp:283] 192.168.1.222:8009: read thread spawning adb I 01-10 13:06:49 8 18 transport.cpp:296] 192.168.1.222:8009: write thread spawning failed to connect to 192.168.1.222:8009 adb I 01-10 13:07:29 8 23 transport.cpp:271] BlockingConnectionAdapter(): destructing adb I 01-10 13:07:29 8 23 transport.cpp:346] BlockingConnectionAdapter(): not started already connected to 192.168.1.222:8009 adb I 01-10 13:07:49 8 17 transport.cpp:287] 192.168.1.222:8009: read failed: Success adb I 01-10 13:07:49 8 17 transport.cpp:695] 192.168.1.222:8009: connection terminated: read failed adb I 01-10 13:07:49 8 8 adb.cpp:110] 192.168.1.222:8009: already offline adb I 01-10 13:07:49 8 8 transport.cpp:779] destroying transport 192.168.1.222:8009 adb I 01-10 13:07:49 8 8 transport.cpp:359] BlockingConnectionAdapter(192.168.1.222:8009): stopping adb I 01-10 13:07:49 8 8 transport.cpp:377] BlockingConnectionAdapter(192.168.1.222:8009): stopped adb I 01-10 13:07:50 8 9 transport.cpp:271] BlockingConnectionAdapter(192.168.1.222:8009): destructing adb I 01-10 13:07:50 8 9 transport.cpp:351] BlockingConnectionAdapter(192.168.1.222:8009): already stopped adb I 01-10 13:07:50 8 26 transport.cpp:296] 192.168.1.222:8009: write thread spawning adb I 01-10 13:07:50 8 25 transport.cpp:283] 192.168.1.222:8009: read thread spawning adb I 01-10 13:07:59 8 30 transport.cpp:271] BlockingConnectionAdapter(): destructing adb I 01-10 13:07:59 8 30 transport.cpp:346] BlockingConnectionAdapter(): not started already connected to 192.168.1.222:8009 Cool, I was going to say I think you're confusing the add-ons in supervisor with other containers with core. You should just need HA Core and this docker. There's no other add-on needed but I have mine setup so it can turn on and off my Android tv and change source, etc like you're after. Could you post a screenshot of this docker along with your HA configuration.yaml (the relevant part) along with what your unRAID IP and ATV/FTV box IP addresses are? I'll take a peek. Quote Link to comment
Natcoso9955 Posted January 11, 2021 Share Posted January 11, 2021 See attached including the log output from both containers, im sure its something simple, i just don't have much output from the ADB bridge (well that i understand anyway, hahaha) Thanks. ADB-HAcore.zip Quote Link to comment
CorneliousJD Posted January 11, 2021 Author Share Posted January 11, 2021 8 hours ago, Natcoso9955 said: See attached including the log output from both containers, im sure its something simple, i just don't have much output from the ADB bridge (well that i understand anyway, hahaha) Thanks. ADB-HAcore.zip 548.08 kB · 0 downloads So unraid server IP itself is 192.168.1.129 is that correct? And the fire TV itself is 192.168.1.222 yes? If so then things look okay but ports are wrong somewhre for sure. Is there a reason you are not using the default ADB port of 5555? either way something is wrong somewhere, in the ADB container you say port 8009 for ADB, and in HA config you are saying port 5009, so there's a mismatch on ports right off the bat. Unlessy you've actually changed ADB ports on the FireTV I'd leave them as default of 5555 in both palces otherwise it likely will not work. If you have changed the port then you still have a mismatch somewhere. 1 Quote Link to comment
Natcoso9955 Posted January 11, 2021 Share Posted January 11, 2021 Hmmm, i think i changed the port because i had seen that 5009 was an open port and just confused that as being the one needed specifically for Fire TV. Reverted them both to 5555 and everything is working. you mentioned having it configured to change source etc, any chance you can share the additional code you used for that? I set it to get_sources but it doesn't seem to be getting all of them. Quote Link to comment
CorneliousJD Posted January 12, 2021 Author Share Posted January 12, 2021 2 hours ago, Natcoso9955 said: Hmmm, i think i changed the port because i had seen that 5009 was an open port and just confused that as being the one needed specifically for Fire TV. Reverted them both to 5555 and everything is working. you mentioned having it configured to change source etc, any chance you can share the additional code you used for that? I set it to get_sources but it doesn't seem to be getting all of them. I just have it get the default sources, I'm routing my logic via NodeRED to change inputs on a Android TV (built in ATV) - I'm not personally using any Fire TVs. See here though: https://www.home-assistant.io/integrations/androidtv/#apps get_sources boolean (optional, default: true) Whether or not to retrieve the running apps as the list of sources. apps map (optional, default: {}) A dictionary where the keys are app IDs and the values are app names that will be displayed in the UI; see example below. If a name is not provided, the app will never be shown in the sources list. (These app names are configured in the backend package and do not need to be included in your configuration.) exclude_unnamed_apps boolean (optional, default: false) If this is true, then only the apps you specify in the apps configuration parameter and those specified in the backend library will be shown in the sources list. exclude_unnamed_apps: true apps: com.amazon.tv.launcher: "Fire TV" some.background.app: # this will never show up in the sources list another.background.app: "" # this will also never show up in the sources list You will want to name apps in your app dictionary list for them to show up too. Also because the docker conatiner is working that's really as far as I can take it, if you need more support than this I'd suggest the HA forums or discord channel or something, this is really just support for the container running properly on unraid which you've now got. hope this helps though! Quote Link to comment
Natcoso9955 Posted January 13, 2021 Share Posted January 13, 2021 Ah okay, yeah i found that stuff, i have that working, i thought you had specific FireTv extra config things. All good. Thanks for the help. Quote Link to comment
CoZ Posted February 2, 2021 Share Posted February 2, 2021 So I've been struggling for a few days now connecting my Nvidia Shield PRO (and also my Nvidia ShieldTV) to HA. Most people I run across just say "I just simply put in my IP address into the Config.yaml file and it connects, I never even need to acknowledge the prompt to allow it to connect" Unfortunately, I am not one of those people. I've installed this ADB Docker container. Verified in the shell with adb devices and it returns my Shield TV that's connected. I even got the "Allow this computer to connect" notification on the Shield initially. So, I went ahead and added the rest of the lines to the config.yaml file to point to my unraid ADB docker: media_player: # Use the Python ADB implementation - platform: androidtv name: Living Room Shield host: 191.168.1.103 adb_server_ip: 192.168.1.102 adb_server_port: 5037 My Unraid IP is correct. The docker port is correct. Yet my HA install has all these errors in the log: Logger: androidtv.adb_manager.adb_manager_async Source: /usr/local/lib/python3.8/site-packages/androidtv/adb_manager/adb_manager_async.py:400 First occurred: 5:39:13 PM (1 occurrences) Last logged: 5:39:13 PM Couldn't connect to 191.168.1.103:5555 via ADB server 192.168.1.102:5037 because the server is not connected to the device Logger: homeassistant.components.androidtv.media_player Source: components/androidtv/media_player.py:227 Integration: androidtv (documentation, issues) First occurred: 5:39:13 PM (1 occurrences) Last logged: 5:39:13 PM Could not connect to Living Room Shield at 191.168.1.103:5555 using ADB server at 192.168.1.102:5037 So one of these programs is lying to me ... either HomeAssistant or the Docker lol Any suggestions? Because I am at my Wit's end here with this. Quote Link to comment
CorneliousJD Posted February 3, 2021 Author Share Posted February 3, 2021 3 hours ago, CoZ said: So I've been struggling for a few days now connecting my Nvidia Shield PRO (and also my Nvidia ShieldTV) to HA. Most people I run across just say "I just simply put in my IP address into the Config.yaml file and it connects, I never even need to acknowledge the prompt to allow it to connect" Unfortunately, I am not one of those people. I've installed this ADB Docker container. Verified in the shell with adb devices and it returns my Shield TV that's connected. I even got the "Allow this computer to connect" notification on the Shield initially. So, I went ahead and added the rest of the lines to the config.yaml file to point to my unraid ADB docker: media_player: # Use the Python ADB implementation - platform: androidtv name: Living Room Shield host: 191.168.1.103 adb_server_ip: 192.168.1.102 adb_server_port: 5037 My Unraid IP is correct. The docker port is correct. Yet my HA install has all these errors in the log: Logger: androidtv.adb_manager.adb_manager_async Source: /usr/local/lib/python3.8/site-packages/androidtv/adb_manager/adb_manager_async.py:400 First occurred: 5:39:13 PM (1 occurrences) Last logged: 5:39:13 PM Couldn't connect to 191.168.1.103:5555 via ADB server 192.168.1.102:5037 because the server is not connected to the device Logger: homeassistant.components.androidtv.media_player Source: components/androidtv/media_player.py:227 Integration: androidtv (documentation, issues) First occurred: 5:39:13 PM (1 occurrences) Last logged: 5:39:13 PM Could not connect to Living Room Shield at 191.168.1.103:5555 using ADB server at 192.168.1.102:5037 So one of these programs is lying to me ... either HomeAssistant or the Docker lol Any suggestions? Because I am at my Wit's end here with this. Check the docker log for the ADB container - click the "uptime x minutes/hours" section and it'll load the log, anything interesting in there? You may want to restart the docker container, let it run for 5-10 minutes then look at it so you have a fresh look at what hte log is saying. It SHOULD be telling you it's trying to connectg to 192.168.1.130 over and over again and saying that it's already connected to that device every few minutes. Quote Link to comment
CoZ Posted February 3, 2021 Share Posted February 3, 2021 11 hours ago, CorneliousJD said: Check the docker log for the ADB container - click the "uptime x minutes/hours" section and it'll load the log, anything interesting in there? You may want to restart the docker container, let it run for 5-10 minutes then look at it so you have a fresh look at what hte log is saying. It SHOULD be telling you it's trying to connectg to 192.168.1.130 over and over again and saying that it's already connected to that device every few minutes. Yes sir, it does indeed say that I also have this bit of confusing information: adb I 02-02 22:27:49 8 17 transport.cpp:283] 192.168.1.103:5555: read thread spawning adb I 02-02 22:27:49 8 18 transport.cpp:296] 192.168.1.103:5555: write thread spawning adb I 02-02 22:27:49 8 8 transport.cpp:1365] fetching keys for transport 192.168.1.103:5555 adb I 02-02 22:27:49 8 8 auth.cpp:489] Calling send_auth_response adb I 02-02 22:27:49 8 8 adb.cpp:114] 192.168.1.103:5555: offline connected to 192.168.1.103:5555 It says "offline" and then right after it it says it's connected. Not sure which line to believe. Quote Link to comment
CorneliousJD Posted February 3, 2021 Author Share Posted February 3, 2021 (edited) 1 hour ago, CoZ said: Yes sir, it does indeed say that I also have this bit of confusing information: adb I 02-02 22:27:49 8 17 transport.cpp:283] 192.168.1.103:5555: read thread spawning adb I 02-02 22:27:49 8 18 transport.cpp:296] 192.168.1.103:5555: write thread spawning adb I 02-02 22:27:49 8 8 transport.cpp:1365] fetching keys for transport 192.168.1.103:5555 adb I 02-02 22:27:49 8 8 auth.cpp:489] Calling send_auth_response adb I 02-02 22:27:49 8 8 adb.cpp:114] 192.168.1.103:5555: offline connected to 192.168.1.103:5555 It says "offline" and then right after it it says it's connected. Not sure which line to believe. So what we should see is that it's "already connected" over and over again, so this is kind of weird to see that you have it saying offline then connected. Is anything ELSE trying to connect to USB debigging on that 192.168.1.130 IP address? Also, just something to check, but have you tried setting it up WITHOUT the ADB server? Right on the HA page it now says Quote When setting up this integration, it is recommended that you do NOT use an ADB server and instead use the built-in Python ADB implementation. This simplifies the setup and makes it easier to troubleshoot issues. If there are stability issues with this approach, then you may wish to try using an ADB server. See the ADB Setup section for more information. Edited February 3, 2021 by CorneliousJD Quote Link to comment
CoZ Posted February 3, 2021 Share Posted February 3, 2021 1 hour ago, CorneliousJD said: So what we should see is that it's "already connected" over and over again, so this is kind of weird to see that you have it saying offline then connected. Is anything ELSE trying to connect to USB debigging on that 192.168.1.130 IP address? Also, just something to check, but have you tried setting it up WITHOUT the ADB server? Right on the HA page it now says Yes sir. I've tried both the Nvidia Shield Pro and my Nvidia Shield TV with and without the ADB Server info. Without the ADB Server info, I never get the prompt on the device asking to allow the connection and no device/entity shows up in HomeAssistant with the names I gave the devices. With the ADB Server, I get the prompt for the connection but then.... nothing happens after that. Hitting "Yes" and "always trust" does nothing past that. The devices never show up in H.A. and the errors about it not being able to connect using the ADB server or, the device is not connected show up in the HA Logs. I've revoked the keys, rebooted both devices, enabled and disabled network debugging. Same result over and over. "Offline" / "Already Connected" over and over again to both devices in your Docker log. Quote Link to comment
CorneliousJD Posted February 3, 2021 Author Share Posted February 3, 2021 6 minutes ago, CoZ said: Yes sir. I've tried both the Nvidia Shield Pro and my Nvidia Shield TV with and without the ADB Server info. Without the ADB Server info, I never get the prompt on the device asking to allow the connection and no device/entity shows up in HomeAssistant with the names I gave the devices. With the ADB Server, I get the prompt for the connection but then.... nothing happens after that. Hitting "Yes" and "always trust" does nothing past that. The devices never show up in H.A. and the errors about it not being able to connect using the ADB server or, the device is not connected show up in the HA Logs. I've revoked the keys, rebooted both devices, enabled and disabled network debugging. Same result over and over. "Offline" / "Already Connected" over and over again to both devices in your Docker log. Are you doing NETWORK debugging or USB debugging? I am not using this personally with a Shield TV at this point in time, but an android TV with android built into the TV, and I had to turn on USB debugging for it to work, not network debugging. Perhaps that's worth a shot? I do have a Shield TV I rarely use anymore, if I can find the time (which is hard to come by right now) I can try hooking it up and see if I can replicate the issue you're running into. Let me know if you get anywhere with USB debugging though instead, keep me posted and I'll see if I can find the time to hook mine up soon to check it out. Quote Link to comment
CoZ Posted February 3, 2021 Share Posted February 3, 2021 40 minutes ago, CorneliousJD said: Are you doing NETWORK debugging or USB debugging? I am not using this personally with a Shield TV at this point in time, but an android TV with android built into the TV, and I had to turn on USB debugging for it to work, not network debugging. Perhaps that's worth a shot? I do have a Shield TV I rarely use anymore, if I can find the time (which is hard to come by right now) I can try hooking it up and see if I can replicate the issue you're running into. Let me know if you get anywhere with USB debugging though instead, keep me posted and I'll see if I can find the time to hook mine up soon to check it out. Are you suggesting enabling both USB & Network debugging or just USB debugging and leave Network off? At this point, I'll try anything. Too much time of my life has been spent on this lol BTW: Still running your SUI Start Page! Quote Link to comment
CorneliousJD Posted February 3, 2021 Author Share Posted February 3, 2021 2 hours ago, CoZ said: Are you suggesting enabling both USB & Network debugging or just USB debugging and leave Network off? At this point, I'll try anything. Too much time of my life has been spent on this lol BTW: Still running your SUI Start Page! IIRC I ONLY have USB debugging on, so I'd try that first - just USB, and if that doesn't seem to do it, try with both USB and Network debugging on, check docker logs each time to see if they change, let mek now the results. Glad to hear SUI is being used, I forked it and brought it into an unraid template, I didn't make it but did it because there was a request for it, glad it's being utlized 1 Quote Link to comment
CoZ Posted February 3, 2021 Share Posted February 3, 2021 So with both USB and Network enabled: adb I 02-03 19:18:12 8 8 auth.cpp:437] adb_auth_init... adb I 02-03 19:18:12 8 8 auth.cpp:412] adb_auth_inotify_init... adb I 02-03 19:18:22 8 17 transport.cpp:283] 192.168.1.104:5555: read thread spawning adb I 02-03 19:18:22 8 18 transport.cpp:296] 192.168.1.104:5555: write thread spawning adb I 02-03 19:18:22 8 8 transport.cpp:1365] fetching keys for transport 192.168.1.104:5555 adb I 02-03 19:18:22 8 8 auth.cpp:489] Calling send_auth_response adb I 02-03 19:18:22 8 8 auth.cpp:456] Calling send_auth_publickey failed to authenticate to 192.168.1.104:5555 adb I 02-03 19:18:32 8 8 adb.cpp:114] 192.168.1.104:5555: offline adb I 02-03 19:18:52 8 23 transport.cpp:271] BlockingConnectionAdapter(): destructing adb I 02-03 19:18:52 8 23 transport.cpp:346] BlockingConnectionAdapter(): not started already connected to 192.168.1.104:5555 adb I 02-03 19:19:22 8 28 transport.cpp:271] BlockingConnectionAdapter(): destructing adb I 02-03 19:19:22 8 28 transport.cpp:346] BlockingConnectionAdapter(): not started already connected to 192.168.1.104:5555 With USB only: adb I 02-03 19:20:48 8 8 auth.cpp:437] adb_auth_init... adb I 02-03 19:20:48 8 8 auth.cpp:412] adb_auth_inotify_init... adb W 02-03 19:20:58 8 16 network.cpp:149] failed to connect to '192.168.1.104:5555': Connection refused failed to connect to '192.168.1.104:5555': Connection refused Quote Link to comment
CorneliousJD Posted February 3, 2021 Author Share Posted February 3, 2021 1 minute ago, CoZ said: So with both USB and Network enabled: adb I 02-03 19:18:52 8 23 transport.cpp:271] BlockingConnectionAdapter(): destructing adb I 02-03 19:18:52 8 23 transport.cpp:346] BlockingConnectionAdapter(): not started already connected to 192.168.1.104:5555 adb I 02-03 19:19:22 8 28 transport.cpp:271] BlockingConnectionAdapter(): destructing adb I 02-03 19:19:22 8 28 transport.cpp:346] BlockingConnectionAdapter(): not started already connected to 192.168.1.104:5555 Ok so this is what I see all the time with my setup that is working as intended. - So i suppose USB + Network debugging on is a good thing here, unless you see exactly the same with just network debugging? It will repeat this over and over again though which is a good sign, saying it's already connected. What's concerning though is this line here: failed to authenticate to 192.168.1.104:5555 adb I 02-03 19:18:32 8 8 adb.cpp:114] 192.168.1.104:5555: offline I'm not sure I understand why this is happening, something is preventing the action from authnenticating. Can you try blowing away this docker container and re-creating it from scratch? All that I've ever had to do is accept the prompt for debugging when it connects the first time and that's been it, it "just worked" after that without any hassle on the TV's I've used it on. For reference here's my sample config #Media Players media_player: - platform: androidtv name: Office Android TV host: 10.0.0.192 adb_server_ip: 10.0.0.10 With .192 being the TV, and .10 being my unraid server. Quote Link to comment
CoZ Posted February 3, 2021 Share Posted February 3, 2021 (edited) 3 hours ago, CorneliousJD said: Can you try blowing away this docker container and re-creating it from scratch? All that I've ever had to do is accept the prompt for debugging when it connects the first time and that's been it, it "just worked" after that without any hassle on the TV's I've used it on. I tried to break apart your post to answer them underneath the quote but I'm not Unraid Forum posting savvy yet apparently. I've removed and re-installed this Docker container a few times now trying to isolate the issue. Initially I had both of my Shield devices in the docker but then removed one just to concentrate on one device only. Apparently removing it form the config didn't actually remove it from the docker because it was still trying to connect to the other device I had removed - strange. It's the same exact error messages across the "board" looking at the Log files of the docker, regardless of which Shield device I'm trying to connect to. Just replace the error messages with the IP address of .104 or .103 I see the same exact error messages with only Networking debugging on that I saw with the USB+Network debugging on. It makes no difference. I know others have used it to connect to their "Smart TVs/Android" and Shield devices so that shouldn't make a difference. I'm also able to successfully connect to my Shield Devices using my Win10 computer and ADB from it. I can "Adb Devices" in the CMD Prompt of Win10 and it will return the Shield device. So something is going on that isn't 'normal'. My HA config looked exactly the same as your HA Config you posted. I've tried with the ADB Server (your docker) and without the ADB Server (and I never get a prompt to authenticate without - only using your ADB Docker did I get the prompt) Not sure where to look at this point. I've pretty much tried everything I could think of. EDIT: Just a further update. I'm able to go into your Docker's shell and issue every single ADB command I could think of. Adb Reboot reboots the shield for instance. Even though the docker's log file is full of these two lines over and over: adb I 02-03 23:22:34 8 127 transport.cpp:271] BlockingConnectionAdapter(): destructing adb I 02-03 23:22:34 8 127 transport.cpp:346] BlockingConnectionAdapter(): not started already connected to 192.168.1.104:5555 Edited February 3, 2021 by CoZ Quote Link to comment
CorneliousJD Posted February 4, 2021 Author Share Posted February 4, 2021 2 hours ago, CoZ said: EDIT: Just a further update. I'm able to go into your Docker's shell and issue every single ADB command I could think of. Adb Reboot reboots the shield for instance. Even though the docker's log file is full of these two lines over and over: adb I 02-03 23:22:34 8 127 transport.cpp:271] BlockingConnectionAdapter(): destructing adb I 02-03 23:22:34 8 127 transport.cpp:346] BlockingConnectionAdapter(): not started already connected to 192.168.1.104:5555 So just to clarify and confirm, when you console into this container and run adb reboot, it will actually work and reboot the shield TV? That's a good sign then, it means the container is actually working to connect to the devices. Quote Link to comment
CoZ Posted February 4, 2021 Share Posted February 4, 2021 1 hour ago, CorneliousJD said: So just to clarify and confirm, when you console into this container and run adb reboot, it will actually work and reboot the shield TV? That's a good sign then, it means the container is actually working to connect to the devices. Yes Sir, that is correct. On a whim, I'd figure I'd try it and it worked. Multiple deleting / installing your docker, multiple revoking and enabling network debugging, multiple reboots of the Shield.... all produced those error messages in the Docker Log file but yet, ADB commands work. After getting the ADB commands to recognize, I went ahead and re-added the Shield I was sending ADB commands to back into Home Assistant and EUREKA it showed up with no errors. Weeks of this troubleshooting. It's kind of anti-climatic now at this point now that it's actually working as it should. Although I still can't power on/off the device from HA - I can "see" everything else the device is doing. Thanks for helping me troubleshoot the issue though! Quote Link to comment
CorneliousJD Posted February 4, 2021 Author Share Posted February 4, 2021 (edited) 30 minutes ago, CoZ said: Yes Sir, that is correct. On a whim, I'd figure I'd try it and it worked. Multiple deleting / installing your docker, multiple revoking and enabling network debugging, multiple reboots of the Shield.... all produced those error messages in the Docker Log file but yet, ADB commands work. After getting the ADB commands to recognize, I went ahead and re-added the Shield I was sending ADB commands to back into Home Assistant and EUREKA it showed up with no errors. Weeks of this troubleshooting. It's kind of anti-climatic now at this point now that it's actually working as it should. Although I still can't power on/off the device from HA - I can "see" everything else the device is doing. Thanks for helping me troubleshoot the issue though! Awesome! Glad you got it working!!! Just a heads up. I am able to turn on/off my android TV devices via this method. I'm using NodeRED to automate and trigger these commands, but you should be able to use the same service calls in HA directly, since all this is doing is sending the service call to HA from NodeRED! Here's a screenshot of the commands I'm sending to get it to do it. Hope this helps you in your pursuit as well Idea here is that the MENU button will wake it up and turn it on. There is a "power" command but it will turn it off if it's already on. I only wanted this to turn it on and never turn it off. One of my TVs I reboot once a day because there's some performance issues if I don't. (it's a cheap HiSense TV) I also use {"command":"INPUT"} and {"command":"HOME"} on a few automations that are specific to my workflows. Edited February 4, 2021 by CorneliousJD Quote Link to comment
CoZ Posted February 4, 2021 Share Posted February 4, 2021 11 hours ago, CorneliousJD said: Awesome! Glad you got it working!!! Just a heads up. I am able to turn on/off my android TV devices via this method. I'm using NodeRED to automate and trigger these commands, but you should be able to use the same service calls in HA directly, since all this is doing is sending the service call to HA from NodeRED! I installed that docker briefly a while back. Had NO idea what it was doing or what it was supposed to do but everyone swears by it. I'll have to re-visit that at some other time. Right now, I'm just imply trying to get everything off of SmartThings and onto H.A. without breaking stuff lol The screenshots help though, I might be able to "translate" that into regular H.A. stuff. Thanks, again. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.