[New Binding] EMBY Server Binding - Alpha

@anon53398788 you likely need to load some packages via the console. What do you logs show for the binding trying to load? Feel free to post them here

@volfan6415 Now it works. The problem was the jar file from git. When I use wget and download it, the binding not work. When i download from git and move it to my server it works.

But Now i have a few question:

How Can i format the CurrenTime and Durration? I get this:
CurrenTime: 8722650000 s
Duration: 17819470000 s

But I will get minutes and Hours. When I calculate the seconds in minutes I cat too much. The episode is only 30 minutes.

Givs a change to calculate the rest time of a episode?

And do you see a change to get the full filename or the episode information? My file:
S01E03 - The Name
In your Binding I see “The Name” as “ShowTitle” and “title” is only -
When I look at Emby server I see the player play “S01:E03 - The Name”

@anon53398788 you need this:
https://www.openhab.org/docs/configuration/rules-dsl.html
And find “Convert epoch to a human readable”. Than just change the format as you wish.

@Krisztian Thank you.

For me the last question is this

And do you see a change to get the full filename or the episode information? My file:
S01E03 - The Name
In your Binding I see “The Name” as “ShowTitle” and “title” is only -
When I look at Emby server I see the player play “S01:E03 - The Name”

I think this can only answer @volfan6415

Sorry @anon53398788, but what I have linked that just doesn’t work. Strange item format.

To Your last question:

quote from @volfan6415: the title channel is for music

Yeh, despite i have music library and I tried out. it still doesn’t show anything. The “Showtitle” gives you only the name of the movie, series or album. If you ask Zach nicely, he may find you solution at. It’s not a huge problem for me, I just use “Mediatype” and “Stop” item to control lights. Sorry again, i could help you.

@Krisztian no Problem. Thank you.
I have find the solution for me. The duration and currentTime can be divide by 10 millions. After this I can convert to hh:mm:ss
So now I see how long is the movie, and how long to end the movie.

I just wanted to post here to say that i am finally able to start working on this again. I have been able to get my ide set back up and I am going to start the work on cleaning this up where we can potentially get it submitted.

For me it has been working rock solid but for those that have been using it. It would be really helpful if you could open up tickets on my repo for any issues that you have so i can look into them

Also put any feature requests etc in that you would like to see.

1 Like

@anon53398788 Yes right now the duration items are all in milliseconds which is what the emby server provides the time as. I have not done any messing with this as the rules can handle this how a user wants to.

Ok so i have pushed a new version of the binding on the old repo. However, this will likely be the last changes that i push to that repo. Going forward please use:

And select the emby-addon branch. This will be all further development happens as i prepare for a pull request hopefully in the near future. One thing that would be really helpful is in fleshing out the readme.md. Specifically sitemaps,items files etc. I do not personally use all of the channels that are available and there are many control channels that can now be added and used. I have been able to implement all control functions made available in the emby api.

I could really use some help in fleshing out the readme.md and with testing of the various control features. So please suggest edits to this readme, or create issues that have your sitemaps and items which use them so i can flesh out the readme documentation.

Also please test the new version and let me know how it works for you!

Hey @volfan6415! What’s new in the binding? There are only improvements or comes with new feature?
Have you ever tried textual item file with the binding? I could’ve done mine that way.

@Krisztian Most of the work was back end optimizations. I think the server should error out less now.

I did add the ability to send control commands. Everything on https://github.com/MediaBrowser/Emby/wiki/Remote-control

should be supported now.

There are two types of general commands. Those that need arguments and those that don’t. For the ones that don’t need arguments you simply add the channel that you want the command of. It adds as a switch and the on command sent to the switch activates the command. For the ones with arguments it adds a string item linked to the command. Then to activate the command you send a json formatted string with the relevant argument.

For example, the set volume command. Sending a channel linked to that command the string of SetVolume {Volume:50} will send the command to set the volume to 50.

I should add that i have not extensively tested the control commands so testing there would be great.

I have created a pull request for the binding. Follow along there for further development.

1 Like

Hi Zachary, will you update the binding for OH 3.0?

Thanks

Regards,
Micha

1 Like

Hi Zachary
@volfan6415!

Could you tell me why the binding in Karaf console has a status “Waiting”? Shouldn’t be “Active”?

203 │ Waiting │ 80 │ 2.5.5.202005060445 │ openHAB Add-ons :: Bundles :: Emby Binding

I’m having difficulties with the add-on lately. I installed the latest server version (4.5.2) and the add-on just losing connection periodically.

THX

1 Like

I’m facing the same issue since a few weeks. Random connection lost but restores itself after some time can be minutes or even hours still don’t know exactly what the issue is. If I adjust something in the config of the server thing and save it its online again.

Hey sorry guys i have been away on this for a bit. Going to get back to this. Are you guys running the most recent version from the addons?

Hey @volfan6415

Glad you are back!
Meanwhile, I just found an another solution to connect Emby to openHAB.
The Scripter-X plugin from the Emby plugin catalog does the job for me.
On play and on Stop event, it runs some shell scripts with curl command to update my items via restAPI. I gladly share the “knowhow” if anyone is interested.

But let’s talk about the binding. too. I played around the emby’s API recently and notice that, the http GET request with “deviceid” in it give back empty json response sometimes. My “deviceid” in this case is my andriod TV device. Seems, android TV device can disappear from the system after awhile. Probably because of the auto logout feature.
So the question is, How do the bindings handle the empty “[]” json response?

1 Like

Would love to know more, and also how it’s better than just using Emby’s built-in Webhooks feature. I’ve been planning to look at that, but maybe Scripter-X is a better way to go?

There are 2 problem with Webhook in this scenario.

1; The built-in Webhook is made for out of the homenetwork (https) service. It’s ok if you want to use service like IFTTT and similar.
2; You can point the http address to OH in the Emby Webhook plugin, but it will send the data in json format and OH can’t handle it. Acceptable format here is only plain text.

Conclusion: Scripter-X is definitely the better way to go and keeping data inside your network.
If the binding remains broken. Sorry @volfan6415

1 Like