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 Devices


rocky63it

Question

Hi, I am new to Fibaro and I own \, for now, just an HCL plus several devices.

 

I would like to create a Virtual device that toggles a predefined Variable.

 

Please login or register to see this attachment.

 

I have tried this: 

 

Please login or register to see this attachment.

 

The code behind each button is, for now, just this:

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

 

The idea is to to activate heating accordingly:

 

This is the scene to turn Heater On

Please login or register to see this attachment.

 

This to turn it OFF

 

Please login or register to see this attachment.

 

Obviously it does NOT work....

Please login or register to see this image.

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

 

What Have I done wrong?

 

I cannot export my Virtual Device, is this doable with an HCL?

 

Can I embed LUA coding in a Virtual Device within an HCL?

 

Additional DREAM: can I change the Icon on my VD according to the Button pressed?

 

Is DEBUGGING possible with an HCL? HOW?

 

 

Many thanks in advance.

 

Roberto

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

You can not use LUA with the HCL and the code in your buttons is LUA. That is the reason why it doesn't work.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Thanks a lot Boomx,

     

    OK, I know I did a mistake by buying just an HCL, BUT....

     

    What type of coding, if any, is permitted in a Virtual Device, within an HCL?

     

    Shall I just move upto HC2?

     

    Any one interested in a brand new HCL?

     

    Roberto

    Link to comment
    Share on other sites

    • 0

    Roberto:

     

    What you can try to do is to:

    • Create a scene which sets Family_Status to At_Home
    • Create a scene which sets Family_Status to At_Office
    • Create a scene which sets Family_Status to At_School
    • Create a scene which sets Family_Status to Away
    • Create a scene which sets Family_Status to At_Holiday

    Then change the buttons in your virtual device to call each corresponding scene:

    Please login or register to see this code.

    In the above, change:

    Please login or register to see this code.

    To the IP adress of your HCL

    Please login or register to see this code.

    To the Base64 encoded string of your <user>:<password> (the above string is admin:admin). Use this webpage to encode the string: 

    Please login or register to see this link.



    And of course, you need to update the id to the corresponding id of your scenes for each button. The example above runs the scene with id 11.

     

    Hope this helps!

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi Henrik,

     

    Sadly it does NOT work.

     

    I am wondering, should'nt I also STOP the other scenes?

     

    Question: I am 99% sure my IP is 101, 

    Please login or register to see this attachment.

     

    Is this correct?

    Secondly to trigger a scene I believe I need a sort of Dummy test, certainly TRUE, like this:

     

    Please login or register to see this attachment.

     

    Sorry to bother, but I really would like to get this through...

     

    BTW is there any Manual around but the Advanced one from Fibaro?

     

    last, for anyone willing to answer:

     

    I cannot export my Virtual Device, is this doable with an HCL?

    Additional DREAM: can I change the Icon on my VD according to the Button pressed?

    Is DEBUGGING possible with an HCL? HOW?

     

     

    Thanks in advance

     

    R

     

    Link to comment
    Share on other sites

    • 0

    I just tried it out and it works for me on 4.058 beta.

     

    I created a virtual device with two buttons which runs two different scenes. The scenes changes a predefined variable (like yours) to two different values. I verified that the variable changes in the variables panel and it does!

     

    I suggest that you first create your scenes and run them manually and verify that the variable is changed using the variables panel. You don't want the scenes to be active since you're only going to run them manually with your virtual device.

     

    Once you get it working with scenes, I suggest you try to run the scenes from the virtual device and again verify using the variables panel.

     

    Now to your questions:

    • BTW is there any Manual around but the Advanced one from Fibaro? Not that I know of, but the forums are great.

      Please login or register to see this image.

      /emoticons/default_icon_smile.gif" alt=":-)" />
    • I cannot export my Virtual Device, is this doable with an HCL? Yes! In the advanced tab of the virtual device, there's a button which lets you export the virtual device.
    • Additional DREAM: can I change the Icon on my VD according to the Button pressed? Not that I know of. However if you set different icons for each button you'll be able to see the which was last pressed since the icon changes.
    • Is DEBUGGING possible with an HCL? HOW? No, but it would be a feature that would be very handy.
    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...