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.

Ikea Blinds API GET lift %
#1
Hi.

Code:
res, code = require('socket.http').request('http://192.168.1.80:40850/api/ABAFA5768F/lights/2/')
log(res, code)

If i use the code above, i get this result:

* arg: 1
  * string: {"etag":"9575d92e1a87a4fc7034b5cd188d239c","hascolor":false,"lastannounced":"2021-05-08T20:41:08Z","lastseen":"2021-05-10T14:34Z","manufacturername":"IKEA of Sweden","modelid":"KADRILJ roller blind","name":"Rullegardin Stue venstre","state":{"bri":254,"lift":100,"on":true,"open":false,"reachable":true},"swversion":"2.2.009","type":"Window covering device","uniqueid":"68:0a:e2:ff:fe:4a:74:9a-01"}
* arg: 2
  * number: 200



I want to retract the "lift" value that in this example is "100".
I tried to use the code below to do this, but i can see that there is something missing in the code to be able to extract this value.
Code:
if res then
  res = require('json').pdecode(res)
  if type(res) == 'table' and res.lift then
    grp.checkupdate('5/4/80', res.lift)
  end
end
BR
Kai-Roger
Reply


Messages In This Thread
Ikea Blinds API GET lift % - by Kai-Roger - 10.05.2021, 15:16
RE: Ikea Blinds API GET lift % - by Daniel - 10.05.2021, 15:23
RE: Ikea Blinds API GET lift % - by Kai-Roger - 10.05.2021, 16:39
RE: Ikea Blinds API GET lift % - by FatMax - 22.05.2021, 15:33
RE: Ikea Blinds API GET lift % - by Kai-Roger - 22.05.2021, 15:53

Forum Jump: