6 Ways to Trigger an IP Camera Alarm Relay Output

These Viewtron IP cameras have alarm relay ports that can be connected to external alarm devices such as lights, sirens, automated audio messages, access gates, and more. The relay port on the IP camera basically turns the power of the attached device on and off by closing and opening the relay. The alarm relay of these IP cameras can be activated automatically and manually via remote control. The above video demonstrates how to remotely control a Viewtron IP camera alarm relay via the mobile app (iPhone and Android), via direct web browser access to the IP camera, and using the Viewtron software developer API.

Here are 6 ways to remotely control a Viewtron IP camera’s alarm relay output.


Trigger Alarm Relay via AI Object Detection / Motion Detection

IP Camera Alarm Output

Watch this video to learn how-to trigger the alarm output of Viewtron IP cameras via AI software human detection. The human detection demonstrated in the above video is built into the IP camera. Please note all of the AI events and other alarm events  hat Viewtron security cameras support can be used to trigger the camera’s alarm relay output. Car detection, face detection, facial recognition, license plate detection, license plate recognition, video motion detection, loitering detection, and illegal parking detection are all supported by the latest Viewtron AI cameras.


Trigger Alarm Relay from Mobile App

alarm relay controls from mobile app for iphone and android

You can manually trigger the alarm relay output of Viewtron IP cameras from the mobile app for iPhone and Android. The alarm relay controls work if you have your IP camera connected to a Viewtron NVR or if you are using it as a stand alone security camera. This can be done on-site where your security cameras are installed or from remotely over the Internet.

DVR alarm output mobile app

If you are using a Viewtron NVR, you can control the alarm relays of all IP cameras connected to the NVR. You can also trigger any of the alarm relay output ports that are built into the Viewtron DVR / NVR. Notice in the above screenshot that the manual alarm screen lists all of the alarm out ports on the NVR as well as the ones built into the IP cameras that are connected to the NVR.

You can see an alarm light connected to one of the DVRs alarm output ports on the right. You can watch this video to see a video demo of triggering the DVRs alarm relay ports from the mobile app.


Viewtron Desktop Software for Mac and Windows

security dvr alarm output light

Viewtron IP cameras and DVRs  / NVRs include desktop software for Mac and Windows. You can control the alarm output of IP cameras and DVRs / NVRs using the desktop software. The above video demonstrates how to do this using an alarm light that is connected to a DVR, however, the process is the same for alarm lights and other alarm devices that are connected to an IP camera’s alarm output port. The CMS software for Mac and Windows can connect directly to Viewtron IP cameras. You do not need to use an NVR.


Trigger Alarm Relay from IP Camera Web Browser Interface

IP camera web browser interface to control alarm relay

The above screenshot is the live view of the security camera from the Chrome web browser. This is a direct web browser interface to the IP camera. You can see the manual alarm relay button on the icon of the screen. You can click on this icon to turn the alarm on / off. All Viewtron IP cameras support web browser access.


Trigger Alarm Relay from DVR / NVR

security camera DVR alarm relay output controls

If you connect your IP camera to a Viewtron security camera NVR or DVR, you can also control the alarm relay directly on the DVR’s interface using a USB mouse. The above screenshot was captured from a Viewtron NVR. To access the alarm output controls, hover the mouse cursor along the bottom of the screen, then click on the alarm light icon. On this screen, you can control any of the NVRs built-in alarm outputs, as well as any alarm outputs of IP cameras connected to the NVR.


IP Camera API / Software Development Kit (SDK)

IP Camera API trigger alarm relay output

Viewtron IP cameras have a software developer API that allows developers to write their own applications and integrate with 3rd party systems. In the above screenshot, the live view of my IP camera is on the left hand side in a web browser. The window on the right is a Terminal window. You can skip to the section of the video that demonstrates the API integration by jumping to the 5:55 part of the video.

I am logged into my Raspberry Pi computer from the Terminal via SSH. The screenshot shows a small proof of concept Python application that I wrote. The Python application remotely controls the alarm relay output of the IP camera using an HTTP / XML API. You can download my Python application on Github to use as an example if you can write an application to integrate with Viewtron IP cameras. Here is a link to the download: IP camera alarm relay output Python application.


Alarm Input / Alarm Output Videos

security camera alarm video demos

Click here to watch additional video demos using security camera alarms.


Related Products


Have Questions / Need Help?

If you have any questions about this article and videos, please email me at mike@cctvcamerapros.net.


Video Transcript

Here is a complete text transcript of the video at the top of this page.

Hey guys, Mike from CCTV Camera Pros here. In this video, I’m going to tell you about our Viewtron IP cameras that have a built-in alarm relay output port on them.

So some of our Viewtron IP cameras have this terminal block like you see here that come off of the cable, and that terminal block has an alarm input port and an alarm output port. Both of those are just dry contacts. So the alarm relay output is either open or closed, and you can connect a external alarm device such as an alarm strobe light, or an audible siren or alarm to it by connecting the power source of that device in line with that alarm relay output. So basically, when the alarm relay is closed, the device will get power and turn on, and in the normal position when the alarm is not going off, it’s open and no power gets to it, so it’s off.

So there’s a number of ways that you can trigger this alarm relay output port on the Viewtron IP camera. So number one, it could be automated through some type of alarm that is triggered on the IP camera. For example, if you set up the IP camera to detect humans intruding in a certain area or a car passing a certain line, these are different AI events that our AI cameras support. That event can automatically trigger the alarm output, close the relay, and in turn, turn on the light or the alarm siren that’s connected to it. And I have a video that I made a while back demonstrating that.

What I really wanted to cover in this video is you can also manually trigger that device because the Viewtron mobile app for iPhone and Android has the ability to tap on a button and manually engage that alarm output. You close it or open it, so you can manually turn on an alarm siren or turn on an alarm light remotely from the mobile app. You can also do it through the web browser interface directly to the IP camera. And last, you could do it via the Viewtron IP camera API. So for software integrators that want to do some type of automation with a third party system and trigger the alarm output on any of these Viewtron IP cameras, you could do that as well.

Actually, this weekend I wrote a little Python script that calls the Viewtron IP camera API and triggers the alarm via software code. It is done via rest API. It’s HTTP and XML. So you can use any language. I used Python because I can whip up things pretty quick with Python, but you could use anything you want. If you want to develop an app for iOS, Android, C#, Java. Whatever you want to use, you could use any language you want.

Anyways, let’s go inside. I want to show you how this works from the mobile app and the web interface, and I’ll also give a quick demo using the API via that Python script that I wrote. Here’s the live view of the IP camera and the web browser interface, and I’m going to put a view of the mobile app over here on the right. If I navigate that manual alarm function and then tap on the icon next to alarm out one, that engages the alarm relay and turns the alarm strobe light on.

Next, let me back up a second. I’m going to log into the IP camera from the beginning because I wanted to show you the configuration. Enter in the username and password in the web browser. Close out this password information. We’re not going to change anything right now and then back at the live view here. But I want to go into the IP camera’s configuration to show you a couple things. So if I go into config and then alarm, and then click on alarm out, here’s the configuration screen for the alarm relay output. And you can put the relay into one of these four modes. So alarm linkage basically means that the alarm relay output is going to be triggered from some type of event on the camera like object detection, human object detection, car detection, or any other type of alarm trigger supported by the camera. Manual operation just means you’re manually going to turn it on and off. Daylight switch means when it turns nighttime out, it’s going to turn on. And then timing lets you set up a custom timer to turn it on and off based on time.

So the next field down below here, that’s just the name of the alarm output. You can name that whatever you want. I normally don’t change it. The holding time, you could set in seconds or you could set to always. So this is if you manually trigger the alarm output from the app or any other method, how long it’ll stay on before it automatically turns off. Or you could set it to always, which means that if it gets triggered, you’ll have to manually turn it off. So I’m going to leave that set to 10 seconds. And then the last setting is just if you want the relay in the normally open or normally closed position.

So next, let’s go back to the live view, and then this is the button on the live view that turns the alarm relay on and off, opens it or closes. So I can simply just tap on that if I want to trigger the alarm relay output. And as we have it set up right now, it’s going to stay on for 10 seconds and then it’ll automatically turn off. And last, I’m going to minimize this screen and bring up my terminal window. This is where I have my Python script running and when I run that script, it prompts me which API method I want to run. So I’m going to run the alarm output method, the manual alarm output, and then I’m going to turn the alarm relay off by selecting one. So that just sent an XML command to the IP camera to turn it on. And then if I check the status, it brings up a big XML document of all the different alarms on the camera. You’ll see that the alarm output is set to true, and then now that it’s off or open, you’ll see that that’s set to false.

Guys, I hope this video has been helpful. I also wanted to mention our Viewtron DVRs and NVRs also have alarm input and alarm relay output ports that you can connect these external devices to. And I also wanted to mention on the IP camera and the NVR, you can trigger the alarm output via one of the alarm input ports. So if you wanted to use an external sensor, like a magnetic door sensor or an external PIR motion sensor into the alarm input to trigger the alarm relay output, you could do that as well. And the mobile app interface that I demonstrated, it’s exactly the same to trigger the alarm output ports on the DVRs and NVRs, as it is the IP camera. It’s the same exact thing.

Guys, if you want to learn more about these Viewtron IP cameras that have the alarm input and the alarm output ports, I’ll also link to the Python script that I wrote. I put that on GitHub if you want to download it so you could use it as an example to integrate with any programming language that you want. You can learn more about all this at www.cctvcamerapros.com/relay. If you want to reach out to me with any questions, you can reach me via email at mike@cctvcamerapros.net. Thank you for watching.