[New Binding] EMBY Server Binding - Alpha

So what the binding is doing is subscribing to the emby notification server. It is the same notification server that the webhooks plugin is using. I’m not actually doing any direct json responses via gets. Essentially what happens is every 10 seconds (or whatever you configure it to be via the refresh interval) Emby will send out a very large json packet about the currently playing media for all devices. The default is 10.

THe binding then parses this data and passes it off to the various devices.v I think where i have been running into stability issues and where i have been trying to fix it, but it has been tough to nail down. Is that i get overflow issues on the buffer sometimes and the binding closes the socket and doesn’t restart it gracefully.

This way…
Tutorial to sent play state and content type from Emby

It’s been a few days to put it together.

I see you removed the new repository, did you gave up on the plugin? I like the plugin idea more than the webhook or scripter-X, also Home Assitant also uses the websocket, so it should be able to work.

And I guess you don’t use the refreshInterval anymore, at least I don’t see it connected to anything, and the websocket should be push based anyways.

Emby also has a java api, it has a bit of android dependencies, but it might be useful

I’m finally getting around to setting up a new machine to run OpenHAB3, but now I’m wondering if I should wait for an updated Emby binding (or is it abandoned, @volfan6415 ?) or if I should “roll my own” using the Scripter-X instructions.

What’s the latest recommendation?

The binding is not abandoned. And the OH3 version above works well in production.

I do however still need to iron out the kinks in why the websocket is closed. And that has proven difficult.

1 Like

Great, thanks!

My home theater depends on this extension, I really don’t want to have to go back to doing things manually (ugh!). Without this, I’d stay at OH2.5.

Which version is the latest for OH3.1.0.M2?

openhab> bundle:list | grep -i "(gson|emby)"
 27 │ Active    │  80 │ 2.8.2.v20180104-1110    │ Gson: Google Json Library for Java
274 │ Installed │  80 │ 2.5.5.202005060445      │ openHAB Add-ons :: Bundles :: Emby Binding

2021-03-31 15:23:29.662 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.emby-2.5.5-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.emby [274]
  Unresolved requirement: Import-Package: org.eclipse.smarthome.config.core

        at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [bundleFile:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4]

I ended up having to keep an OH2.5 server running so I could use the org.openhab.binding.emby-2.5.0-SNAPSHOT.jar binding - the only one that works for me.

Is this binding abandoned now? Checked the repo and looks like last change was made 2 years ago, it’s a pity…

Thanks given the binding is not working I’d give a try on my Qnap…

Sorry for not responding exactly to your request, but,
You could try jellyfin ?

I wouldn’t say abandoned yet. Life has gotten in the way and i haven’t had much time to work on it recently.

Ok i am back at developing for this binding.

Here is a link to the new github for the changes.

volfan6415/openhab-addons at embydev (github.com)

And here is a link to a new version of the binding that should run under oh3.

org.openhab.binding.emby-3.4.0-SNAPSHOT.jar

Please test and let me know any bugs that you have. I am going to run this for awhile myself and squash any bugs i can before making the formal pull request.

pull request created for binding

[emby] Initial contribution by volfan6415 · Pull Request #13340 · openhab/openhab-addons (github.com)

Any updates @volfan6415
When is it available?