Adb FireTV NetFlix automation

My wife watches SuperNatural. She saw me get the TV to come on when she walks in the door. So she wanted me to get the TV to come on. Got to Netflix and then start SuperNatural. Well I have it done. I have one hipcup and hoping the community can help. First I I will give the automation to you then show what it is doing.
Trigger: (right now, will change just for testing) Front door opening and closing.
Condition: wait trigger 10 minutes, Living room motion and alarm set to disarm.
Action: (This is the tricky part)
First I wake on lan for the TV to come alive
Next, I put a 5 sec delay and then call Netflix source
Then, another delay cause netflix is slow to load. Then press enter for the user to login
Then, another delay for it to load the home screen. Then I am suppose to run this command. and here is the issue.

command: adb shell am start -n com.netflix.ninja/.MainActivity -a android.intent.action.VIEW -d netflix://title/70143825 -f 0x10000020 -e "amzn_deeplink_data" "7014385" 

This is the command. If it is all one line it will run correctly. But here is what home assistant does to it.

command: >-
  adb shell am start -n com.netflix.ninja/.MainActivity -a
  android.intent.action.VIEW -d netflix://title/70143825 -f 0x10000020 -e
  "amzn_deeplink_data" "7014385"

Is there a way to make the system see it as one line? or is there a better way? I really want to get a way to always pick the correct user and just start playing the show. But there commands are to long and home assistant is not allowing it to execute correctly.

Thanks

This worked for me.

  - service: androidtv.adb_command
    data:
      entity_id: media_player.firetv_bedroom_adb
      command: adb shell am start -n com.netflix.ninja/.MainActivity -a android.intent.action.VIEW
        -d netflix://title/70143825 -f 0x10000020 -e "amzn_deeplink_data" "7014385"
1 Like

How you find the title number to get the right movie to watch?

I had the same question.

Hello, how do you find the “title number” to get the right movie to watch on netflix to setup a automation?
I am in HA develpor tools → state → “entity_picture: /api/media_player_proxy/media_player.fire_tv_192_168_1_81?token=b887c597f5b00e1f3177561227b9a4264f715e243ca7a8b17f9cf2afb3848d15&cache=1645278048.514133” safe to assume base on my reading that that title is “1645278048” and deeplink_data “514133” (show)
I am unable to start the show automatically when i send the commd via “ADB_command”

Hey, this command has worked for me but I try twitch or prime video and it doesn’t work, do you know how to put them?