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

[Virtual Device] How put a stringvariable as buttontext


Lambik

Question

First of all, hi to your all!!

Please login or register to see this image.

/emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

I just taking the first steps of knowing the Fibaro HC 2 system, and so far I like it!

And please, be patient with me, I have this strange returning habit to ask dumb questions....please don't shoot.

Please login or register to see this image.

/emoticons/default_icon_razz.gif" alt=":-P" />

Also I'm making my first baby steps in LUA and programming.

the question I have:

I created a virtual device which has one button.

What function do I need to change the text by a string-variable?

[ Added: 2013-09-09, 22:04 ]

Nevermind. It's not (yet) supported....

Please login or register to see this image.

/emoticons/default_icon_curve.gif" alt=":-/" />

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Hi Lambik,

if I well understood the question you are trying to change the label of a button through the code. At this stage this function is still not available but, you can define a label near to the button and you can change it through lua code.

See the file here attached and if you want take a look at the post I made just few hours ago.

Regards

Marco

Please login or register to see this attachment.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • I'll take a look at your post. I'm very new to this kind of programming, so I will learn from your script.

    Thanx for your respond. It's highly appreciated!!

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I think the JSON API would let you do this. A bit heavy weight though.

    Do you have an example how to do this?

    With comments if possible. Like I said, I'm new to programming...

    Please login or register to see this image.

    /emoticons/default_icon_curve.gif" alt=":-/" />

    Link to comment
    Share on other sites

    • 0

    Please login or register to see this code.

    but give it a good test and back up before testing

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Wow!

    Please login or register to see this image.

    /emoticons/default_icon_eek.gif" alt=":shock:" />

    I've got a lot to learn!

    I do some testing in the (near) future.

    Thanx!

    Link to comment
    Share on other sites

    • 0

    robmac, but the caption for the button is refreshed only after the page is reloaded

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" /> it's not friendly to do a toggle button

    Please login or register to see this image.

    /emoticons/default_icon_cry.gif" alt=":cry:" />

    Link to comment
    Share on other sites

    • 0

    As I said earlier in the thread it is not a great solution. It is a very heavy weight way to change a single button caption and I am not even saying it is safe. Thus the warning about testing.

    Link to comment
    Share on other sites

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