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

Fibaro Docs change variable


Question

Posted

Im trying to use fibaro docs for the first time but i need a push in the right direction
I want to change the global variable "kWh" but i must do something wrong.
What do i post in the "Body" field

Please login or register to see this attachment.

7 answers to this question

Recommended Posts

  • 0
Posted
6 minutes ago, sonnyboy said:

Im trying to use fibaro docs for the first time but i need a push in the right direction
I want to change the global variable "kWh" but i must do something wrong.
What do i post in the "Body" field

Please login or register to see this attachment.

 

 

Hi @sonnyboy

 

perhaps this is a stupid question but are you trying to update the value stored in the global variable and change the name of the global variable itself ?

 

-f

 

 

 

 

  • 0
  • Inquirer
  • Posted

    @AutoFrank

    Its the value im trying to update.

     

    • 0
    Posted

    @sonnyboy

    Thanks, I've never used the docs to update a variable

    Have you tried the lua approach 

     

    Please login or register to see this code.

     

    I took a look at the docs and I can seem to get the parameters that relate to a global variable

     

    Please login or register to see this attachment.

     

    it looks like the id can be the variable name but when I try a PUT it fails

     

    Please login or register to see this attachment.

     

    which is a bit unexpected.

    To be honest I've never used this approach so I don't know if it works

    perhaps some other forum users have more experience in this space

    .. sorry :|

     

     

     

     

     

    • 0
  • Inquirer
  • Posted (edited)

    Thanks for tryining :)

    i got the same result as you.

    With lua it works but i want to do it with the API, i got my old 1-wire system with the kWh per day and now i want that system to update the global, and 08:00 every day HC:2 sends a push or notifikation with the value stored in the global .

    Edited by sonnyboy
    • 0
    Posted
    3 minutes ago, sonnyboy said:

    Thanks for tryining :)

    i got the same result as you.

    With lua it works but i want to do it with the API, i got my old 1-wire system with the kWh per day and now i want that system to update the global, and 08:00 every day it sends a push or notifikation with that value.

    @sonnyboy

    definitely new to me but If it was me I'd work from the RESTAPI documentation and not docs

     

    Please login or register to see this attachment.

     

    Please login or register to see this link.

     

    might be worth a look...

    • 0
    Posted
    58 minutes ago, sonnyboy said:

    Im trying to use fibaro docs for the first time but i need a push in the right direction
    I want to change the global variable "kWh" but i must do something wrong.
    What do i post in the "Body" field

    Please login or register to see this attachment.

     

    Hi @sonnyboy and @AutoFrank,

     

    If you want to change global variable value using FGHC REST API then in body you need to enter this line:

    Please login or register to see this code.

     

    • 0
  • Inquirer
  • Posted (edited)

    @Sankotronic

    Many thanks :)

     

    @Sankotronic or anybody else

    Do you know how the complete url look like?

    This doesent work  http://192.168.88.148:80/api/globalVariables/kWh{"value":"7"}

    My "7" will change to "$1" when this is figured out

     

     

    Edit: Forget this i will do a Json readout intstead and update the variable from that VD.

    Edited by sonnyboy

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