Page 1 of 2

New Plugin: Chained Events / Camera Patrol

PostPosted: Thu Dec 28, 2017 11:23 am
by Colorado4Wheeler
Downloads

Official Release On The Indigo Plugin Store TBD

Once out of BETA this will be published on the Plugin Store.
Install according to the Indigo documentation.

Development/Interim Release Directly From Git

Indigo-GitHub.png
GitHub Download Link
Indigo-GitHub.png (11.14 KiB) Viewed 3579 times


Introduction

This is the initial BETA release of this plugin. It shouldn't cause any harm to your Indigo system or computer but it may be unstable. It is currently running stable in my production environment but this may differ on your own system. It is recommended that you do not install this plugin unless you consider yourself a more advanced Indigo user.

Originally developed as a way to run patrols on my security cameras, this plugin has the ability to do quite a bit. This allows you to chain a series of events together, separated by a preset time and optional random variant. Yes, it sounds like action groups, but action groups didn't work for my desire to have my cameras patrol to a preset for, say, three minutes and then move on, it seems that it would always get hung up after the second or third preset and then the action group would stop. This was my way to solve this problem for myself.

From a security camera concept this is a way to patrol through your presets, stop at the preset for a designated amount of time and then move on.


A few things that this can do:
  • This will patrol from preset 1 to preset X (unlimited presets available) and pause at each preset for the designated [seconds, minutes, hours]
  • Each preset can be configured to randomize the time to stay in the preset so no pattern can be detected
  • Utilizes my plugins library that allows you to tap into all the actions and fields of every plugin you have loaded
  • A bit of extra functionality added for the Cynical SecuritySpy plugin since that is part of my own security system and I wanted to have more capability with it, to that end it allows for you to utilize the "go to preset" and "move camera" functions from that plugin
  • Rapid preset manipulation with the ability to duplicate a preset you have already saved and then simply edit it to suit your needs
  • Ability to define what happens when you turn OFF the patrol, whether it just stays wherever you stopped it or it returns to a different preset
  • Intelligently chain multiple cameras together so that your overlap makes sense - for instance you could have preset 1 move camera A to look at your front walk with a zero second "stay" period, then preset 2 moves camera B to look to where camera A is no longer looking and that stays for, say, a five minute period - this makes preset 1 & 2 effectively a group that work together to create an intelligent and overlapping security system
  • NOW IN BETA 2: Each action (or preset) that you add allows you to "brighten" your device to increments of 1% to push the patrol to the next preset. This so it can be directly supported in all voice activated Indigo plugins (Homebridge Buddy, Google Home, Hue Bridge) to voice control your cameras to whatever preset you want (i.e., "Hey Siri, set Security Patrol to 3%" moves to preset 3)
  • NOW IN BETA 2: The ability to run autonomously without the need for schedules by having its own built in schedule
  • NOW IN BETA 2: Ability to issue an override to the current patrol that will allow you to force an action that stops the current patrol for X minutes (defined by your action) and then resume at the time you specify. Good if you are running a patrol but a trigger tells your camera to point to, say, the front door for a few minutes and then resume patrol


While not yet implemented in this beta, there are some other things coming that differentiate this from action groups as well:


  • Currently only supports devices, but action groups and possibly variables coming soon
  • Currently only allows you to move from one preset to the next but adding capability for you to have each preset perform another action before it moves on to the next preset, for example you can patrol to the far left to check out that view and have it return to your "default" view before moving to the far right view
  • Once actions and variables are added you can chain these into your setup with "zero time" on them so that they can create a group of things to do on each preset (i.e., arm camera, move camera, take still picture as one preset).

This is being released now as I am running this successfully and know some things I want to develop into it for future releases and, as I use it, i come up with more things I want out of this plugin and wanted to give you the chance to chime in on that as well.

Plugin Images

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Thu Dec 28, 2017 12:23 pm
by Korey
Man you just keep knocking them out of the park!!

Thanks once again!!

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Thu Dec 28, 2017 1:59 pm
by Different Computers
Here's my first stupid question: How are camera movement commands generated? Is there a dialog where I would need to input them, or does the plugin have a "library" of commands that it knows to use based on the camera model?

Also, if you have a url for those camera commands, please point me at them. I have one PTZ Foscam that I KNOW is supposed to respond to them, but no amount of internet searching has revealed these urls to me.

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Thu Dec 28, 2017 2:08 pm
by Colorado4Wheeler
Different Computers wrote:
How are camera movement commands generated?


In my cameras, which include some Foscams, you have to move the camera into position and save the presets right in the native camera web page, and if you do that then you can use SecuritySpy (or whatever) to tell it to go to that preset. Here's a screenshot from one of my Foscams - however, Foscam has always come up short on UI and this is no exception, the preset save/get doesn't work...

Screen Shot 2017-12-28 at 1.06.18 PM.png
Screen Shot 2017-12-28 at 1.06.18 PM.png (43.83 KiB) Viewed 3540 times


Different Computers wrote:
Also, if you have a url for those camera commands, please point me at them.


I have a list of them around somewhere but not right at hand because I let SecuritySpy do the heavy lifting for me. Have you tried the Foscam plugin that's here? If nothing else you can dive into the code and get the various URLs.

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Thu Dec 28, 2017 2:17 pm
by Different Computers
I do have presets set up in the PTZ cam. I'm unable to send those preset commands though.

I looked at the Foscam plugin when it first came out, even tried it. I found it super complex and hard to use--couldn't get my head around it. I abandoned it, messed with Security Camera for a while, and now do 90% of what I want with the Dynamic URL plugin.

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Thu Dec 28, 2017 2:23 pm
by Colorado4Wheeler
Try this:

http://your.webcam.address/decoder_cont ... command=30 = Set preset 0
decoder_control.cgi?command=31 = Go preset 0

decoder_control.cgi?command=32 = Set preset 1
decoder_control.cgi?command=33 = Go preset 1

decoder_control.cgi?command=34 = Set preset 2
decoder_control.cgi?command=35 = Go preset 2

decoder_control.cgi?command=36 = Set preset 3
decoder_control.cgi?command=37 = Go preset 3

the list goes until preset 16

So in theory you could move the camera from Preset 1 to 2 to 3 with the following commands:
http://192.168.0.100/decoder_control.cgi?command=31
<wait some amount of time>
http://192.168.0.100/decoder_control.cgi?command=33
<wait some amount of time>
http://192.168.0.100/decoder_control.cgi?command=35

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Thu Dec 28, 2017 2:24 pm
by Colorado4Wheeler
Those work with mine...

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Thu Dec 28, 2017 3:07 pm
by Different Computers
Sadly, these all generate a 404 for me. Let me make sure:

• Foscam PTZ HD cam
• No Security Spy in the mix.

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Thu Dec 28, 2017 4:55 pm
by Colorado4Wheeler
Yup.

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Thu Dec 28, 2017 5:03 pm
by Colorado4Wheeler
What model is your Foscam? I have another that's a whole different command set and UI.

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Fri Dec 29, 2017 9:19 am
by Different Computers
It's a F19821P V2. This screen shot you posted does not look familiar to me

Image

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Fri Dec 29, 2017 10:33 am
by Colorado4Wheeler
Can you post a screenshot of yours?

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Fri Dec 29, 2017 12:34 pm
by Colorado4Wheeler
Version BETA 2: 0.2.0 (Development BETA Release)

Release Notes

  • Added new action to tell the camera to go to one of its presets and, upon completion, either resume the current patrol or issue the Off command action - this allows for the ability to stop a current patrol to do something else and then come back once the specified time has elapsed
  • The brightness of the device will now represent the preset the device is currently on, i.e., 5 if on preset 5
  • Added ability to dim/brighten the device with each percentage representing the corresponding preset (1% = preset 1, 5% = preset 5, etc)
  • Added options in the device config on how long to remain on a brightness command until it either resumes the patrol or returns to the Off position (setting to zero will move the camera to the positon and stop it there, regardless of the off setting)
  • Enabled continuous mode, plugin can be run manually or can be set to restart the patrol based on the device configuration with an optional randomizer to prevent anyone from detecting a pattern
  • Removed event log debug messages when duplicating a preset in a device
  • Removed Homebridge actions from the device actions list
  • Fixed minor issue with duplicating a preset list item where duplicating in rapid succession would create duplicate keys and, thus, cause two devices to share the same key and the entire list to act wonky
  • Fixed bug where when the preset name was calculated it would always say "seconds" instead of the interval chosen (each item will need to be edited and updated in order to see any changes in existing devices)
  • When saving a device it will now always revert the list action back to Edit and will make the Off action Stay unless otherwise chosen

This release represents a development and/or interim release meaning that this has NOT been pushed to the Indigo Plugin Store as an official release as is "use at your own risk" to test upcoming new features or to address any specific feature request or issue that you may be having. This will be pushed to the Plugin Store once all bugs have been worked out and will represent a different release number when officially published.

ALWAYS BACK UP BEFORE UPGRADING YOUR PLUGIN!

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Fri Dec 29, 2017 5:48 pm
by Colorado4Wheeler
I don't know why I didn't do this before but I have so many plugins..... :roll:

I am going to update my Security Manager plugin to all my new methods and libraries and roll it together with this NEW plugin since this is also sort of a home security plugin. I really need to do more consolidating. This will still be available as Chained Events on Git for now but the next update will be an update to the Security Manager plugin instead and will be the start of making THAT plugin the version 2.0 plugin rather than a brand new one.

:roll: :roll: :roll: :roll:

Re: New Plugin: Chained Events / Camera Patrol

PostPosted: Fri Dec 29, 2017 9:37 pm
by Different Computers
Colorado4Wheeler wrote:
Can you post a screenshot of yours?


Here you go.
Screen Shot 2017-12-29 at 10.36.19 PM.png
Screen Shot 2017-12-29 at 10.36.19 PM.png (84.76 KiB) Viewed 3309 times