Androidtv automation

Helio,
I need a to start this automation:
Turn on AndroidTV, activate a specific app and than activate LiveTv option in the App (first option to click after entering the app).
Thanks all

After a fair bit of experimenting I am able to

  • use media_player.turn_on service on media_player.shield_tv entity to turn the TV on
  • start the app using androidtv.adb_command on media_player.shield_tv entity with command like
"command": "am start -a android.intent.action.VIEW -d -n au.com.ninenow.ctv/.TvActivity"
  • but I haven’t found any way to programmaticaly control within the app, such as activating a liveTV option or selecting which TV channel to watch. Best I have found is to simulate pressing of remote control keys, one at a time.
{
  "domain": "androidtv",
  "service": "adb_command",
  "data": {
    "entity_id": "media_player.shield_tv",
    "command": "{{payload}}"
  },
  "sessionId": "{{sessionId}}",
  "siteId": "{{siteId}}"
}

Sounds reasonable, until you realise that the androidtv might already be on and running a different app, or that when you start the app it remembers where it last was instead of starting in the default position - all thing that a human holding the remote control and watching the screen would adjust for automatically. Consequently I have added many more steps trying to get around these issues :frowning:

1 Like