Get started with rules for events

How do rules for events work?

Your surveillance system can detect different types of events, such as motion in a video stream, the push of a button or sound.

You can make events automatically trigger certain actions. For instance, the system can automatically play an audio clip when a camera detects motion. To do this, you set up a rule, which consists of a condition and an action.

This is how an event triggers an action:

  1. Event — A device in your surveillance system detects an event.

  2. Condition — The system analyzes if the event meets certain conditions.

  3. Action — If the conditions are met, the system triggers an action.

You can add multiple conditions to a single rule. With multiple conditions, the rule will only trigger the action if all the conditions are met.

Example

You have installed a speaker and a camera to prevent trespassing. When the camera detects motion in the forbidden area, the speaker automatically plays a pre-recorded message that tells the intruder to leave the area.

  1. Event — The camera detects motion when someone walks in the camera view.

  2. Condition — The system analyzes if there was movement in the forbidden area. Since this is the case, the system triggers the action.

  3. Action — The speaker plays the audio clip.

You can add a schedule to the condition so that the rule only triggers the action during certain hours. If the rule is active only outside office hours, then your staff can walk in the area during office hours without triggering the audio message.

Set up rules for events

To help you understand how to configure events, we have created a set of video tutorials for common use cases. The tutorials use the device webpage for configuration. You access the device webpage by entering the IP address of your device in a browser.

Record video when the camera detects motion

This example explains how to set up the camera to start recording to the SD card five seconds before it detects motion and to stop one minute after.

How to record a video stream when the camera detects motion
  1. Make sure that AXIS Video Motion Detection is running:
  2. Go to Settings > Apps > AXIS Video Motion Detection.

  3. Start the application if it is not already running.

  4. Make sure you have set up the application according to your needs. If you need help, see the user manual for AXIS Video Motion Detection 4.

  1. Create a rule:
  2. Go to Settings > System > Events and add a rule.

  3. Type a name for the rule.

  4. In the list of conditions, under Application, select AXIS Video Motion Detection (VMD).

  5. In the list of actions, under Recordings, select Record video while the rule is active.

  6. Select an existing stream profile or create a new one.

  7. Set the prebuffer time to 5 seconds.

  8. Set the postbuffer time to 60 seconds.

  9. In the list of storage options, select SD card.

  10. Click Save.

Direct the camera to a preset position when the camera detects motion

This example explains how to set up the camera to go to a preset position when it detects motion in the image.

  1. Make sure that AXIS Video Motion Detection is running:
  2. Go to Settings > Apps > AXIS Video Motion Detection.

  3. Start the application if it is not already running.

  4. Make sure you have set up the application according to your needs. If you need help, see the user manual for AXIS Video Motion Detection 4.

Add a preset position:

Go to Settings > PTZ and set where you want the camera to be directed by creating a preset position.

  1. Create a rule:
  2. Go to Settings > System > Events > Rules and add a rule.

  3. Type a name for the rule.

  4. In the list of conditions, select a video motion detection condition under Application.

  5. From the list of actions, select Go to preset position.

  6. Select the preset position you want the camera to go to.

  7. Click Save.

Use audio to deter intruders

This example explains how to connect a speaker to the camera and set it up to play a warning message when the camera detects motion in a restricted area.

  • Required hardware:
  • Active speaker with built-in amplifier and connecting wires

NOTICE

Make sure the camera is disconnected from power before making the connections. Reconnect to power after connecting the wires.

  1. Add audio clip to the camera:
  2. Go to Settings > Audio > Output and click .

  3. Click Upload new clip.

  4. Browse to locate your audio clip and click Done.

Create a rule:

  1. Open the device webpage for the camera.

  2. Go to Settings > System > Events.

  3. Go to Recipients and add a recipient.

    1. Go to the device webpage of the speaker that has the audio clip stored on its SD card.

    2. Copy a link to the audio clip.

    3. Return to the device webpage of the camera.

  4. Go to Rules and add a new rule:

    1. Under Condition, select Video motion detection.

    2. Under Action, select Send notification through HTTP.

Show a text overlay in the video stream when the device detects motion

This example explains how to display the text “Motion detected” when the device detects motion.

How to show text overlay when the camera detects motion

Make sure that AXIS Video Motion Detection is running:

  1. Go to Settings > Apps > AXIS Video Motion Detection.

  2. Start the application if it is not already running.

  3. Make sure you have set up the application according to your needs.

  4. Add the overlay text:
  5. Go to Settings > Overlay.

  6. Enter #D in the text field.

  7. Choose text size and appearance.

  8. Create a rule:
  9. Go to System > Events > Rules and add a rule.

  10. Type a name for the rule.

  11. In the list of conditions, select AXIS Video Motion Detection.

  12. In the list of actions, select Use overlay text.

  13. Select a view area.

  14. Type “Motion detected”.

  15. Set the duration.

  16. Click Save.

Send an email automatically if someone spray paints the lens

How to send an email notification if someone spray paint the lens
  1. Go to Settings > System > Detectors.

  2. Turn on Trigger on dark images. This will trigger an alarm if the lens is sprayed, covered, or rendered severely out of focus.

  3. Set a duration for Trigger after. The value indicates the time that must pass before an email is sent.

  1. Create a rule:
  2. Go to Settings > System > Events > Rules and add a rule.

  3. Type a name for the rule.

  4. In the list of conditions, select Tampering.

  5. In the list of actions, select Send notification to email.

  6. Select a recipient from the list or go to Recipients to create a new recipient.

    To create a new recipient, click . To copy an existing recipient, click .

  7. Type a subject and a message for the email.

  8. Click Save.

Detect tampering with input signal

This example explains how to trigger an alarm when the input signal has been cut or short-circuited. For more information about the I/O connector, see I/O connector.

How to send an email notification when someone tampers with the input signal
    1. Create a rule:
    2. Go to Settings > System > Events and add a rule.

    3. Type a name for the rule.

    4. In the list of conditions, select Digital input and then select a port.

    5. In the list of actions, select Send notification to email and then select a recipient from the list. Go to Recipients to create a new recipient.

      To create a new recipient, click . To copy an existing recipient, click .

    6. Type a subject and a message for the email.

    7. Click Save.

    Set up rules with a VMS

    You can also set up rules in your video management system (VMS) software. The principle is the same, but each VMS has a different interface.

    For information about how to set up rules in your VMS, see the user manual for the VMS.

    Integrate third-party devices

    I/O connection

    You can connect a third-party device to the I/O port of an Axis device.

    Example

    Start recording when a door is opened.

    In this case the camera is located near the door, and the door sensor is connected by cable to the I/O port on the camera.

    1. The door sensor sends a signal when the door is opened.

    2. The I/O connection on the camera receives the signal and triggers an action in the camera to start recording.

    Virtual input

    You can use a virtual input for incoming HTTP requests.

    Example

    Start recording when a door is opened.

    In this case the camera is not located close to the door. The door sensor is connected by cable to an I/O relay, which is connected to the camera over the network.

    1. The door sensor sends a signal when the door is opened.

    2. The I/O relay box receives the signal and triggers an HTTP request via the network to a virtual input on the camera.

    3. The camera receives the virtual input and triggers an action in the camera to start recording.