Foscam camera motion detect

I have camera FOSCAM FI9805E. I would like when the camera detects motion activates me light for 1 minute when it is dark. I found the info

String Foscam_Motion "Motion detection [MAP(foscam.map):%s]" <camera> (Status,Test) { http="<[http://foscam:88/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=USER&pwd=PASSWORD:4000:REGEX(.*?<motionDetectAlarm>(.*?)</motionDetectAlarm>.*)]" }

, but I have no idea how to write a script or the rules for switching the light. Please help

There is a ZoneMinder Binding that has been submitted for inclusion. You would set up ZoneMinder to process the data and generate the motion detection events.

There is a program called motion that detects motion of a camera feed. You could then write a script around that to publish the events into openHAB using HTTP or MQTT.

That to me is really difficult. Do you have any examples ?? What needs to be in, item sitemap and rest

It depends on how you do the motion detection. You will need to research ZoneMinder and/or Motion, pick one, get it working and only then will we be able to tell you how you would interface it with openHAB.

Fundamentally, motion detection is not something that openHAB does. You need to figure out that part first. I have one camera hooked up to ZoneMinder but it is mostly a DIY cobbled together camera. Your camera will integrate differently and I’ve no advice to provide. And even then I don’t have any integration between my camera and openHAB.

This is a hard problem. With some perseverance you should be able to figure it out. But most of the hard work will take place outside of openHAB so you will find limited help on this particular forum.

But Rich this work very good

String Foscam_Motion "Motion detection [MAP(foscam.map):%s]" <camera> (Status,Test) { http="<[http://foscam:88/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=USER&pwd=PASSWORD:4000:REGEX(.*?<motionDetectAlarm>(.*?)</motionDetectAlarm>.*)]" }

my foscam.map is

0=deactivated
1=quiet
2=movement
undefined=no data
-=no data

And I just need RULES when STRING Foscam_detect will change to 2 = movement, on Light_garagedoor for 30 seconds or 1 minute

In that case create a rule that triggers when that item is updated. In the rule check to see if it is 2. If so sendCommand ON to the light. Then create a Timer to go off in now.plusMinutes(30) with a body to turn the light OFF.