[New Binding] EMBY Server Binding - Alpha

Definitely not. I’m using only one client on my media box. Not one elsewhere. There’s an update on my box and i thought, i doing a clean install on it and delete all devices from Emby. Let see what happening. I’ll preform it today or tomorrow. When I have some result, report back asap.

And Happy New Year!

1 Like

Hi volfan!

Sorry, i’m late for a week. Looks like it repaired itself. Now everything working just fine. No fluctuating info in the logs. One entry comes when I start playing a movie or episode and the next comes by the stop playing. Im happy with it.
What helped, I can not tell. Maybe a new and clean start and updates on my devices. Who knows.

May I have suggestion/wish? I know, this binding based on Kodi binding. What i have used back before Emby. The Kodi binding has one item what I missing so much from yours. And that the “Media type” String. It says the type of the content like is it a movie or episode.
Is it a chance with Emby to extract such or similar data? Can you develop the binding with this? Only if possible.

1 Like

Sorry for the n00b-question. But where do I put the downloaded files from GitHub?

@kristian this should not be hard to do. The data for this field is present i just need to add the fields into the binding and create the channel type. I should have some time over the next week or so and will publish and update

1 Like

@kraen under target is a file called org.openhab.binding.emby-2.4.0-SNAPSHOT.jar but that file in your openHAB addons folder

that is all you need to do to install the binding

@Krisztian so when i went to look at the code i completely forgot that it looks like i should already have this coded in! It should be on the Show Title channel (the title channel is for music which i don’t have anything linked up to yet because i don’t have a music library in emby)

Try it out and let me know if it doesn’t work for you

Of course, it does work for me. That item gives me the title of the movie or serie. Which is Okay as we see as funtion. As I mentioned before, the “Mediatype”, this name come from Kodi binding, can handle out the type of content (Movie, episode, music etc)
Btw, since the binding started to work on my set up, i have no problem with. It does the job well. Nice work!

1 Like

gotcha… i misunderstood … still should be easy to add.

Awesome to see someone working on a binding for Emby. Been using it for years with my XBox 360’s hosting on a Windows server. Excuse this question but the link shows a template in GitHub not filled in. What does this binding actually do? Is this a movie player that plays on your device? Can it play audio from your media library if included in Emby server? Ideally I’m looking for a way to play my music that currently sits on a hard drive but is indexed thru Emby, and play it thru my Sonos speakers. Any pictures of what this looks like? I’m more than happy to help test, just not sure what all this does.

Thanks.

JR

@volfan6415 Is there a variable to differentiate what type of media it’s playing?

Show vs Movie vs Trailer vs Audio?

Hey so what the binding does right now is retrieves information from the emby server. This allows for you to trigger automation events from playing events in emby. For example when a movie starts on the home theater dim the lights… or even if little johnny starts a movie after 10 send me a text notification to my phone. Right now it is read only in the sense that it just gets the data into openHAB what you do with the data is totally up to you in rules etc.

What i use it for is to grab the coverArt for the now playing item to display on the tablet in our home theater. The coverart also has the progress time overlay so you can see how far the movie/tv show is.

Right now the control is one way Emby -> openHAB. However the framework is there for openHAB to send commands back to emby i just need to code the hooks in however life has gotten in the way (my second child was born in november so i have had less time to code. ) However, i have not given up on this and i will loop back and get this completed.

Right now it just does movie vs. TV show. I don’t have music library in emby so i haven’t tested that. However the code is there and this should not be hard to add and certainly needs to be added.

Thanks

Congrats Zachary. Put family first. This kind of stuff can wait!!!

JR

Congrats!

@idean @Krisztian

New version of the binding uploaded to github. This has a mediatype channel which should populate with the current type of media which is playing.

Test and let me know how it works for you. For tv shows this will show up as Episode, and for Movies it will show as Movies.

I do not know what it will show when a trailer or music is playing has i don’t have that feature enabled to test. But please feel free to test and report back with debug logs and any errors. I have not updated the create image url channel with audio files as i don’t have any in my library so not sure how that will work? Same with trailers?

So please test there and send me the logs if there are issues.

1 Like

I should add you will need to delete and recreate any things you have created to see the new channel.

Sounds great! I’ll try it out in about a week - I’m out of town right now.

Hi @volfan6415!
First of all, I too congrats to you.

the next, To be something to report. It would be great to say: not much to report, but I have some question and would go through step by step.

1; MediaType item:
I tried out with movie, serie, music and other video as extras (it doesn’t show anything by trailers). Item reports back as movie, episode, audio and video in this order. I don’t have any other type of content in my collection. So far so good, but not at 100%. The reason why I say that is the “MediaType” item doesn’t change back its status after a movie or episode finished. Just stayed so and keeps the value what quered by the start of playing. Same with item “Duration” too. My solution is, to update the item when Item “ShowTitle” changed back to ON. Something like this:

rule "Update Mediatype Item"
when
    Item LivingRoom1_9083_ShowTitle changed to UNDEF
then
    LivingRoom1_9083_MediaType.postUpdate(UNDEF)
end

I don’t know why but that item works as it should and after a stop, it just return to state UNDEF. So i just use it to trigger the postUpdate command and put the “MediaType” item in the right state. Maybe, is there a way to change it?

2; Do I need my server as an Emby device or not?

List of things on Paper UI:

  1. Server as device
  2. Server as controller
  3. My mediaplayer as device (Emby Android TV App running on Himedia Q5 Pro)

I ask that, because I see many logentry where the 1st deviceid does not equal to 3rd deviceid.

Example:

adding new emby device
Disovered device binhex-arch-emby1 with id b31e0e5798b148c1be61bfb971d50294
Checking to see if handler is null
b31e0e5798b148c1be61bfb971d50294 does not equal 252f96534265e60 the event is for device named: binhex-arch-emby1 
Checking to see if handler is null
the deviceId for: binhex-arch-emby1 matches the deviceId of the thing so we will update stringUrl
Received event from EMBY server passing it to the bridge handler with hostname ip and port
Received event from emby server

I’m getting the same entry in logs, even if that thing has been removed.
Is it normal? Should it be so? Should I remove the 1st device from Paper UI or just let it there?

3; Reliability

A few times a day, and I mean, maybe 1 or 2 times, the binding closing connection due to “Unhandled Error”. But few seconds later come back online and everything is normal. It used to happen during the day too when I’m not home. Happened time to time with your setup too?

But out of this 3 point, i didn’t find any glitch how the binding operates. These aren’t painfull mistakes. I guess, its good news to you.

Keepin up with the great work!

As to the Media type and duration not being reset that is a bug i will get that worked out.

No you do not need a seperate thing for the server. The only type you need is the bridge that communicates with the Server. So in your example the only one that is needed is 2. 1 is not needed and can be safely removed.

As to the reliability I have had to tweak the size of the receive buffer to allow to try and keep it open and the error checking within the binding still has alot of work left to be done before this is ready for mass distribution. So if you wouldn’t mind sharing some logs when you see the thing go offline that would be very helpful.

@Krisztian

New version pushed to github for you to test