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.


Does anyone know what went wrong?


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>

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:


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

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:


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?