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 Tunable white
#1
How do I get it out that I can change the color temperature by a percentage value, either via the absolute color temperature 7,600 or via a 4-bit dimming step 3,007

with this script.
Can someone help me, I'm a complete novice  Huh
Code:
function setBrightnessCT(Light_num,brightness,ct)
  if brightness == 0 then
    body_msg = '{"on":false}'
    response = sendToLight(lamp_id,body_msg)
    return response
  else
    brightness = math.floor((brightness / 1) + 0.5)
    brightness = math.floor((brightness * 2.54) + 0.5)
 
    ct = math.floor(1000000 / ct)
    ct = math.min(500, ct)
    ct = math.max(154, ct)

    --HTTP request send
    body_msg = '{"on":true,"bri":'..brightness..',"ct":'..ct..'}'
    return sendToLight(Light_num,body_msg)
  end
end
Reply


Messages In This Thread
Philips Hue Tunable white - by Karaffe - 30.01.2022, 20:42
RE: Philips Hue Tunable white - by admin - 01.02.2022, 10:41
RE: Philips Hue Tunable white - by Karaffe - 01.02.2022, 19:25
RE: Philips Hue Tunable white - by admin - 02.02.2022, 08:23
RE: Philips Hue Tunable white - by Karaffe - 03.02.2022, 20:23
RE: Philips Hue Tunable white - by icuzz - 09.02.2022, 16:24

Forum Jump: