Page 1 of 1

Script to turn on a Foscam clone camera

Posted: Wednesday 20 January 2016 21:53
by peckerdunne
Hi,
I'm trying to write a script to turn on a camera when I press the AWAY button on my alarm fob.

I attached the script to an On/Off switch. I put this into the 'On Action' slot:

Code: Select all

script:///home/pi/domoticz/scripts/lua/script_camera_on.lua
This is my script.

Code: Select all

commandArray = {}
commandArray['OpenURL']='http://192.168.1.121:88/set_alarm.cgi?motion_armed=1&motion_sensitivity=1&input_armed=0&iolinkage=0&mail=1&upload_interval=0&user=USERID&pwd=MYPWD'
print('Camera shouild be on')
return commandArray
I get this error message:
(/home/pi/domoticz/scripts/lua/script_camera_on.lua). returned: 32256

When I enter the 'http://192...' string into the Windows Run slot it works. I'm a new boy at this so probably missed something simple.
Any help gratefully received.

Re: Script to turn on a Foscam clone camera

Posted: Wednesday 20 January 2016 21:59
by JuanUil
I think you have to name your script
script_device_cameraon.lua

Re: Script to turn on a Foscam clone camera

Posted: Wednesday 20 January 2016 22:08
by peckerdunne
YIPPEEE!
That did it. Thanks for your help.
JuanUil wrote:I think you have to name your script
script_device_cameraon.lua

Re: Script to turn on a Foscam clone camera

Posted: Thursday 21 January 2016 22:20
by JuanUil
Glad I could help you :D :idea: