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

Has anybody managed to set virtual device name through HTTP


Question

Posted

Hi,

Has anyone managed to set a virtual device name, IP and port using HTTP api. without replacing the complete device JSON?

Thanks for any hints if you have managed.

6 answers to this question

Recommended Posts

  • 0
Posted

I think you can't do that with the API

Please login or register to see this image.

/emoticons/default_icon_sad.gif" alt=":-(" />

  • 0
  • Inquirer
  • Posted

    Thanks,

    I know I used to be able to replace the complete json but it is not sensible as a regular process.

    I will have to see if the next release gives a way to configure devices for set-up reasons.

    Would also be nice to be able to create variables through the api. Ever grrowing wish list

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    • 0
    Posted

    It seems you can't even PUT the full JSON object back. It always fails with the response:

    {"type":"ERROR","reason":"WRONG_TYPE","message":"properties[value]: expected string"}

    The API can't handle nested JSON objects. data before the properties can still be changed

    Reported on bugzilla.

    • 0
    Posted

    Have anyone tried converting the json into a single string instead of a multidimensional array?

    Just copy the entire json out, search-and-replace the name you want to change, and then fire the entire package back at the fibaro as a single string using post? I'm thinking maybe HC2 doesn't know how to parse an entire string using PUT (I guess PUT is the wrong method if you want to replace the entire thing anyway).

    I know it is a bit clunky to do it that way, but that should work if you have the right permissions.

    Rob, what response do you get to your put request? If it doesn't change the json, it must give some sort of error response.

    • 0
    Posted

    Well PUT actually was accepted after a HCL restart today. Virtual device ip is not updateable though. name & roomID I can change but not any properties.

    • 0
  • Inquirer
  • Posted

    You can set the complete JSON or used to be able to

    Please login or register to see this link.

    as a starter but that is just mad and probably a bit dangerous on a regular basis.

    Notice all the LUA is in the JSON so think what HC2 has to do if you write the complete string. OK for setup but not something I would do on as a production piece of code. My issue was that I wanted a remote system to name the virtual device and this would be on each connection by the remote system if the name was not correct.

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