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


Question

Posted

Hi all

 

My programs are slowly getting more automatic (i.e auto created VDs, labels, global variables etc). But automatic handling of icons seems tricky. And as usual the Fibaro rest has a function to GET alla icons only and no PUT or POST. Switching icon on a VD or so is easy if they are already in HC2.

 

But...

 

If I have downloaded my icon from my own site with the LUA code and want to upload it to HC2 for later use, how do I do that? Nothing in the Fibaro docs....

 

Anyone?

 

 

Thanks in advance

 

Peo

 

 

2 answers to this question

Recommended Posts

  • 0
Posted
1 hour ago, pos said:

Hi all

 

My programs are slowly getting more automatic (i.e auto created VDs, labels, global variables etc). But automatic handling of icons seems tricky. And as usual the Fibaro rest has a function to GET alla icons only and no PUT or POST. Switching icon on a VD or so is easy if they are already in HC2.

But...

If I have downloaded my icon from my own site with the LUA code and want to upload it to HC2 for later use, how do I do that? Nothing in the Fibaro docs....

Anyone?

Thanks in advance

Peo

 

 

Hi @pos,

 

Please check following VD shared by @annhan91 here:

 

  • 0
  • Inquirer
  • Posted (edited)
    10 hours ago, Sankotronic said:

     

    Hi @pos,

     

    Please check following VD shared by @annhan91 here:

     

     

    @Sankotronic

     

    Many thanks

     

    I have now checked it and it seems it is written "raw". Also it seems you have to do basic auth. And it is not satisfied with a std HC2 user account auth. I did a few scripts similar to what you linked to. And to be able to post info that way you have to use the HC2 super user account.

     

    It is not the nicest solution to have the super user account written directly in the LUA code. But now I at least have a way to do it :) As you could create a VD or a label without basic auth I though it should be possible to also commit a few icons the same way. The HC2 seems this lack this important feature.

     

    Is this the only way to write icons to HC2?

     

     

    Two maybe possible dirty work arounds to avoid to store the super user credentials in LUA code...

     

    # 1

    Maybe I as a dirty work around could put in a credentials global variable that I can put in "<user>:<pass>" into for which the VD waits and poll for. When it sees this variable is no longer null, it executes what is needed with super user credentials and shortly after wipes out the credentials from the global variable. Or do you have a better suggestion? This is similar to what I do when arming DSC alarm where the alarm pin only exists for a very short time in a VD label and are automatically wiped for security reasons a few seconds later.

     

    # 2

    Auto create a user through REST of type "superuser". Then use that user for stuff that need super user credentials and delete the user afterwards. But... I cannot see a way off setting a password on the user...

     

     

    Tnx

     

    Regards

    Peo

    Edited by pos

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