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

Nanoleaf Aurora light panels and api


AutoFrank

Question

Hi 

Has anybody worked with these devices 

Please login or register to see this link.

 

They seem interesting... Zigbee or Wi-Fi and also have an api and there also seems to be some git wrappers 

JavaScript Nanoleaf Aurora API for node.js

Had anybody purchased and worked with the panels or the app 

 

Thanks 

Link to comment
Share on other sites

Recommended Posts

  • 0

Hi @AutoFrank,

 

sort of, hhh

I can read and reasonably understand lua, when iu see some code, but i'm not yet able to produce fluently some code. I almost everytime use some snippets and routines adopted from other codes, instructions and manuals. Also uncle Google is my friend (sometimes)...

 

I'm reading out from Aurora the list of stored current effect like this:

Please login or register to see this code.

And it works like a charm. Then i'm reading out the list of stored effects:

Please login or register to see this code.

I get the list of effects, but i'm not able to find the index (position) of the current effect in the retrieved list in the for next loop. There i'm stucked at the moment

Trying to develop a VD where it is possible to cycle troy the stored effects sequentialy and otherwise.....

Edited by Bodyart
Link to comment
Share on other sites

  • 0
  • Inquirer
  • 9 minutes ago, Bodyart said:

    I get the list of effects, but i'm not able to find the index (position) of the current effect in the retrieved list in the for next loop. There i'm stucked at the moment

     

    Hi @Bodyart

     

    I replicated it as best I could and it seems to be working...

     

    Please login or register to see this code.

    giving me a debug output of 

    Please login or register to see this code.

    Try printing out the value of eff just before you do the match check

    Link to comment
    Share on other sites

    • 0

    @AutoFrank,

     

    if i understand it right, the you've simulated a scene, not a VD. This code is not working in my VD sofar...

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 9 minutes ago, Bodyart said:

    @AutoFrank,

     

    if i understand it right, the you've simulated a scene, not a VD. This code is not working in my VD sofar...

     

     

    @Bodyart, true but I dont think there is anything there (apart from the http requests that appear to be working) that would be different between a scene or a vd... Let me drop the code into a vd and come back..

     

    Update....

    vd attached and the code seems to be working as I thought it might

    Please login or register to see this attachment.

     

     

    debug screen...

    Please login or register to see this attachment.

    Edited by AutoFrank
    Link to comment
    Share on other sites

    • 0

    When i use your code with

    33 minutes ago, AutoFrank said:

    local eff = "Magic"

    then it works... But when i use the code below, it doesnt.

    1 hour ago, Bodyart said:

    local eff, stat, err = aurora:GET(api ..'select');

    Apparently eff is not a string???

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 1 minute ago, Bodyart said:

    When i use your code with

    then it works... But when i use the code below, it doesnt.

    Apparently eff is not a string???

     

    okay - that may make sense..... drop this code in to see what is printed out...

    Please login or register to see this code.

     

    r you could try 

    Please login or register to see this code.

    and see it it makes any difference...

    Link to comment
    Share on other sites

    • 0

    it gives me this:

    Please login or register to see this code.

    Don't understand it actualy... It shoul'd have to work....

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 1 minute ago, Bodyart said:

    it gives me this:

    Please login or register to see this code.

    Don't understand it actualy... It shoul'd have to work....

    @Bodyart, yes it should by the looks of it.. not sure what else to suggest ... 

    Link to comment
    Share on other sites

    • 0

    @AutoFrank,

    in the first place thank you very much Frank for being so helpfull. I'll look at it tomorrow, which seems to be wiser than the evening :-D

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 7 minutes ago, Bodyart said:

    @AutoFrank,

    in the first place thank you very much Frank for being so helpfull. I'll look at it tomorrow, which seems to be wiser than the evening :-D

     

    No worries @Bodyart

    I'm sure you're close 

     

    Perhaps one of the lis experts might have some suggestions tomorrow...

     

    Link to comment
    Share on other sites

    • 0

    Hey @AutoFrank,

     

    got it working now with some help from french forum:

    Please login or register to see this link.

     

    Please login or register to see this code.

    It's kind a complicated solution at the moment, but this gives me the desired result

    Please login or register to see this attachment.

     

    I'll try to simplify and clean the code now.

    I've deleted all the functions in order to simplify and replaced the line:

     

    22 minutes ago, Bodyart said:

    if string.match(val_to_str(v), tostring(eff)) then

     

    with:

    Please login or register to see this code.

    And i have the desired result, hoorraay :-)

    Link to comment
    Share on other sites

    • 0

    I have a backlog of messages/questions/issues.

     

    I am confused, user @szmyk posted "local myArray = json.decode(response)" to get all programs in a table. You seem to have followed that advise.

     

    I did not spend more than 5 minutes on your previous post, because I got lost (actually, "derailed", because my head does not like deciphering "regular expressions") in things like:

    Please login or register to see this code.

    I'd like to get back on track and it would really help if you could attach a file with the contents of variable "resp" right after this call.

     

    Please login or register to see this code.

    Edited by petergebruers
    Link to comment
    Share on other sites

    • 0

    Hi @petergebruers,

     

    after issueing the code:

    Please login or register to see this code.

    I get the following output:

    Please login or register to see this code.

    Is this what you wanted to see?

     

    Link to comment
    Share on other sites

    • 0

    That is all? And you want to print all possible effect names and the index in that table. And you also want to find out the index of a program, for instance, "forest" -> 2?

     

    I must be missing the point completely, so many string manipulation calls.

     

    You do realise that some APIs do not always return data in the same order? So you might need a sort to get consistent results?

     

    Tell me in all honesty if I am not following here, I do not want to take precious time from you... It is probably my headache :-; In that case, I'll be back later...

    Link to comment
    Share on other sites

    • 0

    @petergebruers,

     

    that's exactly what i want.

     

    get the index of 'forest' -> 2 and then cycle throu the programs with buttons 'previous' and 'next' :-)

    I'm sharing the headache due to sudden weather change today... Yesterday we had 28 degrees, today 19 it is and it's constantly raining.... :-(

     

    9 minutes ago, petergebruers said:

    You do realise that some APIs do not always return data in the same order? So you might need a sort to get consistent results?

     

    Yes i do and my findings about this API are, that it returns the effectlist always in the same order.... fortunately.

    Edited by Bodyart
    Link to comment
    Share on other sites

    • 0

    Just a very simple Nanoleaf VD, that cycles trough the stored effects. It can adjust the brightness for some effects, depending on effect definition.

     

    Please login or register to see this attachment.

     

    This device is using a global variable "NanoApi"  containing "/api/v1/kzcaSSBAaDwVZMkxsUKF3VlOJcd5yPri", where  "kzcaSSBAaDwVZMkxsUKF3VlOJcd5yPri" is your API Token.

     

    Please login or register to see this attachment.

     

    Use it, change it, delete it.... whatever you want :-)

     

    Link to comment
    Share on other sites

    • 0

    @PreHack,

     

    i've just orderred Nanoleaf Rhythm and some wall mounting accessories at Nanoleaf Shop Europe.

    Please login or register to see this link.

    Link to comment
    Share on other sites

    • 0
    1 hour ago, Bodyart said:

    @PreHack,

     

    i've just orderred Nanoleaf Rhythm and some wall mounting accessories at Nanoleaf Shop Europe.

    Please login or register to see this link.

    @Bodyart thank you for the heads up, I will order some :)

     

    Also, thank you all for getting the VD development forward.

    Edited by PreHack
    Link to comment
    Share on other sites

    • 0
    1 hour ago, PreHack said:

    @Bodyart thank you for the heads up, I will order some :)

     

    Also, thank you all for getting the VD development forward.

    Hi @PreHack,

    did you try my cycling VD?

    One advantage of my VD is, that you can create, or download any affect and your VD will know about it instead of hardcoding the effect under the buttons :-)

    I'll develop it further as soon i'll receive the rhythm extention.

    Link to comment
    Share on other sites

    • 0
    26 minutes ago, Bodyart said:

    Hi @PreHack,

    did you try my cycling VD?

    One advantage of my VD is, that you can create, or download any affect and your VD will know about it instead of hardcoding the effect under the buttons :-)

    I'll develop it further as soon i'll receive the rhythm extention.

     Hi @Bodyart

    I like it :) I did integrate the Hue / Saturation / Color Temp. Slider and now I replace my old VD.
    In my case, I did keep the authorization token in the VD because I think with more than one Aurora the global variable setup won't be easier.

     

    Hue Slider

    Please login or register to see this code.

    Saturation Slider

    Please login or register to see this code.

    Color Temp. Slider

    Please login or register to see this code.

     

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