Roku and Google Home

I leverage the Roku integration for various functions. I have a node red flow that opens Hulu on the Roku via voice commands. Does anyone know a way to open Hulu with a specific profile as we have multiple Hulu profiles?

did you ever figure this out? I am wanting the same thing but for disney plus or any app for that matter…

I use Android TV and dumped my Roku. You still have the same issue but a solution is to open the app via node red and then send remote control commands to either move up or down between profiles and then send the enter command.

thats a thought! I might have to try that out thanks.

I was able to get this to work. All I had to do is in a script was call the roku media player, add the “extra” content ID to play a specific episode in yaml, add a 25second delay, call the remote.send command right and another call remote send command select. It played perfectly. Hope this can help someone out if they are looking to autoplay a episode or movie automatically and have to select a profile in an app like disney or netflix.

1 Like

Glad it worked out!

1 Like

After some use, I was running into more issues with setup. Sometimes disney plus remembers the profile and other times it doesnt. If it remembers the profile then when my script hits the select button it pausing my show. Also my tv doesnt also turn back on when the smart outlet comes on so gotta figure that out. Maybe someone knows how to add a if/then? statement to where it checks to see if tv show is playing on the roku , then do nothing, else hit select button on the remote. heres my current code:

alias: Play Bluey On Living Room TV
sequence:
  - service: media_player.play_media
    target:
      entity_id: media_player.woody_s_new_stick_in_the_living_rm
    data:
      media_content_id: '291097'
      media_content_type: app
      extra:
        content_id: 655f7202-f7de-4d0b-84cd-2e190aaed851
        media_type: episode
  - delay:
      hours: 0
      minutes: 0
      seconds: 25
      milliseconds: 0
  - service: remote.send_command
    data:
      command: select
mode: single
icon: mdi:play-pause

Did you try the solution that was given to you the last time you asked this?

Sorry, it did not notify me that you replied and just happen to see jaswalters message and wanted to update this post. I just saw your reply on the other and will try it out… I assume I can not do this in UI can i? Must be in yaml?

    - not:
        - condition: state
          entity_id: media_player.woody_s_new_stick_in_the_living_rm
          state:
            - standby
            - home

You can do not conditions in the UI editor. I think you would have to split it into 2 conditions, one for each state though.

From the other thread.

so the -not will basically say if it is in standby or home then run select command?

Run if it is NOT in those states, but now that I think about it I’m not sure that will work. I think we can do this better.

Can you play the video in the script and copy the attributes from dev tools when the video is playing and paste them here? Also make a note of the state of the media player. (Don’t take a screenshot like I did here, I need to copy the text.)

Then do the same thing when the screen is stuck on selecting a profile. I need to see the difference between the two states.

I will get back to you with this.

I was just playing with my Roku TV to try and figure this out. I didn’t realize it would show a playing state! None of my other TV’s do, they just show “on” which wouldn’t help here. That greatly simplifies things! (I tried with Netflix, hopefully it works on whatever app you are using)

This should work. You can do it in the UI.

Basically, if the media player is not already playing keep going, if it is stop here.

    - not:
        - condition: state
          entity_id: media_player.woody_s_new_stick_in_the_living_rm
          state: playing

I tested this and the first time it seemed to work but did a hiccup in playing but kept playing. The second time it paused. and the third. I refreshed my browser and it seemed to work again but then again trying many times, it keeps pausing. Maybe the code I have wrong? I did it through the UI and code seems a little different from yours.

alias: Play Bluey On Living Room TV
sequence:
  - service: media_player.play_media
    data:
      media_content_id: '291097'
      media_content_type: app
      extra:
        content_id: 655f7202-f7de-4d0b-84cd-2e190aaed851
        media_type: episode
    target:
      device_id: 1e336ede2d682ae754e2b63f9e8f8b3f
  - delay:
      hours: 0
      minutes: 0
      seconds: 25
      milliseconds: 0
  - choose:
      - conditions:
          - condition: not
            conditions:
              - condition: state
                entity_id: media_player.woody_s_new_stick_in_the_living_rm
                state: playing
        sequence: []
    default: []
    enabled: true
  - service: remote.send_command
    data:
      command: select
    target:
      device_id: 1e336ede2d682ae754e2b63f9e8f8b3f
mode: single
icon: mdi:play-pause

You put a choose statement in there which you don’t need.

Edit your script in yaml (click the 3 dot menu top right in the UI editor) and copy all of this and paste it over everything that is there now.

alias: Play Bluey On Living Room TV
sequence:
- service: media_player.play_media
  data:
    media_content_id: '291097'
    media_content_type: app
    extra:
      content_id: 655f7202-f7de-4d0b-84cd-2e190aaed851
      media_type: episode
  target:
    device_id: 1e336ede2d682ae754e2b63f9e8f8b3f
- delay:
    hours: 0
    minutes: 0
    seconds: 25
    milliseconds: 0
- condition: not
  conditions:
  - condition: state
    entity_id: media_player.woody_s_new_stick_in_the_living_rm
    state: playing
- service: remote.send_command
  data:
    command: select
  target:
    device_id: 1e336ede2d682ae754e2b63f9e8f8b3f
mode: single
icon: mdi:play-pause

Yes your code is working. I tested three times right now and seems to be working. I am trying to break it now :smiley: trying to hit pause, stop etc… so far it reacts properly. Going to reboot the roku now because it remembers the profile. See what happens if the profile needs to be selected and see how that works.

Awesome. Let me know how the test goes.

Side note - we managed to hijack two totally unrelated threads today solving your issue! When you have a specific question like this that is not directly related to the initial thread it’s usually best to start a new one.

It makes things much easier to find and follow for the next guy that comes along with the same question and you’ll be able to do things like mark your issue as being solved. That and the original thread poster has been getting hammered with notifications of our totally unrelated posts!

1 Like

Still works after rebooting and having it pick a profile… You just made the wifey very happy! Now she can bring the kidos down stairs and their show is already playing. I think we made them very lazy. I will work on doing things more properly in the future as I learn all this. Thank you for all your time!

1 Like