Jump to content

Home Assistant - media_player.play_media with emby?


lundblad

Recommended Posts

lundblad

Hello! Excuse my bad English.

I want to create a button on my dashboard that launches a specific video or playlist on my TV (Shield TV)

Anyone know how to do this? is it even possible?

Help would really be appreciated!

// Marcus, sweden

Link to comment
Share on other sites

Hi, have you tried using our remote control features to send content to our Android TV app?

Link to comment
Share on other sites

lundblad
36 minutes ago, Luke said:

Hi, have you tried using our remote control features to send content to our Android TV app?

Thank you for answering me! :)

I have this in my configuration.yaml :
media_player:
  - platform: emby
    host: 192.168.1.4
    port: 1337
    api_key: !secret api_emby

i know how to play/pause/volume control but not how to start a movie from home assistant. is it possible? :)

Link to comment
Share on other sites

What "Home Assistant" are you referring to?  Got a link to the product?

Link to comment
Share on other sites

lundblad
18 hours ago, Luke said:

Hi, have you tried using our remote control features to send content to our Android TV app?

Luke do you know how to do what i want? Is it possible to get a URL link for a movie/episode in my libary ? 

Link to comment
Share on other sites

chef

Try POST to this URL:

 

"http://localhost:8096/emby/Sessions/YOUR_SESSION_ID_TO_CONTROL/Playing?api_key=YOUR_API_KEY"

 

With something like this in the body:

 

{\"Arguments\":{\"ItemId\":\"MEDIA_ITEM_INTERNAL_ID\"}}"

 

I haven't exactly tried this (I will put it in POSTMAN now to see what works). But in the meantime, for more information I can point you to this git page:

 

https://github.com/MediaBrowser/Emby/wiki/Remote-control

 

 

 

Link to comment
Share on other sites

lundblad
20 hours ago, chef said:

I haven't exactly tried this (I will put it in POSTMAN now to see what works). But in the meantime, for more information I can point you to this git page:

 

Thank you! please do :) 

Link to comment
Share on other sites

  • 2 weeks later...
lundblad

Just found out how to do it so i dont need help anymore

Edited by mopsiptv
Link to comment
Share on other sites

  • 2 weeks later...
On 8/10/2020 at 2:40 PM, mopsiptv said:

Just found out how to do it so i dont need help anymore

What was the solution?

Link to comment
Share on other sites

lundblad
On 22/08/2020 at 18:21, Luke said:

What was the solution?

I followed the guide linked above. Took some time for me to understand it xD new to this!

But it works really good! I just added music playlists, but i want to start the music playlist in shuffle mode. Is that possible? There is no option for that what i can see? :) :

The following values should be included within post data:

ItemIds - A comma-delimited list of item id's
PlayCommand - PlayNow, PlayNext or PlayLast
StartPositionTicks - If supplied, this is the position in which the first title should start at.
MediaSourceId - If supplied, this is the media source that should be used for the first item
AudioStreamIndex - If supplied, this is the audio stream that should be used for the first item
SubtitleStreamIndex - If supplied, this is the subtitle stream that should be used for the first item
StartIndex - If supplied, and if playing a list of items, this is the index of the first item that should be played.

and, it is not possible to start casting with this? to play music on my google home speaker

Edited by mopsiptv
Link to comment
Share on other sites

  • 5 months later...

I'm looking to do something similar (albeit with NFC tags), but I'm running into some issues. 

When I run the rest command it loads up the selected title, but it comes up in a stopped state (despite using the "PlayNow" command), and I either have to manually press the play button on the OSD, or navigate back to the home screen and post the command again. 

It almost seems like it's a focus issue, but I'm not sure...

For my final product, my idea is to run an automation that opens Emby in chrome in kiosk mode with a selected user (which I have working), and then play the title with a post command (which is kind of working, aside from the above issue). 

Any ideas @Luke? I've tried adding a second action (after a 1 second delay) to my home assistant automation that runs the "PlayPause" command, and have the same issue. I've also tried "Unpause", which I why I'm thinking it might be a focus issue. 

Link to comment
Share on other sites

Just now, pmac said:

I'm looking to do something similar (albeit with NFC tags), but I'm running into some issues. 

When I run the rest command it loads up the selected title, but it comes up in a stopped state (despite using the "PlayNow" command), and I either have to manually press the play button on the OSD, or navigate back to the home screen and post the command again. 

It almost seems like it's a focus issue, but I'm not sure...

For my final product, my idea is to run an automation that opens Emby in chrome in kiosk mode with a selected user (which I have working), and then play the title with a post command (which is kind of working, aside from the above issue). 

Any ideas @Luke? I've tried adding a second action (after a 1 second delay) to my home assistant automation that runs the "PlayPause" command, and have the same issue. I've also tried "Unpause", which I why I'm thinking it might be a focus issue. 

Many browsers do not allow autoplay of video without user interaction in order to avoid spam videos. You might be able to find a browser flag to adjust this, although you might not want that for all websites. You're probably better off remote controlling an Emby app instead.

Link to comment
Share on other sites

I initially planned on having it play through Emby Theater, but I couldn't find a way to have ET start with a specific user logged in. Using a chrome shortcut I'm able to have it start with the same user each time. 

Link to comment
Share on other sites

@Luke with my setup I'm dynamically setting the session ID through a sensor I've created in Home Assistant. If I set the device ID to my ET app and set the user ID to my desired user in the post command, will it save the watched state, etc to the user I've specified, regardless of which user is logged in to the session? Sorry if I've worded this wrong, this is my first time using rest commands.

Basically, in order for ET to work for my purpose, I need to be able have the command work regardless of which user is logged in (since ET auto signs in the last user that was using the app), but I want to record watched state, etc as if a particular user was watching it (not necessarily the user that was automatically logged in when the app starts). 

I've also thought about using DLNA, but can't seem to get DLNA to play on my older Panasonic TV (GT30); even though it shows up as a remote controllable device, when I try to play something to it nothing happens. 

Link to comment
Share on other sites

The api currently does not support controlling who is logged in, so there is currently no way of doing that.

Link to comment
Share on other sites

6 hours ago, pmac said:

I'm looking to do something similar (albeit with NFC tags), but I'm running into some issues. 

While not helpful to your issue, I'm curious what you're setting up here with NFC tags? All I can picture in my head is a giant binder filled with NFC tags to match every item in your library but I'm sure that can't be it! lol

Link to comment
Share on other sites

On 11/02/2021 at 20:02, MRobi said:

While not helpful to your issue, I'm curious what you're setting up here with NFC tags? All I can picture in my head is a giant binder filled with NFC tags to match every item in your library but I'm sure that can't be it! lol

Haha no, that's not it. I've actually managed to get it working now, but what I've done is made a little system for my son to play some of his kids shows by placing one of his toys (that corresponds with a particular show) on top of the tv stand (with an NFC reader hidden underneath). When he places the toy there my Echo Show says "Playing (Show Name) on Emby theater" and then turns on the TV and starts the selected show/movie :)

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...