Jump to content


Photo

Vera Home Automation Plugin (Emby Vera)

Home Automation

  • Please log in to reply
480 replies to this topic

#461 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3949 posts
  • Local time: 02:08 AM
  • LocationPeterborough, Canada

Posted 27 May 2019 - 07:35 AM

Sorry lets start again, because I wasn't very clear in my question.


When you click on "Devices" in the Dashboard

5cebc97384e96_exampleDevices.png

is it populated like the image above?


When the Vera plugin populates the "Emby Device" drop down list, it makes an API call to Emby, and grabs all of the names from this list.

I just want to narrow down some possible problems.

Thanks for your patients :)

Edited by chef, 27 May 2019 - 07:46 AM.


#462 gmontem OFFLINE  

gmontem

    Member

  • Members
  • 12 posts
  • Local time: 11:08 PM

Posted 27 May 2019 - 01:03 PM

Yes, I do see devices populating the Devices page.

 

Thanks.  :)

 

5cec182920339_EmbyDevicelist.png

 

 

 

 

Sorry lets start again, because I wasn't very clear in my question.


When you click on "Devices" in the Dashboard

5cebc97384e96_exampleDevices.png

is it populated like the image above?


When the Vera plugin populates the "Emby Device" drop down list, it makes an API call to Emby, and grabs all of the names from this list.

I just want to narrow down some possible problems.

Thanks for your patients :)

 



#463 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3949 posts
  • Local time: 02:08 AM
  • LocationPeterborough, Canada

Posted 27 May 2019 - 01:14 PM

Okay, FYI: That VeraSecure device is the Emby plugin for Vera. It creates a device when it connects to the Emby server.
Looks fine.

Are you in windows? Or Linux?

EDIT: I can deduct you are on windows.

Can you open the Emby server plugin folder?

It is found under:

AppData/Roaming/Emby-Server/program data/plugins

Once there open the folder called "configuration".

Inside there is an xml file called "Vera Home Automation.xml".

Open the xml file and you will see a node called "EmbyReadyNetworkDevices"

I need to know if it is populated with information for you system.


If that seems like too much, note that I am currently reworking the device request code for the plugin
And should have something working really soon.

Edited by chef, 27 May 2019 - 01:20 PM.


#464 gmontem OFFLINE  

gmontem

    Member

  • Members
  • 12 posts
  • Local time: 11:08 PM

Posted 27 May 2019 - 01:41 PM

My XML file doesn't have spaces in the names. It's "VeraHomeAutomation.xml". Here are the contents (empty parent nodes).

<?xml version="1.0"?>
<PluginConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <UserVeraIPOverride>false</UserVeraIPOverride>
  <DeviceConfiguration />
  <SavedDeviceProfiles />
  <InternalIp />
  <SerialNumber />
  <Model />
  <Scenes />
</PluginConfiguration>

I hope this doesn't matter but on my setup, I obtained this XML file from this directory:

AppData\Roaming\MediaBrowser-Server\plugins\configurations

I found no Emby-Server directory. I think the Emby server installer reused my old MediaBrowser-Server directory when I upgraded it.

 

 

Thanks.

 

 

 

Okay, FYI: That VeraSecure device is the Emby plugin for Vera. It creates a device when it connects to the Emby server.
Looks fine.

Are you in windows? Or Linux?

EDIT: I can deduct you are on windows.

Can you open the Emby server plugin folder?

It is found under:

AppData/Roaming/Emby-Server/program data/plugins

Once there open the folder called "configuration".

Inside there is an xml file called "Vera Home Automation.xml".

Open the xml file and you will see a node called "EmbyReadyNetworkDevices"

I need to know if it is populated with information for you system.


If that seems like too much, note that I am currently reworking the device request code for the plugin
And should have something working really soon.

 


  • chef likes this

#465 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3949 posts
  • Local time: 02:08 AM
  • LocationPeterborough, Canada

Posted 27 May 2019 - 01:45 PM

Okay, there is certainly an issue with that xml structure. It's missing a lot if information. I realize you may have removed some for the sake of posting.

Would you mind, cutting the xml out of the plugins/configuration folder and pasting it somewhere that you could find later if needs be, and restarting the server?

It should generate a new xml which may be a fixed version.

#466 gmontem OFFLINE  

gmontem

    Member

  • Members
  • 12 posts
  • Local time: 11:08 PM

Posted 27 May 2019 - 02:41 PM

Here is the contents of the XML file. It looks the same as last time.

<?xml version="1.0"?>
<PluginConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <UserVeraIPOverride>false</UserVeraIPOverride>
  <DeviceConfiguration />
  <SavedDeviceProfiles />
  <InternalIp />
  <SerialNumber />
  <Model />
  <Scenes />
</PluginConfiguration>

This file was generated after I did the following:

  1. Shutdown the Emby server.
  2. Delete the 'plugins/configuration/VeraHomeAutomation.xml' file.
  3. Restart the Emby server.
  4. Wait until the Vera Emby plugin appeared in the active device list.

 

Also, my VeraSecure FW is 1.7.4454.

 

Do I need to enable the other two security settings below?

 

5cec2f456858a_VeraSecuritySettings.png

 

 

Thanks.  :)

 

 

Okay, there is certainly an issue with that xml structure. It's missing a lot if information. I realize you may have removed some for the sake of posting.

Would you mind, cutting the xml out of the plugins/configuration folder and pasting it somewhere that you could find later if needs be, and restarting the server?

It should generate a new xml which may be a fixed version.

 



#467 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3949 posts
  • Local time: 02:08 AM
  • LocationPeterborough, Canada

Posted 27 May 2019 - 02:57 PM

Here is the contents of the XML file. It looks the same as last time.

<?xml version="1.0"?>
<PluginConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <UserVeraIPOverride>false</UserVeraIPOverride>
  <DeviceConfiguration />
  <SavedDeviceProfiles />
  <InternalIp />
  <SerialNumber />
  <Model />
  <Scenes />
</PluginConfiguration>
 
This file was generated after I did the following:
  • Shutdown the Emby server.
  • Delete the 'plugins/configuration/VeraHomeAutomation.xml' file.
  • Restart the Emby server.
  • Wait until the Vera Emby plugin appeared in the active device list.

Also, my VeraSecure FW is 1.7.4454.

Do I need to enable the other two security settings below?

5cec2f456858a_VeraSecuritySettings.png


Thanks. :)

Okay, now when you open the plugin configuration page, is you Vera recognized?




Still there is a problem with getting your emby devices...

Okay, I need to take a look.

#468 gmontem OFFLINE  

gmontem

    Member

  • Members
  • 12 posts
  • Local time: 11:08 PM

Posted 27 May 2019 - 03:17 PM

From the Home Automation tab, I can see the Vera is recognized. It is showing the internal IP address and the correct image of the Vera.

 

The Emby Devices list is empty.

 

Okay, now when you open the plugin configuration page, is you Vera recognized?




Still there is a problem with getting your emby devices...

Okay, I need to take a look.


  • chef likes this

#469 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3949 posts
  • Local time: 02:08 AM
  • LocationPeterborough, Canada

Posted 27 May 2019 - 09:16 PM

Holy mackerel! I recoded the entire device acquisition.

That took a while. @gmontem In a second I'm gonna post the dll here on this thread. Will you install it in your plugin folder and test it for me before I push an update?

Edited by chef, 27 May 2019 - 09:16 PM.

  • gmontem likes this

#470 gmontem OFFLINE  

gmontem

    Member

  • Members
  • 12 posts
  • Local time: 11:08 PM

Posted 27 May 2019 - 10:47 PM

Hi chef, I would be more than happy to test it for you.

Thanks. :)

 

Holy mackerel! I recoded the entire device acquisition.

That took a while. @gmontem In a second I'm gonna post the dll here on this thread. Will you install it in your plugin folder and test it for me before I push an update?

 


  • chef likes this

#471 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3949 posts
  • Local time: 02:08 AM
  • LocationPeterborough, Canada

Posted 27 May 2019 - 10:53 PM

Thank you

 

Here is the Zipped up plugin DLL

 

Attached File  VeraHomeAutomation.zip   120.6KB   1 downloads

 

If this doesn't populate the device list, then there may be a big issue.

 

This version uses the javascript to access the API and request all the device names directly. 

 

The plugin use to build a list in C# and then hand it over through the plugin configuration to the web page.

 

Meh... this is how it should have been written in the first place.

 

Hope this works.



#472 gmontem OFFLINE  

gmontem

    Member

  • Members
  • 12 posts
  • Local time: 11:08 PM

Posted 27 May 2019 - 11:30 PM

Tried the test plugin DLL and couldn't get it to work. The XML file contents looked identical to the one written from the DLL available through the catalog.

 

Steps I took:

  1. Shut down the Emby server
  2. Deleted the 'plugins\configurations\VeraHomeAutomation.xml' file
  3. Replaced the 'plugins\VeraHomeAutomation.dll' with the test DLL.
  4. Restarted the Emby server

One thing that just occurred to me is maybe I was not supposed to install the Emby interface app that was available through the Vera web interface. Any ideas?

 

Thanks

 

Thank you

 

Here is the Zipped up plugin DLL

 

attachicon.gifVeraHomeAutomation.zip

 

If this doesn't populate the device list, then there may be a big issue.

 

This version uses the javascript to access the API and request all the device names directly. 

 

The plugin use to build a list in C# and then hand it over through the plugin configuration to the web page.

 

Meh... this is how it should have been written in the first place.

 

Hope this works.



#473 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3949 posts
  • Local time: 02:08 AM
  • LocationPeterborough, Canada

Posted 28 May 2019 - 07:40 AM

Yeah, the xml for then plugin changed, so that dll should have created a whole new xml which would look almost nothing like the old one.

Edited by chef, 28 May 2019 - 08:37 AM.


#474 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3949 posts
  • Local time: 02:08 AM
  • LocationPeterborough, Canada

Posted 28 May 2019 - 08:37 AM

@jasonwilliams

You wouldnt mind weighing in here and tell us about your experiences with the latest releases of this plugin. Does the Devices list populates for you?

#475 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3949 posts
  • Local time: 02:08 AM
  • LocationPeterborough, Canada

Posted 28 May 2019 - 08:39 AM

Tried the test plugin DLL and couldn't get it to work. The XML file contents looked identical to the one written from the DLL available through the catalog.

Steps I took:

  • Shut down the Emby server
  • Deleted the 'plugins\configurations\VeraHomeAutomation.xml' file
  • Replaced the 'plugins\VeraHomeAutomation.dll' with the test DLL.
  • Restarted the Emby server
One thing that just occurred to me is maybe I was not supposed to install the Emby interface app that was available through the Vera web interface. Any ideas?

Thanks

Having that interface app from Vera is okay. I'm using it too and it causes no issues. There is something else happening here.

Can you PM me some log files of your server loading?

#476 gmontem OFFLINE  

gmontem

    Member

  • Members
  • 12 posts
  • Local time: 11:08 PM

Posted 28 May 2019 - 12:19 PM

I sent you two PMs with two sets of log files, one with debug logging off, and the other set with it enabled.

 

I don't know what happened but after attempting to get logs with debug logging on, I noticed the Emby Devices list was finally populated. This is with your test plugin.

 

Having that interface app from Vera is okay. I'm using it too and it causes no issues. There is something else happening here.

Can you PM me some log files of your server loading?


Edited by gmontem, 28 May 2019 - 12:20 PM.

  • chef likes this

#477 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3949 posts
  • Local time: 02:08 AM
  • LocationPeterborough, Canada

Posted 28 May 2019 - 01:13 PM

That's good news.

The newest version if the plugin is really quite different.

It has been completely reworked.

#478 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3949 posts
  • Local time: 02:08 AM
  • LocationPeterborough, Canada

Posted 28 May 2019 - 07:46 PM

Great News! I'm releasing a new version of this plugin!

 

There are a whole lot of new upgrades to the logic. 

 

It follows closely to the other plugins in the catalog.

 

Here are some screen shots:

 

5cedc84661231_veraHome1.png

 

5cedc85912b54_veraHome12png.png

 

5cedc8eb44304_veraHome3.png

 

Really excited about this releases!


Edited by chef, 28 May 2019 - 07:49 PM.

  • BillOatman likes this

#479 BillOatman OFFLINE  

BillOatman

    Advanced Member

  • Members
  • 472 posts
  • Local time: 02:08 AM

Posted 29 May 2019 - 08:51 AM

I'm doing something similar with Hue regarding using scenes.  I see you have different ones for paused and unpaused which is a pretty cool idea :)  


  • chef likes this

#480 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 3949 posts
  • Local time: 02:08 AM
  • LocationPeterborough, Canada

Posted 29 May 2019 - 09:48 AM

I'm doing something similar with Hue regarding using scenes.  I see you have different ones for paused and unpaused which is a pretty cool idea :)  

 

@BillOatman

 

Here is how the pause events are wired up :)

        public static void CurrentPlaybackProgress(object sender, PlaybackProgressEventArgs e)
        {
            var config = new PluginConfiguration();
            foreach (SessionInfo session in from session in SessionManager.Sessions 
                                            from device in config.SavedDeviceProfiles 
                                            where device.Name.Equals(session.DeviceName) && device.AppName.Equals(session.Client) 
                                            select session)
            {
                switch (session.PlayState.IsPaused)
                {
                    case true:
                       
                            PlaybackPaused(e);
                       
                        break;

                    case false:
                       
                            PlaybackUnPaused(e);
                      
                        break;
                }
            }
        }

The device in the Linq expression is one the user creates. Each time the Progress event is fired it looks for Paused Sessions and then compares info to saved profile data.

 

There is a 'gottcha' there! notice 'AppName' and 'Client' are being compared. Sessions call the AppName: 'Client', while other parts of the API call the Client: 'AppName'!  LOL! 

 

That switch statement calls the appropriate subroutine and it gets passed the EventArguments. PlaybackPaused(e) and PlaybackUnPaused(e).

 

The rest of the logic is handled in those subroutine functions.


Edited by chef, 29 May 2019 - 09:54 AM.






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