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

Changing symbol at virtual device


Question

Posted (edited)

Hi.

 

I built a virtual device to switch on and off a device. I have a symbol for the on-position (connected it to the on-button) and a symbol for the off-position (connected to the off-button). Within the virtual device the icon changes when I change from on to off and back. But I also want to have this corresponding symbol on the main page of the virtual device so I can see the status of that device without opening the vd. Like you can see it with lights.

 

How can I do this?

 

Thanks a lot.

 

Regards

Edited by lulu99

10 answers to this question

Recommended Posts

  • 0
Posted
49 minutes ago, lulu99 said:

Hi.

 

I built a virtual device to switch on and off a device. I have a symbol for the on-position (connected it to the on-button) and a symbol for the off-position (connected to the off-button). Within the virtual device the icon changes when I change from on to off and back. But I also want to have this corresponding symbol on the main page of the virtual device so I can see the status of that device without opening the vd. Like you can see it with lights.

 

How can I do this?

 

Thanks a lot.

 

Regards

 

Based on what you have described this should already be working for you. Maybe clearing your browsers cache and restarting the browser might help?

 

If that doesnt work, posting some screenshots of your VD would be helpful.

  • 0
  • Inquirer
  • Posted

    Hi.

     

    Yes you are right that is working already. But if I switch on the device with the on/off button at the device (it is a greenwave single power plug) I can not see the change at the virtual device. I need to read out the status somehow, right?

     

    Regards and thanks a lot

    • 0
    Posted

    Ah, I see. The issue is that the button on the main VD page is only linked to the button in your VD that has the little "Main" circle filled in at the top of its section.

     

    In order to have the functionality you described this "Main" button would have to toggle the state of the device instead of having two separate buttons for "On" and "Off".

     

    You could then check the device status and change the VD image using LUA.  If you have any questions about the code required let me know.

    • 0
    Posted
    29 minutes ago, lulu99 said:

    Hi.

     

    Yes you are right that is working already. But if I switch on the device with the on/off button at the device (it is a greenwave single power plug) I can not see the change at the virtual device. I need to read out the status somehow, right?

     

    Regards and thanks a lot

     

    Sorry @lulu99, just re-read your last post. You are talking about switching the device physically or through the VD? If physically then yes, you need to check status. This can be done by triggering a scene that changed the VD icon or by running code in the VD main loop that checks constantly.

    • 0
  • Inquirer
  • Posted

    Yes, physically. So I know to get the status, that is via getvalue(id, "value"). But how is the LUA code to change the icon?

     

    This whole thing via a VD is because the greenwave also shows and measures the power. I can switch off to record the power consumption within the module, but the current power is still showing also in the dashboard of Fibaro. And this is a problem because the greenwave power plug is behind a fibaro wall plug already measuring the whole system. So I now hide the greenwave module and select it via a VD because I can not find a way to totally ignore the power values of that thing.

     

    • 0
    Posted

    The LUA code to change a VD icon is:

    Please login or register to see this code.

      - selfId is a local variable that acquires the VD device ID

      - The integer at the end, 1008 in this case, is the icon #

     

    Figuring out the integer for the VD icon is a little tricky. Here is how I do it using Google Chrome:

     

      - Go into your VD and click on "Change icon". 

      - Right click on the icon you want and select "Inspect"

      - A toobar opens on the right side of the screen showing the properties of that icon. In this description you should be able to find the icon #, usually user added icons are numbered 1000 and up.

     

    Hope this helps. Let me know if you have any other questions!

     

     

    • 0
  • Inquirer
  • Posted

    Thanks a lot.

     

    How to get the image id I got already from a description how to use the Philips HUE VD. :-)

     

    But I have one more question. Is there an easy way to get out which "pressbutton"-id is behind a VD-button? Presently I export the VD and open it with an editor to search the button and in front of that I can see the ID. Isn't there an easier way?

     

    • 0
    Posted

    May I ask what method you use to get the icon ID? I would love to know an easier way if there is one haha.

     

    You can check the "pressButton" number in the same fashion as I described for the icon ID by using the "Inspect" toolbar in your browser. Another method is to count all VD labels, buttons, sliders, until you get to the button you want. Remember that if you add something into the VD later that the button numbers below it will be effected. If there is an easier way to do this I would love to know about it too!

    • 0
  • Inquirer
  • Posted

    Yeah, I go to the VD and there I export the VD into a file. And then I open it with an editor and just search for the buttonname, in front of that I can find the ID.

     

    • 0
    Posted

    Do you know if there is a method to change a scene icon as well?

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