Simulated Motion Sensors for D-Link DCS 2132L *Working*

Hey all,

Just wanted to share my work. I was able to configure simulated motion events from the DCS 2132L to SmartThings. It’s a little complicated, and you need to be fairly linux savy, but it can be done.

The code is at https://github.com/spritian/SmartThingsPublic/tree/master/smartapps/spritian

The gist of it:

  • Configure camera events for SMTP to a linux box
  • Configure events for PIR to fire a dummy snapshot and email to configured SMTP
  • On linux box, configure postfix and pipe incoming mail to a script, rather than MTA
  • In my scenario, I just wrote a quick php script using mailparse to get the data I needed.
  • The script then calls the ST API over curl to toggle the Simulated Motion Sensor on, sleep 15 seconds, and curls back the off action. I was previously using RunIn with groovy, but didn’t seem to always fire.

This was the only way I could think of getting it to work, considering the limitations of the cameras themselves. Works great though! Enjoy!

You may be able to simply this by sending the mail to IFTTT. While IFTTT can’t (to my knowledge) toggle a virtual motion sensor sensor it can turn a toggle virtual switch to indicate motion.

I love how you got linux to do the heavy lifting!