Jump to content


Photo

Vera Home Automation Plugin (Emby Vera)

Home Automation

  • Please log in to reply
480 replies to this topic

#21 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 08:58 AM
  • LocationLemoore, CA

Posted 29 March 2015 - 01:34 PM

Chef, any idea how the app could possibly ignore video backdrops?

#22 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3944 posts
  • Local time: 11:58 AM
  • LocationPeterborough, Canada

Posted 29 March 2015 - 01:58 PM

Working on it.

and Intros too.

I think the only way to ignore video backdrops is to tell it to ignore video which has a runtime under a certain amount of ticks.
I think we can ask the api how long the media file is, and then ignore short/small media files.

Edited by chef, 29 March 2015 - 02:02 PM.


#23 AgileHumor OFFLINE  

AgileHumor

    Advanced Member

  • Alpha Testers
  • 759 posts
  • Local time: 07:58 AM

Posted 29 March 2015 - 02:01 PM

delete me, pii cleanup


Edited by AgileHumor, 17 April 2015 - 01:32 AM.


#24 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3944 posts
  • Local time: 11:58 AM
  • LocationPeterborough, Canada

Posted 29 March 2015 - 02:09 PM

So you would like Vera to control mb.

I think we would have to authenticate a user to allow mb to listen to more then just pubic userdto requests, but if you could give me an example of a situation you would like to control mb with Vera, I ahave learned that anything is possible when writing code.

I should mention that I don't currently have a dedicated theatre room, but have the lights dim in my front room when a media item starts.

I was thinking about add some specific functionality to the plugin regarding TV, movies, audio.

Also perhaps time of day functions when certain scene request would be ignored by media browser.

I am up for anything really.

But I should mention also @AgileHumor that current the ugin is only set up for 1 Vera device.
I was wondering if people ran two.

I could implement two, but just one for now I think.

Edited by chef, 29 March 2015 - 03:33 PM.


#25 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3944 posts
  • Local time: 11:58 AM
  • LocationPeterborough, Canada

Posted 29 March 2015 - 02:20 PM

Working on it.

and Intros too.

I think the only way to ignore video backdrops is to tell it to ignore video which has a runtime under a certain amount of ticks.
I think we can ask the api how long the media file is, and then ignore short/small media files.

Oh but, with intros.. Do we do we wait for the feature film to start? Or do we ignore the feature film and run the scene when the intro starts?

Hmm... Or do we get super complicated and allow for a scene to run for both. Lol!

Edited by chef, 29 March 2015 - 02:20 PM.


#26 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3944 posts
  • Local time: 11:58 AM
  • LocationPeterborough, Canada

Posted 29 March 2015 - 03:58 PM

@Xzener !!

 

I am using Xbox One so it doesn't have video backdrops or intros, and I can't test this. But, I believe that this will stop both of the mentioned plugins from triggering scenes :)

 

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


  • Xzener likes this

#27 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 08:58 AM
  • LocationLemoore, CA

Posted 29 March 2015 - 04:30 PM

I'm not there yet... Although, functionality like that sounds amazing.

What I am referring too is the issue where you browse to a movie with a video backdrop. When I press play, the "Off" command is not sent. I have to close and restart the client to get the plugin functionality back.

#28 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 08:58 AM
  • LocationLemoore, CA

Posted 29 March 2015 - 04:37 PM

@Xzener !!
 
I am using Xbox One so it doesn't have video backdrops or intros, and I can't test this. But, I believe that this will stop both of the mentioned plugins from triggering scenes :)


That fixed it. Nice work Chef!

#29 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3944 posts
  • Local time: 11:58 AM
  • LocationPeterborough, Canada

Posted 29 March 2015 - 04:40 PM

That fixed it. Nice work Chef!


Should we make it customizable?

#30 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 08:58 AM
  • LocationLemoore, CA

Posted 29 March 2015 - 04:42 PM

Chef,

Is there an event for Emby clients starting?? For example... I walk into the room, manually turn on the lights. I start Emby Classic (or was it Emby for WMC). The lights dim from full to half because Emby started.

Is that possible??

#31 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 08:58 AM
  • LocationLemoore, CA

Posted 29 March 2015 - 04:43 PM

Should we make it customizable?


How so?

#32 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 08:58 AM
  • LocationLemoore, CA

Posted 29 March 2015 - 04:53 PM

That fixed it. Nice work Chef!

I spoke too soon. Initially, the commands are sent correctly. I can browse, start a movie, stop it, all the while, the lights are responding correctly. But, if I browse to another movie, start it, the commands are not being sent. Again I have to restart the client.

Functionality only works for the first two commands, off then on. After that, Vera isn't sending commands.

Edited by Xzener, 29 March 2015 - 05:01 PM.


#33 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3944 posts
  • Local time: 11:58 AM
  • LocationPeterborough, Canada

Posted 29 March 2015 - 05:03 PM

I spoke too soon. Initially, the commands are sent correctly. I can browse, start a movie, stop it, all the while, the lights are responding correctly. But, if I browse to another movie, start it, the commands are not being sent. Again I have to restart the client.

Functionality only works for the first two commands, off then on. After that, Vera isn't sending commands.

Okay, I will see what is up.

Right! I see, we have to set the tick monitor back to zero.

One second.

Edited by chef, 29 March 2015 - 05:07 PM.


#34 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3944 posts
  • Local time: 11:58 AM
  • LocationPeterborough, Canada

Posted 29 March 2015 - 05:17 PM

Xzener,

 

  I was checking to see if the scene ran or not, and wasn't updating the JSON from Vera when I was checking. Sorry about that. It's fixed.

 

 

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

 

 

 

Chef,

Is there an event for Emby clients starting?? For example... I walk into the room, manually turn on the lights. I start Emby Classic (or was it Emby for WMC). The lights dim from full to half because Emby started.

Is that possible??

 

 

I believe that is what AgileHumor was asking about. Although this would mean looking at the other end of things. From the Vera Unit.

 

It is possible. I just learned how to write JQuery.

So, I could learn luua code next.

I could technically write three languages then. of coarse sometimes it's half hazard... lol :)


Edited by chef, 29 March 2015 - 05:36 PM.


#35 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 08:58 AM
  • LocationLemoore, CA

Posted 29 March 2015 - 05:34 PM

Oops. This one is broken... Nothing is working.

Restarted Emby Server... Still only the first two commands working.

Edited by Xzener, 29 March 2015 - 05:46 PM.


#36 Vidman OFFLINE  

Vidman

    Advanced Member

  • Alpha Testers
  • 2662 posts
  • Local time: 11:58 PM

Posted 29 March 2015 - 05:45 PM

Chef,

Is there an event for Emby clients starting?? For example... I walk into the room, manually turn on the lights. I start Emby Classic (or was it Emby for WMC). The lights dim from full to half because Emby started.

Is that possible??

Again I think all that is really needed here is to run a scene when a user has logged into the client, right? As emby server cannot tell when a client has started, but it does know when someone logs into it

Edited by Vidman, 29 March 2015 - 05:47 PM.


#37 Xzener OFFLINE  

Xzener

    Advanced Member

  • Super Testers
  • 3112 posts
  • Local time: 08:58 AM
  • LocationLemoore, CA

Posted 29 March 2015 - 05:48 PM

Yes, but in a specific room/client.

Edited by Xzener, 29 March 2015 - 05:48 PM.


#38 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3944 posts
  • Local time: 11:58 AM
  • LocationPeterborough, Canada

Posted 29 March 2015 - 06:51 PM

Again I think all that is really needed here is to run a scene when a user has logged into the client, right? As emby server cannot tell when a client has started, but it does know when someone logs into it

 

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.

 

 

Yes, but in a specific room/client.

 

 

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.


Edited by chef, 29 March 2015 - 07:30 PM.


#39 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3944 posts
  • Local time: 11:58 AM
  • LocationPeterborough, Canada

Posted 29 March 2015 - 07:22 PM

Xzener,

 

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

 

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


Edited by chef, 29 March 2015 - 07:25 PM.


#40 techywarrior OFFLINE  

techywarrior

    Advanced Member

  • Members
  • 2408 posts
  • Local time: 07:58 AM

Posted 30 March 2015 - 12:02 AM

No, it wouldn't need a Vera plugin at all (and absolutely no need to confine this to the Vera)...instead, open it to any HA (hundreds) software that can send a HTTP request (again, without authentication).  All that is needed is an UNAUTHENTICATED HTTP listener to trigger defined macros on MB.  It shouldn't be a security concern as the macros would be user defined.

 

Anyway, don't want to take away for what seems like a nice plugin.   The only scenario I see it working is those with a dedicated Theater room scenario...so not your typical mass market HA appeal.  

 

However, I would have suggested you provide just generic user customizable http commands to run against the Vera (no need to limit to just Vera HA) using this format:

http://<vera_ip_address>:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=<SceneNum>

For those looking for having Vera (or any HA) control MB, I suggest you look at VoxCommando which can "bridge" the two systems together by using VoxCommando's TCP event engine (can trigger from Vera). I have about 200 devices controlled by two Vera's and it's working well.

After all the work that the devs have done to add security to the server it would be terrible design decision to create a plugin that opens an unauthenticated HTTP listener.

 

On your other point. Creating a plugin that would require users to enter long commands strings isn't very user friendly. Perhaps that could be added as some sort of advanced option in the future. But if you look at other plugins as an example, none of them require you to manually type in commands or anything like that. :)

 

What Chef has created is a plugin that (once working 100%) is something that is simple to use and probably covers 99% of the usecases. Anyone can have their theater/living room automatically run scenes thru the Vera from Emby with little knowledge of the workings of either. Think about if a company setup your Vera/HA, or perhaps in this forum it would be more likely that someone setup a system for their parents/friends, but now that person could have Emby control something simply. (I don't think a lot of users would know how to create the command strings for generic HTTP requests for their HA systems)







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