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

VD icon disappear


Question

Posted

Is it a known bug, or am I just doing something wrong? When I change the Icon of VD, after I click on the device the icon disappear and instead of it, standard VD icon is used. After I restart HC, custom icon is back, until the moment I click the device again.

 

14 answers to this question

Recommended Posts

  • 0
Posted

jimicr sorry for the late replay. I usually avoid to use main loop because I have already plenty VD and to many loops running causes delays and problems with blue screen with that famous number that it is forbidden to access. what I did is one scene in loop which then calls "Refresh" button on selected virtual devices.

 

But of course, I use only Fibaro to control everything in my house and no other app or device so I don't really need updating status with VD main loop.

 

You can move checking of what is selected with remote to main loop and do simple if then else to set VD icon like this:

Please login or register to see this code.

  • 0
Posted

You have to change the icon of the button.

  • 0
  • Inquirer
  • Posted

    Thanks, that solved my issue.

    • 0
    Posted

    Wish there was a way to disable this so the virtual device icon doesn't change from button clicks or slider changes.

    Buttons I can handle setting the same icon for, but sliders!!  

    Please login or register to see this image.

    /emoticons/default_angry.png" alt=":angry:" />  Very annoying

    • 0
    Posted

    For button and sliders I add code in LUA to immediately refresh VD icon:

    Please login or register to see this code.

    This way many of my VD does not need any code in main loop because icon is refreshed as soon as button is pressed or slider is changed.

    • 0
    Posted

    For button and sliders I add code in LUA to immediately refresh VD icon:

    Please login or register to see this code.

    This way many of my VD does not need any code in main loop because icon is refreshed as soon as button is pressed or slider is changed.

     

     

    You miss one line:

     

    local selfId = fibaro:getSelfId()

    local iconID = fibaro:get(selfId, "deviceIcon");

     

    -- your code

    fibaro:call(selfId, "setProperty", "currentIcon", iconID)

     

    • 0
    Posted

    Remco, you are right. Thank you for correction.

    • 0
    Posted

    Thanks for this, just a question: what is the code to set the icon from a variable?

     

    thanks in advance, Jim

    • 0
    Posted

    Above example actually uses variable 'IconID' which is taken for icon of that virtual device:

     

    local selfId = fibaro:getSelfId() -- get the ID of virtual device itself

    local iconID = fibaro:get(selfId, "deviceIcon"); -- put icon ID of virtual device in variable.

    fibaro:call(selfId, "setProperty", "currentIcon", iconID) -- set icon for virtual device in the code.
     
    There are many ways how to set icon in LUA code. For more complex code you must tell us what you want. Here is another example where you set icon depending on weather forecast code from www.openweather.org:
     

    Please login or register to see this code.

    Hope that this answers your question.

    • 0
    Posted

    Thanks will try as soon as possible!

    • 0
    Posted

     

    Above example actually uses variable 'IconID' which is taken for icon of that virtual device:

     

    local selfId = fibaro:getSelfId() -- get the ID of virtual device itself

    local iconID = fibaro:get(selfId, "deviceIcon"); -- put icon ID of virtual device in variable.

    fibaro:call(selfId, "setProperty", "currentIcon", iconID) -- set icon for virtual device in the code.
     
    There are many ways how to set icon in LUA code. For more complex code you must tell us what you want. Here is another example where you set icon depending on weather forecast code from www.openweather.org:
     

    Please login or register to see this code.

    Hope that this answers your question.

     

     

    Hey Sankotronic, what I am trying to do is the following:

     

    I use a mounted tablet as my main remote for the house, light multimedia ect. I have a Harmony remote but I dont like the original Fibaro plugin.

    On the tablet I have Tasker running in combination with a harmony plugin.

     

    I want the Fibaro to know what I have chosen as multimedia source on the tablet so I use another plugin to "put" the variable of the chosen activity in my harmony variable table on the Fibaro.

    Now I just want to have the VD main Icon change according to the variable (e.g. Tv, Kodi, Radio, ect).

     

    I have this in the VD buttons:

    Please login or register to see this code.

    I guess I need to move some of that to the main loop and maybe an if/ else statement?

     

    Hope you can kick me in the right direction. I am no coder, but can copy and paste like the best

    Please login or register to see this image.

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

    • 0
    Posted

    Thanks Sankotronic,

     

    No worries bout being a little late, my wife has me painting the house

    Please login or register to see this image.

    /emoticons/default_sad.png" alt=":(" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> So not much time to tinker...

    As soon as I get the chance I'll try it and let you know the result!

     

    Jim

    • 0
    Posted

    No problemo, have fun!

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

    • 0
    Posted

    Thanks man, works perfect!!

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