Author Topic: Vera 2 Emby  (Read 4242 times)

Offline PrincessCleavage

  • Sr. Member
  • ****
  • Posts: 352
  • Karma: +6/-1
Vera 2 Emby
« Reply #60 on: January 03, 2019, 04:39:10 am »
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
« Last Edit: January 03, 2019, 05:07:24 am by PrincessCleavage »

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +183/-3
Re: Vera 2 Emby
« Reply #61 on: January 03, 2019, 09:48:48 am »
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.
« Last Edit: January 03, 2019, 01:09:42 pm by rigpapa »
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline PrincessCleavage

  • Sr. Member
  • ****
  • Posts: 352
  • Karma: +6/-1
Re: Vera 2 Emby
« Reply #62 on: January 03, 2019, 07:12:18 pm »
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.
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)

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +183/-3
Re: Vera 2 Emby
« Reply #63 on: January 07, 2019, 11:00:51 am »
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!
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline cw-kid

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1612
  • Karma: +18/-2
Re: Vera 2 Emby
« Reply #64 on: January 07, 2019, 02:30:10 pm »
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

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +183/-3
Re: Vera 2 Emby
« Reply #65 on: January 07, 2019, 04:45:52 pm »
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.

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.

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

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

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

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

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

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

Quote
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.
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline cw-kid

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1612
  • Karma: +18/-2
Re: Vera 2 Emby
« Reply #66 on: January 08, 2019, 04:18:46 am »
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.

Offline PrincessCleavage

  • Sr. Member
  • ****
  • Posts: 352
  • Karma: +6/-1
Vera 2 Emby
« Reply #67 on: January 08, 2019, 05:37:31 pm »
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.
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?
« Last Edit: January 08, 2019, 11:57:57 pm by PrincessCleavage »

Offline PrincessCleavage

  • Sr. Member
  • ****
  • Posts: 352
  • Karma: +6/-1
Re: Vera 2 Emby
« Reply #68 on: January 10, 2019, 09:56:55 pm »
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 )

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +183/-3
Re: Vera 2 Emby
« Reply #69 on: January 10, 2019, 10:12:48 pm »
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 )

that is correct. now, I have only tested with audio and movies. proceed into the unknown bravely!
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline PrincessCleavage

  • Sr. Member
  • ****
  • Posts: 352
  • Karma: +6/-1
Re: Vera 2 Emby
« Reply #70 on: January 10, 2019, 10:43:13 pm »
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 )

that is correct. now, I have only tested with audio and movies. proceed into the unknown bravely!
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)

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +183/-3
Re: Vera 2 Emby
« Reply #71 on: January 11, 2019, 07:36:57 am »
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 )

that is correct. now, I have only tested with audio and movies. proceed into the unknown bravely!
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)

Check the contents of the log. The ResumeMedia action logs something on every exit path.
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.