Jump to content

Vera Zwave Controller: Add More Than 1 Emby Device


otispresley

Recommended Posts

otispresley

Hello @@chef, I am loving the Vera Zwave Controller plugin, but it will not keep the configuration for more than 1 device. Is this by design? When I add a config for a second device  and leave the Settings and then come back, only the most recent device is shown and automation for the previous device no longer works. I have both the Emby app and Kodi on my NVIDIA Shield TV and need automation for both devices since it is use in the theater room where Kodi with CinemaVision is used for movie nights and Emby is used for Live TV and casual viewing. Thanks for your help!

Link to comment
Share on other sites

After trying a bunch of different things with the plugin:

 

- adding devices

- taking them away

- adding scenes

-removing them

 

I can't seem to replicate this.

 

 

Can you explain to me again where the plugin breaks?

 

I think you mean that the UI doesn't show the second device you add, I just can;t seem to replicate it.

 

 

Link to comment
Share on other sites

otispresley

Just to reset, I uninstalled the plugin, restarted the server, installed the plugin, and restarted the server. It still has save files though because it still had my previous config.

 

I start with one device as seen below:

5d87969dec648_ss1.jpg

 

I add and configure another device and it looks good.

5d8797056a87d_ss2.jpg

 

I navigate away or refresh and only the last device is shown and only that one gets automated.

5d879728af2e9_ss3.jpg

  • Like 1
Link to comment
Share on other sites

Oh, that is very strange. It's a configuration issue for sure.

 

Last question before I locate troublesome code, which browser are you using there?

Edited by chef
Link to comment
Share on other sites

@@otispresley I'm going to release a new version of the plugin which changes when it access the configuration, I also made sure to double check how it is saving everything. You should see it later tonight.

Link to comment
Share on other sites

otispresley

Hi @@chef, my Emby still hasn't downloaded a new version of the plugin. It is still on 1.0.1.8. Do you know when the new version would be available?

  • Like 1
Link to comment
Share on other sites

Hi @@chef, my Emby still hasn't downloaded a new version of the plugin. It is still on 1.0.1.8. Do you know when the new version would be available?

I'll get it up right after work.

Link to comment
Share on other sites

@@otispresley

 

I have pushed a release which I am hoping will fix some issues.

 

Would you mind removing the : 'Emby-Server\programdata\plugins\VeraHomeAutomation.xml' configuration file from your computer before you restart the server.

 

This way you'll start from a clean slate with the plugin.

 

Please let me know how it goes.

  • Like 1
Link to comment
Share on other sites

otispresley

Hi @@chef, just got home and found my server crashed. I restarted it, and the new version of the plugin was installed already, so I deleted /var/lib/emby/plugins/configurations/VeraHomeAutomation.xml and restarted the server. There were no profiles, so I created and saved 2. When I navigated away and back again, it only shows the last one now, same as before. BTW, I am running Emby on Debian 10 in a Hyper-V VM.

Link to comment
Share on other sites

Hi @@chef, just got home and found my server crashed. I restarted it, and the new version of the plugin was installed already, so I deleted /var/lib/emby/plugins/configurations/VeraHomeAutomation.xml and restarted the server. There were no profiles, so I created and saved 2. When I navigated away and back again, it only shows the last one now, same as before. BTW, I am running Emby on Debian 10 in a Hyper-V VM.

I'm starting to wonder if this is an issue specifically with Linux saving configuration data. Although I can't understand why because .netcore should be the same across platforms.

 

Is there anyway to pm me a log file from when you added the device?

 

There is some logging happening in the plugin, plus maybe I would see some configuration errors that would lead to a fix.

 

I know where the culprit code is. It is the 'add' button, but I just don't know why.

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

otispresley

Hi @@chef, I PM'ed you the log. I shutdown the server, deleted the XML config file and then started the server and added 2 devices; however I did things a bit different this time. I added the 2 devices without configuring them, and they stuck. I was then able to configure both of them, but now the Playback Unpause Scene config won't stick on both devices. I can configure it on one and it will remove it from the other device. It should all be in the log. Please let me know if you need me to redo it the other way and send that log.

Link to comment
Share on other sites

otispresley

I went and tested automation and found that it is not working for either device. I deleted both devices and added and configured 1 device, and the automation works. I hope this helps!

Edited by otispresley
Link to comment
Share on other sites

Hi @@chef, I PM'ed you the log. I shutdown the server, deleted the XML config file and then started the server and added 2 devices; however I did things a bit different this time. I added the 2 devices without configuring them, and they stuck. I was then able to configure both of them, but now the Playback Unpause Scene config won't stick on both devices. I can configure it on one and it will remove it from the other device. It should all be in the log. Please let me know if you need me to redo it the other way and send that log.

Ah, I see. There must have been an error in the xml configuration initially, which would explain why the config couldn't save and read.

 

Okay playback unpause events, not sticking.

 

Would you mind pm'ing me the xml configuration file?

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

otispresley

Ah, I see. There must have been an error in the xml configuration initially, which would explain why the config couldn't save and read.

 

Okay playback unpause events, not sticking.

 

Would you mind pm'ing me the xml configuration file?

 

I was unable to recreate the previous scenario, so I recreated the one where the second device added overwrites the first and PM'ed you the config and log.

  • Like 1
Link to comment
Share on other sites

I have a theory, would you mind changing the name of your scene in Vera from "Overhead 20%" to "Overhead 20".

 

Remove the percent sign from the name. Something tells me that the percent is causing issues when saving the configuration. It's just a theory.

 

Afterwards, you would want to shut down the server and delete the configuration xml. Restart the server and try to save devices again.

 

If this fixes the issue, then we would have a bug in the configuration setup and we can bring it to the lead devs.

  • Like 1
Link to comment
Share on other sites

I should also mention that sometimes it takes a second for the drop-down controls to populate on the device scene configuration page. I noticed it the other day and I'll get some code written to keep the Emby loader on the screen until the drop-down selectors are populated.

  • Like 1
Link to comment
Share on other sites

otispresley

I have a theory, would you mind changing the name of your scene in Vera from "Overhead 20%" to "Overhead 20".

 

Remove the percent sign from the name. Something tells me that the percent is causing issues when saving the configuration. It's just a theory.

 

Afterwards, you would want to shut down the server and delete the configuration xml. Restart the server and try to save devices again.

 

If this fixes the issue, then we would have a bug in the configuration setup and we can bring it to the lead devs.

 

Thanks @@chef! I removed the '%' from the name of the scene, but I am still seeing the same issue where adding the second device removes the first. I also tried to recreate the other scenario again with no luck. :(

Edited by otispresley
Link to comment
Share on other sites

@@otispresley, I realize you're probably a super busy person. But I was hoping you could test something for me so I can better understand what is happening. 

 

Would you be able to Add a second device to your configuration (like you would do before it causes issues), and then before you tab away, look at the xml configuration file and see if the second device has been added to the file?

 

I'm not sure if:

 

1. the second device gets lost when the 'add' button is clicked, which is supposed to write to the configuration file and save a new device

 

or

 

2. if the second device gets lost  on page load, when the configuration is accessed to write the devices to the page.

 

Sorry for the trouble.

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

Ah ha! I have found it!

 

@@otispresley

 

Your Kodi is called "Theater Room" and your Android TV is also called "Theater Room"

 

 

The plugin looks for the same names and will over write them. It was the only way to edit saved Profiles!

 

see this code here:

                                if (config.SavedDeviceProfiles) {  //These are saved Profiles in COnfiguration
                                    config.SavedDeviceProfiles.forEach(function (c) { //For each of those saved Profiles
                                        if (c.Name !== config.DeviceConfiguration.Name &&  //If the name is not already in configuration Ignore it!! <-- That's what is happening.
                                            c.AppName !== config.DeviceConfiguration.AppName) {
                                            pushedDevice = {
                                                Name                   : c.Name,
                                                Id                     : c.Id,
                                                AppName                : c.AppName,
                                                MoviesPlaybackStarted  : c.MoviesPlaybackStarted,
                                                MoviesPlaybackStopped  : c.MoviesPlaybackStopped,
                                                MoviesPlaybackPaused   : c.MoviesPlaybackPaused,
                                                MoviesPlaybackUnpaused : c.MoviesPlaybackUnpaused,
                                                SeriesPlaybackStarted  : c.SeriesPlaybackStarted,
                                                SeriesPlaybackStopped  : c.SeriesPlaybackStopped,
                                                SeriesPlaybackPaused   : c.SeriesPlaybackPaused,
                                                SeriesPlaybackUnpaused : c.SeriesPlaybackUnpaused,
                                                MusicPlaybackStarted   : c.MusicPlaybackStarted,
                                                MusicPlaybackStopped   : c.MusicPlaybackStopped,
                                                MusicPlaybackPaused    : c.MusicPlaybackPaused,
                                                MusicPlaybackUnpaused  : c.MusicPlaybackUnpaused,
                                                LiveTvPlaybackStarted  : c.LiveTvPlaybackStarted,
                                                LiveTvPlaybackStopped  : c.LiveTvPlaybackStopped,
                                                LiveTvPlaybackPaused   : c.LiveTvPlaybackPaused,
                                                LiveTvPlaybackUnpaused : c.LiveTvPlaybackUnpaused,
                                                SessionEnded           : c.SessionEnded,
                                                SessionStarted         : c.SessionStarted,
                                                SceneSchedule          : c.SceneSchedule,
                                                EnableSmartSchedule    : c.EnableSmartSchedule
                                            };
                                            deviceProfiles.push(pushedDevice);
                                        }
                                    });

Okay, to be honest, I'm not sure exactly how I'm going to fix the code right now. 

 

Would you be okay with changing one of your device names to something else, like "Theater Room Android TV".

 

In the meantime, I'll look into changing this, I just have to figure out how :)

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

otispresley

@@chef, gotta run but I changed the display names for those devices in Emby, and now can save both profiles and it is now back to the issue where the Unpaused scene does not save on the second device. PM'ing the log.

  • Like 1
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...