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 Lamps state
#5
hello, I was going crazy trying to command on a single group at a time, without succeeding. On and OFF acted on all groups. When I noticed in the function in the library what I think is an oversight:

Code:
function sendToGroup(Group_num,body_request)
  local response = {}
  socket.http.request({
  url = "http://"..ip_add.."/api/"..user.."/groups/"..tostring(Light_num).."/action",
  method = 'PUT',
  sink = ltn12.sink.table(response),
  headers = {
  ['content-length'] = #body_request,
  ['content-type'] = 'application/json',
  },
  source = ltn12.source.string(body_request),
  })
  return response
end


I guess Light_num on url in 4 row is wrong and to be subsustite by Group_num.... am I right?
By the way, can I address a group by its name?
Reply


Messages In This Thread
Philips HUE Lamps state - by gdimaria - 21.09.2021, 15:18
RE: Philips HUE Lamps state - by admin - 22.09.2021, 12:54
RE: Philips HUE Lamps state - by gdimaria - 22.09.2021, 15:34
RE: Philips HUE Lamps state - by gdimaria - 14.12.2021, 17:44
RE: Philips HUE Lamps state - by gdimaria - 15.12.2021, 14:47
RE: Philips HUE Lamps state - by admin - 15.12.2021, 05:50
RE: Philips HUE Lamps state - by gdimaria - 15.12.2021, 13:53
RE: Philips HUE Lamps state - by gdimaria - 16.12.2021, 07:02
RE: Philips HUE Lamps state - by gdimaria - 16.12.2021, 12:32
RE: Philips HUE Lamps state - by gdimaria - 25.01.2022, 13:09

Forum Jump: