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

Storing Multiple Hue Bridge Data in a single table


Mateo

Question

Hi,

 

I'm trying to create a QA/QD to get through APIs all my Philips Hue Data:

  • Button 1: Get all Hue Groups
  • Button 2: Get all Hue Scenes
  • Button 3: Get all Hue Lights

 

The purpose is to store this in a global variable and then be in a position to use this in other QD and scenes (saving light parameters for instance, to come back to initial state after an alert...or naming hue light in fibaro HC3 as they are in Philips hue environment...)

I've managed to make it run, see code below, hope it could help some one...

That's kind of a miracle considering my skills ^^

 

My issue starts where i actually do have 2 hue bridges (more than 50 lights).

I would like to extract data from each of them and then merge result in a single table that I would then set as a global variable.

This table should have one more key than the hue table: for the bridge source (1 or 2).

I guess it's something with a for k,v in pairs(result) but i can't manage making it run :(

 

To understand the code below:

* to avoid having device id coded in scene and QA, they are all part of a Global Variable (mappingTable). If I want to change a device Id because replacing it, changing the Id in mappingTable updates all scenes and QA

* i have coded only bridge 1. user information for bridge 2 are prepared

* I've deleted all my attempts to present a running code if someone is interested

 

Another question is around the function to get hue information in return.

I'm not sure really understanding and mastering the synthax which remains a little bit obscur for me. could it be simpler?

 

May I request some help and attention? Covid alert gives me sometime to search, but honestly, i'm stuck :)

Thanks in advance for your support ^^

 

Please login or register to see this code.

 

 

Edited by Mateo
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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