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

Variable status


Mats Even

Question

Can someone tell me how I can see the status of my variable. I have some scenes that changes my variables. E.g from home to away. But I can not see what variable is active.

Link to comment
Share on other sites

Recommended Posts

  • 0

in the variables panel you see all the variables.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Hi. Maybe you misunderstood. I have some scenes that changes my house from home to away. But I want to see if it is set to Home or away. I want to see it from the app.

    Link to comment
    Share on other sites

    • 0

    Hi Mats Even,

     

    You can easily do this by creating a Virtual Device that allows you to read out some information.

    See the first attachment ("VD - House and Alarm status" for your reference, this is how I have it in place.

     

    By adding labels to your VD, and adding some code in the "Main loop" section, you can easily read out the Global Variable (.. see my second attachment "VD Label ..."" for details).

     

    The code you use in the Main loop section is:

     

    ----------

    fibaro:call(159, "setProperty", "ui.Label1.value", tostring(fibaro:getGlobalValue(".. here comes your Global variable name..")));

    ----------

     

    The ID you need to call is the ID of the Virtual Device (.. in my case it is 159).

    The red-coloured numbers and text you must customize to your own numbers and Global Variable name.

     

    I hope this will be of any help to you, else just let me know.

     

    I also wanted to share you my Virtual Device so you can see what I've listed in the device and also what buttons I added, but I get a proxy error when I try to export the device... Will try it again once I'm at home. You can do pretty cool things with a Virtual Device

    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" />

     

    Best regards,

    Mark

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    Nice idea mvdkallen, I'm going to use it that way.

     

    Edit:
    Instead of setting the deviceID, you can set "selfId". See below:
     

    Please login or register to see this code.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Thanks for the help. But I have a few more questiions. Do I make a Virtual Device With 2 buttons? (home/away) I can not see the ID of the VD

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I figured it out. Use label. Not Button.

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" />

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Where do I find the ID of the VD?

    Or do I need a VD button in addition to the Label? Because I have a wall switch that changes my variable from home to away.

    Link to comment
    Share on other sites

    • 0

    Hi Mats Even,

     

    If you click on the Virtual Device like you would edit it, then in the browser URL you'll see the device ID at the end.

     

    Normally you use a label to display information only.

    A button is used to trigger or activate something (.. that action you have to program for the specific button then).

     

    Best regards,

    Mark

    Link to comment
    Share on other sites

    • 0

    Hi guys,

     

    In my Virtual Device I read out- and display many other useful information (.. at least, they are useful for me

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" />)

    And with Global Variables you can do really cool and easy stuff.

     

    The only drawback I see is, because I have a lot of Variables set up, that it is easy to loose track. Also if you have set up scenes based on Global Variables then it can be darn complex especially if you use multiple variables in one scene 

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" /> .. but, I have to say it works like a charm and very stable.

     

    Home Center 2 is really the best and most flexible controller on the market, without a doubt.

    Don't get me wrong, I also experienced some of the bugs and challenges after doing a software update in the past, but I have to say that after version 4 it really became a more solid system and also the team of Fibaro is putting a lot of effort in the development and bugfixing.... Compliments to them and really thanks for the support.

     

    Best regards,

    Mark

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi Mats Even,

     

    If you click on the Virtual Device like you would edit it, then in the browser URL you'll see the device ID at the end.

     

    Normally you use a label to display information only.

    A button is used to trigger or activate something (.. that action you have to program for the specific button then).

     

    Best regards,

    Mark

    Hi again. Sorry for beeing a bit slow. But I want to see what variable that is active. Can I then use the label you posted first? I don`t need the VD button. So I don`t understand what ID i should use.

    Link to comment
    Share on other sites

    • 0

    Hi Mats Even,

     

    No problem;  yes, you create a virtual device and then add a label. If it is the first label you add, it is called "Label1"

    The ID we talk about is the Virtual Device ID. This ID is mandatory to use in the code in order to make it work:

     

    ----------

    fibaro:call(xxx, "setProperty", "ui.Label1.value", tostring(fibaro:getGlobalValue(".. here comes your Global variable name..")));

    ----------

     

    If you want then you can set up a remote desktop connection so that I can have a look to what you have.

    I'll send you a Personal Message with my personal email address, that you can use to send the remote desktop link to.

     

    Best regards,

    Mark

    Link to comment
    Share on other sites

    • 0

    You don't need the ID of the VD (You really should not)

    See my post #5. You can use selfId.

    Link to comment
    Share on other sites

    • 0

    There is no need to use VD to check status of some global variables. It is also possible to do with scene and popup message:

    Please login or register to see this code.

    Every time when you want to check just run the scene, or you can call this scene from another scene when some change is done so later you can check when it happened and what value was set.

    Link to comment
    Share on other sites

    • 0

     

    [DEBUG] 21:24:01: line 24: attempt to concatenate a nil value

     
     
    thoughts?

     

    Do you have these two global variables?

    What is their content?

    Link to comment
    Share on other sites

    • 0

    i actually use a VD which i have been for a while. attached is my VD just amend the global variable names in the main loop and either delete the labels that are not required or add more and add the extra code...

    Please login or register to see this link.

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    I don't see the mentioned variables in your screenshot and vfib file.

    What can you see on this page: 'fibaro/de/panels/variables.html'

     

    I think you are just missing the variables darkness and autoWakeup.

    Link to comment
    Share on other sites

    • 0

     

    [DEBUG] 21:24:01: line 24: attempt to concatenate a nil value

     
     
    thoughts?

     

    As Alex allready pointed out you do not have one of global variables from my code. Change my code and put your globals in it. as I mentioned before, advantage of popup service is that it can be called from other scenes and it will remember time of occurrence for later review.

    Link to comment
    Share on other sites

    • 0

    Hi Mats Even,

     

    You can easily do this by creating a Virtual Device that allows you to read out some information.

    See the first attachment ("VD - House and Alarm status" for your reference, this is how I have it in place.

     

    By adding labels to your VD, and adding some code in the "Main loop" section, you can easily read out the Global Variable (.. see my second attachment "VD Label ..."" for details).

     

    The code you use in the Main loop section is:

     

    ----------

    fibaro:call(159, "setProperty", "ui.Label1.value", tostring(fibaro:getGlobalValue(".. here comes your Global variable name..")));

    ----------

     

    The ID you need to call is the ID of the Virtual Device (.. in my case it is 159).

    The red-coloured numbers and text you must customize to your own numbers and Global Variable name.

     

    I hope this will be of any help to you, else just let me know.

     

    I also wanted to share you my Virtual Device so you can see what I've listed in the device and also what buttons I added, but I get a proxy error when I try to export the device... Will try it again once I'm at home. You can do pretty cool things with a Virtual Device

    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" />

     

    Best regards,

    Mark

    I'm using a HCL. But if I got it right, the lite doesn't support LUA and the main loop. Is there a sollution for the lite to be able to make a simple VD to switch between Home and Away en be able to see the status?

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