Script to turn on a Foscam clone camera

Moderator: leecollings

Post Reply
peckerdunne
Posts: 6
Joined: Sunday 13 December 2015 10:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Script to turn on a Foscam clone camera

Post 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.
JuanUil
Posts: 500
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: Script to turn on a Foscam clone camera

Post by JuanUil »

I think you have to name your script
script_device_cameraon.lua
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
peckerdunne
Posts: 6
Joined: Sunday 13 December 2015 10:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Script to turn on a Foscam clone camera

Post by peckerdunne »

YIPPEEE!
That did it. Thanks for your help.
JuanUil wrote:I think you have to name your script
script_device_cameraon.lua
JuanUil
Posts: 500
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: Script to turn on a Foscam clone camera

Post by JuanUil »

Glad I could help you :D :idea:
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest