Cynical SecuritySpy: Integrate SecuritySpy with Indigo

Posted on
Sat Oct 15, 2011 5:57 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Cynical SecuritySpy: Integrate SecuritySpy with Indigo

SecuritySpy is a Macintosh-hosted camera surveillance program. This plugin lets you set up SecuritySpy cameras as Indigo devices, and use actions to manipulate their active mode, set their overlay strings, command PTZ motion (if capable) and a few other tricks. If you are willing to install a relay script into SecuritySpy, you can also use SecuritySpy's visual motion detection to trigger events in Indigo.

This plugin requires SecuritySpy 2.1 or later. It ought to work with the demo version if you just want to play around with it.

This integration should to be much richer. It is currently held back on both sides: SecuritySpy's web interface (as of version 2.1) is limited; and Indigo is missing integration of plugins with its web engine, so that plugins cannot manage dynamic images there. Perhaps over time this will improve.

Download from http://www.cynic.org/indigo/plugins. Use the "About..." menu item for a (preliminary) help page. Let me know if you have any questions.

Cheers
-- perry

Posted on
Tue Oct 18, 2011 11:03 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

Great plugin. I like how once I defined the server device, it automatically populated the camera device settings UI with my available cameras.

Your docs web page mentioned password support, but I could not get that to work. There is no username/password UI in the settings dialog and it didn't accept a URL with the username/password embedded. Also, when trying to connect to an authenticated SS server, it threw out this XML parse exception which you might want to catch/log instead:

Code: Select all
  File ".../Server Plugin/asyn/core.py", line 126, in callout
    results = [cb(ctx, *args) for cb in list(self._callbacks)]
  File ".../Server Plugin/asyn/http.py", line 169, in _read_body
    return self.callout('body', self.body)
  File ".../Server Plugin/asyn/core.py", line 126, in callout
    results = [cb(ctx, *args) for cb in list(self._callbacks)]
  File ".../Server Plugin/spy/core.py", line 61, in reply
    self._configure(body)
  File ".../Server Plugin/spy/core.py", line 83, in _configure
    system = ET.fromstring(xml)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/xml/etree/ElementTree.py", line 963, in XML
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/xml/etree/ElementTree.py", line 1245, in feed
ExpatError: syntax error: line 1, column 0

I received a similar exception when I tried connecting to an unauthenticated SS server that was running 2.0.x (yeah, I shouldn't have done that). It was returning a 404 error which caused the parsing to throw as well.

Perry The Cynic wrote:
...and Indigo is missing integration of plugins with its web engine, so that plugins cannot manage dynamic images there.

Definitely on our list.

Image

Posted on
Tue Oct 18, 2011 9:50 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

Your docs web page mentioned password support, but I could not get that to work. There is no username/password UI in the settings dialog and it didn't accept a URL with the username/password embedded.


That's because I updated the webpage this morning but didn't have time to actually push the updated plugin. Download version 0.9.1; it provides the password support and fixes the PTZMotion error.

Cheers
-- perry

Posted on
Tue Oct 18, 2011 9:55 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

I received a similar exception when I tried connecting to an unauthenticated SS server that was running 2.0.x (yeah, I shouldn't have done that). It was returning a 404 error which caused the parsing to throw as well.


Oh, right. There's a version check that errors out safely, but it uses the version returned by the ++systemInfo request that doesn't exist before 2.1. Oops. Well, you should get a slightly less ugly "file not found" error now. I'll see about making this clearer.

Cheers
-- perry

Posted on
Tue Oct 18, 2011 10:28 pm
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

Great Work Perry! :wink:

Installed the Server and a Camera plugin devices into indigo, all is well, however the script installed into security spy to detect motion and pass the event to Indigo is giving errors:

Code: Select all
Oct 18, 2011 11:05:57 PM
  Cynical SecuritySpy             mapping device "new device" 1471851935(server)
  Cynical SecuritySpy             new device starting
  Cynical SecuritySpy             new device is now ready

Oct 18, 2011 11:06:27 PM
  Cynical SecuritySpy             Front Door Camera reconfiguring because xaddress has changed
  Cynical SecuritySpy             Front Door Camera is now active

Oct 18, 2011 11:09:35 PM
  Cynical SecuritySpy Error       unknown notification Front Door from ('127.0.0.1', 52343)

Oct 18, 2011 11:12:31 PM
  Cynical SecuritySpy Error       unknown notification Front Door from ('127.0.0.1', 52359)
  Cynical SecuritySpy Error       unknown notification Front Door from ('127.0.0.1', 52360)

Oct 18, 2011 11:20:58 PM
  Cynical SecuritySpy Error       unknown notification Front Door from ('127.0.0.1', 52414)


Any insight to what I am doing wrong? Indigo and SecuritySpy reside on the same machine.

Thanks!

--
Korey

Posted on
Tue Oct 18, 2011 11:45 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

Any insight to what I am doing wrong? Indigo and SecuritySpy reside on the same machine.


Yes: you're following the instructions. :-)

I changed the naming scheme for the relay script and neglected to update the web page instructions. Name the script
Indigo Relay-localhost-motion Front Door
(i.e. add the word "motion" before the name of the camera).

The good news is that the notifications arrive just fine at the script, so you're almost there.

Sorry about that.
-- perry

Posted on
Thu Oct 20, 2011 7:20 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

Perry The Cynic wrote:
support wrote:
Your docs web page mentioned password support, but I could not get that to work. There is no username/password UI in the settings dialog and it didn't accept a URL with the username/password embedded.


That's because I updated the webpage this morning but didn't have time to actually push the updated plugin. Download version 0.9.1; it provides the password support and fixes the PTZMotion error.

Yep, new version is working great with authentication. Thanks.

Image

Posted on
Fri Oct 21, 2011 10:10 am
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

Version 0.9.3 released: bug fixes relating to PTZ commands and motion relay operation, and a less unhelpful error message with pre-2.1 SecuritySpy servers. Special thanks to James Dewberry for his persistent testing.

Cheers
-- perry

Posted on
Fri Oct 21, 2011 11:25 am
Swancoat offline
Posts: 503
Joined: Nov 20, 2009
Location: Houston

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

Installed this last night, and from what I can tell - it's working flawlessly.

Nice.

http://nerdhome.jimdo.com

Posted on
Wed Oct 26, 2011 1:42 pm
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

Perry The Cynic wrote:
Any insight to what I am doing wrong? Indigo and SecuritySpy reside on the same machine.


Yes: you're following the instructions. :-)

I changed the naming scheme for the relay script and neglected to update the web page instructions. Name the script
Indigo Relay-localhost-motion Front Door
(i.e. add the word "motion" before the name of the camera).

The good news is that the notifications arrive just fine at the script, so you're almost there.

Sorry about that.
-- perry


Working great Perry, Thanks!

--
Korey

Posted on
Fri Oct 28, 2011 10:23 am
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

Caution: This version needs a beta test version of SecuritySpy. See below.

Now available: Cynical SecuritySpy 0.9.5. This version works with the not-quite-yet-released SecuritySpy 2.1.1, and does away with a lot of the cruft formerly required to link things up. In particular, there is no need for motion-relay scripts anymore, and state tracking is now near-instantaneous. There's other goodies, too. Big thanks go to Ben Bird for making his SecuritySpy so much nicer to work with.

Download from http://www.cynic.org/indigo/plugins. To test 0.9.5, you will also need to download and install SecuritySpy 2.1.1b7 (or later). Select About Cynical SecuritySpy, find the download link for the beta, and install it.

Do understand that you're testing a triple-beta: Indigo 5b9, SecuritySpy 2.1.1b7, and Cynical SecuritySpy 0.9.5. How daring of you!

As always, reports of mysterious bugs and glorious misbehaviors are gratefully anticipated.

Cheers
-- perry

Posted on
Fri Oct 28, 2011 1:22 pm
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

Downloaded both. Deleted and reinstalled all camera and server. Appears to work as advertised except for one difference in the motion detect action.

Now when a motion is detected the trigger setup for it fires for each motion, so for someone coming into range and moving around causes a continuous steam of repeated triggers.

There is a setting in camera setup to delay a re-trigger for so many seconds after an action has been generated but since there are no longer any actions selected or required (no script to run) then the setting is not having an effect. Not sure if this is SecuritySpy issue or Plug-in issue? Will you pass on to Ben or should I?

You mentioned other new items. Is there a list? I could not find the beta on the SecuritySpy site.

This version is great.

Terry

Posted on
Fri Oct 28, 2011 10:22 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

Now when a motion is detected the trigger setup for it fires for each motion, so for someone coming into range and moving around causes a continuous steam of repeated triggers.


Thanks for pointing that out. During testing, you're usually happy that there's no delay, so I had turned mine off. I'll talk to Ben. Between us, we'll fix it either way (though if I fix it, you'll have a different setting in Cynical SecuritySpy).

You mentioned other new items. Is there a list? I could not find the beta on the SecuritySpy site.


Actually, I never asked Ben what else he's added to SecuritySpy. I assume it's the usual passel of new cameras supported out of the box and bug fixes. (A few that affected me, I do know about. :-))

As for my plugin, you can now both read and change motion sensitivity; the Execute Script and Play Sound actions let you pick from a menu of choices; the polling interval parameter for servers is gone (we don't need to poll anymore); you can now see SecuritySpy errors echoed into the Indigo log if you check that server checkbox; and we're more likely to respond intelligently to cameras coming and going than before.

I promise I'll get more organized with release notes when we hit version 1.0. :-)

Cheers
-- perry

Posted on
Thu Nov 03, 2011 9:17 am
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

SecuritySpy 2.1.1 has been released and is available at http://securityspy.com. Would everyone who downloaded 2.1.1b7 and tested with it please throw it out and replace it with the real thing? Thank you.

Now available: version 1.0.0b1, working with 2.1.1. Camera Motion events have a new parameter to throttle motion triggers so they don't happen every second. Beyond that, not much news - I think this one's almost baked.

Cheers
-- perry

Posted on
Fri Nov 04, 2011 4:59 pm
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: Cynical SecuritySpy: Integrate SecuritySpy with Indigo

Perry The Cynic wrote:
SecuritySpy 2.1.1 has been released and is available at http://securityspy.com. Would everyone who downloaded 2.1.1b7 and tested with it please throw it out and replace it with the real thing? Thank you.

Now available: version 1.0.0b1, working with 2.1.1. Camera Motion events have a new parameter to throttle motion triggers so they don't happen every second. Beyond that, not much news - I think this one's almost baked.

Cheers
-- perry



Thanks for your effort on this Perry, new versions installed, So far so good! ;)

Thanks to Ben too!

--
Korey

Who is online

Users browsing this forum: No registered users and 1 guest