10.05.2021, 15:16
Hi.
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:
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
Kai-Roger