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.

Deconz REST API
#3
(19.04.2021, 06:31)admin Wrote: Try this:
Code:
http = require('socket.http')
ltn12 = require('ltn12')

body = '{"lift":50}'

res, code = http.request({
  url = '192.168.1.80:40850/api/8EBFA5778F/lights/2/state/',
  method = 'PUT',
  headers = {
    ['Content-Length'] = #body,
  },
  source = ltn12.source.string(body)
})

log(res, code)

Excellent Smile Thanks. I had to put in http:// in front of the url, but else it worked perfectly.
BR
Kai-Roger
Reply


Messages In This Thread
Deconz REST API - by Kai-Roger - 18.04.2021, 17:54
RE: Deconz REST API - by admin - 19.04.2021, 06:31
RE: Deconz REST API - by Kai-Roger - 19.04.2021, 21:34
RE: Deconz REST API - by Kai-Roger - 20.04.2021, 06:14
RE: Deconz REST API - by admin - 20.04.2021, 06:24
RE: Deconz REST API - by Kai-Roger - 20.04.2021, 16:07

Forum Jump: