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.

Hue Brightness feedback
#48
I Tried this with no effect

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
Reply


Messages In This Thread
Hue Brightness feedback - by Arjen Straver - 05.07.2017, 19:30
RE: Hue Brightness feedback - by Hippolyte - 19.07.2017, 15:14
RE: Hue Brightness feedback - by Hippolyte - 27.07.2017, 07:03
RE: Hue Brightness feedback - by Albertor - 21.11.2017, 18:22
RE: Hue Brightness feedback - by Albertor - 22.11.2017, 19:51
RE: Hue Brightness feedback - by DarthPaul - 13.08.2018, 12:19
RE: Hue Brightness feedback - by DarthPaul - 14.08.2018, 04:42
RE: Hue Brightness feedback - by admin - 13.08.2018, 12:40
RE: Hue Brightness feedback - by ralwet - 19.10.2018, 20:28
RE: Hue Brightness feedback - by FatMax - 30.11.2018, 16:36
RE: Hue Brightness feedback - by admin - 30.11.2018, 16:48
RE: Hue Brightness feedback - by FatMax - 01.12.2018, 02:58
RE: Hue Brightness feedback - by admin - 03.12.2018, 07:49
RE: Hue Brightness feedback - by FatMax - 03.12.2018, 07:59
RE: Hue Brightness feedback - by timchan054 - 02.01.2019, 01:13
RE: Hue Brightness feedback - by Daniel - 02.01.2019, 13:05
RE: Hue Brightness feedback - by lenze90 - 24.02.2019, 10:07
RE: Hue Brightness feedback - by Daniel - 25.02.2019, 09:13
RE: Hue Brightness feedback - by Zandkever - 21.08.2019, 09:02
RE: Hue Brightness feedback - by admin - 21.08.2019, 09:22
RE: Hue Brightness feedback - by Zandkever - 21.08.2019, 10:20
RE: Hue Brightness feedback - by Tee_Trinker - 08.05.2020, 22:31
RE: Hue Brightness feedback - by Tee_Trinker - 13.05.2020, 19:47
RE: Hue Brightness feedback - by Firechief - 08.06.2020, 16:16
RE: Hue Brightness feedback - by Firechief - 09.06.2020, 08:24
RE: Hue Brightness feedback - by Ravi Kiran S - 25.03.2021, 10:51
RE: Hue Brightness feedback - by MLa - 30.07.2020, 20:03
RE: Hue Brightness feedback - by MLa - 31.07.2020, 18:05
RE: Hue Brightness feedback - by Sral1987 - 02.08.2020, 17:25
RE: Hue Brightness feedback - by Sral1987 - 09.08.2020, 08:27
RE: Hue Brightness feedback - by Sral1987 - 05.09.2020, 15:48
RE: Hue Brightness feedback - by Sral1987 - 05.09.2020, 16:03
RE: Hue Brightness feedback - by Sral1987 - 01.05.2023, 08:44
RE: Hue Brightness feedback - by Firechief - 08.11.2020, 12:35
RE: Hue Brightness feedback - by admin - 09.11.2020, 08:23
RE: Hue Brightness feedback - by Firechief - 09.11.2020, 15:17
RE: Hue Brightness feedback - by admin - 09.11.2020, 15:45
RE: Hue Brightness feedback - by Firechief - 09.11.2020, 16:24
RE: Hue Brightness feedback - by admin - 09.11.2020, 17:13
RE: Hue Brightness feedback - by Firechief - 09.11.2020, 17:31
RE: Hue Brightness feedback - by admin - 09.11.2020, 17:45
RE: Hue Brightness feedback - by Firechief - 09.11.2020, 18:15
RE: Hue Brightness feedback - by Sral1987 - 27.11.2020, 17:36
RE: Hue Brightness feedback - by admin - 30.11.2020, 07:26
RE: Hue Brightness feedback - by Sral1987 - 30.11.2020, 15:59
RE: Hue Brightness feedback - by Sral1987 - 01.12.2020, 15:21
RE: Hue Brightness feedback - by Karaffe - 21.01.2022, 07:50
RE: Hue Brightness feedback - by Firechief - 25.03.2023, 14:56
RE: Hue Brightness feedback - by admin - 27.03.2023, 05:28
RE: Hue Brightness feedback - by Firechief - 28.03.2023, 07:47
RE: Hue Brightness feedback - by admin - 28.03.2023, 07:58
RE: Hue Brightness feedback - by Firechief - 28.03.2023, 09:31
RE: Hue Brightness feedback - by admin - 28.03.2023, 09:31
RE: Hue Brightness feedback - by Firechief - 28.03.2023, 09:35
RE: Hue Brightness feedback - by admin - 28.03.2023, 09:39
RE: Hue Brightness feedback - by Firechief - 28.03.2023, 09:41
RE: Hue Brightness feedback - by NKereshki - 20.04.2023, 11:32
RE: Hue Brightness feedback - by NKereshki - 20.04.2023, 13:38
RE: Hue Brightness feedback - by NKereshki - 24.04.2023, 06:33

Forum Jump: