Vera and Emby

I have even managed to auto display my cameras (using Chefs surveillance app for emby) if there is motion detection when armed and playing state is active on my Main HTPC. Might be a long shot but Is there any way to temp store previous playing media name and resume it when camera stream is stopped ? Emby keeps records of resume state in its database I assume but not sure if this is exposed through the api

OK, so let me checkpoint here.

Your play status issue is now working. I’m guessing you didn’t wait long enough. The plugin may take up to a minute to detect that playing has started on a session. The plugin is not a replacement for the client’s UI, so don’t expect to-the-second updates on the Vera UI to tell you what a client/session is doing. Between Vera and Emby’s limitations, it’s not going to work that way.

You sent me a PM with your machine name, but I never got your plugin status data. Did you PM that or email it?

As far as I can tell, Emby does not maintain an accessible resume state on the server. That is why I hid the “Stop” button in the control panel and didn’t put it on the dashboard card. So, as you can see, I’ve asked Luke what he suggests, because nothing pops out otherwise. EDIT: Luke has confirmed, the playlist of a session is not accessible through the API (he’s planning on adding that to a later release).

You should use media Ids as much as possible, BTW. Your PlayMedia example may be lucky that the title is unique in the database, but if the title matches more than one media object, all of them will be played. Using a media Id assures that you will play the one exact item you are requesting.

[quote=“rigpapa”]OK, so let me checkpoint here.

Your play status issue is now working. I’m guessing you didn’t wait long enough. The plugin may take up to a minute to detect that playing has started on a session. The plugin is not a replacement for the client’s UI, so don’t expect to-the-second updates on the Vera UI to tell you what a client/session is doing. Between Vera and Emby’s limitations, it’s not going to work that way.

You sent me a PM with your machine name, but I never got your plugin status data. Did you PM that or email it?

As far as I can tell, Emby does not maintain an accessible resume state on the server. That is why I hid the “Stop” button in the control panel and didn’t put it on the dashboard card. So, as you can see, I’ve asked Luke what he suggests, because nothing pops out otherwise. EDIT: Luke has confirmed, the playlist of a session is not accessible through the API (he’s planning on adding that to a later release).

You should use media Ids as much as possible, BTW. Your PlayMedia example may be lucky that the title is unique in the database, but if the title matches more than one media object, all of them will be played. Using a media Id assures that you will play the one exact item you are requesting.[/quote]
I sent status data in a PM just prior to the sending the machine name (was a large dump so it may of failed but I did not receive any error sending).
In attempting to see the current play state I had a movie playing for >5mins with nothing showing and it wasn?t until I played a tv show(different media container) that active play state showed. I will do further testing.
Luke has confirmed that movie resume state is currently available through the api (see his last post in Emby forum)

The 1.0 release of the Emby Interface plugin is now published in the Vera Plugin Marketplace and AltAppStore. Releases are still available in the Github report.

Full details in the new “official” Emby Interface thread: http://forum.micasaverde.com/index.php/topic,118013.0.html

New questions, bug reports, features requests, discussion, etc. in the official thread from today, please!

Just updated the plugin to version 1.0 via the app store, some feedback.

On my Android phone with the Emby app whilst playing a TV show, if I press the VOL - button on the device in the Vera GUI it turns the volume right up not down.

The skip back / forward buttons jump 5 minutes back or forward in the playback, is that expected?

After pressing each button in the Vera GUI, there is a delay with a spinning wheel for a few seconds.

I have some emulated Logitech Squeezebox software clients, the plugin has picked these up and placed devices for them in the Vera GUI.

If I look in the Emby servers Dashboard and go to Devices I don’t see these Squeezebox clients listed in there.

However if in the Emby web GUI in Chrome browser I click the Cast button I then do see the two Squeezebox clients listed as DLNA.

I started to play some music via the LMS server to one of the Squeezebox clients. I refreshed the browser page for the Vera GUI and looking at the Emby device instance for this Squeezebox client, no playing status is shown. The transport control buttons in the Vera GUI didn’t really work either and some times after pressing a button a popup would say Error: Action Failed.

As these Squeezebox clients are not proper Emby client devices, I guess I will just hide them from the Vera web GUI, I see you now have options to hide certain devices if you want too.

Thanks

[quote=“cw-kid, post:65, topic:199693”]Just updated the plugin to version 1.0 via the app store, some feedback.

On my Android phone with the Emby app whilst playing a TV show, if I press the VOL - button on the device in the Vera GUI it turns the volume right up not down.[/quote]

Volume implementation varies by client and IMO isn’t currently a useful implementation (on Emby/Android client’s part). See the README file in the Github repository for more information and how enable the plugin’s SmartVolume feature. Mute is also inconsistent/broken on Android, but again, I’ve provided workarounds for this that you can enable in the plugin.

The skip back / forward buttons jump 5 minutes back or forward in the playback, is that expected?

The behavior of skip is up to the client. The command gets sent by the plugin, the Emby server passes it to the client/session, and the client determines what to do with it. For audio files, my experience is that it usually moves on to the next file in the queue. For other media types, though, it seems there’s no standard, and bevahior varies a lot. The plugin attempts to make it make sense for movies, at least, by using chapter information if the Emby server exposes it; but if not, the behavior is whatever the client implementation decides it is.

After pressing each button in the Vera GUI, there is a delay with a spinning wheel for a few seconds.

Vera hard at work. Love UI7.

I have some emulated Logitech Squeezebox software clients, the plugin has picked these up and placed devices for them in the Vera GUI.

Emby servers with DLNA enabled will pick up a lot of clients. If the server lists them as “SupportRemoteControl” in its database, they will make an appearance in the Vera interface via the plugin.

If I look in the Emby servers Dashboard and go to Devices I don't see these Squeezebox clients listed in there.

I don’t know what the heuristic is for that dashboard. I suspect is uses the “recently active” filter. The plugin shows all sessions because you may want to set up scenes and actions for a session that has not been recently active.

However if in the Emby web GUI in Chrome browser I click the Cast button I then do see the two Squeezebox clients listed as DLNA.

Yup. So they become active, and show up, which is consistent with my suspicion about that display.

I started to play some music via the LMS server to one of the Squeezebox clients. I refreshed the browser page for the Vera GUI and looking at the Emby device instance for this Squeezebox client, no playing status is shown. The transport control buttons in the Vera GUI didn't really work either and some times after pressing a button a popup would say Error: Action Failed.

The Emby server does not provide current activity (playing media) data for all DLNA types in all circumstances. In my particular case, it will show my Sonos as an Emby client, but I don’t see playing media updates unless I turn on UPnP on my router (which I don’t like to do).

But it could also be that the Emby plugin was just sleeping. In order to keep load down on the Vera, if there are no active clients, the plugin greatly reduces its polling rate to the server. But that means when a client starts playing, it may take the plugin up to this polling interval (60 seconds by default) to discover that fact and begin to show state information for the session. Once it sees an active session, the polling interval gets much shorter (5 seconds by default), and stays that short for 60 seconds after all clients go idle (just in case the idle period is just a media change).

As these Squeezebox clients are not proper Emby client devices, I guess I will just hide them from the Vera web GUI, I see you now have options to hide certain devices if you want too.

That would be the correct approach, and the reason I made automatic and manual hiding available in the interface. There’s just a lot of opportunity for a lot of devices to be listed that you may not be interested in. The “Sessions” tab on your Emby server device should give you good control over what shows and what doesn’t.

A lot of these issues are written up in the README in the project’s Github repository. Check that out.

Also just as a philosophical matter, this plugin is not intended to be a replacement for, or mirror of, the UI for Emby media clients. It is a control and response interface. The “what’s playing” display is only to give you a general idea of what’s going on, not a to-the-beat accurate display of what the client is doing. Vera/UI7 isn’t up to it.

Thanks for the response.

Another plugin I’d love to see for Vera is one for Google ChromeCast / Google Home devices.

Perhaps sending a camera stream to a ChromeCast or a TTS to a Google Home speaker(s).

The Vera Concierge has TTS but it’s a bit hit and miss.

[quote=“cw-kid”]Thanks for the response.

Another plugin I’d love to see for Vera is one for Google ChromeCast / Google Home devices.

Perhaps sending a camera stream to a ChromeCast or a TTS to a Google Home speaker(s).

The Vera Concierge has TTS but it’s a bit hit and miss.[/quote]
Have you tried Chefs Surveillance plugin for emby? I have it successfully sending my garage camera streams to my main emby client if it?s play state is active and the garage sensor is armed and I?m in home or night mode, all is left is to auto resume playing media when closing the camera streams (luke has stated that he will add resume function to the emby api).
I believe you could do the same or similar with chromcast?

Hi Rigpapa,
I can see in the latest emby plugin you are now capturing resume state, until Luke adds resume into the api how would I resume a movie after closing a video camera feed sent to a client when I have set it to send to client if senors is triggered?
Would this be correct call:
luup.call_action( “urn:toggledbits-com:serviceId:EmbySession1”, “ResumeMedia”, 777 )

[quote=“PrincessCleavage, post:69, topic:199693”]Hi Rigpapa,
I can see in the latest emby plugin you are now capturing resume state, until Luke adds resume into the api how would I resume a movie after closing a video camera feed sent to a client when I have set it to send to client if senors is triggered?
Would this be correct call:
luup.call_action( “urn:toggledbits-com:serviceId:EmbySession1”, “ResumeMedia”, 777 )[/quote]

that is correct. now, I have only tested with audio and movies. proceed into the unknown bravely!

[quote=“rigpapa”][quote=“PrincessCleavage, post:69, topic:199693”]Hi Rigpapa,
I can see in the latest emby plugin you are now capturing resume state, until Luke adds resume into the api how would I resume a movie after closing a video camera feed sent to a client when I have set it to send to client if senors is triggered?
Would this be correct call:
luup.call_action( “urn:toggledbits-com:serviceId:EmbySession1”, “ResumeMedia”, 777 )[/quote]

that is correct. now, I have only tested with audio and movies. proceed into the unknown bravely![/quote]
Ok so I have setup a new reactor to monitor 2 x emby clients I use mainly if the have the condition of playingitemtitle = Garage (my garage security camera feed) and then set up a scene with this reactor restores from triggered state of armed or disarmed run the following luup code:
luup.call_action( “urn:toggledbits-com:serviceId:EmbySession1”, “ResumeMedia”, 777 )
luup.call_action( “urn:toggledbits-com:serviceId:EmbySession1”, “ResumeMedia”, 772 )

This seems to trip and untrip in a reasonable time but the luup resume calls do nothing, am I missing something (I had both clients playing a movie for the trip test)

[quote=“PrincessCleavage, post:71, topic:199693”][quote=“rigpapa”][quote=“PrincessCleavage, post:69, topic:199693”]Hi Rigpapa,
I can see in the latest emby plugin you are now capturing resume state, until Luke adds resume into the api how would I resume a movie after closing a video camera feed sent to a client when I have set it to send to client if senors is triggered?
Would this be correct call:
luup.call_action( “urn:toggledbits-com:serviceId:EmbySession1”, “ResumeMedia”, 777 )[/quote]

that is correct. now, I have only tested with audio and movies. proceed into the unknown bravely![/quote]
Ok so I have setup a new reactor to monitor 2 x emby clients I use mainly if the have the condition of playingitemtitle = Garage (my garage security camera feed) and then set up a scene with this reactor restores from triggered state of armed or disarmed run the following luup code:
luup.call_action( “urn:toggledbits-com:serviceId:EmbySession1”, “ResumeMedia”, 777 )
luup.call_action( “urn:toggledbits-com:serviceId:EmbySession1”, “ResumeMedia”, 772 )

This seems to trip and untrip in a reasonable time but the luup resume calls do nothing, am I missing something (I had both clients playing a movie for the trip test)[/quote]

Check the contents of the log. The ResumeMedia action logs something on every exit path.

Is there a way to capture an Emby Server idle state and trigger a Windows Task?

Specifically, I’d like to have MCEBuddy start processing when my Emby Server is idle and then stop when it isn’t idle.

Thoughts

@chef ?
@PrincessCleavage ?
@rigpapa ?

TIA

I cross posted.

https://emby.media/community/index.php?/topic/73164-using-vera-plugin-to-trigger-windows-pc-events/?p=736999

At the moment, the best way is to look at the “Message” variable on the server instance (and in service urn:toggledbits-com:serviceId:EmbyServer1). It will contain “Idle” when no sessions on that server are active.

Then what to do?

Set a scene to do what to tell the HTPC with Emby to start or stop MCEBuddy executable?

Or is this something I can do directly with the Windows Task Scheduler outside Vera Emby Plugin?

Thanks!

Not being familiar with MCEBuddy and keeping my use of Windows to a minimum to the greatest extent possible (and nowhere in my own HA), I can’t answer for that piece of your puzzle.

Thank you. I need to have Vera tell the PC when Emby is idle or busy. Is this possible, maybe in linux? If yes, it has to be somewhat similar but maybe not in Windows.

Anyone else know what to do?

Thanks.

@rigpapa

How to you pull the information as to what user is active and/or ServerIsIdle?

Thanks. I think a little script in a .bat in Windows can solve this.

https://emby.media/community/index.php?/topic/73164-Using-Vera-Plugin-to-trigger-Windows-PC-Events#entry737423

There is no single-point source for user or session activity in the plugin. You can look at each session plugin device individually to see if it is active. There is no user data.