me once again. I am gettign everyday a lil closer and smarter about this new progamming thing here. Just started and once again would need somebodys help.
What I want to do:
Send shell command to my ADB connected Nvidia Shield
How far I got?
I was able to send via a docker adp app inside of the docker terminal, commands to the shield which also worked fine. When I tried to sent them from HA nothing worked. Anyway I guess the whole Adp Docker App is not even correct installed. I can’t find any config files/folder for it nether I didnt know which options to choose from all this setting/setups inside docker when I installed the app. I just choosed something.
So can anybody give me a guidlines for newbys how I do it step by step correctly?
For my understanding the correct way would be:
install any ADP App inside docker (I prefer by cmd line if someone can help me. At least I can’t do anything wrong, I guess)
Get somehow the ADP Container connected and listinging to HA.
Is this so far correct?
Really appritiate if somebody could help me how to do. I don’t have hass.io.
My System:
Synology DS916 running HA v69.1 in Docker
1 - use this to generate a key from the docker into your host system. Basically
ssh-keygen -t rsa (just press enter, enter, enter till you get the key)
ssh-copy-id [email protected] (pass the key to your host your NAS)
2 - Copy the python script to your python folder
3- Install adb (apt get install adb) on your host (NAS)
4- create a shell command: example. for instance my command for kodi is this.
shell_command:
Since I’m in docker I have to ssh into my host and then fire the python command
5- you have to activate developer options in your nvidia shield. settings, select develper options and clicke 8 times or something like that. Then activate adb debugging.
First time you fire the command, you need to got to your shiled and accept the pop up screen.
hey, dont suppose its possible to use https://hub.docker.com/r/sorccu/adb/
use that as a docker image (i really want to leave my host completely untouched).
Only issue is I have no idea how to envoke the adb running on the docker?
does one SSH into it then run the command?
I have set up sorccu/adb in an docker container on my HASS.io via Portainer.
I can send the adb commands from the addon “SSH & Web terminal” using these commands:
I am logged in as root via SSH (dont know if that is necessary)
# Connect ADB to your Nvidia Shield TV (you need to accept the fingerprint on the screen @ your shield)
docker exec -it ADB adb connect 192.168.111.11 (use your own ipadress of your Shield)
# Send the "wakeup" code to get your shield out of sleepmode (or screensaver)
docker exec -it ADB adb shell input keyevent KEYCODE_WAKEUP
# Send the "sleep" code
docker exec -it ADB adb shell input keyevent KEYCODE_SLEEP
# Start Youtube
docker exec -it ADB adb shell monkey -p com.android.youtube.tv -v 1
# Start KODI
docker exec -it ADB adb shell monkey -p org.xbmc.kodi -v 1
# Start TV4play
docker exec -it ADB adb shell monkey -p se.tv4.tv4playtab -v 1
# Start Twitch
docker exec -it ADB adb shell monkey -p tv.twitch.android.app -v 1
# Start Netflix
docker exec -it ADB adb shell monkey -p com.netflix.ninja -v 1
I have not been able to figure out how to use these commands from hass.io using the command_line switch yet.
problem is you need to create an ssh key and then save it so it doesnt get lost on hassio restart. I dont run hassio, but I saw a post here on how to create the key and make it persistent.
Now i remember, it’s at this point i have hit the wall earlier to.
I have no idea how to get around this.
I have added a file “authorised_keys” (with my public ssh key) in the root, in the /root/.ssh/ and in /config/ but i still get this error:
because hassio is running in a container. that container doesnt have a docker installation.
your docker engine is on the os (debian)
so debian needs to fire the command
ok, so been playing with this and have a suggested workaround.
you cant mount volumes on hassio. it’s locked
so what you could do is run a script when you start your system that would copy the ssh key into the correct directory into the hassio folder.
these would be the steps:
enter the hassio container - sudo docker exec -it homeassistant /bin/bash
i can run all my command’s
(this is new since the latest update of the addon SSH & Webterminal)
(If you disable “protection mode”)
Dosent that mean that i now have access to docker inside hassio?
I am running all my docker exec -it ADB commands inside the hassio container arent i?
And would that not mean that i would be able to run it directly with a shell command or command_line switch?