LIFX Developer Zone

Lifx in Fibaro HC3

Hi all,

I want to use the Lifx bulbs in my Fibaro Homecenter 3.
When checking the status, I do get the right status of the bulb “Vloerlamp”:

–[[
%% properties
%% events
%% globals
–]]

local http = net.HTTPClient()
local bauth = “MY OWN LIFX AUTHENTICATION ID” --Lifx authentication ID
local Bname = “Vloerlamp”
local power = “off”
local brightness = “1”
local color = “white”

local url1 = “https://api.lifx.com/v1/lights/label:
local url2 = “/state.json?selector=label:”
local url3 = “&power=”
local url4 = “&brightness=”
local url5 = “&color=”
local Bbear = "Bearer "

http:request(url1 … Bname, {

options = {
    method = "GET",
    headers = {
        ["Authorization"] = Bbear .. bauth
              }
           },

success = function (response) print(“OK:” … response.data) end,
error = function (err) print(“Error:” … err) end
})

But when I turn on/off the bulb, I get a “timed_out” error, with this script:

–[[
%% properties
%% events
%% globals
–]]

local http = net.HTTPClient()
local bauth = “MY OWN LIFX AUTHENTICATION ID” --Lifx authentication ID
local Bname = “Vloerlamp”
local power = “off”
local brightness = “1”
local color = “white”

local url1 = “https://api.lifx.com/v1/lights/label:
local url2 = “/state.json?selector=label:”
local url3 = “&power=”
local url4 = “&brightness=”
local url5 = “&color=”
local Bbear = "Bearer "

http:request(url1 … Bname … url2 … Bname … url3 … power, {

options = {
    method = "PUT",
    headers = {
        ["Authorization"] = Bbear .. bauth
              }
           },

success = function (response) print(“OK:” … response.data) end,
error = function (err) print(“Error:” … err) end
})

DEBUG:

[20.01.2021] [23:27:52] [DEBUG] [SCENE352]: OK:{ “results”: [ { “id”: “d073d55bca3e”, “status”: “timed_out”, “label”: “Vloerlamp” } ] }

Can anybody help with this?