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

Being driven mad by list Virtual Device label.value - help!


Question

Posted

Hi All,

 

I'm trying to do something I feel is quite simple....yet I am failing every time!

 

I have some lua which creates a list of events. I can do this via my own lua OR using API via httpclient. If I do this in a scene and use fibaro.debug I can see the list or, even, stick it in a table/variable etc. No problemo.

 

The problems start when I 'try' to show this list in a virtual device label value. Basically it goes wrong in that it's all just on one line with no wrapping so, in browser you see the whole list (just as one string). In iPhone you see only the start of the first value and in iPad you see even less (oddly even though there is more screen real estate!). Everything is also right padded. No matter what I try (custom functions etc) I cannot a) seem to put in any carriage return to split the list elements or b) in iphone/ipad see anything at all!!

 

I have no doubt that I could, if I wanted say a list of 10, split it into 10 individual labels (still even then I would probably encounter the reading issue) but I really wanted a list in one label. Can this not be done? Can no formatting be done or ? Any help appreciated for examples. I have only personally seen a 'list' like what I am after in Fibaro's own Sonos plugin (list of songs). I want to do similar (well just a list really) in a VD.....am I pissing in the wind or ? Any info on formatting labels or doing this is much appreciated.

 

KR, Dave

Please login or register to see this image.

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

5 answers to this question

Recommended Posts

  • 0
Posted

Here's some code I used at the time of firmware 3.X... I wrote it because I found out the label value splits (only) at whitespace. I concluded, like you, nothing else works. It doesn't solve your problem, but maybe it gets you closer:

 

Please login or register to see this code.

  • 0
  • Inquirer
  • Posted

    Hi Peter,

     

    MANY thanks. I will have a play with it.....thanks for sharing

    Please login or register to see this image.

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

     

    KR

     

    Dave

    • 0
  • Inquirer
  • Posted

    Hi Again,

     

    Just whacked it into my code to do a quick hack test and, whilst it looks great in the browser (it indeed splits it as you suggested), in the iOS app/s (at least) it's a major fubar. 

     

    Basically, you still get 'one' line (only) of the original string (still concatenated). In the iPhone app, with your 'message' you get:

     

    12345678901234567890...      and in iPad app you only get:

                    123456789012...      i.e. even less as already mentioned.

     

    Am I the only one thinking this is a bit of a nightmare?

     

    So, Peter, thank you, but I am thinking that its only going to work in the browser and therefore I am still stuck with having to just put, say, 10 records, into 10 different label.values?

     

    KR, Dave 

    • 0
    Posted

    Right... sorry, don't have an iPhone, didn't know that. But now I know so I've learned something

    Please login or register to see this image.

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

    I can't think of anything besides the 10-label solution you've come up with.

    • 0
  • Inquirer
  • Posted

    Glad to have helped lol!

     

    Annoying but Ive got it working fine with 10 labels. 

     

    Many thanks

     

    Dave

    Please login or register to see this image.

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

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