Ip camera binding

i have an IP camera Hikvision. everything seems to be working good with the new camera ip bnding except one anoying thing :slight_smile: i always have to double switch the “enableMotionAlarm” until it sets to the right state.

this is my configuration:
Switch enableMotionAlarm “Judesio stebėjimas” (ghikvision) {channel=“ipcamera:hikvision:Garazas:enableMotionAlarm”}

i have it in sitemap
Switch item=enableMotionAlarm label=“Judesio stebėjimas” icon=“switch”

when i click to change the state i get this strange behaviour:
2021-03-21 20:23:16.641 [ome.event.ItemCommandEvent] - Item ‘enableMotionAlarm’ received command OFF

2021-03-21 20:23:16.655 [nt.ItemStatePredictedEvent] - enableMotionAlarm predicted to become OFF
2021-03-21 20:23:16.720 [vent.ItemStateChangedEvent] - enableMotionAlarm changed from ON to OFF
2021-03-21 20:23:16.723 [vent.ItemStateChangedEvent] - enableMotionAlarm changed from OFF to ON

first time it always predicts to change to the desired state but stright forward it reverses. the second i click it changes successfully.

Matt (the author of the IP camera binding) doesn’t seem to mind posting issues in the original thread, he uses it to track issues… see here

Create a rule that sends REFRESH command after the system has started and the camera is online. There was also a bug fix in that area so use latest binding version.

the binding version is 2.5.12. is there a newer version?
my OH is 2.5…

refresh command on system startup did not help…

The bug fix is not in that version as it only went into V3.1mx?.. For a 2.5.x version without the issue you would need to go older then the merged version, which I would not recommend due to numerous breaking changes made at the time the binding was merged. I do have a copy of the binding just before the changes were made here but as mentioned it has breaking changes and probably needs the things deleted and recreated plus the cache and tmp folders cleared to get it going so for an advanced user…

There were two things that caused issues…

  1. Bug in the binding not storing the cameras settings correctly. Fixed in V3.1mx
  2. Binding relied on a refresh command to be sent which happens in V2 but not in V3, this is not fixed yet (been looking into it) and is why I mentioned the work around as a temporary measure but in the case of v2.5.x it would not help as it is the bug mentioned above that is the cause.

seems that i am stuck :slight_smile: i can not update to OH3 beause it has other bindings that stop working in 3version cause of newer java version. Or i will write my on HTTP request to /ISAPI/System/Video/inputs/channels/1/motionDetectionExt to enable/disable motion detection cause everything else seems to be working like a charm.

Yes you could do it with a curl command under linux, probably best to put it in a bash script. It needs to be a POST message from memory and you need to fetch the settings from the camera, edit the setting and then POST it back. If you only turn it on and off then you can just blindly send a set XML reply back.