Jump to content

Vera Home Automation Plugin (Emby Vera)


chef

Recommended Posts

Ill give it a try, this is the only plugin to do this with a vera and emby. Have you considered looking into creating a plugin on vera to help facilitate the actions and also allow for two way scenes like pausing when a doorbell is rung or if a light is turned on or off? I have scenes for door bell ringing so would be nice to just be able to get up and answer it without having to find the remote first.

  • Like 2
Link to comment
Share on other sites

Ill give it a try, this is the only plugin to do this with a vera and emby. Have you considered looking into creating a plugin on vera to help facilitate the actions and also allow for two way scenes like pausing when a doorbell is rung or if a light is turned on or off? I have scenes for door bell ringing so would be nice to just be able to get up and answer it without having to find the remote first.

I found code to do this. I just have to learn the vera plugin environment, and the doorbell will pause media playback.

  • Like 1
Link to comment
Share on other sites

@@MEB What doorbell device are you referring to?

 

I use a window/door sensor and a reed switch on the dry contact. I place the reed switch next to the electromagnet of the door bell. When the bell rings it triggers the sensor as closed. On vera I have a scene when the device closes it has Imperihome on my wall mounted phones say "Ding Dong" and displays the door cameras.

Link to comment
Share on other sites

GlennNZ

Hi

Don't worry about the source - I understand - hard fought baby and all! - I think from reading a few forum posts I'm going through the same issues (with a similar skill level) that you had earlier in the year!

 

Had made a start on another front (and needed to start on a emby plugin - because the c# api did not pull together for me)  

 

On this front needed a Emby Plugin - so worked through both my issues and the automation side - was hoping to get both done.

 

BUT:

Have just lost most of a day (last free day for a while) wondering why I couldn't get configPage to load (keep erroring out) - after most of the day and usual issues (Embedded code, GUI etc .etc) discovered it was I had installed ServiceStack package (later removed - rather than ServiceStack.Interfaces only)  This must have buggered something up such that I spent the day trouble shooting.  Even removing it didn't revert whatever it had done - so had to start over.

 

Oh well - the reason I'm on this thread - is I had another approach to the Pause/UnPaused issue - which I think might work better if successful.

 

I see you  (from decompiling the dll -gives really readable code - must be the .net basis of it) are hooking into the EventHandlers for PlaybackStarted, PlaybackStopped -& SessionManager for start sessions etc - I had made a start exactly along this lines as well - until sidetracked.

 

 

But sessionManager also has access to PlayState.IsPaused field - is the file paused or not.  (at _sessionManger.Sessions - then within PlayState.IsPaused)

I would suggest - hooking like you are into PlaybackProgress (Runs every second - best I can tell) and checking this PlayState.IsPaused for the DeviceID?  (or SessionID - sorry forget) via _sessionManager  ?

 

 

Glenn

Edited by GlennNZ
  • Like 1
Link to comment
Share on other sites

The version uploaded to the admin server yesterday, fixes any of the session problems.

 

Works much better now. The session ended event seemed to be broken before the fix.

Edited by chef
  • Like 1
Link to comment
Share on other sites

@@GlennNZ
Glenn sorry, I meant to post a download link to the sln yesterday.
 
I will send you my version tonight. Again I do apologize. 
 
Also, you are correct that you use session manager, session manager has all the playback events.
 
For some reason "IsPaused" didn't work. I'll look at it again tonight and see if I can use it during the playback checkins.
 

 

Link to comment
Share on other sites

@@Xzener! we can thank @@GlennNZ for figuring out the Playback Paused Events. He was spot on, and it works quite nicely. 

 

I look forward to seeing if he has anything else to add to the plugin!

 

If you haven't yet, update to the latest version of the plugin, it has his fixes added.

  • Like 1
Link to comment
Share on other sites

Xzener

Want to apologize for abandoning you and your app Chef. I will test things out and report back. Been very deep in the new Emby Theater testing as of late.

 

Any progress on the Xbone UUID issue. Perhaps we can setup the app to rely on it's IP as opposed to UUID. The Vera app I'm using is dependent on IP addresses and is very dependable. Although this would only pertain to session started/ended.

Link to comment
Share on other sites

fantaxp7

Hey guys, I haven't actually gotten this working since my last post awhile back and I saw an update this morning. So I updated to latest and I cannot see my Vera unit after refreshing browser.

 

Thoughts?

 

Thanks Chef! 

Link to comment
Share on other sites

Hey guys, I haven't actually gotten this working since my last post awhile back and I saw an update this morning. So I updated to latest and I cannot see my Vera unit after refreshing browser.

 

Thoughts?

 

Thanks Chef!

 

@@fantaxp7

Yep, which UI are you using? Also does it appear I the configuration xml?

Edited by chef
Link to comment
Share on other sites

The new pause update has been great, very fast response as well. Don't change a thing :D

Great news!

 

Now we just have to figure out why fantas vera device isn't getting recognized and we'll have a stable product.

Link to comment
Share on other sites

fantaxp7

@@fantaxp7

Yep, which UI are you using? Also does it appear I the configuration xml?

I logged into it to check, saw there was a firmware update and applied it...and of course now I can't reload the page...grr...I'll check later after I get home and can reboot it.

 

Thanks 

Link to comment
Share on other sites

fantaxp7

OK so I rebooted my vera, I have firmware  1.7.760

 

also the configuration xml...would it list it there even if the plugin doesn't see it? I'll have to fig around to find the xml as I recently switched to using the unraid docker version of emby server...

 

Thanks 

Link to comment
Share on other sites

There maybe a chance that the very info is being recorded to the configuration xml but not showin properly in the ui.

 

Not sure why, but I thought I'd cover all the bases.

 

When you find the configuration xml, delete it and then restart the emby server.

 

You'll have to set up your devices agajn, but there is also a chance that new entries I the xml configuration may have broken older version of the plugin.

Link to comment
Share on other sites

fantaxp7

There maybe a chance that the very info is being recorded to the configuration xml but not showin properly in the ui.

 

Not sure why, but I thought I'd cover all the bases.

 

When you find the configuration xml, delete it and then restart the emby server.

 

You'll have to set up your devices agajn, but there is also a chance that new entries I the xml configuration may have broken older version of the plugin.

Ok so I deleted the config xml. Still didn't find my unit, then I uninstalled the plugin and reinstalled, still did not find it. 

 

I also noticed there wasn't a xml after reinstalling, I assume that gets created after finding the vera?

Link to comment
Share on other sites

fantaxp7

Hmm... It should create the plugin xml right away when the server starts.

After another uninstall/reinstall the xml is back. The plugin still won't see my device. 

 

Is there a way to input the vera's IP manually into the xml?

 

Thanks 

Link to comment
Share on other sites

After another uninstall/reinstall the xml is back. The plugin still won't see my device. 

 

Is there a way to input the vera's IP manually into the xml?

 

Thanks

 

Yes, I will create the entry for that to happen.

 

I will put a release out tonight.

  • Like 1
Link to comment
Share on other sites

After another uninstall/reinstall the xml is back. The plugin still won't see my device. 

 

Is there a way to input the vera's IP manually into the xml?

 

Thanks

 

Yes, I will create the entry for that to happen.

 

I will put a release out tonight.

Link to comment
Share on other sites

Hey @@MEB

 

I figured out how to have you doorbell trigger emby playback.

 

But Vera is wierd because it actually polls each device in its plugins (in real time too).

 

So, I was thinking I would poll a particular device during playback.

 

This means that when a media item starts its going to keep checking your doorbell every second for a trigger.

 

But, I don't know the actual stress this going to have in your network, or how it would imped streaming. Let's give it a shot.

 

I am close. I don't think my network could handle it, but I will mark the option as experimental.

Link to comment
Share on other sites

fantaxp7

Hey Chef,

 

Hate to sound like I'm nagging, but did you get a chance to look at how I might be able to manually enter my Vera's IP?

 

Thanks 

Link to comment
Share on other sites

Yep. I will post a new version in one second. If this still cause an issue, then I have one more version to try. I will upload the new version.

 

By the way this new version breaks the xml configuration, so anyone updating will have to update their configuration from scratch.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...