Automation triggered by security camera alert - how to?

After a spate of prowlers, I am looking for a way to have ST connected devices (lamps) turn on for a set period of time in response to an alert from our IP security camera.

The camera has options to send an email or post a file to FTP when movement is detected.

I suspect it’s possible to use IFTTT to trigger on receipt of an email and have ST turn on a single device.

However I want a little more.

  • I want more than one device to turn on when triggered

  • Devices should turn off after a set period

  • Automation should only run at defined times (overnight or dusk to dawn etc etc).

I have ST hub; IFTTT; iOS shortcuts; Alexa; gmail ID/s available to me.

Any and all guidance on approaching this would be much appreciated. I can code, but would need pointers / samples to get going.

The automation part in Smartthings is a set of pretty standard responses to various triggers, non of that is an issue

The issue is at present there is no way of converting anything from an IP cam to a response in ST

Add to that false detections like cats, trees, ambient lighting from passing cars triggering events, if you did find a way to get an IP cam to trigger something in ST your lights indoors will be flashing on off all night long

There are other options for security and indoor outdoor lighting but it all depends on what is feasible in your particular circumstance

Thanks (again) Mike for the comprehensive reply.

I’ve got myself interested in the problem of building the automation. Where can I start if I ignore the IP cam as a trigger? Specifically setting up the time criteria, the lamp triggers, duration counters etc.

For an alternative trigger I’m wondering about a voice activation. I already have an automation that uses Siri and iOS Shortcuts to call a Webhook which in turn unlocks a door (via ST). I could do something similar for this application.

Pointers welcome.

1 Like

Programmatically I’m not your man, so am unable to advise on that route

Is it possible you could fit a movement sensor with a light attached externally?

I have done it and it is powered by a power sense plug/pocket socket

All external movement sensors have there own adjusters to activate at a set level of light and they usually have there own adjustable illumination timer, plus they are cheap as chips

So no need to program light level switch on times, light duration times as its all done by the movement sensor

The power sense plug socket will detect if voltage rises (on movement when detected) this in turn can then be used in any automation ST has available

Been using this setup for 4 years and not once have I had an issue, a movement sensor placed in the right position will be much easier to deal with and way more reliable than camera movement

So if you have other lights, and devices controled by ST You can have them switch on off change colour or whatever you like simply using ST automations within the app

It’s possible, but there may be a significant delay for an email trigger. At one point it was up to 15 minutes and I don’t know if that would work for your scenario.

But if you’re OK with any delay caused by the email trigger, then it’s easy. Make your “single device“ a virtual switch, and then have that virtual switch turning on trigger any other events within smartthings that you want to have happen, with any filters that you want to apply. :sunglasses:

1 Like

@gcore71

I have a setup that does exactly what you are describing, but I use a 20-line Python script on a Raspberry Pi to act as a mail server and invokes a webcore piston via URL to toggle a virtual switch. Works great and avoids the lag you would get using IFTTT.

My cameras are Reolink and unfortunately they don’t actually send the email until they’ve recorded for a few seconds, so it’s not as instantaneous as I’d like…

2 Likes

Lots of different ways to tackle security, my personal take, the easier and simpler it is the more reliable it is

30w led security light
External dumb movement sensor
Power sense plug
ST automations

What do you mean by ‘Power sense plug’?

One of my cameras is out at the end of my driveway; there’s an outlet there so I use a TPLink Powerline module to get the camera connected to the LAN. The distance is a bit on the long side so sometimes it looses signal, but works most of the time. I’ve thought about putting a motion sensor out there for faster response, but I don’t know any motion sensor that would have an ethernet connection. It’s too far for wireless, and besides, a wireless motion sensor would run off battery and I don’t want to have to worry about changing batteries or recharging.

You guys call them pocket sockets maybe ! the zigbee or zwave versions that sense power draw

When the movement sensor detects movement it switches on the connected light, that voltage change sensed by the plug is what turns the whole lot smart

Ah ok; cool trick! Unfortunately limited by distance of zigbee/zwave.

Yeah to me that would be a challenge to beat, would drive me nuts :grin:

What is that exactly ? Does it have WiFi capability or is it a simple power line adapter with an RJ45 connection

Sonoff make a power sense wifi switch that can go inline to a mains connected movement sensor

It allows you to run ethernet over power lines (‘mains’?). Yes, a power line adapter with RJ45 connection. Handy solution for when you need ethernet access where there is no ethernet cable, but there is a power outlet. I think the limit in the US is something like 300 meters of 120v line.

1 Like

Sounds like it’s mini digger cat5 time :smiley:

JD thanks for this, it nudged me in the right direction.

The IP camera sends an email to IFTTT.
IFTTT turns on a virtual switch.
ST SmartApp responds to the switch state change and runs a template smartapp turning on switches. All the timer controls etc are in the SmartApp.

Not perfect I’m sure… but it’s a great start for me.

Thanks to you and all others for inputs!

1 Like

I have been searching for a way to have my Reolink cameras bypass IFTTT and use Raspberry Pi to act as a mail server to receive camera motion email triggers to turn on virtual ST switch just as you described. Would appreciate you sharing the python script you used and any suggestions you have for moving away from the webcore piston approach to an edge driver approach to receive the URL trigger. Interesting to learn Reolink delays sending for a few recording seconds.

I have an IP ONVIF camera driver that supports many of the Reolink cameras. With it you can directly integrate your camera motion events locally. This would eliminate the need for an email-based solution.

See this topic: [ST Edge] ONVIF-compliant IP Camera Motion Detection & Video Streaming - Testers Wanted!

1 Like

Thanks for the quick reply. I installed your driver and it discovered my two Reolink E1’s and my Reolink NVR, but did not discover my Reolink RLC-823A. On all three I get a no Response from the App and can do no configurations. On a side note, all three were immediately discovered and appeared in my Alexa app. Here is my setup:

Discovered as IP Cam #1 Reolink E1 Wifi to router and not direct connected to NVR
Discovered as IP Cam #2 Reolink E1 Wifi to router and not direct connected to NVR
Discovered as IP Cam #3 Reolink NVR direct connected to router

Not discovered Reolink RLC-823A POE to switch that is connected to router

I know you said E1’s are not working with your driver, but it is the RLC-823A that I am most interested in getting the motion to work. I am satisfied using the Reolink app and NVR for my video and recording playback.

I also have never figured out why, but I have tried a few other camera programs and for some reason they also have never been able to see the RLC-823A directly, but have as a channel on the NVR?

A couple things to check:

  • have you gone through all the configuration options in the Reolink app for your RLC-823A to make sure you don’t have to enable ONVIF or enable discovery? Sometimes these features have to be explicitly enabled.
  • Are your cameras and POE switch and SmartThings hub all under the same router and within the same subnet? It is possible you have a networking issue.

I have gone through all the settings on all cameras and there is no option to enable ONVIF or discovery that I can find. The only ONVIF option is to change the port setting, which is currently at 8000 for all three cameras.

All cameras, POE Switch and NVR are under the same router with the same subnet. However, my Smartthings hub was directly connected to a second router I am using in a different part of the house to extend wifi coverage off my main router. I have moved my Smartthings hub to now be directly connected to the POE switch the RLC-823A is connected to. So now when I run the Smartthings app the two E1 Pro cameras and NVR are showing a status of “Responding” with no motion. When I press the events button it temporarily goes on and then off again. I tried rescaning again, but still not discovering the RLC-823A camera. I did want to point out that the Reolink NVR was able to scan my network when it was installed and found all three cameras as they are currently configured.

Don