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

Can't make Api program work


Question

Posted (edited)

Hello Fibaro community,

 

I have a problem with my code and thinking, maybe some of you guys had similar issue and can help me :)

 

I'm trying to make a program, that works with API commands and is resistant to network IP changes. I allready figured out how to get device IP through API, but can't include it in Net.FHttp configuration.

 

Not working code:

 

Please login or register to see this code.

It does work, when i write it this way:

 

Please login or register to see this code.

Maybe there's a more simple way to work with API wihout needing to write IP adress in the code? Any help would be appreciated :)

 

Thanks guys and sorry for my bad english  :)

 

Edited by gediminasv

4 answers to this question

Recommended Posts

  • 0
Posted

1) api do not needed auth - you can remove auth code 

2) do not mix VD api and scene APi

3) if you trying to find heater override you can search ready for used solution 

Please login or register to see this spoiler.

 

  • 0
  • Inquirer
  • Posted

    Thank you for your advice 10der, I'm using this code in VD. I'm not sure where did I mixed VD api and scene API. Is there a difference if the code works at the end?

     

    My VD is a bit more complex than just heating override, I just didn't want to write unrelated information. 

     

    Maybe you can suggest how to make my code without a need of HC IP?

    • 0
    Posted

    Calling API always return table your not needed use JSON

    btw all properties and methods for heating also you can call via native LUA calling

    just create empty LUA SCENE and at the left side you can find all properties for your device 

    Fibaro LUA calling just translate all settinging / getting props via http api calling it’s just for your info ;)  

    • 0
  • Inquirer
  • Posted

    Thank you 10der, i'm not good at programming, just trying to make a working VD :)  LUA scene is not a good solution for me because I need to control heating panel. Also I want to see and change fan speeds, modes and other things in a single device. :)

     

    Is there a way to change heating panel temperatures/modes without a need of IP adress in the 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...