I wanted to add my contribution to this thread.
Some background: I am running a VeraEdge UI7/ 1.7.2406 with two Amcrest IP2M-841E cameras (and a Hikvision DS-2CD2T42WD-I5 4mm camera). I also have an NVR (QNAP NAS TS-231+, running Surveillance Station 5.1.1.0). I record all three cameras 7x24 for rolling 6 days to a 4TB HDD, and I have a 64GB SD card in each of the two Amcrest cameras for Alarm recording only (redundant to the alarm recording also configured in the NVR…meaning someone has to steal the cameras and the NVR to get rid of evidence). I am using the Vera with multiple Ecolink PIR Motion Detectors, multiple Ecolink door/window sensors, multiple First Alert fire/CO detectors, and multiple GE SmartSwitch (in wall).
I?ve read many posts regarding the challenges of using the camera?s software-based motion detection and I never had any success using the software-based detection on some analog cameras I?ve used. So, I want to trigger motion related recording by using passive infrared sensors and door sensors using Vera?s Scene management.
My scene objective was the following:
When a specific PIR motion (or door/window) sensor detects motion, then?
[ul][li]Send command to a specific camera to pan/tilt to a specific preset position[/li]
[li]Send command to the same camera to record video to the on-board SD card[/li]
[li]Send command to the NVR to record video on the NAS (and flag it as an alarm recording)[/li]
[li]Send email/text message with the details of the event, with fast access to the recording[/li][/ul]
I used the instructions from GaryTTirn above to upload & configure the Amcrest camera implementation file in Vera for the pan/tilt function. I then created a Vera Scene, selecting the appropriate sensor and camera. I then edited the Scene using the Advanced Editor to add the command ?GoToPreset? and designate the appropriate Preset related to the location of the sensor which triggered the action. I also set the scene to notify me via text message.
I then added the following Luup code to the Scene:
luup.inet.wget(“http://userid:password@ipaddress/cgi-bin/configManager.cgi?action=setConfig&Alarm[0].SensorType=NC”)
luup.call_delay (“pirMotionReset”, 60)
function pirMotionReset()
luup.inet.wget(“http:// userid:password@ipaddress /cgi-bin/configManager.cgi?action=setConfig&Alarm[0].SensorType=NO”)
end
(Note: replace userid:password@ipaddress with your credentials)
I then edited Relay Activation on the Setup>Event>Alarm page of the Amcrest camera:
[ul][li]Select Enable, and set the Sensor Type to NO (Normally Open)[/li]
[li]Select Record, with Record delay = 10 seconds[/li][/ul]
I then edited the storage path on the Setup>Storage>Destination page of the Amcrest camera to save Alarm recordings to the SD Card.
I then edited the recording control on the Setup>Storage>Record Control page of the Amcrest camera:
[ul][li]Pack = 1 (which is 1 minute of recording)[/li]
[li]Pre-event Record = [b]10 /b[/li]
[li]Record Mode = Auto[/li]
[li]Record Stream = Main Steam[/li][/ul]
Now, when a sensor is triggered, my camera pans to the preset, records to the SD card with 10secs of video before the trigger occurred, records an alarm event (and alarm video file) to the NVR, and I get an email & text. Also, vMobile (which is the mobile app for Surveillance Station), sends me a push notification, with a quick connection to the alert and associated recording file. (I can also define some additional actions that the NVR will take when it gets the Alarm signal from the camera.)
Note: I tried using the following (provided in a post above)
–Enable MotionDetect in scene LUUP code
luup.inet.wget(“http://:@/cgi-bin/configManager.cgi?action=setConfig&MotionDetect[0].Enable=true”,5)
–Disable MotionDetect in scene LUUP code
luup.inet.wget(“http://:@/cgi-bin/configManager.cgi?action=setConfig&MotionDetect[0].Enable=false”,5)
but those commands only enable Motion Detection. The camera still has to be preconfigured to detect the motion for it to detect the motion that was already detected by the sensor. There is no guarantee that simply enabling Motion Detection would actually trigger the recording.
Using the Luup code to set the Alarm Sensor Type to NC (Normally Closed) forces the camera into an alarm state. Using this binary approach ensures I get a recording from any PIR motion or door/window sensor trigger (or any Vera-attached device, for that matter). And, I can fire off multiple cameras to capture alarm recordings everywhere as the event is in progress from a single sensor. Setting the Alarm Sensor Type to NO ends the alarm state. I can control the duration of the alarm (and therefore the recording) using the delay command. In fact, I can set the delay parameter to a variable, and change the alarm duration (recording) based on the type of event that is detected (using conditional statements and variables within the Luup code.
Hope this helps anyone who was trying to find a way around software based motion detection.
Now…to find the same HTTP commands for the Hikvision…