Author Topic: Extending Watcher Plugin  (Read 7560 times)

0 Members and 1 Guest are viewing this topic.

Nodo

  • Jr. Member
  • **
  • Posts: 22
  • Karma: 6
    • View Profile
Extending Watcher Plugin
« on: June 02, 2015, 11:49:42 PM »
Good day,

I have been experimenting with VC for a long time now and I must apologize for not being active on the forum :).

@James: great updates to VC. VC keeps proving that it is such a valuable tool in home automation. Even though I know you do not need the compliments... but as a programmer I know that it does not hurt to know that your work is appreciated from time to time ;).

@nime5ter: Well done on the excellent support, tutorials and innovative ideas to integerate VC with other tools.

With that being said, I have been experimenting with the watcher plugin recently and I know that you have been busy with all the updates that you have no time for the watcher plugin, but I thought to throw my request out there.

I think the watcher plugin can be a great plugin if it was a bit dynamic (i.e. being able to assign a folder to the watcher plugin through a command with a payload). If that is quite hard to implement I think the next best option is to have a check box to enable watching "Subdirectories" at the plugin interface.

Also, another set of Watch plugin commands to enable and disable the plugin would be nice but I think this is a bit of a lower priority and it can be worked around for the time being.

Thank you again for the great tool and just to let you know I plan on purchasing VC once my setup is complete and I move to my new place.


PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Extending Watcher Plugin
« Reply #1 on: June 03, 2015, 12:07:08 AM »
+1

I think another good feature to add would be the ability to watch multiple folders, I have a Script that I run with eventghost that once the media is finished being transferred or recorded to that folder it then renames and moves the video to the right folder, and if I could get VC to take care of that then eventghost would only be used for my remote  ;D 

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Extending Watcher Plugin
« Reply #2 on: June 03, 2015, 08:54:46 AM »
All good ideas, and I know that Haddood also asked for multiple folders.

I was meaning to get to this eventually but now that I see more demand I will prioritize it.  It won't make it into the upcoming release but hopefully the one after that.

I had not considered actions to extend the plugin.  Good idea.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Extending Watcher Plugin
« Reply #3 on: June 03, 2015, 05:41:08 PM »
I just did a little test with the watcher plugin and looks like it only triggers an event when an item is first put in the folder that is being watched,

would it be possible to have the watcher plugin trigger the following events:

Watcher.Created (as it does now)
Watcher.Updated (used to see when a change is made to a file in that folder)
Watcher.Completed (or something similar when the file is fully transferred like a video being recorded or transferred across the network)
Watcher.Deleted (when a file or video is deleted from the folder, I could do this one with my script if I have Watcher.Completed to trigger the script)

these commands would be similar to what the Directory watcher plugin does in eventghost,
hope I'm not sounding greedy, I Could see this being a good addition to the VC plugins

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Extending Watcher Plugin
« Reply #4 on: June 03, 2015, 10:38:16 PM »
All good ideas, and I know that Haddood also asked for multiple folders.

I was meaning to get to this eventually but now that I see more demand I will prioritize it.  It won't make it into the upcoming release but hopefully the one after that.

I had not considered actions to extend the plugin.  Good idea.

now I know, I should be collecting signatures before making new requests  :biglaugh :biglaugh ...
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Extending Watcher Plugin
« Reply #5 on: June 06, 2015, 05:24:35 PM »
2.1.4.8 is out and includes the new watcher plugin.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Extending Watcher Plugin
« Reply #6 on: June 06, 2015, 06:07:41 PM »
Jitterjames, I just upgraded to 2.1.4.8 and the watcher plugin didn't show up in my plugins list to I opened options and went to the plugins tab and the watcher plugin was still selected so I unselected it and restarted VC then went back into options and selected the watcher plugin and clicked save and close and then clicked ok on the popup that says you must restart VC for the changes to take effect and after that I have an error message popup



after clicking ok on that error I restarted VC and the plugin wasn't added but in options it is still checked

let me know if you need me to check anything else

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Extending Watcher Plugin
« Reply #7 on: June 06, 2015, 06:32:56 PM »
Freaky...  I've no idea what could be causing that either.

I've tested with upgrades and with clean installs and had no issues from the watcher plugin. It loads fine, but you will need to redefine your settings because of the changes.

Do you get the same thing with a fresh install?

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Extending Watcher Plugin
« Reply #8 on: June 06, 2015, 07:33:34 PM »
Yes it works when I do a fresh install,

I tried to uninstall the plugin and then do the update but still see the same error and the plugin doesn't show up  :bonk

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Extending Watcher Plugin
« Reply #9 on: June 06, 2015, 07:44:40 PM »
OK that's good.  I least we know your machine is capable of running the plugin.

Make sure VC is completely closed before doing an upgrade.  Run task manager to double check there is no VoxCommando.exe process running before you run the installer.

Do an upgrade and make sure to choose to clean dlls.

It should not matter if the plugin in enabled or not when you do the upgrade.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Extending Watcher Plugin
« Reply #10 on: June 06, 2015, 08:37:04 PM »
tried all that again and I also tried restarting my pc to make sure, but no luck... would it work if I took the watcher plugin folder from the new install and replace the watcher plugin folder in the updated one

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Extending Watcher Plugin
« Reply #11 on: June 06, 2015, 08:55:12 PM »
I just copied the watcher plugin folder from the new install to the updated install and it shows up now and no errors are showing up  ;D

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Extending Watcher Plugin
« Reply #12 on: June 06, 2015, 09:21:18 PM »
It makes no sense to me (unless vc was running or the files were locked somehow)  but I'm glad you got it working.

I tested upgrades on four different machines with no issues.  There's nothing special about that plugin versus any others in terms of the installation.  It should just be copying files and overwriting them when they already exist.

Computers eh...   :bonk

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Extending Watcher Plugin
« Reply #13 on: June 07, 2015, 01:59:42 AM »
I had similar issue ... all I did, disabled the watcher plug in ... went to the plugin folder, deleted the options.xml ... restarted VC and enabled the plug in ...all working fine 

BTW @James thank you for this update :)

update: compared both files ... the new options.xml has 2 more tags ... probably that is the issue, when they are missing ... plug-in get confused
    <WatcherList>
        <Watcher>
« Last Edit: June 07, 2015, 02:03:48 AM by Haddood »
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Extending Watcher Plugin
« Reply #14 on: June 07, 2015, 08:26:52 AM »
OK.  All you need to do when upgrading is to delete the options.xml from the ".\plugins\watcher" folder.  No other changes are needed.

I will release a fix for this soon.

If you are doing a fresh install or if you never used the watcher plugin before then there is no issue.

The problem with the tests I did here was that I had the watcher enabled but I had not set up any actual watchers in the older version.

Thanks guys for helping figure it out!