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

Ip camera preset http link


Question

Posted

Hi!

 

Im totally noob on Lua and im trying to make front door ip-camera to change its preset and take a picture when someone presses our front door bell.

How the code should be...?

The link works.

Its like this: http://192.168.1.155/decoder_control.cgi?user="user"&pwd="password"&command=43

 

Thank you very much!

 

-Tomi

7 answers to this question

Recommended Posts

  • 0
Posted

The topic has been moved from "

Please login or register to see this link.

" to "

Please login or register to see this link.

".

 

Temat został przeniesiony z "

Please login or register to see this link.

" do "

Please login or register to see this link.

".

  • 0
Posted

did you look there?

 

Please login or register to see this image.

 

and finally

 

Please login or register to see this code.

 

where 522 is front doorbell button.

2 - it's me

 

  • 0
  • Inquirer
  • Posted

    Hi and thanks for the answer but i have to be honest, im not sure did you answered to my question :D

     

    Camera works fine and even sending the picture works when i press the door bell but i dont know how to make the camera auto move to the preset position where my front door is (number 6 is the preset number and "command=43" moves the camera to the correct position when i run the "http command" by pasting it to the web browser.

     

    Thank you!

    • 0
    Posted (edited)

    Ahhh!!! Sorry, I am stupid :) 

     

    Please login or register to see this code.

    UPD: if cam says HTTP 200 OK immediately upon (!) new relocation - please simple remove "sleep" function from code  ...

    Edited by 10der
    • 0
  • Inquirer
  • Posted

    Hi!

     

    For some reason it doesnt work... :/

     

    Here is the full code with changed password.

    Hope you or someone else can help me.

    The camera goes immediately to front door if i execute the link on internet browser :/

     

     

    --[[
    %% autostart
    %% properties
    160 armed
    %% weather
    %% events
    %% globals
    --]]

    local startSource = fibaro:getSourceTrigger();
    if(startSource["type"] == "other") then
        setTimeout(function()
            fibaro:call(129, "sendPhotoToUser", "2");
        end, 2000)
    else
    if (( tonumber(fibaro:getValue(160, "armed")) > 0 )) then
    setTimeout(function()
    local delayedCheck0 = false;
    local tempDeviceState0, deviceLastModification0 = fibaro:get(160, "value");
    if (( tonumber(fibaro:getValue(160, "armed")) > 0 ) and (os.time() - deviceLastModification0) >= 2) then
        delayedCheck0 = true;
    end

    local startSource = fibaro:getSourceTrigger();
    if (
     ( delayedCheck0 == true )
    or
    startSource["type"] == "other"
    )
    then
        local httpClient = net.HTTPClient(); 
        httpClient:request('http://192.168.1.155/decoder_control.cgi?user=admin&pwd=thesecretword&command=43', { 
          success = function(resp) 
              fibaro:sleep(1000 * 5); -- waiting for... for example 5 sec
              fibaro:call(119, "sendPhotoToUser", "2"); -- say cheese
          end, 
          error = function(err) 
            print('error = ' .. err) 
          end, 
          options = { 
            method = 'GET' 
          }
        })
    end
        end, 2000)
    end
    end
     

     

     

     

     

     

    Thank you again!

    • 0
    Posted (edited)

    Sorry, I have some old models of FOSCAM without moving functionality, so my question is what doesn’t work?

    can you create empty scrip with my code?

    also add in succ fibaro:debug[“Hello”)

    and run this script manually without params ahead

     

    thnx!

    Ohh,!! Another question for u

    can you run your url in incognito browser mode?

    r u sure what do not use basic auth for example and your browser save your credentials?

    what HTTP response code after GET?

    can u add some debug information to fibaro log?

     

    sorry I am on phone...

    Edited by 10der
    • 0
  • Inquirer
  • Posted

    Hi.

     

    Thank you for helping me resolving my problem but i havent been able to test the code right now because i had to rethink my configuration all over.

    I couldnt connect my existing door bell buttons wiring straight to fibaros door sensor.

    I need to use transistor to make it work right.

    The door sensor went mad when i tried to connect it straight to door bell wires, it seems that there is power on those wires(didnt check that before i tried it).

     

    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...