Triggering BI camera to record with HTTP commands, works with VERA

erkme73

BIT Beta Team
Nov 9, 2014
1,568
1,484
I started out my search looking for a way to have my VERA Lite home automation controller trigger a specific camera to begin recording when a sensor was tripped.

Without getting into too much detail, my VERA system integrates with my DSC alarm system. The DSC has 32 wireless sensor that are used for doors and windows.

When a sensor is tripped, VERA sees it by way of a plugin for the DSC alarm systems. VERA can then execute scripts, such as turn specific lights on/off, arm or disarm the house, etc.

Using an extra sensor, and mounting it in my mailbox, I have VERA send me an email anytime the mailbox is opened. It works great. However, not being satisfied with just a text email, I wanted VERA to send a command to the BI server to trigger a specific camera to record, and more importantly, ALERT by way of push notification and email pics/mp4.

While the cameras are all set up to record on motion via BI, none send an alert. The sensor in the mailbox would be the only trigger for the alert, and would instantly let me know that the box has been opened - by way of the BI app on my phone.

Entering this HTTP string in any web browser will trigger that specific camera to begin recording:


Code:
http://IP_ADDRESS_OF_BI_SERVER:PORT/admin?camera=camera_short_name&trigger&user=XXXXX&pw=XXXXXX

For example:
Code:
http://192.168.1.100:81/admin?camera=Cam6&trigger&user=admin&pw=adminpassword

The user credentials must be for an administrative account.

When BI receives this command, it handles the request as an "external" trigger for the specific camera. So, if you want to receive an alert for this specific type of trigger on the camera, you do the following... Open camera properties, select alerts, and under 'trigger by', uncheck everything except for 'external'.

If you're using VERA, the string must be modified to work under the LUUP engine. Setting up a scene, you choose your trigger, and then for the action, you click on LUUP and paste the following:

Code:
luup.inet.wget("http://192.168.X.X:XX/admin?camera=camera_short_name&trigger&user=XXXXX&pw=XXXXXX",5)

It's that simple. And it works great... EXCEPT...

Just as with the Hikvision alarm bit that can be used to trigger a record in BI, this external trigger has the same limitations. That is, if you are using BI's motion detection for the camera, the 'external' trigger my not work. If the camera sees motion and initiates a record event, and as it's recording, BI receives an 'external' trigger, it will ignore the trigger - and any associated alert. The external trigger will only initiate an alert if the camera is NOT already recording.

For example: If my mailbox is opened, BI receives the command to trigger my front camera, and trigger an alert push notification/email. However, since the camera is looking at the mailbox, as my mail lady pulls up, BI's built-in motion detect triggers a record session. Since that session is underway as she opens the mailbox, the subsequent HTTP command VERA sends to BI is ignored, and I never receive my alert.

I can disable the BI motion detection option, but then that same camera will ONLY record when the mailbox is opened. I want both. Record any motion, but alert only if the box is opened - regardless of whether the camera is already recording due to motion.

What a wordy post - sorry. I've sent an email to Ken to ask him if it is possible to have BI respect an external trigger and its associated alert configuration even if that camera is already recording.

I'll post back what I hear. In the meantime, if anyone has any ideas on how to work around this issue (with using a single camera), I'm all ears.
 
I'm not 100% sure, but wouldn't a cloned camera set for alerts work? Set the cloned camera hidden and it can send the alerts while the other camera is setup for motion record.
 
  • Like
Reactions: erkme73
That's a really good idea. I guess I never considered it because I already have 30+ cameras and am running at 50% on an i7. I'd hate to add more load if it's unavoidable. Which, until Ken allows the alerts to function independently of the motion detect, I guess it really isn't. I'll give that a go and report back... Thanks.
 
So that does seem to work. The only downside (aside from the CPU cycles) is that while the 'hidden' feature works with the console view, it doesn't with the webserver view (either the BI webserver page or the UI2 version). I can live with seeing double for now. Just hoping Ken can work that into his to-do list.
 
I agree, with the hidden cameras in web and app view. That is one reason I don't use the cloned cameras yet. If there isn't and I just haven't found or looked for it, there should be a way to hide the hidden cameras from things like web view and the mobile app.
 
For anyone still interested in having simultaneous triggers - both internal BI MD and external/DIO triggers - where BI initiating a record for one, while still recognizing a new trigger (and thereby sending an alert/push notification based on the new trigger only), Ken has solved the problem.

Under the "Alerts" tab there is a new option to "also re-trigger". This let's BI recognize concurrent triggers, and deal with them accordingly.

Now, even when my front porch camera sees motion, it starts to record (via BI's MD). If, during that recording session, someone breaks the IR beam, it will then trigger a push notification and email to be sent.

This means I get all the recording benefits of MD, but only get actual notifications if there's physically something there to break the beam. Single camera.

Pure awesomeness...
 

Attachments

  • 2015-09-02_19-27-16.jpg
    2015-09-02_19-27-16.jpg
    83.2 KB · Views: 182
This is really cool erkme73! So how do you hook the IR beam up to trigger BI recording? Still using the VERA controller to send the HTTP msg?

I am guessing that for people like myself who have cams with PIR that I no longer need a clone camera to do the record on motion and send alerts based on PIR detection.... which is AWESOME!
 
@erkme73 Thanks for this info.

This is definitely most of the information I need in my attempt to trigger a PTZ camera preset and record in BI when my mailbox is opened. I'm hoping someone can help me close the loop and share some options/ideas to get the trigger working. I've search for possible answers, but I'm afraid my lack of technical knowledge and experience on the subject are not helping me think clearly. Any help will be greatly appreciated.

My setup consists of an Ademco Vista20p alarm system with an EYEZ-ON EVL-3 - Envisalink Internet Alert Module. I installed a wireless sensor in my mailbox that alerts me via indoor alarm chime sound and email/sms notifications thru the Eyez-On alert settings when the mailbox is opened (mailbox sensor triggered > Vista 20P alert > Eyez-On module to Online Server > Eyez-On Email/SMS alert notifications). Right now I'm just trying to figure out how can I get the sample http trigger command (http://IP_ADDRESS_OF_BI_SERVER:PORT/admin?camera=camera_short_name&trigger&user=XXXXX&pw=XXXXXX) to reach my BI server. I understand the delay from the time the mailbox is open to the time the trigger gets to BI might be too long to capture anyone in the mailbox, but at this point I just want to get it to work, especially if it doesn't involve incurring into more expenses. If it works, but the delay is too long, then I will look at a localized solution which may require different sensor and/or hardware for instant trigger within my LAN.

Any ideas?
 
Last edited by a moderator:
You're 90% of the way there. You've basically described my setup. I'm using a DSC1555 alarm panel with the same eyezon board. I used to use their free notification service, but I don't know how that can be used to trigger BI with the HTTP command line.

There may be another way to do it, but what works for me is a zwave setup. I'm using the VERA Edge controller, a DSC Plugin (free) which allows VERA to get instant updates from the EVL-3 board, and a another plugin called PLEG (about $10).

Inside my mailbox is a standard DSC wireless door sensor (magnet on the door, sensor in the mailbox). When it's opened, the DSC1555 alarm panel recognizes it as though a door is opened. The EVL-3 then changes status on the network (also notifying the eyez-on portal) which the VERA controller sees (via the DSC Plugin).

At this point VERA knows the mailbox is open. The PLEG plugin is a "if/then" routine that say "if X sensor trips, then do Y". The Y part is the fun stuff. With the mailbox open, the PLEG plugin executes the http command, notifying my BI server to start recording. I also have it turn on an RGB light in my living room to strobe blue for 1 hour.

The BI server is set to trigger based on the HTTP command. That 'external' trigger (under the alerts tab for the camera trained on the mailbox) not only records a 10 second clip, but also sends a push notification to my Android phone, as well as an email containing two pictures and a 5 second video clip.

It works like a charm. I have the same setup for the front door. There, the when the IR beam is tripped, it opens a relay (in the IR beam module). That is hooked up to another DSC door sensor. I simply removed the tiny glass reed switch (that would normally be activated by a moving magnet) and soldered the relay output from the IR beam to in place of it. Now, when the beam is broken, it has the same effect as moving a magnet away from the DSC door sensor.

The rest is the same - the DSC 1555 panels tells VERA (by way of the EVL-3 and DSC Plugin) that someone's at the door - which the PLEG plugin then uses to send the appropriate trigger to BI.

In either case, I get the BI push notification on my phone within 2 seconds of the sensor being tripped. With pre-buffering turned on, BI starts recording a full second before the trigger - so I literally miss nothing. It's plenty fast enough.

This all sounds very complicated. I'm not super technically savvy, yet I was able to make it work. The VERA controller has a fantastic forum support group, with developers that have plugins for virtually every connected device... the EVL-3, Onkyo receivers, Sharp TVs, wifi thermostats, and dozens of other non-zwave devices that are connected to your network (wireless or ethernet).

Be forewarned, though. The zwave home automation thing can get quite addictive. You'll find yourself automating everything. There isn't a light, door, or other piece of electronics in my house that I can't turn on/off/lock/unlock or otherwise modify remotely. Can get pricey :)
 
I'd forgotten how much detail I'd already posted in my OP... so that last post was a bit redundant. Your question got me thinking - there has to be a way to have the ELV-3 execute an HTTP command. It has a TPI (third-party interface) rule set, which is what the DSC plugin uses.

I've tossed the question out for the experts over at the eyezon forum here: http://forum.eyez-on.com/FORUM/viewtopic.php?f=6&t=2041

Maybe someone will chime in? It could be something as simple as running a small script (curl or python?) on your BI PC that monitors the EVL-3 through that TPI... but that is WAY beyond my ability.
 
  • Like
Reactions: djangel
Yeah, I've looked into the VERA Lite, but I can't find a plugin for the Vista panel I have. Seem like there is just one for DSC panels like yours. At the same time I know my pocket will suffer if I do get one, since being able to automate and control stuff for fun it can easily become an addictive and expensive hobby for me. Anyway, I did some testing with my current setup and if I have to rely on the trigger to go outside my network and back I will definitely miss who opened the mailbox, since it's taking random times to receive the notification (sometimes 3-5, others up to 10 secs). Just too many hops. The ideal solution is exactly what you posted, some type of app/python/curl script that run in my network and can query the Vista panel thru EVL-3 and perform the http command in my LAN. I will monitor and see if I can find any additional help in the Eyez-On forum too. Thanks again for your help!
 
I asked Eyez-On technical support about the EVL-3 capability to send a http command and this was their answer:

"No, the EVL3 doesn't have sufficient memory to handle those kinds of
features. The new EVL4 has increased memory and engineering is looking into
the possibility of these types of options."

So based on my research I have only a couple of options.

1) get lucky and find someone with programming knowledge that either already wrote or can write a script/app to monitor alerts on a Vista panel using the EVL-3 TPI commands, or

2) replace my EVL-3 module with a AD2USB and Vera Lite as outline in this thread I found from last year ( http://forum.micasaverde.com/index.php?topic=23295.0 ).

3) forget about it and leave it as is :sad2:

I have a feeling option 2 will eventually win...

If any awesome programmers reading this post wants a challenge, let me know what you can come up with and I'll be glad to pay for your efforts.


*Edit*
Apparently there is a Vista/EVL-3 plugin for Vera (PLUGIN: Ademco Vista Alarm Panel with EVL3), so it seems like I will be buying a Vera soon :cool: Now I have to read on which Vera should I get and if it need to be on a specific firmware.
 
Last edited by a moderator:
That's what I ended up doing, but still no response. Meanwhile, I was able to find a solution by calling the preset for the PTZ using the camera's manufacturer (Dahua) http command. This method is probably more effective, since you don't have to send the command to BI, then wait for BI to call the preset eliminating any additional delay. I was able to pick up a used Veralite from eBay for $55, so I'm playing with it for now. So many possibilities :D
 
I use HTTP commands for BI PTZ and it works great!

/cam/{cam-short-name}?pos=x
Performs a PTZ command on the specified camera, where x= 0=left, 1=right, 2=up, 3=down, 4=home, 5=zoom in, 6=zoom out, 7+1 = Preset 1, 7+2 = Preset 2, etc
 
  • Like
Reactions: erkme73
I use HTTP commands for BI PTZ and it works great!

/cam/{cam-short-name}?pos=x
Performs a PTZ command on the specified camera, where x= 0=left, 1=right, 2=up, 3=down, 4=home, 5=zoom in, 6=zoom out, 7+1 = Preset 1, 7+2 = Preset 2, etc

Wow. Pure gold. How did you learn about this? are there any other easter eggs like that?
 
I use HTTP commands for BI PTZ and it works great!

/cam/{cam-short-name}?pos=x
Performs a PTZ command on the specified camera, where x= 0=left, 1=right, 2=up, 3=down, 4=home, 5=zoom in, 6=zoom out, 7+1 = Preset 1, 7+2 = Preset 2, etc

Thanks for the info. I'll try that, but when I looked thru the help file I did not find the 7+1 = Preset 1, 7+2 = Preset 2, etc. Did find the /cam/{cam-short-name}?pos=x where x= 0=left, 1=right, 2=up, 3=down, 4=home, 5=zoom in, 6=zoom out.
 
luup.inet.wget("192.168.1.134:8021/cam/BK3/pos=8")

BK3 is the short cam name. Mine is local only so I don't worry about the name and password.
 
  • Like
Reactions: djangel