Thanks! This issue would be a good place.
No problem. Logs attached to that issue.
I updated the custom component. Let me know if that fixes the issue!
Will do. Itās been running for ~30 minutes now without any disconnects, so it seems to be a significant improvement at least.
Awesome! A good stress test would be to send a lot of commands rapidly. Volume up/down might cause your device to do a power cycle (I donāt know why), but the back button should be safe. You can use the androidtv.adb_command
service with "BACK"
.
Thanks for testing!
Iām not in front of the device to verify, but I did spam the hell out of the device using the service and didnāt see any errors pop up. Still looking pretty solid.
Good to hear! If you donāt experience any issues, Iāll create a new release and submit a pull request to HA later today.
Any issues to report? If not, Iāll go ahead and release a new version.
Nope, all good here. Tried with both my Shields and havenāt seen any problems yet.
Iād love to start playing with indents but Iām stuck getting this working - help please!
Iāve got adb setup on my shield, and I get an on-screen prompt to accept connection and the adb logs say connected but I canāt see new android media_player in my developers_tools sections e.g. if I open an op
What am I doing wrong? What aim aiming for to be able to see whatās open on each device like in this video from 11m onwards https://www.youtube.com/watch?v=m4kDsy36x5U
{
"devices": [
"192.168.30.20"
],
"reconnect_timeout": 90
}
media_player:
- platform: androidtv
name: Living Room
host: 192.168.30.20
adb_server_ip: 127.0.0.1
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] adb.sh: executing...
[cont-init.d] adb.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[17:26:19] INFO: Starting the Android Debug Bridge server...
[17:26:19] INFO: Connecting to device: 192.168.30.20...
connected to 192.168.30.20:5555
You only posted the ADB server log, not the Home Assistant log, so I canāt tell what the problem is.
Regardless, Iām trying to push toward the Python ADB implementation approach and away from the ADB server approach because itās easier to debug and handle errors, disconnects, and re-connect attempts. Follow the instructions in this post: https://community.home-assistant.io/t/androidtv-adb-manager-adb-device-is-unavailable-encountered-an-error-when-searching-for-device/140522/2.
Youāll also need to add the adbkey
entry to your configuration. The ADB server add-on should have saved a key somewhere, so use that.
Thanks. Iāve setup the python method and Iām connected and I can add the (nvidia) media_player but it just says paused all the time.
Iāve tried sending āGET_PROPERTIESā but I must be doing something wrong e.g. for the prime video app I tried sending the command whilst playing but I get:
volume_level: 0.13333333333333333
is_volume_muted: false
app_id: com.amazon.amazonvideo.livingroom
app_name: com.amazon.amazonvideo.livingroom
source: hdmi
adb_response: null
friendly_name: Living Room
supported_features: 21945
I think itās all working now, as thereās no android errors in my ha logs, I think I just donāt know how to detect the states correctly.
I think youāre doing something wrong regarding the āGET_PROPERTIESā call. Or maybe you just need to refresh the page.
The service call should look like this:
And the result should look like this (note the adb_response
attribute):
You can then use that info to define state detection rules that work for your apps and your device, as in this thread: [Testers needed!] Custom state detection rules for Android TV / Fire TV
Sorted - thanks. What was happening was I was selecting the right media_player but when I clicked āfill example dataā it was changing the player to the wrong one!
I was having this problem with my android phone. couldnāt find a solution anywhere until i saw your entry. disconnecting adb was my issue. Thank you so much.
Did you find the cause of the data length messages?
Hi, my issue was a lack of understanding on how the intents were working. I sorted it when someone sent me an example of one in action. Once I had the basics, it was easy to amend it to my own entities and get it up and running. I can control the Shield direct via HA or via node-red now depending on what I am trying to do.
Hi there all,
and sorry if I reopen this already long thread.
I have already set the ADB component and itās work if I call it from Tools>Services
using POWER and SLEEP data.
Now, in order to use it with google home assistance, I need to make a switch (at last I believe)
I try a lot of combination but this yaml language Iāll never understand
So the last think is to ask your helpā¦
Here is what I want to correct if itās possible to help me:
switch 6:
- platform: template
switches:
tv: ### TV PHILIPS (192.168.1.157)
turn_on:
service: androidtv.adb_command
data:
entity_id: 'media_player.philips_tv'
command: 'POWER'
turn_off:
service: androidtv.adb_command
data:
entity_id: 'media_player.philips_tv'
command: 'SLEEP'
I need to name the switch: tv
This in order to ask āhey googleā¦ turn on the tvā
Please help me to finish thes script.
Thasks a lot all
Denis
Dear all,
I finally find how to make a switch in order to use it with google home mini
Here is my actual config:
switch 6:
- platform: template
switches:
tv:
value_template: 'off'
turn_on:
- service: androidtv.adb_command
data:
entity_id: 'media_player.philips_tv'
command: 'POWER'
- service: androidtv.adb_command
data:
entity_id: 'media_player.philips_tv'
command: 'HDMI1'
turn_off:
- service: androidtv.adb_command
data:
entity_id: 'media_player.philips_tv'
command: 'SLEEP'
The problem now is that I canāt understand how to make the HDMI1
always activate when I power on the TV.
I put 2 times the service and activate HDMI1, but is not work.
Anybody can help me please ?
Thanks in advance
Denis