De API (Application Programming Interface) van Larnitech geeft software ontwikkelaars de mogelijkheid om Larnitech te besturen.

Omdat software ontwikkelaars gewend zijn Engelstalige documentatie te gebruiken, is de complete API niet vertaald naar het Nederlands.

Daarom hieronder de originele Engelstalige tekst; mocht je specifieke vragen hebben over het gebruik van de API dan kun je altijd een mailtje sturen naar [email protected] of via Skype in contact komen met onze support. Het Skype adres van de Larnitech Support is: lthsreview

Team Larnitech Nederland


API works through HTTP GET request, so you can work with your Larnitech server from browser, just sending requests from address string.Request:http://IPADDR:PORT/JSON_REQUEST, whereIPADDR – ip address of your metaforsa or DE-MG;PORT – port for API plugin (you can get it from LT Setup=>Plugins=>API=>Configure button);JSON_REQUEST – request to server in json format.Fields of JSON_REQUEST:

Examples of requests and responses:

request:
{"requestType":"getDevicesList","key":"0000000000000000"}
  
response:
{
    "requestType":"devicesList",
    "devices": [
        {
            "type": "lamp",
            "name": "Ceiling",
            "addr":"401:1"
        },
                        
        {
            "type": "conditioner",
            "name": "AC",
            "addr":"158:200",
            "t-min":"16",
            "t-delta":"16"
        }
  
        ]
}
  
request:
{"requestType":"getDeviceStatus","addr":"310:1","key":"0000000000000000"}
response:
{
   "requestType" : "deviceStatus",
   "status" : {
      "addr" : "310:1",
      "state" : "middle",
      "type" : "jalousie"
   }
}
  
request:
{"requestType":"setDeviceStatus","addr":"310:1","key":"0000000000000000","status":{"state": "on"}}
  
response:
{
  "requestType":"setDeviceStatus",
  "addr":"410:1",
  "status":{
    "state": "on"
  }
    
}
  
request:
{"requestType":"getAllDevicesStatus","key":"0000000000000000"}
  
response:
{
    "requestType":"allDevicesStatus",
    "statuses": [
      {
        "addr":"401:1",
        "state": "off",
      },
        
      {
        "addr":"158:200",
        "state": "on",
        "temp":"25",
        "mode":"cool",
        "fan":"low",
        "vane-ver":"1",
        "vane-hor":"4"
      }  
        ]
}
  
request:
{"requestType":"setDeviceStatusRaw","addr":"310:1","key":"0","status":{"state":"ff00"}}
  
response:
{
   "addr" : "310:1",
   "key" : "0",
   "requestType" : "setDeviceStatusRaw",
   "status" : {
      "state" : "ff00"
}