Hi gents, quite a bummer that my old account has gone missing but what to do.
Back to the point. I intend to create a LiFX virtual device as I have a few LiFX bulbs around my home and I can't really integrate them with Fibaro. I've also checked LiFX community and they said:
I tried to connect my Lifx bulbs with the HC2. Now it works! I found a lot of information on the subject of http requests in the pages of this forum.
Here you find how I did it:
You need to use the new firmware version on Lifx bulbs (version 2.0) - we can do the update in the app on Android.
Register on https://cloud.lifx.com , search the "settings" and register a new "token" for the API. You can find all the API information that exists on http://developer.lifx.com/
Create a new scene in HC2 and put for example:
Adapt your LUA code.
For authorization: Take your lifx cloud token, add a ":" and encrypt it in base64 ( https://www.base64encode.org/ )
That's all, good luck
At this point, I'm a bit lost. Any ideas on what he wants to say with adapt your LUA code?
local http = net . HTTPClient ()
http : request ( 'https://api.lifx.com/v1beta1/lights/group%3ASchlafzimmer/power.json?selector=group%3ASchlafzimmer&state=on' , {
options = {
method = 'PUT' ,
headers = { [ 'Authorization' ] = 'Basic Y2YxM2FjODJkZDcyYjRmZmZiYTAwOGQ4ZDUxMTE2ZWQ4ZTdlMTE0ZTJjYWU4YWMzZjI5NzUwMTEyMjBmMTk0Nzo =' } },
success = function ( response )
fibaro : debug ( response . data ) end ,
error = function ( err ) fibaro : debug ( "Error:" .. err ) end })
this bit was missing