This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Philips Hue Authentication
#4
Hi Koen,

No its not a good idea to put the functions into common functions.

Common functions are used when most of you scripts need the functions. Every script is connected to the common functions and loads that content. If you put all your functions into common functions it will rapidly reduce your sytem performance. 

That is why we have user liberies. When you put your functions in there you have to request in each script you make to include the content of that user libery by the command: require('youruserlibname')

So what you should do is create a user lib called hue (disable automatic load checkbox) , paste the functions from the first code block in my post above. Change only the IP to your HUE bridge IP and save.

Create a event based script connected to the RGB object that needs to trigger the action, start the script with requesting the just created user libary with: require('user.hue') and past my code from the second code block in my post above under the require command line.

To create the user where now xxxxxxx is filled in, you must temperary put the command bridgeSetup() under the require ('user.hue') line, save , enable the script and change the color once. Your HUE does not respond yet but now the user is created and you can find it in the log tab. 

Paste this user into the hue userlib, remove the bridgeSetup() command from your event based script, save all changed scripts.

Now you can control your HUE from the RGB object.

I will see you at the homeLYnk training in the Netherlands as i'm your trainer (:

BR,

Erwin
Reply


Messages In This Thread
Philips Hue Authentication - by George - 04.02.2017, 02:40
RE: Philips Hue Authentication - by George - 05.02.2017, 06:05
RE: Philips Hue Authentication - by Erwin van der Zwart - 05.02.2017, 08:46

Forum Jump: