Logic Machine Forum
Sensibo APi - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Sensibo APi (/showthread.php?tid=2557)



Sensibo APi - benthoma - 01.04.2020

Is there a code for sensibo on LM?
https://support.sensibo.com/l/en/article/73outalwmi-sensibo-api-overview


RE: Sensibo APi - admin - 01.04.2020

This API is really simple, just send HTTP GET/POST requests. Change key and device_id for this example to work:
Code:
key = '12345'
https = require('ssl.https')

-- GET
res, err = https.request('https://home.sensibo.com/api/v2/users/me/pods?fields=*&apiKey=' .. key)
log(res, err)

-- POST
data = '{"acState":{"on":true}}'
device_id = '456'
res, err = https.request('https://home.sensibo.com/api/v2/pods/' .. device_id .. '/acStates?apiKey=' .. key, data)
log(res, err)



RE: Sensibo APi - benthoma - 01.04.2020

Tnx. is there a simple way to write and read all these values on the bus?


RE: Sensibo APi - admin - 02.04.2020

To get current status you need a resident script that sends GET request to https://home.sensibo.com/api/v2/pods/{device_id}/acStates, then parses the result and writes to objects. For control you need event scripts that send changed values via POST.