switching on/off surveillance in Domoticz (Foscam cam)

Moderator: leecollings

Post Reply
JohnBoy32
Posts: 16
Joined: Friday 04 March 2016 9:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

switching on/off surveillance in Domoticz (Foscam cam)

Post by JohnBoy32 »

I am already using an doorbell to take a snapshot of my camera with domoticz using LUA and the cgi-bin command for this: 8-)
-- get snapshot van camera
os.execute('wget "http://<host>:<port>/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=<user>&pwd=<password>" -O /var/tmp/snapshotV.jpg')
-- send snapshot with Telegram
os.execute('curl -s -X POST "https://api.telegram.org/>xxxx>:<yyy>/sendPhoto" -F chat_id=<uuu> -F photo="@/var/tmp/snapshotV.jpg" ')

Now I want to switch off and on surveillance of my camera with Domoticz (eg only at night or only when I am not at home).
To switch of surveillance (detection) I can use this command: "http://<host>:<port>/cgi-bin/CGIProxy.fcgi?usr=<user>&pwd=<password>&cmd=cmd=setMotionDetectConfig1&isEnable=0"

But the problem is that all setting of the detection are removed (also area's and sensitivity). So switching on in the same manner is more or less impossible. The command would be: "http://<host>:<port>/cgi-bin/CGIProxy.fcgi?usr=<user>&pwd=<password>&cmd=cmd=setMotionDetectConfig1&isEnable=1&linkage=1230&snapInterval=2&sensitivity=0&triggerInterval=5&schedule0=281474976710655&schedule1=281474976710655&schedule2=281474976710655&schedule3=281474976710655&schedule4=281474976710655&schedule5=281474976710655&schedule6=281474976710655&area0=1023&area1=1023&area2=1023&area3=1023&area4=1023&area5=1023&area6=1023&area7=1023&area7=1023&area8=1023&area9=1023". And if you change a setting you will have to change this "command".

It is possible to get from the camera these settings with a "get" instead of a "set": "http://<host>:<port>/cgi-bin/CGIProxy.fcgi?usr=<user>&pwd=<password>&cmd=getMotionDetectConfig1"

:?: :?: My question is: Is it possible to "store" the setting in a variable before switching surveillance off (the first step of switching of would be the "get" and after storing the setting do the "set"), in order the use these setting in the set-command (with the parameters of the get at switching off) when switching surveillance on. :?: :?:

PS. For those interested in the commands see: http://lightswitch05.github.io/foscam-client/index.html :ugeek:
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest