05.09.2020, 16:03
I Tried this with no effect
then i added a function in user.hue with also no luck.
Code:
--Control HUE from byte object (brightness) (use as event based script)
require('user.hue')
value = event.getvalue() -- 1 byte unsigned integer scale 0 - 100
group_id = 1 -- change this ID to your actual light, see getHueLights() result for lamps or use your app to resolve them
setBrightness(group_id,value)
then i added a function in user.hue with also no luck.
Code:
function setBrightness(Group_id,brightness)
if brightness == 0 then
body_msg = '{"on":false}'
response = sendToGroup(group_id,body_msg)
return response
else
brightness = math.floor((brightness / 1) + 0.5)
brightness = math.floor((brightness * 2.54) + 0.5)
--HTTP request send
body_msg = '{"on":true,"bri":'..brightness..'}'
response = sendToGroup(Group_num,body_msg)
return response
end
end