[New Binding] EMBY Server Binding - Alpha

My apoligies, i didn’t see your reply.
i didn’t got it to work so i figured i had to install the bundle install of maven.

eventually it did work but now it is again failing to acces my instance of emby. the bridge is trying to connect but it fails. Is there any way i can extract only the logs for the emby-binding ?

Regards
sander

Yes, there is.
Go to userdata/etc and find this file: org.ops4j.pax.logging.cfg then insert this code at end.

# Emby log appender
log4j2.appender.out.type = RollingRandomAccessFile
log4j2.appender.out.name = LOGFILE
log4j2.appender.out.fileName = ${openhab.logdir}/emby.log
log4j2.appender.out.filePattern = ${openhab.logdir}/emby.log.%i
log4j2.appender.out.immediateFlush = true
log4j2.appender.out.append = true
log4j2.appender.out.layout.type = PatternLayout
log4j2.appender.out.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n
log4j2.appender.out.policies.type = Policies
log4j2.appender.out.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.out.policies.size.size = 4MB 

Maybe, you should create file “emby.log” first under /userdata/logs

This seems to just put all of the logs from openhab into the emby.log file ?

Also thank you, i just had to search the right file locations for linux :slight_smile:

Yes, it does only. But easier to follow the logging

What OH version do you use?

i’m running 2.5.2-1 on linux ubuntu server

@volfan6415 thank you for the binding.

I have load the Plugin in the folder /usr/share/openhab2/addons
But I don’t find the binding in PaperUI, and with log:tail I don’t see any error from emby binding.

Does someone have an idea where I can dound the problem

@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