Jump to content


Photo

Vera Home Automation Plugin (Emby Vera)

Home Automation

  • Please log in to reply
480 replies to this topic

#41 Vidman OFFLINE  

Vidman

    Advanced Member

  • Alpha Testers
  • 2662 posts
  • Local time: 09:57 AM

Posted 30 March 2015 - 08:55 AM

Actually @Vidman there is a way. It is how I am populating the Device lists in the plugin; with Session Started and Session Ended.

Also, User Authenticated is also an event we can take advantage of.

If you would like to have scenes attached to these events, I can do that.

I think we can tap even into scheduled tasks.



The best thing to do is look at each room as a Emby Device. So even if you use MBTheater one day in your Theater, or MBC the next, that computer will always trigger events the same.

We connect Vera Room/Scenes to emby Devices.

At least that is how it is set up right now.


I will put the other events mentioned above into the Scene editing page for you guys.

OK I stand corrected :) great work BTW chef!

#42 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3994 posts
  • Local time: 08:57 PM
  • LocationPeterborough, Canada

Posted 30 March 2015 - 10:44 AM

I have added all three events to the client config page.

User authenticated
Session started
Session ended

I have read beginners lua code, and also the how to write a Vera plugin. So maybe... You'll be able to flick a light switch and enable your entire room.
  • Xzener likes this

#43 AgileHumor OFFLINE  

AgileHumor

    Advanced Member

  • Alpha Testers
  • 759 posts
  • Local time: 05:57 PM

Posted 30 March 2015 - 04:17 PM

delete me, pii cleanup 


Edited by AgileHumor, 17 April 2015 - 02:12 AM.


#44 techywarrior OFFLINE  

techywarrior

    Advanced Member

  • Members
  • 2408 posts
  • Local time: 05:57 PM

Posted 30 March 2015 - 04:48 PM

Yes, Vera, and other HA controllers aren't using authentication that much but Emby is. Just because you "should" only send specific commands to the Emby plugin doesn't mean that it's ok to leave it unprotected.

 

To make a "universal" HA plugin you are passing a lot of complexity over to the user but you should never assume that the user knows what they are doing.

 

With the work Chef has done it wouldn't be that hard to create other HA plugins for other controllers. That's the path that should be followed. This would allow future updates to include tighter integration with the controller or other specific functionality that certain controllers have over others.



#45 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 06:57 PM
  • LocationLemoore, CA

Posted 30 March 2015 - 06:57 PM

Xzener,

 

This seems to be working for me, when selecting movies in succession.

 

https://dl.dropboxus... Automation.zip

 

I like the "Refresh" button... I was going to mention I needed to refresh the browser to get the clients to show.

 

Unfortunately, your plugin is failing to see active clients and therefore broken. 

 

Just upgraded my Emby server to v3.0.5557.40000 just to let you know.

 

EDIT: Looking at the configuration file, its saving the active clients to the XML file. There also seems to be some residual functionality left over (I deleted the old config file). But its not working correctly, only giving random play/stop commands.


Edited by Xzener, 30 March 2015 - 07:11 PM.


#46 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3994 posts
  • Local time: 08:57 PM
  • LocationPeterborough, Canada

Posted 30 March 2015 - 08:19 PM

Xzener,

I will post some here after my kids go to bed, but if you are experiencing that begaviour it is because the "currentAliveNetworkDevices" (or the emby device) are not full populated in the configuration before you attempt to attach scenes.

This is a problem with the event engine trying to keep updating the config xml file in real time.

If that even makes anything sense...

It isn't pretty at the moment, but try refreshing the web page until the device list is completely populated.

#47 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 06:57 PM
  • LocationLemoore, CA

Posted 30 March 2015 - 08:57 PM

The "client" is not populating. The XML is magically listing them... But I never see, nor can I configure any clients. The plugin main menu is blank. Also, the Vera dashboard will not load.

#48 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3994 posts
  • Local time: 08:57 PM
  • LocationPeterborough, Canada

Posted 30 March 2015 - 08:59 PM

@Xzener

 

I am not sure exactly why, but when I add a new plugin version to the server, and then navigate to the configuration settings page, it never loads the Device Lists until I refresh either....

 

I know with jQuery you can implement different page loading events. Current we use "pagebeforeshow" to try and load all the device names into the config.

 

The thing is, that if you navigate to the config settings page and then refresh the browser - for the entire lifetime of the plugin, it will work exactly as expected.

 

We'll just have to do that for now.

 

1. Copy the DLL into plugins

2.Restart the server

3.Navigate to the plugin config page

4. Refresh the Browser

 

From that moment on, you'll be able to utilize the "Refresh" Button to refresh the list of Devices and not have to Refresh the whole browser page, until you update the plugin.

 

https://dl.dropboxus... Automation.zip

 

My apologies about the extra steps.

 

I try to write the Device Names to the XML auto-magically, but the page load is just not quite right in the config.


Edited by chef, 30 March 2015 - 09:08 PM.


#49 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3994 posts
  • Local time: 08:57 PM
  • LocationPeterborough, Canada

Posted 30 March 2015 - 09:01 PM

If you do want to learn LUA plugin, here is the best forum to get started:

http://forum.micasav...board,23.0.html

 

and IDE: 

http://studio.zerobrane.com/vera.html

 

and plugin repository (for sample code):

http://code.mios.com/account

https://www.google.c...ite:github.com 

 

and walkthrough blog:

http://dmlogic.com/b...h-lua-and-luup 

 

Thank you for the links AgileHumor, they have already deemed quite useful.



#50 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 06:57 PM
  • LocationLemoore, CA

Posted 30 March 2015 - 10:32 PM

Chef,

 

With the build posted... I still have to manually refresh the browser. Your button is not working (IE). Although, after refreshing, I configured the plugin. I can confirm  session start/stop, play and stop commands are working. This is the best build yet. Well done as always. I will test more before work tonight and report back.


  • chef likes this

#51 Vicpa OFFLINE  

Vicpa

    Advanced Member

  • Alpha Testers
  • 1428 posts
  • Local time: 08:57 PM
  • LocationWest Chester, Pa. USA

Posted 31 March 2015 - 04:21 PM

Hi Chef

Plugin is looking pretty awesome !!!, :) Just about to start testing.

 

How about showing a "little love" to the music folks out there. Maybe it could be "Include Music" unchecked by default, :D ..

 

Thanks for your hard work!!!

 

-Vicpa



#52 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3994 posts
  • Local time: 08:57 PM
  • LocationPeterborough, Canada

Posted 31 March 2015 - 07:19 PM

Okay Vicpa will do.

Remember to refresh the browser when you navigate to the config page for the first time.

Edited by chef, 31 March 2015 - 07:20 PM.


#53 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3994 posts
  • Local time: 08:57 PM
  • LocationPeterborough, Canada

Posted 31 March 2015 - 07:45 PM

Chef,

With the build posted... I still have to manually refresh the browser. Your button is not working (IE). Although, after refreshing, I configured the plugin. I can confirm session start/stop, play and stop commands are working. This is the best build yet. Well done as always. I will test more before work tonight and report back.


The refresh button only refreshes the device list drop down/select box. When you log into a new device it should show up in the list after you press the button.

Should I have it refresh the whole page?

#54 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 06:57 PM
  • LocationLemoore, CA

Posted 31 March 2015 - 07:45 PM

The more functionality in the plugin, the more I want to drop my Grafik Eye and install just Z Wave dimmers. Keep up the great work Chef!

#55 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 06:57 PM
  • LocationLemoore, CA

Posted 31 March 2015 - 07:47 PM

The refresh button only refreshes the device list drop down/select box. When you log into a new device it should show up in the list after you press the button.
Should I have it refresh the whole page?


Yes. The button does not work, only refreshing the browser works (IE).
  • chef likes this

#56 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3994 posts
  • Local time: 08:57 PM
  • LocationPeterborough, Canada

Posted 31 March 2015 - 09:33 PM

Oooo, scarey build 666 allows you to edit your saved Scenes without duplicating them in the Configuration File.

 

 

https://dl.dropboxus... Automation.zip

 

 

 

I'm now testing in IE and trying to fix some of the cross browser code issues.... trying is the key word there... ;)


  • Xzener likes this

#57 techywarrior OFFLINE  

techywarrior

    Advanced Member

  • Members
  • 2408 posts
  • Local time: 05:57 PM

Posted 01 April 2015 - 12:10 AM

Chef, I should have time Thursday and Friday to look at the code a little if you want. jQuery takes care of all the cross browser stuff for you so try migrate your straight JS to jQuery and it may solve a lot of the problems in other browsers.


  • chef likes this

#58 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3994 posts
  • Local time: 08:57 PM
  • LocationPeterborough, Canada

Posted 02 April 2015 - 06:02 PM

Have you guys ever noticed a lag in wireless because of your Vera device?

All my connected devices will stream emby alright, but anything perpetual needs to be set to a low resolution since Vera has been added to my network.

Of coarse I do have the latest server release installed which kind of coincides with my Vera hook up.
Transocding is taking a definite hit.

#59 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3994 posts
  • Local time: 08:57 PM
  • LocationPeterborough, Canada

Posted 02 April 2015 - 10:26 PM

I am a little disappointed.

The emby server knows it's servering media through DLNA, and it ecen knows I want it to server media to an XBOX ONE, but it won't raise playback events.

I even got awesome light dimmers for my family room and everything.
I am going to put a ticket in to the main devs for a feature request to implement playback events with DLNA.
Can you guys up vote the request to help me out?

Also, I have learned that each scene is set to a room and has to be iterated for our scene editing page. Right now it Only reads one room.

I wouldn't have figured it out, but I now have two room with zwave lighting and right now the plugin only lists one room at a time.

I have to fix that.

Edited by chef, 02 April 2015 - 10:29 PM.

  • AgileHumor likes this

#60 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 06:57 PM
  • LocationLemoore, CA

Posted 02 April 2015 - 11:40 PM

Chef,

Does the server know when a DLNA device/client has started?? Reason I ask is because I too have an Xbone, I'd like to simply turn on/off lights when the Xbox has powered on/off. Is this possible with the app right now??





Also tagged with one or more of these keywords: Home Automation

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users