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.
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.
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.
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.