Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Question

Posted

I want to send this http command using a VD button.
 

Please login or register to see this link.


 
It works pretty fine if i paste it into a browser, but not so much luck using a VD.
 
**I've tried this code with no success:
 
HTTP = Net.FHttp("192.168.15.102", 1040)
response, status, errorCode = HTTP:GET('/config/motion.cgi?enable=yes')
fibaro:debug(errorCode)
if errorCode == 0
then
fibaro:log("Done")
else
fibaro:log("Error")
end
 
**And also this code with no success:
 
GET /config/motion.cgi?enable=yes&user=admin&pwd=password
HTTP/1.10x0D0x0A0x0D0x0A

 

Can anyone help me with this ??

9 answers to this question

Recommended Posts

  • 0
Posted

Did you try to set Authentication - see below

Please login or register to see this code.

As you know usually browser remembers the passwords......

  • 0
Posted

What doesn't work? I mean do you receive an error?

Another issue, I recall that I had some problems using HTTP as a variable, could you please change it let say to HC2? I know it looks like long shot but worth to try.

 

Did you try to see what exactly happens when you send it on your browser (network monitor)?

 

there is another way to use net.HTTPClient(), but it works at scene only.

  • 0
  • Inquirer
  • Posted

    Well this command is supposed to enable the motion detection option for an IP camera.

    By pasting the URL command to a browser it works and i can see that by a tick next to the Motion detection section, but no similar luck when using the VD.

     

    I tried what you stated but nothing new either.

    • 0
  • Inquirer
  • Posted

    Also when i debug the variable "response" this unauthorized error thing appears, although sending the command from the browser no error appears.

     

    Please login or register to see this attachment.

           

    Please login or register to see this attachment.

     

     

    • 0
  • Inquirer
  • Posted

    Thank You very much, the Authentication thing worked fine.

    • 0
    Posted

    I want to get pictures from my Foscam FI8905W when the alarm is acitvated and someone is recognized via Foscam motion control, but not activate the Alarm (because maybe it´s only the postman). Can I use this command for my HC2 for sending mails form my Foscam camera as well, or do I need another command?

    • 0
    Posted

    Did you try to set Authentication - see below

    Please login or register to see this code.

    As you know usually browser remembers the passwords......

     

    Hi I am trying to do then same thing but I am getting an error in the first line

    attempt to index global 'net' (a nil value)

     

    What cant be wrong? 

    I am runing SW version 4.080 on my HC2

     

    Best Morten 

    • 0
    Posted

    This code is for VD and not for usual lua scenes.

    • 0
    Posted

    Hi I am trying to do then same thing but I am getting an error in the first line

    attempt to index global 'net' (a nil value)

     

    What cant be wrong? 

    I am runing SW version 4.080 on my HC2

     

    Best Morten 

     

     

    This code is for VD and not for usual lua scenes.

    Unfortunately  Net.FHttp doesn't work at scene, but you can try to use net.HTTPClient(). It works in scene.

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...