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

How to display a Global Variable value as a label in Virtual Device?


mvdkallen

Question

Hi all,

 

First I'll give you some background info else you might not understand my request later on (.. I own a HC2 by the way).

 

I've set up one Global Variable called "Lampscene" with values "Uit" (off), "Ochtend" (morning), "Avond" (evening), and "Nacht" (night).

Depending on this Global Variable value, some of my lights go on with different dimming levels. The values "Avond" (evening) and "Uit" (off) are both triggered by sunset and sunrise timers, the other ones are triggered by fixed times set in the HC2. All work like a charm and the system itself runs very stable

Please login or register to see this image.

/emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

 

Besides letting HC2 to control this fully automated, I now have also created a Virtual Device which allows me to change the Global Variable manually. The Virtual Device works well and does exactly what I want.

 

Now, I'd like to add a label onto this VD which shows me the active Global Variable value at a glance... But I don't know how to do this.

 

The attached file shows you the simple VD as how it appears, the label I've added shows the text "Current state:" .. and behind this text I'd like to have the Global Variable value shown which is active at that moment.

 

Can someone help me out maybe, please?

 

Thanks and best regards,

Mark van der Kallen

Please login or register to see this attachment.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

in main loop do:

fibaro:call(X, "setProperty", "ui.LabelY.value", tostring(fibaro:getGlobalValue(Z)));

 

where X = id of virtual device

LabelY - label name

Z - global name

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Hi Marecki,

     

    Perfect, it works

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

     

    Thanks a lot!

     

    Best regards,

    Mark

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