How to enable the "Motion Alarm" of an IP-camera (Foscam)?

I do have a foscam integrated in OH 4.1 which is working so far. Now I would like to use the channel “Motion Alarm”. Here I added a new item but for some reasons this item is always “NULL” but I have no idea why. I can see that the motion detection of the camera settings on my mobile are activated.


foscamt

Does anyone know what went wrong?

Thanks!

No idea as you did not post TRACE logs (remove your password if you do as foscam may put it in any urls)

It was common for Foscam to release cameras without the API in them, you would need to check if yours has it or not. If the camera has no API but has ONVIF support, you can set it up as an onvif thing type.

ok here the trace log:

2024-03-16  [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is 	:<CGI_Result>
    <result>0</result>
    <IOAlarm>0</IOAlarm>
    <motionDetectAlarm>0</motionDetectAlarm>
    <humanDetectAlarmState>1</humanDetectAlarmState>
    <soundAlarm>0</soundAlarm>
    <record>0</record>
    <sdState>0</sdState>
    <sdFreeSpace>0k</sdFreeSpace>
    <sdTotalSpace>0k</sdTotalSpace>
    <ntpState>2</ntpState>
    <url></url>
    <isWifiConnected>0</isWifiConnected>
    <wifiConnectedAP></wifiConnectedAP>
    <infraLedState>0</infraLedState>
    <carDetectAlarmState>0</carDetectAlarmState>
    <petDetectAlarmState>1</petDetectAlarmState>
</CGI_Result>

The camera is working and the foscam C5M has onvif support. The camera app has an onvif enable button which I set to Off and On. The result is the same and I can not see any difference in OH 4.1.

When I set manually the item “Enable Motion Alarm” (switch) to ON it goes back automatically after a few seconds. The item “Motion Alarm” remains always “NULL”.

The ONVIF port is set to 888 as indicated in the app.
Do you have an idea what wend wrong?

See customMotionAlarmUrl

Thanks for the link. Now i set the URL as described and get this information back:

<CGI_Result>
    <result>-3</result>
</CGI_Result>

The step 3) I do not fully understand. Could you pls explain?

nobody knows? Is there a list over all CGI commands available maybe or…?

Google came up with this https://alarmforum.de/attachment.php?aid=2467

Thank you for sharing that document, it helps to understand the CGI outputs.

1 Like

The IP camera binding instruction says:

Enable the motion alarm in the web interface of your camera and setup any areas you wish movement to be ignored in. E.g. tree branches moving in the wind.
Use any web browser to fetch this URL https://x.x.x.x/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig1&usr=xxxxx&pwd=xxxxx
Use the information returned by the above URL to create the override settings.

Then I setup the URL and put it into the IPcamera Thing like this:

/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&linkage=646&snapInterval=1&sensitivity=2&triggerInterval=0&schedule0=281474976645119&schedule1=281474976645119&schedule2=281474976645119&schedule3=281474976645119&schedule4=281474976710655&schedule5=281474976710655&schedule6=281474976645119&area0=120&area1=120&area2=120&area3=120&area4=120&area5=120&area6=120&area7=120&area7=120&area8=120&area9=120&usr=***&pwd=***

The event log shows me this:

 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'IP_Kamera_OG__Foscam_Camera_with_API_Enable_Motion_Alarm' updated to OFF
 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'IP_Kamera_OG__Foscam_Camera_with_API_LED_Controls' updated to 0

When I check the channel “Motion Alarm” it is always OFF! Do I need to use another channel or what I am doing wrong?

Maybe @Matt1 has an idea what went wrong here?

Hello Norick

Did you found out why its not working?
I have the same problem

Oded

yes it is working now