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: Setting a variable's value thru URL. Can it be done?


Question

Posted

Anyone here who might know if it is possible to set a variable's value thru an URL?

 

Something like:

Please login or register to see this code.

15 answers to this question

Recommended Posts

  • 0
Posted

I think this is possible (not tested)

 

yourusername = the username you use to login to your fibaro box (default admin)

yourpassword = the password you use to login to your box

boxip = set here the network ip of your box

yourdeviceid = set the device id of the item you want to change

Please login or register to see this code.

  • 0
  • Inquirer
  • Posted

    Thank you for the info.

     

    I think that the callAction is for turning a device on / off.

    What I would like to do is set a global variable.

    • 0
    Posted

    That has already been asked here:

    Please login or register to see this link.

    and here:

    Please login or register to see this link.

    and here:

    Please login or register to see this link.

     

    But it looks like that it is not easily working with an URL.

    • 0
    Posted

    That has already been asked here:

    Please login or register to see this link.

    and here:

    Please login or register to see this link.

    and here:

    Please login or register to see this link.

     

    But it looks like that it is not easily working with an URL.

    Oh nice

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> i will look into it and check if i can use it some day. 

    • 0
    Posted

     

    Anyone here who might know if it is possible to set a variable's value thru an URL?

     

    Something like:

    Please login or register to see this code.

    Why you need that? May be there is another way to execute what you need!?

    • 0
  • Inquirer
  • Posted

    Thank you Alex,

     

    I've searched on the forum, but never seen the posts you mentioned.

     

    Once again than you!

    • 0
  • Inquirer
  • Posted

    Hi cag014.

     

    I need to receive a "pushed" value from another server.

    The server is doing this by using a "post".

     

    Please login or register to see this code.

    • 0
    Posted

    First of all there is a way to change variable value via API .  Please refer to 

    Please login or register to see this link.

       globalVariables section (PUT option). 

     

    Here an example to do it on HC2

    Please login or register to see this code.

    In case you have limited number of values from your server may I suggest to create Virtual Device with several buttons for every value. In this case it's much easier to use API for button pressing 

     

    Please login or register to see this link.

    • 0
  • Inquirer
  • Posted

    Unfortunately it is not a limited number of values

     

    The string consists of 10 or more random numbers (they are phone numbers)

    This string is being pushed by an Asterisk PBX server when a call is received.

     

    At the moment I'm pushing the string to another server, and reading it (as JSON) with a VD in HC2.

    Things would be so much easer when I can push (and read the value) strait away to the VD in HC2

    • 0
    Posted

    Still I believe you can use HTTP at your server to set global variable

    • 0
    Posted

    Just registered on fiber developers and i really love the rest api they offer! I will try to write my own interface now with jQuery.

    • 0
    Posted

    Just registered on fiber developers and i really love the rest api they offer! I will try to write my own interface now with jQuery.

    Great... if you don't mind,  please share any progress with us.

    • 0
  • Inquirer
  • Posted

    Got it working with curl

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" />

     

    This example will populate the variable LastCall with 1234567890

    Please login or register to see this code.

    • 0
    Posted

    Only problem is that no scene will get triggered by this.

    (At least with version 4.070)

     

    Somebody has written to add parameter '"invokeScenes":True'

    But this did not work for me.

    • 0
    Posted

    It is working.

    "True" must be in lower cases: "true".

     

    So this should work:

    Please login or register to see this code.

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