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 can I display an Icon from within HC2 in a list?


Question

Posted

Hi All,

 

I've got a list of motion/door breaches from api event history for display in a VD. What I want to do, in the loop, is (depending on whether a Motion Sensor or a door) show the HC2 icon 'in' that list. So, lets say, when queried, I have a list of x10 motion breaches then I will see the breached motion sensor icon 10 times; one for each breach.

 

So, I have tried the following but no joy. Probably doing something stupid so any suggestions would help.

 

local _motionIc  = _HC22:GET("/fibaro/icons/motion_sensor/motion_sensor100.png");

 

then further down, where I try to display, basically as a URL ref:

 

fibaro:call(212, "setProperty", "ui.label_5_0.value", _motionIc .._name .." : " .._Time);

 

This doesn't work.

 

Help appreciated

Please login or register to see this image.

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

5 answers to this question

Recommended Posts

  • 0
Posted

So you try to display icons in Virtual Devices? I am afraid you can't do that.

  • 0
  • Inquirer
  • Posted

    Oh

    Please login or register to see this image.

    /emoticons/default_icon_mad.gif" alt=":-x" />

     

    Thanks for reply. So, let me get this straight then:

     

    1) You can add your own icons to a button, yes? So, say I want to add my own 'Play' Icon instead of text 'Play' to a button....I can do that yes? If so, how?

    2) But I cannot add icons for display within a 'Label'? Not even an icon (say Motion Sensor) from within HC2? Real shame, any plans to add?

    3) If I want to change the txt size (in a label etc), font, color etc how do I do that?

     

    I'm looking for what advanced things I can do with a standard Virtual Device really to make more user friendly. I saw, in the Sonos 'Plugin' the fact that that has album cover and different size buttons/txt so would like to know how to do really. Or are those only achievable in a plugin?

     

    Thanks again

     

    Dave

    Please login or register to see this image.

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

    • 0
    Posted

    Dave, unfortunately it's not as simple as that.

     

    1) Yes, you can add icons to buttons, but the icons do not replace the button labels. Instead the selected icon replaces the main Virtual Device icon when the button is pressed. (Think of "Light on / Light off" icon update on button press)

    2) Nope, can't use icons at all with labels.

    3) I'm not sure you can do that either.

     

    Plugins are different from virtual devices. You get a bit more flexibility with them, unfortunately they have disabled the feature of manually uploading plugins - which means you are only stuck with using the plugins they are offering in their repository and can not write your own.

    • 0
    Posted

    @up is right about first 2 things. Regarding styles for font in labels: you can add some standard html tags to do that, but I just tested it and browser will display it only after refresh and mobile applications also does not support it. I already made bug report in that matter.

    • 0
  • Inquirer
  • Posted

    Thanks for info guys.

     

    It would be unbelievably useful to be able to change font/color/txt size in a label otherwise a list can take up too much screen real estate and not easily be read.

     

    As an example, I used to (when doing lists) add a faint border every other line so that it was more easily read/counted. Obviously anything which makes it easier to read helps.

     

    Not only that but I did notice that a basic list (I mean x10 iterations of 1) Motion/Door Sensor 'Name' .. 2) Date/Time of breach) looks different on iPhone VD compared to iPad VD?? On iPhone it returns the line whereas on iPad everything seems padded right and list is unreadable (i.e. you only see start of Motion Sensor Name) and rest disappears off screen?! This is even though there is much more room in iPad interface. VERY weird.

     

    KR, Dave

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