Page 1 of 1

request http camera to Axis1034w not working.

Posted: Wednesday 06 January 2016 0:36
by optik8
Hello First I apologize for my English translated by Google.

I own a camera Axis1034W, I created an event in the camera to emit a sound with this address:

http://192.168.1.xx:xx/axis-cgi/io/virtualinput.cgi?action=6:/ is used to activate

http://192.168.1.xx:xx/axis-cgi/io/virtualinput.cgi?action=6:\ is used to deactivate

if I write this address in firefox it works, the camera emits sound so the event that I created works.

But if I create a "Dummy" and in the "Dummy" I create a interuptor I I call "on_off_cam"
dummy anglais.png
dummy anglais.png (310.72 KiB) Viewed 2158 times
if I click on the button, nothing happens.
-------------------------------------------------------------------
I then read the documentation .lua https://www.domoticz.com/wiki/LUA_commands
and I saw this ... commandArray['OpenURL']='www.yourdomain.com/api/movecamtopreset.cgi'

I tried to make this script
commandArray = {}

if (devicechanged['fgms001'] == 'On' then
commandArray['OpenURL']='http://192.168.1.99:99/axis-cgi/io/virt ... i?action=6:/'
end
return commandArray
And the same for "off" with http://192.168.1.99:99/axis-cgi/io/virt ... i?action=6:\'

The log return :
2016-01-06 00:31:23.226 Error: EventSystem: /home/pi/domoticz/scripts/lua/script_device_cam_off.lua:3: ')' expected near 'then'
2016-01-06 00:31:23.231 Error: EventSystem: /home/pi/domoticz/scripts/lua/script_device_cam_on.lua:3: ')' expected near 'then'
the difference between these two lines is / and \ I have to put it is this that on or off control

I do not know how to settle this problem.
My goal is that the camera emits a sound when the sensor is triggered FGMS001.

Thank you for your help and even desolated for translation.

Re: request http camera to Axis1034w not working.

Posted: Wednesday 06 January 2016 8:13
by JuanUil
Hi,

you should:
if (devicechanged['fgms001'] == 'On' then
change in:
if (devicechanged['fgms001']) == 'On' then
so one ) more.

succes!!
Jan

Re: request http camera to Axis1034w not working.

Posted: Wednesday 06 January 2016 8:37
by optik8
Thanks for your help. Is Google translation correct?

I redid the two scripts like this:

For On;
commandArray = {}

if (devicechanged['fgms001']) == 'On' then
commandArray['OpenURL']='http://192.168.1.99:99/axis-cgi/io/virt ... i?action=6:/'
end
return commandArray
For Off:
commandArray = {}

if (devicechanged['fgms001']) == 'Off' then
commandArray['OpenURL']='http://192.168.1.99:99/axis-cgi/io/virt ... i?action=6:\'
end
return commandArray
the log says:
2016-01-06 08:35:38.439 Error: EventSystem: /home/pi/domoticz/scripts/lua/script_device_cam_off.lua:4: unfinished string near ''http://192.168.1.99:99/axis-cgi/io/virt ... i?action=6:''
only for the "Off" But it is still not working.

I also feel I should put the login and password of the cam? but I do not know how.

Re: request http camera to Axis1034w not working.

Posted: Wednesday 06 January 2016 9:15
by JuanUil
In the on action you end te line with /' and in the off action with \'

Re: request http camera to Axis1034w not working.

Posted: Wednesday 06 January 2016 9:21
by optik8
JuanUil wrote:In the on action you end te line with /' and in the off action with \'
yes I do like that.

Re: request http camera to Axis1034w not working.

Posted: Wednesday 06 January 2016 13:02
by optik8
but it does not work...

Re: request http camera to Axis1034w not working.

Posted: Wednesday 06 January 2016 16:23
by optik8
Then I have news ...
With .lui but I can not do it by creating a scenario, I can access the sound file from my camera and play.
I pass your hand over the motion detector
the fact scenario LED strip light a red and 7 seconds after the sound of my camera resounded.

Here's the scenario:
scenario intrus garage.png
scenario intrus garage.png (310.67 KiB) Viewed 2084 times
I put the first red LED strip light for 20secondes, then Requette "Off" for the camera to start from zero and finally the Requette "On" for the sound that starts 7 seconds after the outbreak of the detector.

I am looking for help to create this szene .lua script but I do not know if I can choose the color of the LED strip

Merci de votre aide.
Eric

Re: request http camera to Axis1034w not working.

Posted: Tuesday 12 January 2016 21:45
by optik8
I find the good script !
commandArray = {}

if (devicechanged['bouton_intrus']) == 'On' and otherdevices['rgbw_rgbw'] == 'Off' then
commandArray[1]={['OpenURL']='xxx:[email protected]/axis-cgi/io/virtualinput.cgi?action=6:/'}
commandArray[2]={['OpenURL']='xxx:[email protected]/axis-cgi/io/virtualinput.cgi?action=6:\\'}



end
return commandArray