Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Praktische Anwendungen (Showcase)
  4. [Javascript] Midas (Aquatemp) Poolheizung

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.5k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    2.0k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    16
    1
    2.7k

[Javascript] Midas (Aquatemp) Poolheizung

Geplant Angeheftet Gesperrt Verschoben Praktische Anwendungen (Showcase)
359 Beiträge 25 Kommentatoren 77.3k Aufrufe 25 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • O oxident

    @pietnb Ich glaube, die Entwickler beim Hersteller haben selber Device- und ProductID verwechselt. Letztere ist richtig und gehört auch in die Auflistung.

    Darauf bezieht sich auch zufälligerweise der obige GitHub-Link!

    Werde am WE leider zu nichts kommen, aber wir schaffen das schon noch ;-)

    P Offline
    P Offline
    PietNB
    schrieb am zuletzt editiert von PietNB
    #147

    @oxident Ich bekomme im "rawJSON" jetzt viele Werte angezeigt. Leider erscheinen die Werte nicht unter den Objekten? Gersten wurden T1-T4 und der Mode angezeigt. weil ich nach dem ganzen gefummel nicht mehr genau wusste was jetzt genau ich gemacht habe, habe ich nochmal alles neu gemacht. Nun sind die Werte in der Objekten bis auf Mode und Ambient Temp wieder weg???

    [{"value":"0","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"21.5","code":"T2"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"23.5","code":"T3"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"16.0","code":"T4"},{"value":"19.0","code":"T5"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}]
    

    Bildschirm­foto 2023-07-02 um 21.56.45.png

    Warum werden die Daten nicht unter den Objekten angezeigt? Ich weis nicht weiter?

    O 1 Antwort Letzte Antwort
    0
    • P PietNB

      @oxident Ich bekomme im "rawJSON" jetzt viele Werte angezeigt. Leider erscheinen die Werte nicht unter den Objekten? Gersten wurden T1-T4 und der Mode angezeigt. weil ich nach dem ganzen gefummel nicht mehr genau wusste was jetzt genau ich gemacht habe, habe ich nochmal alles neu gemacht. Nun sind die Werte in der Objekten bis auf Mode und Ambient Temp wieder weg???

      [{"value":"0","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"21.5","code":"T2"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"23.5","code":"T3"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"16.0","code":"T4"},{"value":"19.0","code":"T5"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}]
      

      Bildschirm­foto 2023-07-02 um 21.56.45.png

      Warum werden die Daten nicht unter den Objekten angezeigt? Ich weis nicht weiter?

      O Offline
      O Offline
      oxident
      schrieb am zuletzt editiert von
      #148

      @pietnb Im Code wird ja (weiter unten) dann auch die Zuordnung vorgenommen. Ich denke, da ist der Hund begraben...

      Hoffe aber, das in den nächsten Tagen auch selber angehen zu können.

      P 1 Antwort Letzte Antwort
      0
      • O oxident

        @pietnb Im Code wird ja (weiter unten) dann auch die Zuordnung vorgenommen. Ich denke, da ist der Hund begraben...

        Hoffe aber, das in den nächsten Tagen auch selber angehen zu können.

        P Offline
        P Offline
        PietNB
        schrieb am zuletzt editiert von PietNB
        #149

        @oxident Moin. Habe gestern noch etwas mit den Werten rumprobiert, kann aber nicht sagen was genau jetzt anders ist. Inzwischen werden fast alle unterstützten Werte angezeigt. Aktuell fehlt nur noch die "setTemp" (Solltemperatur).

        Bildschirm­foto 2023-07-03 um 06.41.50.png

        Hier stehen im Code ja auch die Solltemperaturen für die einzelnen Modi (R01-R03) im rawJASON. Evtl. kann man damit was anfangen?

        O 1 Antwort Letzte Antwort
        0
        • P PietNB

          @oxident Moin. Habe gestern noch etwas mit den Werten rumprobiert, kann aber nicht sagen was genau jetzt anders ist. Inzwischen werden fast alle unterstützten Werte angezeigt. Aktuell fehlt nur noch die "setTemp" (Solltemperatur).

          Bildschirm­foto 2023-07-03 um 06.41.50.png

          Hier stehen im Code ja auch die Solltemperaturen für die einzelnen Modi (R01-R03) im rawJASON. Evtl. kann man damit was anfangen?

          O Offline
          O Offline
          oxident
          schrieb am zuletzt editiert von oxident
          #150

          @pietnb Ich habe jetzt mal angefangen, das ein wenig "in Form" zu gießen.
          Vielleicht machst Du Dir lieber vorher eine Kopie Deines aktuellen Skripts ;-)

          // Midas Poolheizung
          // v0.0.8c
          // Changelog:
          // 0.0.8: Testweise Unterstützung von neu registrierten Anlagen
          // 0.0.7: Kleinigkeiten überarbeitet
          //        weitere Modelle hinzugefügt
          // 0.0.6: Gültigkeitsprüfung des Zertifikats deaktiviert (Dank an znyde)
          //        Kompatibilität mit Promo Next Modellen durch generische Product-ID (Dank an znyde)
          // 0.0.5: weitere Abfragewerte hinzugefügt (Kompressor- und Ansaugtemperatur)
          // 0.0.4: Tokenverfall jetzt 60min nach Skriptstart und nicht zu jeder vollen Stunde (Dank an dering)
          // 0.0.3: Datenpunkte beim Start automatisch anlegen (Dank an Andy200877)
          // 0.0.2: Token bei jedem Set-Vorgang prüfen und ggf. neu anfordern (Dank an dering)
          
          // ANFANG konfigurierbare Elemente -----
          const username = "EMAIL";
          var password = "KENNWORT";
          const interval = 30; // Abfrageintervall in Sekunden
          const dpRoot = "0_userdata.0.Poolheizung"; // Stammordner der Datenpunkte
          var apilevel = 1;   // 1: AquaTemp-Accounts, die vor v.1.5.8 erstellt wurden
                              // 2: HiTemp-Accounts
                              // 3: AquaTemp-Accounts, die mit neueren App-Versionen erstellt wurden
                              
          
          // ENDE --------------------------------
           
          var cloudURL;
          
          var token = "";
          var tokenRefreshTimer;
          var device = "";
          
          // ProductIDs:
          // Gruppe 1:
          // 1132174963097280512: Midas/Poolsana InverPro
          const AQUATEMP_POOLSANA="1132174963097280512";
          // Gruppe 2:
          // 1442284873216843776: 
          const AQUATEMP_OTHER1="1442284873216843776";
          
          var product = "";
          var reachable = false;
          
          function setupEndpoints() {
              if(apilevel==1) {
                  cloudURL = "https://cloud.linked-go.com/cloudservice/api";
              } else if(apilevel==2) {
                  cloudURL = "https://cloud.linked-go.com/cloudservice/api";
              } else if(apilevel==3) {
                  cloudURL = "https://cloud.linked-go.com:449/crmservice/api";
                  password = require('crypto').createHash('md5').update(password).digest("hex");
          
              }
          }
           
          function clearValues() {
              saveValue("error", true, "boolean");
              saveValue("consumption", 0, "number");
              saveValue("state", false, "boolean");
          }
           
          function saveValue(key, value, sType) {
              var dp = dpRoot + "." + key;
           
              if ( !existsState(dp )) {
                  createState(dp,value,{name: key,  type: 'number', role: 'value'}, function () {}); 
              } else {
                  setState(dp,value,true);
              }
          }
           
          function findCodeVal(result, code) {
              //log(code);
              for(var i=0; i<result.length; i++) {
                  //log(result[i].code);
                  
                  if(result[i].code.indexOf(code) >= 0) {
                      return result[i].value;
                  }
              }
              return "";
          }
           
          function createobjects() {
              log ("erstelle Objekte");
              createState(dpRoot + '.ambient', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Umgebungstemperatur"});
              createState(dpRoot + '.connection', {read: true, write: false,  type: "boolean", role: "state", name: "Verbindung", def: false});
              createState(dpRoot + '.consumption', {read: true, write: false,  type: "number", unit:"W", role: "value.power", name: "Stromverbrauch", def: 0});
              createState(dpRoot + '.error', {read: true, write: false,  type: "boolean", role: "state", name: "Fehler", def: false});
              createState(dpRoot + '.errorCode', {read: true, write: false,  type: "string", name: "Fehlercode", def: ""});
              createState(dpRoot + '.errorLevel', {read: true, write: false,  type: "number", name: "Fehlerlevel"});
              createState(dpRoot + '.errorMessage', {read: true, write: false,  type: "string", name: "Fehlermeldung", def: ""});
              createState(dpRoot + '.mode', {read: true, write: true,  type: "string", states: "-1:off;0:cool;1:heat;2:auto", name: "Modus", def: ""});
              createState(dpRoot + '.rotor', {read: true, write: false,  type: "number", unit:"rpm", def: 0, name: "Lüfterdrehzahl"});
              createState(dpRoot + '.silent', {read: true, write: true,  type: "boolean", role: "state", name: "Silent", def: false});
              createState(dpRoot + '.state', {read: true, write: false,  type: "boolean", role: "state", name: "Status", def: false});
              createState(dpRoot + '.tempIn', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Eingangstemperatur"});
              createState(dpRoot + '.tempOut', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Ausgangstemperatur"});
              createState(dpRoot + '.tempSet', {read: true, write: true,  type: "number", unit:"°C", role: "level.temperature", name: "Solltemperatur"});
              createState(dpRoot + '.suctionTemp', {read: true, write: false,  type: "number", unit:"°C", name: "Luftansaugtemperatur"});
              createState(dpRoot + '.coilTemp', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Kompressortemperatur"});
              
              createState(dpRoot + '.rawJSON', {read: true, write: false,  type: "array", name: "komplette Rückgabe"});
          }
           
          function updateToken() {
           
              if(token=="") {
                  //log("Token Neuanforderung");
                  var request = require('request');
                  var options;
              
                  if(apilevel<3) {
                      options = {
                          url: cloudURL + '/app/user/login.json',
                          method: 'POST',
                          json: { "user_name": username, "password": password, "type": "2" },
                          rejectUnauthorized: false
                      };
                  } else {
                      options = {
                          url: cloudURL + '/app/user/login',
                          method: 'POST',
                          json: { "userName": username, "password": password, "type": "2" },
                          rejectUnauthorized: false
                      };
                  }
                  
          
                  //log(JSON.stringify(options));
                  
                  request(options,function (error, response, body){
                  
                      //log(JSON.stringify(response));
                      if(parseInt(body.error_code)==0) {
                          
                          if(apilevel<3) {
                              token = body.object_result["x-token"];
                          } else {
                              token = body.objectResult["x-token"];
                          }
                          
                          //log("Login ok! Token " + token);
                          updateDeviceID();
                      } else {
                          // Login-Fehler
                          //log("Login-Fehler in updateToken(): " + response.body, "error");
                          token = "";
                          saveValue("connection", false, "boolean");
                      }
                      
                  });
              } else {
                  updateDeviceID();
              }
           
              
           
              
           
          }
           
          function updateDeviceID() {
              if(token!="") {
                  var optionsDev;
                  if(apilevel<3) {
                      optionsDev = {
                          url: cloudURL + '/app/device/deviceList.json',
                          headers: { "x-token": token },
                          body: {"product_ids": [
                                  "1132174963097280512",
                                  "1186904563333062656",
                                  "1158905952238313472",
                                  "1245226668902080512",
                                  "1442284873216843776",
                                  "1548963836789501952",
                                  ]},
                          method: 'POST',
                          json: true,
                          rejectUnauthorized: false  
                      };
                  } else {
                      optionsDev = {
                          url: cloudURL + '/app/device/deviceList',
                          headers: { "x-token": token },
                          body: {"productIds": [
                                  "1132174963097280512",
                                  "1186904563333062656",
                                  "1158905952238313472",
                                  "1245226668902080512",
                                  "1442284873216843776",
                                  "1548963836789501952",
                                  ]},
                          method: 'POST',
                          json: true,
                          rejectUnauthorized: false  
                      };
                  }
          
                  var request = require('request');
           
                  request(optionsDev,function (error, response, body){
              
                      //log(JSON.stringify(response));
                      //log(JSON.stringify(body.object_result));
           
                      if(parseInt(body.error_code)==0) {
                          
                          //token = body.object_result["x-token"];
                          //log("Login ok! Token " + token);
                          
                          if(apilevel<3) {
                              device = body.object_result[0].device_code;
                              product = body.object_result[0].product_id;
                              reachable = (body.object_result[0].device_status=="ONLINE");
                          } else {
                              device = body.objectResult[0].deviceCode;
                              product = body.object_result[0].productId;
                              reachable = (body.objectResult[0].deviceStatus=="ONLINE");
                          }
          
                          //log(product);
                          
                          if(reachable) {
                              saveValue("connection", true, "boolean");
                              if(device!="") updateDeviceStatus(device);
                          } else {
                              // offline
                              device = "";
                              saveValue("connection", false, "boolean");
                          }
                          
                      } else {
                          // Login-Fehler
                          //log("Fehler in updateDeviceID(): " + response.body, "error");
                          token = "";
                          device = "";
                          reachable = false;
                          saveValue("connection", false, "boolean");
                      }
                      
                  });
              }
          }
           
          function updateDeviceStatus(devicecode) {
              if(token!="") {
                  var optionsDev;
          
                  if(apilevel<3) {
                      optionsDev = {
                          url: cloudURL + '/app/device/getDeviceStatus.json',
                          headers: { "x-token": token },
                          json: { "device_code": devicecode },
                          method: 'POST',
                          rejectUnauthorized: false
                      };
                  } else {
                      optionsDev = {
                          url: cloudURL + '/app/device/getDeviceStatus',
                          headers: { "x-token": token },
                          json: { "deviceCode": devicecode },
                          method: 'POST',
                          rejectUnauthorized: false
                      };
                  }
                  
           
                  var request = require('request');
           
                  request(optionsDev,function (error, response, body){
              
                      //log(JSON.stringify(response));
                      //log(JSON.stringify(body.object_result));
           
                      if(parseInt(body.error_code)==0) {
          
                          if(apilevel<3) {
                              if(body.object_result["is_fault"]==true) {
                                  // TODO: Fehlerbeschreibung abrufen
                                  //clearValues();
                                  saveValue("error", true, "boolean");
                                  updateDeviceDetails(devicecode);
                                  updateDeviceErrorMsg(devicecode);
                              } else {
                                  // kein Fehler
                                  saveValue("error", false, "boolean");
                                  saveValue("errorMessage", "", "string");
                                  saveValue("errorCode", "", "string");
                                  saveValue("errorLevel", 0, "number");
                                  updateDeviceDetails(devicecode);
                              }
                          } else {
                              if(body.objectResult["is_fault"]==true) {
                                  // TODO: Fehlerbeschreibung abrufen
                                  //clearValues();
                                  saveValue("error", true, "boolean");
                                  updateDeviceDetails(devicecode);
                                  updateDeviceErrorMsg(devicecode);
                              } else {
                                  // kein Fehler
                                  saveValue("error", false, "boolean");
                                  saveValue("errorMessage", "", "string");
                                  saveValue("errorCode", "", "string");
                                  saveValue("errorLevel", 0, "number");
                                  updateDeviceDetails(devicecode);
                              }
                          }
           
                          
                          
                          //token = body.object_result["x-token"];
                          //log("Login ok! Token " + token);
                          
                      } else {
                          // Login-Fehler
                          //log("Fehler in updateDeviceStatus(): " + response.body, "error");
                          token = "";
                          device = "";
                          saveValue("connection", false, "boolean");
                      }
                      
                  });
              }
          }
           
          function updateDeviceErrorMsg(devicecode) {
              if(token!="") {
                  var optionsDev;
          
                  if(apilevel<3) {
                      optionsDev = {
                          url: cloudURL + '/app/device/getFaultDataByDeviceCode.json',
                          headers: { "x-token": token },
                          json: { "device_code": devicecode },
                          method: 'POST',
                          rejectUnauthorized: false
                          //headers: {"content-type": "application/json"},
                          //charset: 'utf8',
                          //json: true
                          
                      };
                  } else {
                      optionsDev = {
                          url: cloudURL + '/app/device/getFaultDataByDeviceCode',
                          headers: { "x-token": token },
                          json: { "deviceCode": devicecode },
                          method: 'POST',
                          rejectUnauthorized: false
                          //headers: {"content-type": "application/json"},
                          //charset: 'utf8',
                          //json: true
                          
                      };
                  }
                  
           
                  var request = require('request');
           
                  request(optionsDev,function (error, response, body){
              
                      //log(JSON.stringify(response));
                      //log(JSON.stringify(body.object_result));
           
                      if(parseInt(body.error_code)==0) {
           
                          
                          saveValue("error", true, "boolean");
          
                          if(apilevel<3) {
                              saveValue("errorMessage", body.object_result[0].description, "string");
                              saveValue("errorCode", body.object_result[0].fault_code, "string");
                              saveValue("errorLevel", body.object_result[0].error_level, "string");
                          } else {
                              saveValue("errorMessage", body.objectResult[0].description, "string");
                              saveValue("errorCode", body.objectResult[0].fault_code, "string");
                              saveValue("errorLevel", body.objectResult[0].error_level, "string");
                          }
                          
                          
                      } else {
                          // Login-Fehler
                          //log("Fehler in updateDeviceErrorMsg(): " + response.body, "error");
                          token = "";
                          device = "";
                          saveValue("connection", false, "boolean");
                      }
                      
                  });
              }
          }
           
          function updateDeviceDetails(devicecode) {
              if(token!="") {
                  var optionsDev;
          
                  if(apilevel<3) {
                      if(product==AQUATEMP_POOLSANA) {
                          optionsDev = {
                              url: cloudURL + '/app/device/getDataByCode.json',
                              headers: { "x-token": token },
                              json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                              // "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05"]
                              method: 'POST',
                              rejectUnauthorized: false
                          
                          };
                      } else if(product==AQUATEMP_OTHER1) {
                          optionsDev = {
                              url: cloudURL + '/app/device/getDataByCode.json',
                              headers: { "x-token": token },
                              json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T4","T5","T7","T14","T17"] },
                              method: 'POST',
                              rejectUnauthorized: false
                          
                          };
                      }
                      
                  } else {
                      if(product==AQUATEMP_POOLSANA) {
                          optionsDev = {
                              url: cloudURL + '/app/device/getDataByCode',
                              headers: { "x-token": token },
                              json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                              method: 'POST',
                              rejectUnauthorized: false
                          
                          };
                      } else if (product==AQUATEMP_OTHER1) {
                          optionsDev = {
                              url: cloudURL + '/app/device/getDataByCode',
                              headers: { "x-token": token },
                              json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T4","T5","T7","T14","T17"] },
                              method: 'POST',
                              rejectUnauthorized: false
                          
                          };
                      }
                      
          
                  }
                  
           
                  var request = require('request');
           
                  request(optionsDev,function (error, response, body){
           
           
                      if(parseInt(body.error_code)==0) {
          
                          if(apilevel<3) {
                              saveValue("rawJSON", body.object_result, "string");
                              
                              if(findCodeVal(body.object_result, "Power")=="1") {
                                  if(product==AQUATEMP_POOLSANA) {
                                      // Stromverbrauch T07 x T14 in Watt
                                      saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T07")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                      // Luftansaug-Temperatur T01
                                      saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T01")), "number");
                                      // Inlet-Temperatur T02
                                      saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T02")), "number");
                                      // outlet-Temperatur T03
                                      saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T03")), "number");
                                      // Coil-Temperatur T04
                                      saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T04")), "number");
                                      // Umgebungs-Temperatur T05
                                      saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T05")), "number");
                                  } else if (product==AQUATEMP_OTHER1) {
                                      // Stromverbrauch T7 x T14 in Watt
                                      saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T7")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                      // Luftansaug-Temperatur T1
                                      saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T1")), "number");
                                      // Inlet-Temperatur T2
                                      saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T2")), "number");
                                      // outlet-Temperatur T3
                                      saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T3")), "number");
                                      // Coil-Temperatur T4
                                      saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T4")), "number");
                                      // Umgebungs-Temperatur T5
                                      saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T5")), "number");
                                  }
                              
                                  // Lüfter-Drehzahl T17
                                  saveValue("rotor", parseInt(findCodeVal(body.object_result, "T17")), "number");
                                
                                  
                              } else {
                                  saveValue("consumption", 0, "number");
                                  saveValue("rotor", 0, "number");
                              }
              
                              // Ziel-Temperatur Set_Temp
                              saveValue("tempSet", parseFloat(findCodeVal(body.object_result, "Set_Temp")), "number");
                  
                              // Flüstermodus Manual-mute
                              if(findCodeVal(body.object_result, "Manual-mute")=="1") {
                                  saveValue("silent", true, "boolean");
                              } else {
                                  saveValue("silent", false, "boolean");
                              }
              
                              // Zustand Power
                              if(findCodeVal(body.object_result, "Power")=="1") {
                                  saveValue("state", true, "boolean");
                                  saveValue("mode", findCodeVal(body.object_result,"Mode"), "string");
                              } else {
                                  saveValue("state", false, "boolean");
                                  saveValue("mode", "-1", "string");
                              }
                              
                              saveValue("connection", true, "boolean");
          
                              // Durchlauf ENDE
              
                              //log(findCodeVal(body.object_result, "T07"));
                          } else {
                              saveValue("rawJSON", body.objectResult, "string");
                          
                              if(findCodeVal(body.objectResult, "Power")=="1") {
                                  // Stromverbrauch T07 x T14 in Watt
                                  saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T07")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
          
                                  // Lüfter-Drehzahl T17
                                  saveValue("rotor", parseInt(findCodeVal(body.objectResult, "T17")), "number");
                                  // Luftansaug-Temperatur T01
                                  saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T01")), "number");
                                  // Inlet-Temperatur T02
                                  saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T02")), "number");
                                  // outlet-Temperatur T03
                                  saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T03")), "number");
                                  // Coil-Temperatur T04
                                  saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T04")), "number");
                              } else {
                                  saveValue("consumption", 0, "number");
                                  saveValue("rotor", 0, "number");
                              }
          
          
              
                              // Ziel-Temperatur Set_Temp
                              saveValue("tempSet", parseFloat(findCodeVal(body.objectResult, "Set_Temp")), "number");
              
                              // Umgebungs-Temperatur T05
                              saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T05")), "number");
              
                              // Flüstermodus Manual-mute
                              if(findCodeVal(body.objectResult, "Manual-mute")=="1") {
                                  saveValue("silent", true, "boolean");
                              } else {
                                  saveValue("silent", false, "boolean");
                              }
              
                              // Zustand Power
                              if(findCodeVal(body.objectResult, "Power")=="1") {
                                  saveValue("state", true, "boolean");
                                  saveValue("mode", findCodeVal(body.objectResult,"Mode"), "string");
                              } else {
                                  saveValue("state", false, "boolean");
                                  saveValue("mode", "-1", "string");
                              }
                              
                              saveValue("connection", true, "boolean");
          
                              // Durchlauf ENDE
              
                              //log(findCodeVal(body.object_result, "T07"));
                          }
          
                          
                      } else {
                          // Login-Fehler
                          //log("Fehler in updateDeviceDetails(): " + response.body, "error");
                          token = "";
                          device = "";
                          saveValue("connection", false, "boolean");
                      }
                      
                  });
              }
          }
           
          function updateDevicePower(devicecode, power) {
              var powerOpt;
              var powerMode = 2;
           
              if(power==-1) {
                  // aus
                  powerOpt = 0;
                  powerMode = -1;
              } else if(power==0) {
                  // an und kühlen
                  powerOpt = 1;
                  powerMode = 0;
              } else if(power==1) {
                  // an und heizen
                  powerOpt = 1;
                  powerMode = 1;
              } else if(power==2) {
                  // an und auto
                  powerOpt = 1;
                  powerMode = 2;
              } else {
                  log("ungülter Zustand!");
                  return;
              }
           
              if(token!="") {
                  var optionsDev;
          
                  if(apilevel<3) {
                      optionsDev = {
                          url: cloudURL + '/app/device/control.json',
                          headers: { "x-token": token },
                          json: {"param":[{ "device_code": devicecode, "protocol_code": "Power","value": powerOpt }]},
                          method: 'POST',
                          rejectUnauthorized: false
                      };
                  } else {
                      optionsDev = {
                          url: cloudURL + '/app/device/control',
                          headers: { "x-token": token },
                          json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Power","value": powerOpt }]},
                          method: 'POST',
                          rejectUnauthorized: false
                      };
          
                  }
                  
           
                  var request = require('request');
           
                  request(optionsDev,function (error, response, body){
                      //log(devicecode);
                      //log(JSON.stringify(response));
                      //log(JSON.stringify(body.object_result));
           
                      if(parseInt(body.error_code)==0) {
                          saveValue("mode", power, "string");
                          if(power>=0) updateDeviceMode(device, power);
                          
                      } else {
                          log("Zustandsänderung fehlgeschlagen!", "error");
                      }
                      
                  });
              }
          }
           
          function updateDeviceMode(devicecode, mode) {
              
           
              if(token!="") {
                  var optionsDev;
          
                  if(apilevel<3) {
                      optionsDev = {
                          url: cloudURL + '/app/device/control.json',
                          headers: { "x-token": token },
                          json: {"param":[{ "device_code": devicecode, "protocol_code": "mode","value": mode }]},
                          method: 'POST',
                          rejectUnauthorized: false
                          //headers: {"content-type": "application/json"},
                          //charset: 'utf8',
                          //json: true
                          
                      };
                  } else {
                      optionsDev = {
                          url: cloudURL + '/app/device/control',
                          headers: { "x-token": token },
                          json: {"param":[{ "deviceCode": devicecode, "protocolCode": "mode","value": mode }]},
                          method: 'POST',
                          rejectUnauthorized: false
                          //headers: {"content-type": "application/json"},
                          //charset: 'utf8',
                          //json: true
                          
                      };
                  }
                  
           
                  var request = require('request');
           
                  request(optionsDev,function (error, response, body){
                      //log(devicecode);
                      //log(JSON.stringify(response));
                      //log(JSON.stringify(body.object_result));
           
                      if(parseInt(body.error_code)==0) {
                          saveValue("mode", mode, "string");
                          
                          
                      } else {
                          log("Zustandsänderung fehlgeschlagen!", "error");
                          token = "";
                          device = "";
                          saveValue("connection", false, "boolean");
                      }
                      
                  });
              }
          }
           
          function updateDeviceSilent(devicecode, silent) {
              
              var silentMode;
           
              if(silent) {
                  silentMode = "1";
              } else {
                  silentMode = "0";
              }
           
              if(token!="") {
          
                  var optionsDev;
          
                  if(apilevel<3) {
                      optionsDev = {
                          url: cloudURL + '/app/device/control.json',
                          headers: { "x-token": token },
                          json: {"param":[{ "device_code": devicecode, "protocol_code": "Manual-mute","value": silentMode }]},
                          method: 'POST',
                          rejectUnauthorized: false
                          //headers: {"content-type": "application/json"},
                          //charset: 'utf8',
                          //json: true
                          
                      };
                  } else {
                      optionsDev = {
                          url: cloudURL + '/app/device/control',
                          headers: { "x-token": token },
                          json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Manual-mute","value": silentMode }]},
                          method: 'POST',
                          rejectUnauthorized: false
                          //headers: {"content-type": "application/json"},
                          //charset: 'utf8',
                          //json: true
                          
                      };
                  }
                  
           
                  var request = require('request');
           
                  request(optionsDev,function (error, response, body){
                      //log(devicecode);
                      //log(JSON.stringify(response));
                      //log(JSON.stringify(body.object_result));
           
                      if(parseInt(body.error_code)==0) {
                          saveValue("silent", silent, "boolean");
                          
                          
                      } else {
                          log("Zustandsänderung fehlgeschlagen!", "error");
                          token = "";
                          device = "";
                          saveValue("connection", false, "boolean");
                      }
                      
                  });
              }
          }
           
          function updateDeviceSetTemp(devicecode, temperature) {
           
              var sTemperature = temperature.toString().replace(",", ".");
              var sMode = getState(dpRoot + ".mode").val;
              if(sMode=="-1") {
                  //log("Gerät einschalten um Temperatur zu ändern!", 'warn');
                  return;
              } else if(sMode=="0") {
                  sMode = "R01"; // Kühlen
              } else if(sMode=="1") {
                  sMode = "R02"; // Heizen
              } else if(sMode=="2") {
                  sMode = "R03"; // Auto
              }
           
              
           
           
              if(token!="") {
                  var optionsDev;
          
                  if(apilevel<3) {
                      optionsDev = {
                          url: cloudURL + '/app/device/control.json',
                          headers: { "x-token": token },
                          json: {"param":[{ "device_code": devicecode, "protocol_code": "R01","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R02","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R03","value": sTemperature },{ "device_code": devicecode, "protocol_code": "Set_Temp","value": sTemperature }]},
                          method: 'POST',
                          rejectUnauthorized: false
                          //headers: {"content-type": "application/json"},
                          //charset: 'utf8',
                          //json: true
                          
                      };
                  } else {
                      optionsDev = {
                          url: cloudURL + '/app/device/control',
                          headers: { "x-token": token },
                          json: {"param":[{ "deviceCode": devicecode, "protocolCode": "R01","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R02","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R03","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "Set_Temp","value": sTemperature }]},
                          method: 'POST',
                          rejectUnauthorized: false
                          //headers: {"content-type": "application/json"},
                          //charset: 'utf8',
                          //json: true
                          
                      };
          
                  }
                  
           
                  var request = require('request');
           
                  request(optionsDev,function (error, response, body){
                      //log(devicecode);
                      //log(JSON.stringify(response));
                      //log(JSON.stringify(body.object_result));
           
                      if(parseInt(body.error_code)==0) {
                          saveValue("tempSet", temperature, "number");
                          
                          
                      } else {
                          log("Zustandsänderung fehlgeschlagen!", "error");
                          token = "";
                          device = "";
                          saveValue("connection", false, "boolean");
                          //log(JSON.stringify(response));
                      }
                      
                  });
              }
          }
           
          // Beginn des Skripts
          
          setupEndpoints();
          createobjects(); // DPs anlegen
           
          updateToken(); // Zugriffstoken erfragen und aktuelle Werte lesen
           
          schedule('*/' + interval + ' * * * * *', function () {
              // regelmäßig Token und Zustand abfragen
              updateToken();
           
              // gewünschte Änderungen ausführen
              if(!getState(dpRoot + ".mode").ack) {
                  updateDevicePower(device, getState(dpRoot + ".mode").val);
              }
              if(!getState(dpRoot + ".silent").ack) {
                  updateDevicePower(device, getState(dpRoot + ".silent").val);
              }
          });
           
          tokenRefreshTimer = setInterval(function () {
              // Token verfällt nach 60min
              token = "";
              //log("Token nach Intervall verworfen.")
              updateToken();
          }, 3600000);
           
          on({id: dpRoot + ".mode", change: "ne", ack: false}, function (obj) {
              updateToken();
              updateDevicePower(device, getState(dpRoot + ".mode").val);
          });
           
          on({id: dpRoot + ".silent", change: "ne", ack: false}, function (obj) {
              updateToken();
              updateDeviceSilent(device, getState(dpRoot + ".silent").val);
          });
           
          on({id: dpRoot + ".tempSet", change: "ne", ack: false}, function (obj) {
              updateToken();
              updateDeviceSetTemp(device, getState(dpRoot + ".tempSet").val);
          });
          
          
          T P R 3 Antworten Letzte Antwort
          0
          • O oxident

            @pietnb Ich habe jetzt mal angefangen, das ein wenig "in Form" zu gießen.
            Vielleicht machst Du Dir lieber vorher eine Kopie Deines aktuellen Skripts ;-)

            // Midas Poolheizung
            // v0.0.8c
            // Changelog:
            // 0.0.8: Testweise Unterstützung von neu registrierten Anlagen
            // 0.0.7: Kleinigkeiten überarbeitet
            //        weitere Modelle hinzugefügt
            // 0.0.6: Gültigkeitsprüfung des Zertifikats deaktiviert (Dank an znyde)
            //        Kompatibilität mit Promo Next Modellen durch generische Product-ID (Dank an znyde)
            // 0.0.5: weitere Abfragewerte hinzugefügt (Kompressor- und Ansaugtemperatur)
            // 0.0.4: Tokenverfall jetzt 60min nach Skriptstart und nicht zu jeder vollen Stunde (Dank an dering)
            // 0.0.3: Datenpunkte beim Start automatisch anlegen (Dank an Andy200877)
            // 0.0.2: Token bei jedem Set-Vorgang prüfen und ggf. neu anfordern (Dank an dering)
            
            // ANFANG konfigurierbare Elemente -----
            const username = "EMAIL";
            var password = "KENNWORT";
            const interval = 30; // Abfrageintervall in Sekunden
            const dpRoot = "0_userdata.0.Poolheizung"; // Stammordner der Datenpunkte
            var apilevel = 1;   // 1: AquaTemp-Accounts, die vor v.1.5.8 erstellt wurden
                                // 2: HiTemp-Accounts
                                // 3: AquaTemp-Accounts, die mit neueren App-Versionen erstellt wurden
                                
            
            // ENDE --------------------------------
             
            var cloudURL;
            
            var token = "";
            var tokenRefreshTimer;
            var device = "";
            
            // ProductIDs:
            // Gruppe 1:
            // 1132174963097280512: Midas/Poolsana InverPro
            const AQUATEMP_POOLSANA="1132174963097280512";
            // Gruppe 2:
            // 1442284873216843776: 
            const AQUATEMP_OTHER1="1442284873216843776";
            
            var product = "";
            var reachable = false;
            
            function setupEndpoints() {
                if(apilevel==1) {
                    cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                } else if(apilevel==2) {
                    cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                } else if(apilevel==3) {
                    cloudURL = "https://cloud.linked-go.com:449/crmservice/api";
                    password = require('crypto').createHash('md5').update(password).digest("hex");
            
                }
            }
             
            function clearValues() {
                saveValue("error", true, "boolean");
                saveValue("consumption", 0, "number");
                saveValue("state", false, "boolean");
            }
             
            function saveValue(key, value, sType) {
                var dp = dpRoot + "." + key;
             
                if ( !existsState(dp )) {
                    createState(dp,value,{name: key,  type: 'number', role: 'value'}, function () {}); 
                } else {
                    setState(dp,value,true);
                }
            }
             
            function findCodeVal(result, code) {
                //log(code);
                for(var i=0; i<result.length; i++) {
                    //log(result[i].code);
                    
                    if(result[i].code.indexOf(code) >= 0) {
                        return result[i].value;
                    }
                }
                return "";
            }
             
            function createobjects() {
                log ("erstelle Objekte");
                createState(dpRoot + '.ambient', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Umgebungstemperatur"});
                createState(dpRoot + '.connection', {read: true, write: false,  type: "boolean", role: "state", name: "Verbindung", def: false});
                createState(dpRoot + '.consumption', {read: true, write: false,  type: "number", unit:"W", role: "value.power", name: "Stromverbrauch", def: 0});
                createState(dpRoot + '.error', {read: true, write: false,  type: "boolean", role: "state", name: "Fehler", def: false});
                createState(dpRoot + '.errorCode', {read: true, write: false,  type: "string", name: "Fehlercode", def: ""});
                createState(dpRoot + '.errorLevel', {read: true, write: false,  type: "number", name: "Fehlerlevel"});
                createState(dpRoot + '.errorMessage', {read: true, write: false,  type: "string", name: "Fehlermeldung", def: ""});
                createState(dpRoot + '.mode', {read: true, write: true,  type: "string", states: "-1:off;0:cool;1:heat;2:auto", name: "Modus", def: ""});
                createState(dpRoot + '.rotor', {read: true, write: false,  type: "number", unit:"rpm", def: 0, name: "Lüfterdrehzahl"});
                createState(dpRoot + '.silent', {read: true, write: true,  type: "boolean", role: "state", name: "Silent", def: false});
                createState(dpRoot + '.state', {read: true, write: false,  type: "boolean", role: "state", name: "Status", def: false});
                createState(dpRoot + '.tempIn', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Eingangstemperatur"});
                createState(dpRoot + '.tempOut', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Ausgangstemperatur"});
                createState(dpRoot + '.tempSet', {read: true, write: true,  type: "number", unit:"°C", role: "level.temperature", name: "Solltemperatur"});
                createState(dpRoot + '.suctionTemp', {read: true, write: false,  type: "number", unit:"°C", name: "Luftansaugtemperatur"});
                createState(dpRoot + '.coilTemp', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Kompressortemperatur"});
                
                createState(dpRoot + '.rawJSON', {read: true, write: false,  type: "array", name: "komplette Rückgabe"});
            }
             
            function updateToken() {
             
                if(token=="") {
                    //log("Token Neuanforderung");
                    var request = require('request');
                    var options;
                
                    if(apilevel<3) {
                        options = {
                            url: cloudURL + '/app/user/login.json',
                            method: 'POST',
                            json: { "user_name": username, "password": password, "type": "2" },
                            rejectUnauthorized: false
                        };
                    } else {
                        options = {
                            url: cloudURL + '/app/user/login',
                            method: 'POST',
                            json: { "userName": username, "password": password, "type": "2" },
                            rejectUnauthorized: false
                        };
                    }
                    
            
                    //log(JSON.stringify(options));
                    
                    request(options,function (error, response, body){
                    
                        //log(JSON.stringify(response));
                        if(parseInt(body.error_code)==0) {
                            
                            if(apilevel<3) {
                                token = body.object_result["x-token"];
                            } else {
                                token = body.objectResult["x-token"];
                            }
                            
                            //log("Login ok! Token " + token);
                            updateDeviceID();
                        } else {
                            // Login-Fehler
                            //log("Login-Fehler in updateToken(): " + response.body, "error");
                            token = "";
                            saveValue("connection", false, "boolean");
                        }
                        
                    });
                } else {
                    updateDeviceID();
                }
             
                
             
                
             
            }
             
            function updateDeviceID() {
                if(token!="") {
                    var optionsDev;
                    if(apilevel<3) {
                        optionsDev = {
                            url: cloudURL + '/app/device/deviceList.json',
                            headers: { "x-token": token },
                            body: {"product_ids": [
                                    "1132174963097280512",
                                    "1186904563333062656",
                                    "1158905952238313472",
                                    "1245226668902080512",
                                    "1442284873216843776",
                                    "1548963836789501952",
                                    ]},
                            method: 'POST',
                            json: true,
                            rejectUnauthorized: false  
                        };
                    } else {
                        optionsDev = {
                            url: cloudURL + '/app/device/deviceList',
                            headers: { "x-token": token },
                            body: {"productIds": [
                                    "1132174963097280512",
                                    "1186904563333062656",
                                    "1158905952238313472",
                                    "1245226668902080512",
                                    "1442284873216843776",
                                    "1548963836789501952",
                                    ]},
                            method: 'POST',
                            json: true,
                            rejectUnauthorized: false  
                        };
                    }
            
                    var request = require('request');
             
                    request(optionsDev,function (error, response, body){
                
                        //log(JSON.stringify(response));
                        //log(JSON.stringify(body.object_result));
             
                        if(parseInt(body.error_code)==0) {
                            
                            //token = body.object_result["x-token"];
                            //log("Login ok! Token " + token);
                            
                            if(apilevel<3) {
                                device = body.object_result[0].device_code;
                                product = body.object_result[0].product_id;
                                reachable = (body.object_result[0].device_status=="ONLINE");
                            } else {
                                device = body.objectResult[0].deviceCode;
                                product = body.object_result[0].productId;
                                reachable = (body.objectResult[0].deviceStatus=="ONLINE");
                            }
            
                            //log(product);
                            
                            if(reachable) {
                                saveValue("connection", true, "boolean");
                                if(device!="") updateDeviceStatus(device);
                            } else {
                                // offline
                                device = "";
                                saveValue("connection", false, "boolean");
                            }
                            
                        } else {
                            // Login-Fehler
                            //log("Fehler in updateDeviceID(): " + response.body, "error");
                            token = "";
                            device = "";
                            reachable = false;
                            saveValue("connection", false, "boolean");
                        }
                        
                    });
                }
            }
             
            function updateDeviceStatus(devicecode) {
                if(token!="") {
                    var optionsDev;
            
                    if(apilevel<3) {
                        optionsDev = {
                            url: cloudURL + '/app/device/getDeviceStatus.json',
                            headers: { "x-token": token },
                            json: { "device_code": devicecode },
                            method: 'POST',
                            rejectUnauthorized: false
                        };
                    } else {
                        optionsDev = {
                            url: cloudURL + '/app/device/getDeviceStatus',
                            headers: { "x-token": token },
                            json: { "deviceCode": devicecode },
                            method: 'POST',
                            rejectUnauthorized: false
                        };
                    }
                    
             
                    var request = require('request');
             
                    request(optionsDev,function (error, response, body){
                
                        //log(JSON.stringify(response));
                        //log(JSON.stringify(body.object_result));
             
                        if(parseInt(body.error_code)==0) {
            
                            if(apilevel<3) {
                                if(body.object_result["is_fault"]==true) {
                                    // TODO: Fehlerbeschreibung abrufen
                                    //clearValues();
                                    saveValue("error", true, "boolean");
                                    updateDeviceDetails(devicecode);
                                    updateDeviceErrorMsg(devicecode);
                                } else {
                                    // kein Fehler
                                    saveValue("error", false, "boolean");
                                    saveValue("errorMessage", "", "string");
                                    saveValue("errorCode", "", "string");
                                    saveValue("errorLevel", 0, "number");
                                    updateDeviceDetails(devicecode);
                                }
                            } else {
                                if(body.objectResult["is_fault"]==true) {
                                    // TODO: Fehlerbeschreibung abrufen
                                    //clearValues();
                                    saveValue("error", true, "boolean");
                                    updateDeviceDetails(devicecode);
                                    updateDeviceErrorMsg(devicecode);
                                } else {
                                    // kein Fehler
                                    saveValue("error", false, "boolean");
                                    saveValue("errorMessage", "", "string");
                                    saveValue("errorCode", "", "string");
                                    saveValue("errorLevel", 0, "number");
                                    updateDeviceDetails(devicecode);
                                }
                            }
             
                            
                            
                            //token = body.object_result["x-token"];
                            //log("Login ok! Token " + token);
                            
                        } else {
                            // Login-Fehler
                            //log("Fehler in updateDeviceStatus(): " + response.body, "error");
                            token = "";
                            device = "";
                            saveValue("connection", false, "boolean");
                        }
                        
                    });
                }
            }
             
            function updateDeviceErrorMsg(devicecode) {
                if(token!="") {
                    var optionsDev;
            
                    if(apilevel<3) {
                        optionsDev = {
                            url: cloudURL + '/app/device/getFaultDataByDeviceCode.json',
                            headers: { "x-token": token },
                            json: { "device_code": devicecode },
                            method: 'POST',
                            rejectUnauthorized: false
                            //headers: {"content-type": "application/json"},
                            //charset: 'utf8',
                            //json: true
                            
                        };
                    } else {
                        optionsDev = {
                            url: cloudURL + '/app/device/getFaultDataByDeviceCode',
                            headers: { "x-token": token },
                            json: { "deviceCode": devicecode },
                            method: 'POST',
                            rejectUnauthorized: false
                            //headers: {"content-type": "application/json"},
                            //charset: 'utf8',
                            //json: true
                            
                        };
                    }
                    
             
                    var request = require('request');
             
                    request(optionsDev,function (error, response, body){
                
                        //log(JSON.stringify(response));
                        //log(JSON.stringify(body.object_result));
             
                        if(parseInt(body.error_code)==0) {
             
                            
                            saveValue("error", true, "boolean");
            
                            if(apilevel<3) {
                                saveValue("errorMessage", body.object_result[0].description, "string");
                                saveValue("errorCode", body.object_result[0].fault_code, "string");
                                saveValue("errorLevel", body.object_result[0].error_level, "string");
                            } else {
                                saveValue("errorMessage", body.objectResult[0].description, "string");
                                saveValue("errorCode", body.objectResult[0].fault_code, "string");
                                saveValue("errorLevel", body.objectResult[0].error_level, "string");
                            }
                            
                            
                        } else {
                            // Login-Fehler
                            //log("Fehler in updateDeviceErrorMsg(): " + response.body, "error");
                            token = "";
                            device = "";
                            saveValue("connection", false, "boolean");
                        }
                        
                    });
                }
            }
             
            function updateDeviceDetails(devicecode) {
                if(token!="") {
                    var optionsDev;
            
                    if(apilevel<3) {
                        if(product==AQUATEMP_POOLSANA) {
                            optionsDev = {
                                url: cloudURL + '/app/device/getDataByCode.json',
                                headers: { "x-token": token },
                                json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                // "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05"]
                                method: 'POST',
                                rejectUnauthorized: false
                            
                            };
                        } else if(product==AQUATEMP_OTHER1) {
                            optionsDev = {
                                url: cloudURL + '/app/device/getDataByCode.json',
                                headers: { "x-token": token },
                                json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T4","T5","T7","T14","T17"] },
                                method: 'POST',
                                rejectUnauthorized: false
                            
                            };
                        }
                        
                    } else {
                        if(product==AQUATEMP_POOLSANA) {
                            optionsDev = {
                                url: cloudURL + '/app/device/getDataByCode',
                                headers: { "x-token": token },
                                json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                method: 'POST',
                                rejectUnauthorized: false
                            
                            };
                        } else if (product==AQUATEMP_OTHER1) {
                            optionsDev = {
                                url: cloudURL + '/app/device/getDataByCode',
                                headers: { "x-token": token },
                                json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T4","T5","T7","T14","T17"] },
                                method: 'POST',
                                rejectUnauthorized: false
                            
                            };
                        }
                        
            
                    }
                    
             
                    var request = require('request');
             
                    request(optionsDev,function (error, response, body){
             
             
                        if(parseInt(body.error_code)==0) {
            
                            if(apilevel<3) {
                                saveValue("rawJSON", body.object_result, "string");
                                
                                if(findCodeVal(body.object_result, "Power")=="1") {
                                    if(product==AQUATEMP_POOLSANA) {
                                        // Stromverbrauch T07 x T14 in Watt
                                        saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T07")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                        // Luftansaug-Temperatur T01
                                        saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T01")), "number");
                                        // Inlet-Temperatur T02
                                        saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T02")), "number");
                                        // outlet-Temperatur T03
                                        saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T03")), "number");
                                        // Coil-Temperatur T04
                                        saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T04")), "number");
                                        // Umgebungs-Temperatur T05
                                        saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T05")), "number");
                                    } else if (product==AQUATEMP_OTHER1) {
                                        // Stromverbrauch T7 x T14 in Watt
                                        saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T7")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                        // Luftansaug-Temperatur T1
                                        saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T1")), "number");
                                        // Inlet-Temperatur T2
                                        saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T2")), "number");
                                        // outlet-Temperatur T3
                                        saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T3")), "number");
                                        // Coil-Temperatur T4
                                        saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T4")), "number");
                                        // Umgebungs-Temperatur T5
                                        saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T5")), "number");
                                    }
                                
                                    // Lüfter-Drehzahl T17
                                    saveValue("rotor", parseInt(findCodeVal(body.object_result, "T17")), "number");
                                  
                                    
                                } else {
                                    saveValue("consumption", 0, "number");
                                    saveValue("rotor", 0, "number");
                                }
                
                                // Ziel-Temperatur Set_Temp
                                saveValue("tempSet", parseFloat(findCodeVal(body.object_result, "Set_Temp")), "number");
                    
                                // Flüstermodus Manual-mute
                                if(findCodeVal(body.object_result, "Manual-mute")=="1") {
                                    saveValue("silent", true, "boolean");
                                } else {
                                    saveValue("silent", false, "boolean");
                                }
                
                                // Zustand Power
                                if(findCodeVal(body.object_result, "Power")=="1") {
                                    saveValue("state", true, "boolean");
                                    saveValue("mode", findCodeVal(body.object_result,"Mode"), "string");
                                } else {
                                    saveValue("state", false, "boolean");
                                    saveValue("mode", "-1", "string");
                                }
                                
                                saveValue("connection", true, "boolean");
            
                                // Durchlauf ENDE
                
                                //log(findCodeVal(body.object_result, "T07"));
                            } else {
                                saveValue("rawJSON", body.objectResult, "string");
                            
                                if(findCodeVal(body.objectResult, "Power")=="1") {
                                    // Stromverbrauch T07 x T14 in Watt
                                    saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T07")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
            
                                    // Lüfter-Drehzahl T17
                                    saveValue("rotor", parseInt(findCodeVal(body.objectResult, "T17")), "number");
                                    // Luftansaug-Temperatur T01
                                    saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T01")), "number");
                                    // Inlet-Temperatur T02
                                    saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T02")), "number");
                                    // outlet-Temperatur T03
                                    saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T03")), "number");
                                    // Coil-Temperatur T04
                                    saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T04")), "number");
                                } else {
                                    saveValue("consumption", 0, "number");
                                    saveValue("rotor", 0, "number");
                                }
            
            
                
                                // Ziel-Temperatur Set_Temp
                                saveValue("tempSet", parseFloat(findCodeVal(body.objectResult, "Set_Temp")), "number");
                
                                // Umgebungs-Temperatur T05
                                saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T05")), "number");
                
                                // Flüstermodus Manual-mute
                                if(findCodeVal(body.objectResult, "Manual-mute")=="1") {
                                    saveValue("silent", true, "boolean");
                                } else {
                                    saveValue("silent", false, "boolean");
                                }
                
                                // Zustand Power
                                if(findCodeVal(body.objectResult, "Power")=="1") {
                                    saveValue("state", true, "boolean");
                                    saveValue("mode", findCodeVal(body.objectResult,"Mode"), "string");
                                } else {
                                    saveValue("state", false, "boolean");
                                    saveValue("mode", "-1", "string");
                                }
                                
                                saveValue("connection", true, "boolean");
            
                                // Durchlauf ENDE
                
                                //log(findCodeVal(body.object_result, "T07"));
                            }
            
                            
                        } else {
                            // Login-Fehler
                            //log("Fehler in updateDeviceDetails(): " + response.body, "error");
                            token = "";
                            device = "";
                            saveValue("connection", false, "boolean");
                        }
                        
                    });
                }
            }
             
            function updateDevicePower(devicecode, power) {
                var powerOpt;
                var powerMode = 2;
             
                if(power==-1) {
                    // aus
                    powerOpt = 0;
                    powerMode = -1;
                } else if(power==0) {
                    // an und kühlen
                    powerOpt = 1;
                    powerMode = 0;
                } else if(power==1) {
                    // an und heizen
                    powerOpt = 1;
                    powerMode = 1;
                } else if(power==2) {
                    // an und auto
                    powerOpt = 1;
                    powerMode = 2;
                } else {
                    log("ungülter Zustand!");
                    return;
                }
             
                if(token!="") {
                    var optionsDev;
            
                    if(apilevel<3) {
                        optionsDev = {
                            url: cloudURL + '/app/device/control.json',
                            headers: { "x-token": token },
                            json: {"param":[{ "device_code": devicecode, "protocol_code": "Power","value": powerOpt }]},
                            method: 'POST',
                            rejectUnauthorized: false
                        };
                    } else {
                        optionsDev = {
                            url: cloudURL + '/app/device/control',
                            headers: { "x-token": token },
                            json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Power","value": powerOpt }]},
                            method: 'POST',
                            rejectUnauthorized: false
                        };
            
                    }
                    
             
                    var request = require('request');
             
                    request(optionsDev,function (error, response, body){
                        //log(devicecode);
                        //log(JSON.stringify(response));
                        //log(JSON.stringify(body.object_result));
             
                        if(parseInt(body.error_code)==0) {
                            saveValue("mode", power, "string");
                            if(power>=0) updateDeviceMode(device, power);
                            
                        } else {
                            log("Zustandsänderung fehlgeschlagen!", "error");
                        }
                        
                    });
                }
            }
             
            function updateDeviceMode(devicecode, mode) {
                
             
                if(token!="") {
                    var optionsDev;
            
                    if(apilevel<3) {
                        optionsDev = {
                            url: cloudURL + '/app/device/control.json',
                            headers: { "x-token": token },
                            json: {"param":[{ "device_code": devicecode, "protocol_code": "mode","value": mode }]},
                            method: 'POST',
                            rejectUnauthorized: false
                            //headers: {"content-type": "application/json"},
                            //charset: 'utf8',
                            //json: true
                            
                        };
                    } else {
                        optionsDev = {
                            url: cloudURL + '/app/device/control',
                            headers: { "x-token": token },
                            json: {"param":[{ "deviceCode": devicecode, "protocolCode": "mode","value": mode }]},
                            method: 'POST',
                            rejectUnauthorized: false
                            //headers: {"content-type": "application/json"},
                            //charset: 'utf8',
                            //json: true
                            
                        };
                    }
                    
             
                    var request = require('request');
             
                    request(optionsDev,function (error, response, body){
                        //log(devicecode);
                        //log(JSON.stringify(response));
                        //log(JSON.stringify(body.object_result));
             
                        if(parseInt(body.error_code)==0) {
                            saveValue("mode", mode, "string");
                            
                            
                        } else {
                            log("Zustandsänderung fehlgeschlagen!", "error");
                            token = "";
                            device = "";
                            saveValue("connection", false, "boolean");
                        }
                        
                    });
                }
            }
             
            function updateDeviceSilent(devicecode, silent) {
                
                var silentMode;
             
                if(silent) {
                    silentMode = "1";
                } else {
                    silentMode = "0";
                }
             
                if(token!="") {
            
                    var optionsDev;
            
                    if(apilevel<3) {
                        optionsDev = {
                            url: cloudURL + '/app/device/control.json',
                            headers: { "x-token": token },
                            json: {"param":[{ "device_code": devicecode, "protocol_code": "Manual-mute","value": silentMode }]},
                            method: 'POST',
                            rejectUnauthorized: false
                            //headers: {"content-type": "application/json"},
                            //charset: 'utf8',
                            //json: true
                            
                        };
                    } else {
                        optionsDev = {
                            url: cloudURL + '/app/device/control',
                            headers: { "x-token": token },
                            json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Manual-mute","value": silentMode }]},
                            method: 'POST',
                            rejectUnauthorized: false
                            //headers: {"content-type": "application/json"},
                            //charset: 'utf8',
                            //json: true
                            
                        };
                    }
                    
             
                    var request = require('request');
             
                    request(optionsDev,function (error, response, body){
                        //log(devicecode);
                        //log(JSON.stringify(response));
                        //log(JSON.stringify(body.object_result));
             
                        if(parseInt(body.error_code)==0) {
                            saveValue("silent", silent, "boolean");
                            
                            
                        } else {
                            log("Zustandsänderung fehlgeschlagen!", "error");
                            token = "";
                            device = "";
                            saveValue("connection", false, "boolean");
                        }
                        
                    });
                }
            }
             
            function updateDeviceSetTemp(devicecode, temperature) {
             
                var sTemperature = temperature.toString().replace(",", ".");
                var sMode = getState(dpRoot + ".mode").val;
                if(sMode=="-1") {
                    //log("Gerät einschalten um Temperatur zu ändern!", 'warn');
                    return;
                } else if(sMode=="0") {
                    sMode = "R01"; // Kühlen
                } else if(sMode=="1") {
                    sMode = "R02"; // Heizen
                } else if(sMode=="2") {
                    sMode = "R03"; // Auto
                }
             
                
             
             
                if(token!="") {
                    var optionsDev;
            
                    if(apilevel<3) {
                        optionsDev = {
                            url: cloudURL + '/app/device/control.json',
                            headers: { "x-token": token },
                            json: {"param":[{ "device_code": devicecode, "protocol_code": "R01","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R02","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R03","value": sTemperature },{ "device_code": devicecode, "protocol_code": "Set_Temp","value": sTemperature }]},
                            method: 'POST',
                            rejectUnauthorized: false
                            //headers: {"content-type": "application/json"},
                            //charset: 'utf8',
                            //json: true
                            
                        };
                    } else {
                        optionsDev = {
                            url: cloudURL + '/app/device/control',
                            headers: { "x-token": token },
                            json: {"param":[{ "deviceCode": devicecode, "protocolCode": "R01","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R02","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R03","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "Set_Temp","value": sTemperature }]},
                            method: 'POST',
                            rejectUnauthorized: false
                            //headers: {"content-type": "application/json"},
                            //charset: 'utf8',
                            //json: true
                            
                        };
            
                    }
                    
             
                    var request = require('request');
             
                    request(optionsDev,function (error, response, body){
                        //log(devicecode);
                        //log(JSON.stringify(response));
                        //log(JSON.stringify(body.object_result));
             
                        if(parseInt(body.error_code)==0) {
                            saveValue("tempSet", temperature, "number");
                            
                            
                        } else {
                            log("Zustandsänderung fehlgeschlagen!", "error");
                            token = "";
                            device = "";
                            saveValue("connection", false, "boolean");
                            //log(JSON.stringify(response));
                        }
                        
                    });
                }
            }
             
            // Beginn des Skripts
            
            setupEndpoints();
            createobjects(); // DPs anlegen
             
            updateToken(); // Zugriffstoken erfragen und aktuelle Werte lesen
             
            schedule('*/' + interval + ' * * * * *', function () {
                // regelmäßig Token und Zustand abfragen
                updateToken();
             
                // gewünschte Änderungen ausführen
                if(!getState(dpRoot + ".mode").ack) {
                    updateDevicePower(device, getState(dpRoot + ".mode").val);
                }
                if(!getState(dpRoot + ".silent").ack) {
                    updateDevicePower(device, getState(dpRoot + ".silent").val);
                }
            });
             
            tokenRefreshTimer = setInterval(function () {
                // Token verfällt nach 60min
                token = "";
                //log("Token nach Intervall verworfen.")
                updateToken();
            }, 3600000);
             
            on({id: dpRoot + ".mode", change: "ne", ack: false}, function (obj) {
                updateToken();
                updateDevicePower(device, getState(dpRoot + ".mode").val);
            });
             
            on({id: dpRoot + ".silent", change: "ne", ack: false}, function (obj) {
                updateToken();
                updateDeviceSilent(device, getState(dpRoot + ".silent").val);
            });
             
            on({id: dpRoot + ".tempSet", change: "ne", ack: false}, function (obj) {
                updateToken();
                updateDeviceSetTemp(device, getState(dpRoot + ".tempSet").val);
            });
            
            
            T Offline
            T Offline
            tklein
            schrieb am zuletzt editiert von
            #151

            @oxident hi, ist das die aktuellste version des scriptes?

            O 1 Antwort Letzte Antwort
            0
            • O oxident

              @pietnb Ich habe jetzt mal angefangen, das ein wenig "in Form" zu gießen.
              Vielleicht machst Du Dir lieber vorher eine Kopie Deines aktuellen Skripts ;-)

              // Midas Poolheizung
              // v0.0.8c
              // Changelog:
              // 0.0.8: Testweise Unterstützung von neu registrierten Anlagen
              // 0.0.7: Kleinigkeiten überarbeitet
              //        weitere Modelle hinzugefügt
              // 0.0.6: Gültigkeitsprüfung des Zertifikats deaktiviert (Dank an znyde)
              //        Kompatibilität mit Promo Next Modellen durch generische Product-ID (Dank an znyde)
              // 0.0.5: weitere Abfragewerte hinzugefügt (Kompressor- und Ansaugtemperatur)
              // 0.0.4: Tokenverfall jetzt 60min nach Skriptstart und nicht zu jeder vollen Stunde (Dank an dering)
              // 0.0.3: Datenpunkte beim Start automatisch anlegen (Dank an Andy200877)
              // 0.0.2: Token bei jedem Set-Vorgang prüfen und ggf. neu anfordern (Dank an dering)
              
              // ANFANG konfigurierbare Elemente -----
              const username = "EMAIL";
              var password = "KENNWORT";
              const interval = 30; // Abfrageintervall in Sekunden
              const dpRoot = "0_userdata.0.Poolheizung"; // Stammordner der Datenpunkte
              var apilevel = 1;   // 1: AquaTemp-Accounts, die vor v.1.5.8 erstellt wurden
                                  // 2: HiTemp-Accounts
                                  // 3: AquaTemp-Accounts, die mit neueren App-Versionen erstellt wurden
                                  
              
              // ENDE --------------------------------
               
              var cloudURL;
              
              var token = "";
              var tokenRefreshTimer;
              var device = "";
              
              // ProductIDs:
              // Gruppe 1:
              // 1132174963097280512: Midas/Poolsana InverPro
              const AQUATEMP_POOLSANA="1132174963097280512";
              // Gruppe 2:
              // 1442284873216843776: 
              const AQUATEMP_OTHER1="1442284873216843776";
              
              var product = "";
              var reachable = false;
              
              function setupEndpoints() {
                  if(apilevel==1) {
                      cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                  } else if(apilevel==2) {
                      cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                  } else if(apilevel==3) {
                      cloudURL = "https://cloud.linked-go.com:449/crmservice/api";
                      password = require('crypto').createHash('md5').update(password).digest("hex");
              
                  }
              }
               
              function clearValues() {
                  saveValue("error", true, "boolean");
                  saveValue("consumption", 0, "number");
                  saveValue("state", false, "boolean");
              }
               
              function saveValue(key, value, sType) {
                  var dp = dpRoot + "." + key;
               
                  if ( !existsState(dp )) {
                      createState(dp,value,{name: key,  type: 'number', role: 'value'}, function () {}); 
                  } else {
                      setState(dp,value,true);
                  }
              }
               
              function findCodeVal(result, code) {
                  //log(code);
                  for(var i=0; i<result.length; i++) {
                      //log(result[i].code);
                      
                      if(result[i].code.indexOf(code) >= 0) {
                          return result[i].value;
                      }
                  }
                  return "";
              }
               
              function createobjects() {
                  log ("erstelle Objekte");
                  createState(dpRoot + '.ambient', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Umgebungstemperatur"});
                  createState(dpRoot + '.connection', {read: true, write: false,  type: "boolean", role: "state", name: "Verbindung", def: false});
                  createState(dpRoot + '.consumption', {read: true, write: false,  type: "number", unit:"W", role: "value.power", name: "Stromverbrauch", def: 0});
                  createState(dpRoot + '.error', {read: true, write: false,  type: "boolean", role: "state", name: "Fehler", def: false});
                  createState(dpRoot + '.errorCode', {read: true, write: false,  type: "string", name: "Fehlercode", def: ""});
                  createState(dpRoot + '.errorLevel', {read: true, write: false,  type: "number", name: "Fehlerlevel"});
                  createState(dpRoot + '.errorMessage', {read: true, write: false,  type: "string", name: "Fehlermeldung", def: ""});
                  createState(dpRoot + '.mode', {read: true, write: true,  type: "string", states: "-1:off;0:cool;1:heat;2:auto", name: "Modus", def: ""});
                  createState(dpRoot + '.rotor', {read: true, write: false,  type: "number", unit:"rpm", def: 0, name: "Lüfterdrehzahl"});
                  createState(dpRoot + '.silent', {read: true, write: true,  type: "boolean", role: "state", name: "Silent", def: false});
                  createState(dpRoot + '.state', {read: true, write: false,  type: "boolean", role: "state", name: "Status", def: false});
                  createState(dpRoot + '.tempIn', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Eingangstemperatur"});
                  createState(dpRoot + '.tempOut', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Ausgangstemperatur"});
                  createState(dpRoot + '.tempSet', {read: true, write: true,  type: "number", unit:"°C", role: "level.temperature", name: "Solltemperatur"});
                  createState(dpRoot + '.suctionTemp', {read: true, write: false,  type: "number", unit:"°C", name: "Luftansaugtemperatur"});
                  createState(dpRoot + '.coilTemp', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Kompressortemperatur"});
                  
                  createState(dpRoot + '.rawJSON', {read: true, write: false,  type: "array", name: "komplette Rückgabe"});
              }
               
              function updateToken() {
               
                  if(token=="") {
                      //log("Token Neuanforderung");
                      var request = require('request');
                      var options;
                  
                      if(apilevel<3) {
                          options = {
                              url: cloudURL + '/app/user/login.json',
                              method: 'POST',
                              json: { "user_name": username, "password": password, "type": "2" },
                              rejectUnauthorized: false
                          };
                      } else {
                          options = {
                              url: cloudURL + '/app/user/login',
                              method: 'POST',
                              json: { "userName": username, "password": password, "type": "2" },
                              rejectUnauthorized: false
                          };
                      }
                      
              
                      //log(JSON.stringify(options));
                      
                      request(options,function (error, response, body){
                      
                          //log(JSON.stringify(response));
                          if(parseInt(body.error_code)==0) {
                              
                              if(apilevel<3) {
                                  token = body.object_result["x-token"];
                              } else {
                                  token = body.objectResult["x-token"];
                              }
                              
                              //log("Login ok! Token " + token);
                              updateDeviceID();
                          } else {
                              // Login-Fehler
                              //log("Login-Fehler in updateToken(): " + response.body, "error");
                              token = "";
                              saveValue("connection", false, "boolean");
                          }
                          
                      });
                  } else {
                      updateDeviceID();
                  }
               
                  
               
                  
               
              }
               
              function updateDeviceID() {
                  if(token!="") {
                      var optionsDev;
                      if(apilevel<3) {
                          optionsDev = {
                              url: cloudURL + '/app/device/deviceList.json',
                              headers: { "x-token": token },
                              body: {"product_ids": [
                                      "1132174963097280512",
                                      "1186904563333062656",
                                      "1158905952238313472",
                                      "1245226668902080512",
                                      "1442284873216843776",
                                      "1548963836789501952",
                                      ]},
                              method: 'POST',
                              json: true,
                              rejectUnauthorized: false  
                          };
                      } else {
                          optionsDev = {
                              url: cloudURL + '/app/device/deviceList',
                              headers: { "x-token": token },
                              body: {"productIds": [
                                      "1132174963097280512",
                                      "1186904563333062656",
                                      "1158905952238313472",
                                      "1245226668902080512",
                                      "1442284873216843776",
                                      "1548963836789501952",
                                      ]},
                              method: 'POST',
                              json: true,
                              rejectUnauthorized: false  
                          };
                      }
              
                      var request = require('request');
               
                      request(optionsDev,function (error, response, body){
                  
                          //log(JSON.stringify(response));
                          //log(JSON.stringify(body.object_result));
               
                          if(parseInt(body.error_code)==0) {
                              
                              //token = body.object_result["x-token"];
                              //log("Login ok! Token " + token);
                              
                              if(apilevel<3) {
                                  device = body.object_result[0].device_code;
                                  product = body.object_result[0].product_id;
                                  reachable = (body.object_result[0].device_status=="ONLINE");
                              } else {
                                  device = body.objectResult[0].deviceCode;
                                  product = body.object_result[0].productId;
                                  reachable = (body.objectResult[0].deviceStatus=="ONLINE");
                              }
              
                              //log(product);
                              
                              if(reachable) {
                                  saveValue("connection", true, "boolean");
                                  if(device!="") updateDeviceStatus(device);
                              } else {
                                  // offline
                                  device = "";
                                  saveValue("connection", false, "boolean");
                              }
                              
                          } else {
                              // Login-Fehler
                              //log("Fehler in updateDeviceID(): " + response.body, "error");
                              token = "";
                              device = "";
                              reachable = false;
                              saveValue("connection", false, "boolean");
                          }
                          
                      });
                  }
              }
               
              function updateDeviceStatus(devicecode) {
                  if(token!="") {
                      var optionsDev;
              
                      if(apilevel<3) {
                          optionsDev = {
                              url: cloudURL + '/app/device/getDeviceStatus.json',
                              headers: { "x-token": token },
                              json: { "device_code": devicecode },
                              method: 'POST',
                              rejectUnauthorized: false
                          };
                      } else {
                          optionsDev = {
                              url: cloudURL + '/app/device/getDeviceStatus',
                              headers: { "x-token": token },
                              json: { "deviceCode": devicecode },
                              method: 'POST',
                              rejectUnauthorized: false
                          };
                      }
                      
               
                      var request = require('request');
               
                      request(optionsDev,function (error, response, body){
                  
                          //log(JSON.stringify(response));
                          //log(JSON.stringify(body.object_result));
               
                          if(parseInt(body.error_code)==0) {
              
                              if(apilevel<3) {
                                  if(body.object_result["is_fault"]==true) {
                                      // TODO: Fehlerbeschreibung abrufen
                                      //clearValues();
                                      saveValue("error", true, "boolean");
                                      updateDeviceDetails(devicecode);
                                      updateDeviceErrorMsg(devicecode);
                                  } else {
                                      // kein Fehler
                                      saveValue("error", false, "boolean");
                                      saveValue("errorMessage", "", "string");
                                      saveValue("errorCode", "", "string");
                                      saveValue("errorLevel", 0, "number");
                                      updateDeviceDetails(devicecode);
                                  }
                              } else {
                                  if(body.objectResult["is_fault"]==true) {
                                      // TODO: Fehlerbeschreibung abrufen
                                      //clearValues();
                                      saveValue("error", true, "boolean");
                                      updateDeviceDetails(devicecode);
                                      updateDeviceErrorMsg(devicecode);
                                  } else {
                                      // kein Fehler
                                      saveValue("error", false, "boolean");
                                      saveValue("errorMessage", "", "string");
                                      saveValue("errorCode", "", "string");
                                      saveValue("errorLevel", 0, "number");
                                      updateDeviceDetails(devicecode);
                                  }
                              }
               
                              
                              
                              //token = body.object_result["x-token"];
                              //log("Login ok! Token " + token);
                              
                          } else {
                              // Login-Fehler
                              //log("Fehler in updateDeviceStatus(): " + response.body, "error");
                              token = "";
                              device = "";
                              saveValue("connection", false, "boolean");
                          }
                          
                      });
                  }
              }
               
              function updateDeviceErrorMsg(devicecode) {
                  if(token!="") {
                      var optionsDev;
              
                      if(apilevel<3) {
                          optionsDev = {
                              url: cloudURL + '/app/device/getFaultDataByDeviceCode.json',
                              headers: { "x-token": token },
                              json: { "device_code": devicecode },
                              method: 'POST',
                              rejectUnauthorized: false
                              //headers: {"content-type": "application/json"},
                              //charset: 'utf8',
                              //json: true
                              
                          };
                      } else {
                          optionsDev = {
                              url: cloudURL + '/app/device/getFaultDataByDeviceCode',
                              headers: { "x-token": token },
                              json: { "deviceCode": devicecode },
                              method: 'POST',
                              rejectUnauthorized: false
                              //headers: {"content-type": "application/json"},
                              //charset: 'utf8',
                              //json: true
                              
                          };
                      }
                      
               
                      var request = require('request');
               
                      request(optionsDev,function (error, response, body){
                  
                          //log(JSON.stringify(response));
                          //log(JSON.stringify(body.object_result));
               
                          if(parseInt(body.error_code)==0) {
               
                              
                              saveValue("error", true, "boolean");
              
                              if(apilevel<3) {
                                  saveValue("errorMessage", body.object_result[0].description, "string");
                                  saveValue("errorCode", body.object_result[0].fault_code, "string");
                                  saveValue("errorLevel", body.object_result[0].error_level, "string");
                              } else {
                                  saveValue("errorMessage", body.objectResult[0].description, "string");
                                  saveValue("errorCode", body.objectResult[0].fault_code, "string");
                                  saveValue("errorLevel", body.objectResult[0].error_level, "string");
                              }
                              
                              
                          } else {
                              // Login-Fehler
                              //log("Fehler in updateDeviceErrorMsg(): " + response.body, "error");
                              token = "";
                              device = "";
                              saveValue("connection", false, "boolean");
                          }
                          
                      });
                  }
              }
               
              function updateDeviceDetails(devicecode) {
                  if(token!="") {
                      var optionsDev;
              
                      if(apilevel<3) {
                          if(product==AQUATEMP_POOLSANA) {
                              optionsDev = {
                                  url: cloudURL + '/app/device/getDataByCode.json',
                                  headers: { "x-token": token },
                                  json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                  // "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05"]
                                  method: 'POST',
                                  rejectUnauthorized: false
                              
                              };
                          } else if(product==AQUATEMP_OTHER1) {
                              optionsDev = {
                                  url: cloudURL + '/app/device/getDataByCode.json',
                                  headers: { "x-token": token },
                                  json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T4","T5","T7","T14","T17"] },
                                  method: 'POST',
                                  rejectUnauthorized: false
                              
                              };
                          }
                          
                      } else {
                          if(product==AQUATEMP_POOLSANA) {
                              optionsDev = {
                                  url: cloudURL + '/app/device/getDataByCode',
                                  headers: { "x-token": token },
                                  json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                  method: 'POST',
                                  rejectUnauthorized: false
                              
                              };
                          } else if (product==AQUATEMP_OTHER1) {
                              optionsDev = {
                                  url: cloudURL + '/app/device/getDataByCode',
                                  headers: { "x-token": token },
                                  json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T4","T5","T7","T14","T17"] },
                                  method: 'POST',
                                  rejectUnauthorized: false
                              
                              };
                          }
                          
              
                      }
                      
               
                      var request = require('request');
               
                      request(optionsDev,function (error, response, body){
               
               
                          if(parseInt(body.error_code)==0) {
              
                              if(apilevel<3) {
                                  saveValue("rawJSON", body.object_result, "string");
                                  
                                  if(findCodeVal(body.object_result, "Power")=="1") {
                                      if(product==AQUATEMP_POOLSANA) {
                                          // Stromverbrauch T07 x T14 in Watt
                                          saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T07")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                          // Luftansaug-Temperatur T01
                                          saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T01")), "number");
                                          // Inlet-Temperatur T02
                                          saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T02")), "number");
                                          // outlet-Temperatur T03
                                          saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T03")), "number");
                                          // Coil-Temperatur T04
                                          saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T04")), "number");
                                          // Umgebungs-Temperatur T05
                                          saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T05")), "number");
                                      } else if (product==AQUATEMP_OTHER1) {
                                          // Stromverbrauch T7 x T14 in Watt
                                          saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T7")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                          // Luftansaug-Temperatur T1
                                          saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T1")), "number");
                                          // Inlet-Temperatur T2
                                          saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T2")), "number");
                                          // outlet-Temperatur T3
                                          saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T3")), "number");
                                          // Coil-Temperatur T4
                                          saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T4")), "number");
                                          // Umgebungs-Temperatur T5
                                          saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T5")), "number");
                                      }
                                  
                                      // Lüfter-Drehzahl T17
                                      saveValue("rotor", parseInt(findCodeVal(body.object_result, "T17")), "number");
                                    
                                      
                                  } else {
                                      saveValue("consumption", 0, "number");
                                      saveValue("rotor", 0, "number");
                                  }
                  
                                  // Ziel-Temperatur Set_Temp
                                  saveValue("tempSet", parseFloat(findCodeVal(body.object_result, "Set_Temp")), "number");
                      
                                  // Flüstermodus Manual-mute
                                  if(findCodeVal(body.object_result, "Manual-mute")=="1") {
                                      saveValue("silent", true, "boolean");
                                  } else {
                                      saveValue("silent", false, "boolean");
                                  }
                  
                                  // Zustand Power
                                  if(findCodeVal(body.object_result, "Power")=="1") {
                                      saveValue("state", true, "boolean");
                                      saveValue("mode", findCodeVal(body.object_result,"Mode"), "string");
                                  } else {
                                      saveValue("state", false, "boolean");
                                      saveValue("mode", "-1", "string");
                                  }
                                  
                                  saveValue("connection", true, "boolean");
              
                                  // Durchlauf ENDE
                  
                                  //log(findCodeVal(body.object_result, "T07"));
                              } else {
                                  saveValue("rawJSON", body.objectResult, "string");
                              
                                  if(findCodeVal(body.objectResult, "Power")=="1") {
                                      // Stromverbrauch T07 x T14 in Watt
                                      saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T07")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
              
                                      // Lüfter-Drehzahl T17
                                      saveValue("rotor", parseInt(findCodeVal(body.objectResult, "T17")), "number");
                                      // Luftansaug-Temperatur T01
                                      saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T01")), "number");
                                      // Inlet-Temperatur T02
                                      saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T02")), "number");
                                      // outlet-Temperatur T03
                                      saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T03")), "number");
                                      // Coil-Temperatur T04
                                      saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T04")), "number");
                                  } else {
                                      saveValue("consumption", 0, "number");
                                      saveValue("rotor", 0, "number");
                                  }
              
              
                  
                                  // Ziel-Temperatur Set_Temp
                                  saveValue("tempSet", parseFloat(findCodeVal(body.objectResult, "Set_Temp")), "number");
                  
                                  // Umgebungs-Temperatur T05
                                  saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T05")), "number");
                  
                                  // Flüstermodus Manual-mute
                                  if(findCodeVal(body.objectResult, "Manual-mute")=="1") {
                                      saveValue("silent", true, "boolean");
                                  } else {
                                      saveValue("silent", false, "boolean");
                                  }
                  
                                  // Zustand Power
                                  if(findCodeVal(body.objectResult, "Power")=="1") {
                                      saveValue("state", true, "boolean");
                                      saveValue("mode", findCodeVal(body.objectResult,"Mode"), "string");
                                  } else {
                                      saveValue("state", false, "boolean");
                                      saveValue("mode", "-1", "string");
                                  }
                                  
                                  saveValue("connection", true, "boolean");
              
                                  // Durchlauf ENDE
                  
                                  //log(findCodeVal(body.object_result, "T07"));
                              }
              
                              
                          } else {
                              // Login-Fehler
                              //log("Fehler in updateDeviceDetails(): " + response.body, "error");
                              token = "";
                              device = "";
                              saveValue("connection", false, "boolean");
                          }
                          
                      });
                  }
              }
               
              function updateDevicePower(devicecode, power) {
                  var powerOpt;
                  var powerMode = 2;
               
                  if(power==-1) {
                      // aus
                      powerOpt = 0;
                      powerMode = -1;
                  } else if(power==0) {
                      // an und kühlen
                      powerOpt = 1;
                      powerMode = 0;
                  } else if(power==1) {
                      // an und heizen
                      powerOpt = 1;
                      powerMode = 1;
                  } else if(power==2) {
                      // an und auto
                      powerOpt = 1;
                      powerMode = 2;
                  } else {
                      log("ungülter Zustand!");
                      return;
                  }
               
                  if(token!="") {
                      var optionsDev;
              
                      if(apilevel<3) {
                          optionsDev = {
                              url: cloudURL + '/app/device/control.json',
                              headers: { "x-token": token },
                              json: {"param":[{ "device_code": devicecode, "protocol_code": "Power","value": powerOpt }]},
                              method: 'POST',
                              rejectUnauthorized: false
                          };
                      } else {
                          optionsDev = {
                              url: cloudURL + '/app/device/control',
                              headers: { "x-token": token },
                              json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Power","value": powerOpt }]},
                              method: 'POST',
                              rejectUnauthorized: false
                          };
              
                      }
                      
               
                      var request = require('request');
               
                      request(optionsDev,function (error, response, body){
                          //log(devicecode);
                          //log(JSON.stringify(response));
                          //log(JSON.stringify(body.object_result));
               
                          if(parseInt(body.error_code)==0) {
                              saveValue("mode", power, "string");
                              if(power>=0) updateDeviceMode(device, power);
                              
                          } else {
                              log("Zustandsänderung fehlgeschlagen!", "error");
                          }
                          
                      });
                  }
              }
               
              function updateDeviceMode(devicecode, mode) {
                  
               
                  if(token!="") {
                      var optionsDev;
              
                      if(apilevel<3) {
                          optionsDev = {
                              url: cloudURL + '/app/device/control.json',
                              headers: { "x-token": token },
                              json: {"param":[{ "device_code": devicecode, "protocol_code": "mode","value": mode }]},
                              method: 'POST',
                              rejectUnauthorized: false
                              //headers: {"content-type": "application/json"},
                              //charset: 'utf8',
                              //json: true
                              
                          };
                      } else {
                          optionsDev = {
                              url: cloudURL + '/app/device/control',
                              headers: { "x-token": token },
                              json: {"param":[{ "deviceCode": devicecode, "protocolCode": "mode","value": mode }]},
                              method: 'POST',
                              rejectUnauthorized: false
                              //headers: {"content-type": "application/json"},
                              //charset: 'utf8',
                              //json: true
                              
                          };
                      }
                      
               
                      var request = require('request');
               
                      request(optionsDev,function (error, response, body){
                          //log(devicecode);
                          //log(JSON.stringify(response));
                          //log(JSON.stringify(body.object_result));
               
                          if(parseInt(body.error_code)==0) {
                              saveValue("mode", mode, "string");
                              
                              
                          } else {
                              log("Zustandsänderung fehlgeschlagen!", "error");
                              token = "";
                              device = "";
                              saveValue("connection", false, "boolean");
                          }
                          
                      });
                  }
              }
               
              function updateDeviceSilent(devicecode, silent) {
                  
                  var silentMode;
               
                  if(silent) {
                      silentMode = "1";
                  } else {
                      silentMode = "0";
                  }
               
                  if(token!="") {
              
                      var optionsDev;
              
                      if(apilevel<3) {
                          optionsDev = {
                              url: cloudURL + '/app/device/control.json',
                              headers: { "x-token": token },
                              json: {"param":[{ "device_code": devicecode, "protocol_code": "Manual-mute","value": silentMode }]},
                              method: 'POST',
                              rejectUnauthorized: false
                              //headers: {"content-type": "application/json"},
                              //charset: 'utf8',
                              //json: true
                              
                          };
                      } else {
                          optionsDev = {
                              url: cloudURL + '/app/device/control',
                              headers: { "x-token": token },
                              json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Manual-mute","value": silentMode }]},
                              method: 'POST',
                              rejectUnauthorized: false
                              //headers: {"content-type": "application/json"},
                              //charset: 'utf8',
                              //json: true
                              
                          };
                      }
                      
               
                      var request = require('request');
               
                      request(optionsDev,function (error, response, body){
                          //log(devicecode);
                          //log(JSON.stringify(response));
                          //log(JSON.stringify(body.object_result));
               
                          if(parseInt(body.error_code)==0) {
                              saveValue("silent", silent, "boolean");
                              
                              
                          } else {
                              log("Zustandsänderung fehlgeschlagen!", "error");
                              token = "";
                              device = "";
                              saveValue("connection", false, "boolean");
                          }
                          
                      });
                  }
              }
               
              function updateDeviceSetTemp(devicecode, temperature) {
               
                  var sTemperature = temperature.toString().replace(",", ".");
                  var sMode = getState(dpRoot + ".mode").val;
                  if(sMode=="-1") {
                      //log("Gerät einschalten um Temperatur zu ändern!", 'warn');
                      return;
                  } else if(sMode=="0") {
                      sMode = "R01"; // Kühlen
                  } else if(sMode=="1") {
                      sMode = "R02"; // Heizen
                  } else if(sMode=="2") {
                      sMode = "R03"; // Auto
                  }
               
                  
               
               
                  if(token!="") {
                      var optionsDev;
              
                      if(apilevel<3) {
                          optionsDev = {
                              url: cloudURL + '/app/device/control.json',
                              headers: { "x-token": token },
                              json: {"param":[{ "device_code": devicecode, "protocol_code": "R01","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R02","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R03","value": sTemperature },{ "device_code": devicecode, "protocol_code": "Set_Temp","value": sTemperature }]},
                              method: 'POST',
                              rejectUnauthorized: false
                              //headers: {"content-type": "application/json"},
                              //charset: 'utf8',
                              //json: true
                              
                          };
                      } else {
                          optionsDev = {
                              url: cloudURL + '/app/device/control',
                              headers: { "x-token": token },
                              json: {"param":[{ "deviceCode": devicecode, "protocolCode": "R01","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R02","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R03","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "Set_Temp","value": sTemperature }]},
                              method: 'POST',
                              rejectUnauthorized: false
                              //headers: {"content-type": "application/json"},
                              //charset: 'utf8',
                              //json: true
                              
                          };
              
                      }
                      
               
                      var request = require('request');
               
                      request(optionsDev,function (error, response, body){
                          //log(devicecode);
                          //log(JSON.stringify(response));
                          //log(JSON.stringify(body.object_result));
               
                          if(parseInt(body.error_code)==0) {
                              saveValue("tempSet", temperature, "number");
                              
                              
                          } else {
                              log("Zustandsänderung fehlgeschlagen!", "error");
                              token = "";
                              device = "";
                              saveValue("connection", false, "boolean");
                              //log(JSON.stringify(response));
                          }
                          
                      });
                  }
              }
               
              // Beginn des Skripts
              
              setupEndpoints();
              createobjects(); // DPs anlegen
               
              updateToken(); // Zugriffstoken erfragen und aktuelle Werte lesen
               
              schedule('*/' + interval + ' * * * * *', function () {
                  // regelmäßig Token und Zustand abfragen
                  updateToken();
               
                  // gewünschte Änderungen ausführen
                  if(!getState(dpRoot + ".mode").ack) {
                      updateDevicePower(device, getState(dpRoot + ".mode").val);
                  }
                  if(!getState(dpRoot + ".silent").ack) {
                      updateDevicePower(device, getState(dpRoot + ".silent").val);
                  }
              });
               
              tokenRefreshTimer = setInterval(function () {
                  // Token verfällt nach 60min
                  token = "";
                  //log("Token nach Intervall verworfen.")
                  updateToken();
              }, 3600000);
               
              on({id: dpRoot + ".mode", change: "ne", ack: false}, function (obj) {
                  updateToken();
                  updateDevicePower(device, getState(dpRoot + ".mode").val);
              });
               
              on({id: dpRoot + ".silent", change: "ne", ack: false}, function (obj) {
                  updateToken();
                  updateDeviceSilent(device, getState(dpRoot + ".silent").val);
              });
               
              on({id: dpRoot + ".tempSet", change: "ne", ack: false}, function (obj) {
                  updateToken();
                  updateDeviceSetTemp(device, getState(dpRoot + ".tempSet").val);
              });
              
              
              P Offline
              P Offline
              PietNB
              schrieb am zuletzt editiert von PietNB
              #152

              @oxident Hab das Script gleich mal ausprobiert. Zeigt eigentlich die gleichen Werte wie das optimierte vorher. Mir sind aber 2 Sachen aufgefallen:

              -tempOut t3 stimmt nicht mit dem Wert in der rawJSON überein Bsp. t3 soll 22,5°C ->Objekt Anzeige 25°C
              -tempSet Solltemperatur wird noch immer mit "0" angezeigt->die R01-R03 Werte zeige die richtige Temperatur an

              Weiterhin bekomme ich eine Fehlermeldung:

              javascript.0
              2023-07-03 17:38:00.113	error	Error in request callback: TypeError: Cannot read property '0' of undefined
              
              O 1 Antwort Letzte Antwort
              0
              • T tklein

                @oxident hi, ist das die aktuellste version des scriptes?

                O Offline
                O Offline
                oxident
                schrieb am zuletzt editiert von
                #153

                @tklein Jein, ist eigentlich eher die Entwicklungsversion für diejenigen, bei denen folgendes zutrifft:

                • Registrierung wurde erst vor kurzem (?) mit der neuen AquaTemp-App gemacht
                • Wärmepumpe ist nicht baugleich mit meiner Poolsana InverPro
                1 Antwort Letzte Antwort
                0
                • P PietNB

                  @oxident Hab das Script gleich mal ausprobiert. Zeigt eigentlich die gleichen Werte wie das optimierte vorher. Mir sind aber 2 Sachen aufgefallen:

                  -tempOut t3 stimmt nicht mit dem Wert in der rawJSON überein Bsp. t3 soll 22,5°C ->Objekt Anzeige 25°C
                  -tempSet Solltemperatur wird noch immer mit "0" angezeigt->die R01-R03 Werte zeige die richtige Temperatur an

                  Weiterhin bekomme ich eine Fehlermeldung:

                  javascript.0
                  2023-07-03 17:38:00.113	error	Error in request callback: TypeError: Cannot read property '0' of undefined
                  
                  O Offline
                  O Offline
                  oxident
                  schrieb am zuletzt editiert von
                  #154

                  @pietnb Komisch. Könntest Du mal nochmal Deine rawJSON zeigen?

                  P 1 Antwort Letzte Antwort
                  0
                  • O oxident

                    @pietnb Komisch. Könntest Du mal nochmal Deine rawJSON zeigen?

                    P Offline
                    P Offline
                    PietNB
                    schrieb am zuletzt editiert von PietNB
                    #155

                    @oxident

                    [{"value":"0","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"22.5","code":"T2"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"22.5","code":"T3"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"18.5","code":"T4"},{"value":"19.0","code":"T5"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}]
                    

                    Hier gleich noch die aktuelle Ansicht der Objekte:

                    Bildschirm­foto 2023-07-03 um 21.10.42.png

                    O 1 Antwort Letzte Antwort
                    0
                    • P PietNB

                      @oxident

                      [{"value":"0","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"22.5","code":"T2"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"22.5","code":"T3"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"18.5","code":"T4"},{"value":"19.0","code":"T5"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}]
                      

                      Hier gleich noch die aktuelle Ansicht der Objekte:

                      Bildschirm­foto 2023-07-03 um 21.10.42.png

                      O Offline
                      O Offline
                      oxident
                      schrieb am zuletzt editiert von
                      #156

                      @pietnb Habe jetzt erstmal nur einen kleinen Fehler gefunden. Bitte nochmal probieren:

                      // Midas Poolheizung
                      // v0.0.8b
                      // Changelog:
                      // 0.0.8: Testweise Unterstützung von neu registrierten Anlagen
                      // 0.0.7: Kleinigkeiten überarbeitet
                      //        weitere Modelle hinzugefügt
                      // 0.0.6: Gültigkeitsprüfung des Zertifikats deaktiviert (Dank an znyde)
                      //        Kompatibilität mit Promo Next Modellen durch generische Product-ID (Dank an znyde)
                      // 0.0.5: weitere Abfragewerte hinzugefügt (Kompressor- und Ansaugtemperatur)
                      // 0.0.4: Tokenverfall jetzt 60min nach Skriptstart und nicht zu jeder vollen Stunde (Dank an dering)
                      // 0.0.3: Datenpunkte beim Start automatisch anlegen (Dank an Andy200877)
                      // 0.0.2: Token bei jedem Set-Vorgang prüfen und ggf. neu anfordern (Dank an dering)
                      
                      // ANFANG konfigurierbare Elemente -----
                      const username = "EMAIL";
                      var password = "KENNWORT";
                      const interval = 30; // Abfrageintervall in Sekunden
                      const dpRoot = "0_userdata.0.Poolheizung"; // Stammordner der Datenpunkte
                      var apilevel = 1;   // 1: AquaTemp-Accounts, die vor v.1.5.8 erstellt wurden
                                          // 2: HiTemp-Accounts
                                          // 3: AquaTemp-Accounts, die mit neueren App-Versionen erstellt wurden
                                          
                      
                      // ENDE --------------------------------
                       
                      var cloudURL;
                      
                      var token = "";
                      var tokenRefreshTimer;
                      var device = "";
                      
                      // ProductIDs:
                      // Gruppe 1:
                      // 1132174963097280512: Midas/Poolsana InverPro
                      const AQUATEMP_POOLSANA="1132174963097280512";
                      // Gruppe 2:
                      // 1442284873216843776: 
                      const AQUATEMP_OTHER1="1442284873216843776";
                      
                      var product = "";
                      var reachable = false;
                      
                      function setupEndpoints() {
                          if(apilevel==1) {
                              cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                          } else if(apilevel==2) {
                              cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                          } else if(apilevel==3) {
                              cloudURL = "https://cloud.linked-go.com:449/crmservice/api";
                              password = require('crypto').createHash('md5').update(password).digest("hex");
                      
                          }
                      }
                       
                      function clearValues() {
                          saveValue("error", true, "boolean");
                          saveValue("consumption", 0, "number");
                          saveValue("state", false, "boolean");
                      }
                       
                      function saveValue(key, value, sType) {
                          var dp = dpRoot + "." + key;
                       
                          if ( !existsState(dp )) {
                              createState(dp,value,{name: key,  type: 'number', role: 'value'}, function () {}); 
                          } else {
                              setState(dp,value,true);
                          }
                      }
                       
                      function findCodeVal(result, code) {
                          //log(code);
                          for(var i=0; i<result.length; i++) {
                              //log(result[i].code);
                              
                              if(result[i].code.indexOf(code) >= 0) {
                                  return result[i].value;
                              }
                          }
                          return "";
                      }
                       
                      function createobjects() {
                          log ("erstelle Objekte");
                          createState(dpRoot + '.ambient', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Umgebungstemperatur"});
                          createState(dpRoot + '.connection', {read: true, write: false,  type: "boolean", role: "state", name: "Verbindung", def: false});
                          createState(dpRoot + '.consumption', {read: true, write: false,  type: "number", unit:"W", role: "value.power", name: "Stromverbrauch", def: 0});
                          createState(dpRoot + '.error', {read: true, write: false,  type: "boolean", role: "state", name: "Fehler", def: false});
                          createState(dpRoot + '.errorCode', {read: true, write: false,  type: "string", name: "Fehlercode", def: ""});
                          createState(dpRoot + '.errorLevel', {read: true, write: false,  type: "number", name: "Fehlerlevel"});
                          createState(dpRoot + '.errorMessage', {read: true, write: false,  type: "string", name: "Fehlermeldung", def: ""});
                          createState(dpRoot + '.mode', {read: true, write: true,  type: "string", states: "-1:off;0:cool;1:heat;2:auto", name: "Modus", def: ""});
                          createState(dpRoot + '.rotor', {read: true, write: false,  type: "number", unit:"rpm", def: 0, name: "Lüfterdrehzahl"});
                          createState(dpRoot + '.silent', {read: true, write: true,  type: "boolean", role: "state", name: "Silent", def: false});
                          createState(dpRoot + '.state', {read: true, write: false,  type: "boolean", role: "state", name: "Status", def: false});
                          createState(dpRoot + '.tempIn', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Eingangstemperatur"});
                          createState(dpRoot + '.tempOut', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Ausgangstemperatur"});
                          createState(dpRoot + '.tempSet', {read: true, write: true,  type: "number", unit:"°C", role: "level.temperature", name: "Solltemperatur"});
                          createState(dpRoot + '.suctionTemp', {read: true, write: false,  type: "number", unit:"°C", name: "Luftansaugtemperatur"});
                          createState(dpRoot + '.coilTemp', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Kompressortemperatur"});
                          
                          createState(dpRoot + '.rawJSON', {read: true, write: false,  type: "array", name: "komplette Rückgabe"});
                      }
                       
                      function updateToken() {
                       
                          if(token=="") {
                              //log("Token Neuanforderung");
                              var request = require('request');
                              var options;
                          
                              if(apilevel<3) {
                                  options = {
                                      url: cloudURL + '/app/user/login.json',
                                      method: 'POST',
                                      json: { "user_name": username, "password": password, "type": "2" },
                                      rejectUnauthorized: false
                                  };
                              } else {
                                  options = {
                                      url: cloudURL + '/app/user/login',
                                      method: 'POST',
                                      json: { "userName": username, "password": password, "type": "2" },
                                      rejectUnauthorized: false
                                  };
                              }
                              
                      
                              //log(JSON.stringify(options));
                              
                              request(options,function (error, response, body){
                              
                                  //log(JSON.stringify(response));
                                  if(parseInt(body.error_code)==0) {
                                      
                                      if(apilevel<3) {
                                          token = body.object_result["x-token"];
                                      } else {
                                          token = body.objectResult["x-token"];
                                      }
                                      
                                      //log("Login ok! Token " + token);
                                      updateDeviceID();
                                  } else {
                                      // Login-Fehler
                                      //log("Login-Fehler in updateToken(): " + response.body, "error");
                                      token = "";
                                      saveValue("connection", false, "boolean");
                                  }
                                  
                              });
                          } else {
                              updateDeviceID();
                          }
                       
                          
                       
                          
                       
                      }
                       
                      function updateDeviceID() {
                          if(token!="") {
                              var optionsDev;
                              if(apilevel<3) {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/deviceList.json',
                                      headers: { "x-token": token },
                                      body: {"product_ids": [
                                              "1132174963097280512",
                                              "1186904563333062656",
                                              "1158905952238313472",
                                              "1245226668902080512",
                                              "1442284873216843776",
                                              "1548963836789501952",
                                              ]},
                                      method: 'POST',
                                      json: true,
                                      rejectUnauthorized: false  
                                  };
                              } else {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/deviceList',
                                      headers: { "x-token": token },
                                      body: {"productIds": [
                                              "1132174963097280512",
                                              "1186904563333062656",
                                              "1158905952238313472",
                                              "1245226668902080512",
                                              "1442284873216843776",
                                              "1548963836789501952",
                                              ]},
                                      method: 'POST',
                                      json: true,
                                      rejectUnauthorized: false  
                                  };
                              }
                      
                              var request = require('request');
                       
                              request(optionsDev,function (error, response, body){
                          
                                  //log(JSON.stringify(response));
                                  //log(JSON.stringify(body.object_result));
                       
                                  if(parseInt(body.error_code)==0) {
                                      
                                      //token = body.object_result["x-token"];
                                      //log("Login ok! Token " + token);
                                      
                                      if(apilevel<3) {
                                          device = body.object_result[0].device_code;
                                          product = body.object_result[0].product_id;
                                          reachable = (body.object_result[0].device_status=="ONLINE");
                                      } else {
                                          device = body.objectResult[0].deviceCode;
                                          product = body.object_result[0].productId;
                                          reachable = (body.objectResult[0].deviceStatus=="ONLINE");
                                      }
                      
                                      //log(product);
                                      
                                      if(reachable) {
                                          saveValue("connection", true, "boolean");
                                          if(device!="") updateDeviceStatus(device);
                                      } else {
                                          // offline
                                          device = "";
                                          saveValue("connection", false, "boolean");
                                      }
                                      
                                  } else {
                                      // Login-Fehler
                                      //log("Fehler in updateDeviceID(): " + response.body, "error");
                                      token = "";
                                      device = "";
                                      reachable = false;
                                      saveValue("connection", false, "boolean");
                                  }
                                  
                              });
                          }
                      }
                       
                      function updateDeviceStatus(devicecode) {
                          if(token!="") {
                              var optionsDev;
                      
                              if(apilevel<3) {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/getDeviceStatus.json',
                                      headers: { "x-token": token },
                                      json: { "device_code": devicecode },
                                      method: 'POST',
                                      rejectUnauthorized: false
                                  };
                              } else {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/getDeviceStatus',
                                      headers: { "x-token": token },
                                      json: { "deviceCode": devicecode },
                                      method: 'POST',
                                      rejectUnauthorized: false
                                  };
                              }
                              
                       
                              var request = require('request');
                       
                              request(optionsDev,function (error, response, body){
                          
                                  //log(JSON.stringify(response));
                                  //log(JSON.stringify(body.object_result));
                       
                                  if(parseInt(body.error_code)==0) {
                      
                                      if(apilevel<3) {
                                          if(body.object_result["is_fault"]==true) {
                                              // TODO: Fehlerbeschreibung abrufen
                                              //clearValues();
                                              saveValue("error", true, "boolean");
                                              updateDeviceDetails(devicecode);
                                              updateDeviceErrorMsg(devicecode);
                                          } else {
                                              // kein Fehler
                                              saveValue("error", false, "boolean");
                                              saveValue("errorMessage", "", "string");
                                              saveValue("errorCode", "", "string");
                                              saveValue("errorLevel", 0, "number");
                                              updateDeviceDetails(devicecode);
                                          }
                                      } else {
                                          if(body.objectResult["is_fault"]==true) {
                                              // TODO: Fehlerbeschreibung abrufen
                                              //clearValues();
                                              saveValue("error", true, "boolean");
                                              updateDeviceDetails(devicecode);
                                              updateDeviceErrorMsg(devicecode);
                                          } else {
                                              // kein Fehler
                                              saveValue("error", false, "boolean");
                                              saveValue("errorMessage", "", "string");
                                              saveValue("errorCode", "", "string");
                                              saveValue("errorLevel", 0, "number");
                                              updateDeviceDetails(devicecode);
                                          }
                                      }
                       
                                      
                                      
                                      //token = body.object_result["x-token"];
                                      //log("Login ok! Token " + token);
                                      
                                  } else {
                                      // Login-Fehler
                                      //log("Fehler in updateDeviceStatus(): " + response.body, "error");
                                      token = "";
                                      device = "";
                                      saveValue("connection", false, "boolean");
                                  }
                                  
                              });
                          }
                      }
                       
                      function updateDeviceErrorMsg(devicecode) {
                          if(token!="") {
                              var optionsDev;
                      
                              if(apilevel<3) {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/getFaultDataByDeviceCode.json',
                                      headers: { "x-token": token },
                                      json: { "device_code": devicecode },
                                      method: 'POST',
                                      rejectUnauthorized: false
                                      //headers: {"content-type": "application/json"},
                                      //charset: 'utf8',
                                      //json: true
                                      
                                  };
                              } else {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/getFaultDataByDeviceCode',
                                      headers: { "x-token": token },
                                      json: { "deviceCode": devicecode },
                                      method: 'POST',
                                      rejectUnauthorized: false
                                      //headers: {"content-type": "application/json"},
                                      //charset: 'utf8',
                                      //json: true
                                      
                                  };
                              }
                              
                       
                              var request = require('request');
                       
                              request(optionsDev,function (error, response, body){
                          
                                  //log(JSON.stringify(response));
                                  //log(JSON.stringify(body.object_result));
                       
                                  if(parseInt(body.error_code)==0) {
                       
                                      
                                      saveValue("error", true, "boolean");
                      
                                      if(apilevel<3) {
                                          saveValue("errorMessage", body.object_result[0].description, "string");
                                          saveValue("errorCode", body.object_result[0].fault_code, "string");
                                          saveValue("errorLevel", body.object_result[0].error_level, "string");
                                      } else {
                                          saveValue("errorMessage", body.objectResult[0].description, "string");
                                          saveValue("errorCode", body.objectResult[0].fault_code, "string");
                                          saveValue("errorLevel", body.objectResult[0].error_level, "string");
                                      }
                                      
                                      
                                  } else {
                                      // Login-Fehler
                                      //log("Fehler in updateDeviceErrorMsg(): " + response.body, "error");
                                      token = "";
                                      device = "";
                                      saveValue("connection", false, "boolean");
                                  }
                                  
                              });
                          }
                      }
                       
                      function updateDeviceDetails(devicecode) {
                          if(token!="") {
                              var optionsDev;
                      
                              if(apilevel<3) {
                                  if(product==AQUATEMP_POOLSANA) {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/getDataByCode.json',
                                          headers: { "x-token": token },
                                          json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                          // "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05"]
                                          method: 'POST',
                                          rejectUnauthorized: false
                                      
                                      };
                                  } else if(product==AQUATEMP_OTHER1) {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/getDataByCode.json',
                                          headers: { "x-token": token },
                                          json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T7","T14","T17"] },
                                          method: 'POST',
                                          rejectUnauthorized: false
                                      
                                      };
                                  }
                                  
                              } else {
                                  if(product==AQUATEMP_POOLSANA) {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/getDataByCode',
                                          headers: { "x-token": token },
                                          json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                          method: 'POST',
                                          rejectUnauthorized: false
                                      
                                      };
                                  } else if (product==AQUATEMP_OTHER1) {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/getDataByCode',
                                          headers: { "x-token": token },
                                          json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T7","T14","T17"] },
                                          method: 'POST',
                                          rejectUnauthorized: false
                                      
                                      };
                                  }
                                  
                      
                              }
                              
                       
                              var request = require('request');
                       
                              request(optionsDev,function (error, response, body){
                       
                       
                                  if(parseInt(body.error_code)==0) {
                      
                                      if(apilevel<3) {
                                          saveValue("rawJSON", body.object_result, "string");
                                          
                                          if(findCodeVal(body.object_result, "Power")=="1") {
                                              if(product==AQUATEMP_POOLSANA) {
                                                  // Stromverbrauch T07 x T14 in Watt
                                                  saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T07")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                                  // Luftansaug-Temperatur T01
                                                  saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T01")), "number");
                                                  // Inlet-Temperatur T02
                                                  saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T02")), "number");
                                                  // outlet-Temperatur T03
                                                  saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T03")), "number");
                                                  // Coil-Temperatur T04
                                                  saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T04")), "number");
                                                  // Umgebungs-Temperatur T05
                                                  saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T05")), "number");
                                              } else if (product==AQUATEMP_OTHER1) {
                                                  // Stromverbrauch T7 x T14 in Watt
                                                  saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T7")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                                  // Luftansaug-Temperatur T1
                                                  saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T1")), "number");
                                                  // Inlet-Temperatur T2
                                                  saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T2")), "number");
                                                  // outlet-Temperatur T3
                                                  saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T3")), "number");
                                                  // Coil-Temperatur T4
                                                  saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T4")), "number");
                                                  // Umgebungs-Temperatur T5
                                                  saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T5")), "number");
                                              }
                                          
                                              // Lüfter-Drehzahl T17
                                              saveValue("rotor", parseInt(findCodeVal(body.object_result, "T17")), "number");
                                            
                                              
                                          } else {
                                              saveValue("consumption", 0, "number");
                                              saveValue("rotor", 0, "number");
                                          }
                          
                                          // Ziel-Temperatur Set_Temp
                                          saveValue("tempSet", parseFloat(findCodeVal(body.object_result, "Set_Temp")), "number");
                              
                                          // Flüstermodus Manual-mute
                                          if(findCodeVal(body.object_result, "Manual-mute")=="1") {
                                              saveValue("silent", true, "boolean");
                                          } else {
                                              saveValue("silent", false, "boolean");
                                          }
                          
                                          // Zustand Power
                                          if(findCodeVal(body.object_result, "Power")=="1") {
                                              saveValue("state", true, "boolean");
                                              saveValue("mode", findCodeVal(body.object_result,"Mode"), "string");
                                          } else {
                                              saveValue("state", false, "boolean");
                                              saveValue("mode", "-1", "string");
                                          }
                                          
                                          saveValue("connection", true, "boolean");
                      
                                          // Durchlauf ENDE
                          
                                          
                                      } else {
                                          saveValue("rawJSON", body.objectResult, "string");
                                          
                                          if(findCodeVal(body.objectResult, "Power")=="1") {
                                              if(product==AQUATEMP_POOLSANA) {
                                                  // Stromverbrauch T07 x T14 in Watt
                                                  saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T07")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
                                                  // Luftansaug-Temperatur T01
                                                  saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T01")), "number");
                                                  // Inlet-Temperatur T02
                                                  saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T02")), "number");
                                                  // outlet-Temperatur T03
                                                  saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T03")), "number");
                                                  // Coil-Temperatur T04
                                                  saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T04")), "number");
                                                  // Umgebungs-Temperatur T05
                                                  saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T05")), "number");
                                              } else if (product==AQUATEMP_OTHER1) {
                                                  // Stromverbrauch T7 x T14 in Watt
                                                  saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T7")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
                                                  // Luftansaug-Temperatur T1
                                                  saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T1")), "number");
                                                  // Inlet-Temperatur T2
                                                  saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T2")), "number");
                                                  // outlet-Temperatur T3
                                                  saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T3")), "number");
                                                  // Coil-Temperatur T4
                                                  saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T4")), "number");
                                                  // Umgebungs-Temperatur T5
                                                  saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T5")), "number");
                                              }
                                          
                                              // Lüfter-Drehzahl T17
                                              saveValue("rotor", parseInt(findCodeVal(body.objectResult, "T17")), "number");
                                            
                                              
                                          } else {
                                              saveValue("consumption", 0, "number");
                                              saveValue("rotor", 0, "number");
                                          }
                          
                                          // Ziel-Temperatur Set_Temp
                                          saveValue("tempSet", parseFloat(findCodeVal(body.objectResult, "Set_Temp")), "number");
                              
                                          // Flüstermodus Manual-mute
                                          if(findCodeVal(body.objectResult, "Manual-mute")=="1") {
                                              saveValue("silent", true, "boolean");
                                          } else {
                                              saveValue("silent", false, "boolean");
                                          }
                          
                                          // Zustand Power
                                          if(findCodeVal(body.objectResult, "Power")=="1") {
                                              saveValue("state", true, "boolean");
                                              saveValue("mode", findCodeVal(body.objectResult,"Mode"), "string");
                                          } else {
                                              saveValue("state", false, "boolean");
                                              saveValue("mode", "-1", "string");
                                          }
                                          
                                          saveValue("connection", true, "boolean");
                      
                                          // Durchlauf ENDE
                          
                                          
                                      }
                      
                                      
                                  } else {
                                      // Login-Fehler
                                      //log("Fehler in updateDeviceDetails(): " + response.body, "error");
                                      token = "";
                                      device = "";
                                      saveValue("connection", false, "boolean");
                                  }
                                  
                              });
                          }
                      }
                       
                      function updateDevicePower(devicecode, power) {
                          var powerOpt;
                          var powerMode = 2;
                       
                          if(power==-1) {
                              // aus
                              powerOpt = 0;
                              powerMode = -1;
                          } else if(power==0) {
                              // an und kühlen
                              powerOpt = 1;
                              powerMode = 0;
                          } else if(power==1) {
                              // an und heizen
                              powerOpt = 1;
                              powerMode = 1;
                          } else if(power==2) {
                              // an und auto
                              powerOpt = 1;
                              powerMode = 2;
                          } else {
                              log("ungülter Zustand!");
                              return;
                          }
                       
                          if(token!="") {
                              var optionsDev;
                      
                              if(apilevel<3) {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/control.json',
                                      headers: { "x-token": token },
                                      json: {"param":[{ "device_code": devicecode, "protocol_code": "Power","value": powerOpt }]},
                                      method: 'POST',
                                      rejectUnauthorized: false
                                  };
                              } else {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/control',
                                      headers: { "x-token": token },
                                      json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Power","value": powerOpt }]},
                                      method: 'POST',
                                      rejectUnauthorized: false
                                  };
                      
                              }
                              
                       
                              var request = require('request');
                       
                              request(optionsDev,function (error, response, body){
                                  //log(devicecode);
                                  //log(JSON.stringify(response));
                                  //log(JSON.stringify(body.object_result));
                       
                                  if(parseInt(body.error_code)==0) {
                                      saveValue("mode", power, "string");
                                      if(power>=0) updateDeviceMode(device, power);
                                      
                                  } else {
                                      log("Zustandsänderung fehlgeschlagen!", "error");
                                  }
                                  
                              });
                          }
                      }
                       
                      function updateDeviceMode(devicecode, mode) {
                          
                       
                          if(token!="") {
                              var optionsDev;
                      
                              if(apilevel<3) {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/control.json',
                                      headers: { "x-token": token },
                                      json: {"param":[{ "device_code": devicecode, "protocol_code": "mode","value": mode }]},
                                      method: 'POST',
                                      rejectUnauthorized: false
                                      //headers: {"content-type": "application/json"},
                                      //charset: 'utf8',
                                      //json: true
                                      
                                  };
                              } else {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/control',
                                      headers: { "x-token": token },
                                      json: {"param":[{ "deviceCode": devicecode, "protocolCode": "mode","value": mode }]},
                                      method: 'POST',
                                      rejectUnauthorized: false
                                      //headers: {"content-type": "application/json"},
                                      //charset: 'utf8',
                                      //json: true
                                      
                                  };
                              }
                              
                       
                              var request = require('request');
                       
                              request(optionsDev,function (error, response, body){
                                  //log(devicecode);
                                  //log(JSON.stringify(response));
                                  //log(JSON.stringify(body.object_result));
                       
                                  if(parseInt(body.error_code)==0) {
                                      saveValue("mode", mode, "string");
                                      
                                      
                                  } else {
                                      log("Zustandsänderung fehlgeschlagen!", "error");
                                      token = "";
                                      device = "";
                                      saveValue("connection", false, "boolean");
                                  }
                                  
                              });
                          }
                      }
                       
                      function updateDeviceSilent(devicecode, silent) {
                          
                          var silentMode;
                       
                          if(silent) {
                              silentMode = "1";
                          } else {
                              silentMode = "0";
                          }
                       
                          if(token!="") {
                      
                              var optionsDev;
                      
                              if(apilevel<3) {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/control.json',
                                      headers: { "x-token": token },
                                      json: {"param":[{ "device_code": devicecode, "protocol_code": "Manual-mute","value": silentMode }]},
                                      method: 'POST',
                                      rejectUnauthorized: false
                                      //headers: {"content-type": "application/json"},
                                      //charset: 'utf8',
                                      //json: true
                                      
                                  };
                              } else {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/control',
                                      headers: { "x-token": token },
                                      json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Manual-mute","value": silentMode }]},
                                      method: 'POST',
                                      rejectUnauthorized: false
                                      //headers: {"content-type": "application/json"},
                                      //charset: 'utf8',
                                      //json: true
                                      
                                  };
                              }
                              
                       
                              var request = require('request');
                       
                              request(optionsDev,function (error, response, body){
                                  //log(devicecode);
                                  //log(JSON.stringify(response));
                                  //log(JSON.stringify(body.object_result));
                       
                                  if(parseInt(body.error_code)==0) {
                                      saveValue("silent", silent, "boolean");
                                      
                                      
                                  } else {
                                      log("Zustandsänderung fehlgeschlagen!", "error");
                                      token = "";
                                      device = "";
                                      saveValue("connection", false, "boolean");
                                  }
                                  
                              });
                          }
                      }
                       
                      function updateDeviceSetTemp(devicecode, temperature) {
                       
                          var sTemperature = temperature.toString().replace(",", ".");
                          var sMode = getState(dpRoot + ".mode").val;
                          if(sMode=="-1") {
                              //log("Gerät einschalten um Temperatur zu ändern!", 'warn');
                              return;
                          } else if(sMode=="0") {
                              sMode = "R01"; // Kühlen
                          } else if(sMode=="1") {
                              sMode = "R02"; // Heizen
                          } else if(sMode=="2") {
                              sMode = "R03"; // Auto
                          }
                       
                          
                       
                       
                          if(token!="") {
                              var optionsDev;
                      
                              if(apilevel<3) {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/control.json',
                                      headers: { "x-token": token },
                                      json: {"param":[{ "device_code": devicecode, "protocol_code": "R01","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R02","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R03","value": sTemperature },{ "device_code": devicecode, "protocol_code": "Set_Temp","value": sTemperature }]},
                                      method: 'POST',
                                      rejectUnauthorized: false
                                      //headers: {"content-type": "application/json"},
                                      //charset: 'utf8',
                                      //json: true
                                      
                                  };
                              } else {
                                  optionsDev = {
                                      url: cloudURL + '/app/device/control',
                                      headers: { "x-token": token },
                                      json: {"param":[{ "deviceCode": devicecode, "protocolCode": "R01","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R02","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R03","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "Set_Temp","value": sTemperature }]},
                                      method: 'POST',
                                      rejectUnauthorized: false
                                      //headers: {"content-type": "application/json"},
                                      //charset: 'utf8',
                                      //json: true
                                      
                                  };
                      
                              }
                              
                       
                              var request = require('request');
                       
                              request(optionsDev,function (error, response, body){
                                  //log(devicecode);
                                  //log(JSON.stringify(response));
                                  //log(JSON.stringify(body.object_result));
                       
                                  if(parseInt(body.error_code)==0) {
                                      saveValue("tempSet", temperature, "number");
                                      
                                      
                                  } else {
                                      log("Zustandsänderung fehlgeschlagen!", "error");
                                      token = "";
                                      device = "";
                                      saveValue("connection", false, "boolean");
                                      //log(JSON.stringify(response));
                                  }
                                  
                              });
                          }
                      }
                       
                      // Beginn des Skripts
                      
                      setupEndpoints();
                      createobjects(); // DPs anlegen
                       
                      updateToken(); // Zugriffstoken erfragen und aktuelle Werte lesen
                       
                      schedule('*/' + interval + ' * * * * *', function () {
                          // regelmäßig Token und Zustand abfragen
                          updateToken();
                       
                          // gewünschte Änderungen ausführen
                          if(!getState(dpRoot + ".mode").ack) {
                              updateDevicePower(device, getState(dpRoot + ".mode").val);
                          }
                          if(!getState(dpRoot + ".silent").ack) {
                              updateDevicePower(device, getState(dpRoot + ".silent").val);
                          }
                      });
                       
                      tokenRefreshTimer = setInterval(function () {
                          // Token verfällt nach 60min
                          token = "";
                          //log("Token nach Intervall verworfen.")
                          updateToken();
                      }, 3600000);
                       
                      on({id: dpRoot + ".mode", change: "ne", ack: false}, function (obj) {
                          updateToken();
                          updateDevicePower(device, getState(dpRoot + ".mode").val);
                      });
                       
                      on({id: dpRoot + ".silent", change: "ne", ack: false}, function (obj) {
                          updateToken();
                          updateDeviceSilent(device, getState(dpRoot + ".silent").val);
                      });
                       
                      on({id: dpRoot + ".tempSet", change: "ne", ack: false}, function (obj) {
                          updateToken();
                          updateDeviceSetTemp(device, getState(dpRoot + ".tempSet").val);
                      });
                      
                      
                      P 1 Antwort Letzte Antwort
                      0
                      • O oxident

                        @pietnb Habe jetzt erstmal nur einen kleinen Fehler gefunden. Bitte nochmal probieren:

                        // Midas Poolheizung
                        // v0.0.8b
                        // Changelog:
                        // 0.0.8: Testweise Unterstützung von neu registrierten Anlagen
                        // 0.0.7: Kleinigkeiten überarbeitet
                        //        weitere Modelle hinzugefügt
                        // 0.0.6: Gültigkeitsprüfung des Zertifikats deaktiviert (Dank an znyde)
                        //        Kompatibilität mit Promo Next Modellen durch generische Product-ID (Dank an znyde)
                        // 0.0.5: weitere Abfragewerte hinzugefügt (Kompressor- und Ansaugtemperatur)
                        // 0.0.4: Tokenverfall jetzt 60min nach Skriptstart und nicht zu jeder vollen Stunde (Dank an dering)
                        // 0.0.3: Datenpunkte beim Start automatisch anlegen (Dank an Andy200877)
                        // 0.0.2: Token bei jedem Set-Vorgang prüfen und ggf. neu anfordern (Dank an dering)
                        
                        // ANFANG konfigurierbare Elemente -----
                        const username = "EMAIL";
                        var password = "KENNWORT";
                        const interval = 30; // Abfrageintervall in Sekunden
                        const dpRoot = "0_userdata.0.Poolheizung"; // Stammordner der Datenpunkte
                        var apilevel = 1;   // 1: AquaTemp-Accounts, die vor v.1.5.8 erstellt wurden
                                            // 2: HiTemp-Accounts
                                            // 3: AquaTemp-Accounts, die mit neueren App-Versionen erstellt wurden
                                            
                        
                        // ENDE --------------------------------
                         
                        var cloudURL;
                        
                        var token = "";
                        var tokenRefreshTimer;
                        var device = "";
                        
                        // ProductIDs:
                        // Gruppe 1:
                        // 1132174963097280512: Midas/Poolsana InverPro
                        const AQUATEMP_POOLSANA="1132174963097280512";
                        // Gruppe 2:
                        // 1442284873216843776: 
                        const AQUATEMP_OTHER1="1442284873216843776";
                        
                        var product = "";
                        var reachable = false;
                        
                        function setupEndpoints() {
                            if(apilevel==1) {
                                cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                            } else if(apilevel==2) {
                                cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                            } else if(apilevel==3) {
                                cloudURL = "https://cloud.linked-go.com:449/crmservice/api";
                                password = require('crypto').createHash('md5').update(password).digest("hex");
                        
                            }
                        }
                         
                        function clearValues() {
                            saveValue("error", true, "boolean");
                            saveValue("consumption", 0, "number");
                            saveValue("state", false, "boolean");
                        }
                         
                        function saveValue(key, value, sType) {
                            var dp = dpRoot + "." + key;
                         
                            if ( !existsState(dp )) {
                                createState(dp,value,{name: key,  type: 'number', role: 'value'}, function () {}); 
                            } else {
                                setState(dp,value,true);
                            }
                        }
                         
                        function findCodeVal(result, code) {
                            //log(code);
                            for(var i=0; i<result.length; i++) {
                                //log(result[i].code);
                                
                                if(result[i].code.indexOf(code) >= 0) {
                                    return result[i].value;
                                }
                            }
                            return "";
                        }
                         
                        function createobjects() {
                            log ("erstelle Objekte");
                            createState(dpRoot + '.ambient', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Umgebungstemperatur"});
                            createState(dpRoot + '.connection', {read: true, write: false,  type: "boolean", role: "state", name: "Verbindung", def: false});
                            createState(dpRoot + '.consumption', {read: true, write: false,  type: "number", unit:"W", role: "value.power", name: "Stromverbrauch", def: 0});
                            createState(dpRoot + '.error', {read: true, write: false,  type: "boolean", role: "state", name: "Fehler", def: false});
                            createState(dpRoot + '.errorCode', {read: true, write: false,  type: "string", name: "Fehlercode", def: ""});
                            createState(dpRoot + '.errorLevel', {read: true, write: false,  type: "number", name: "Fehlerlevel"});
                            createState(dpRoot + '.errorMessage', {read: true, write: false,  type: "string", name: "Fehlermeldung", def: ""});
                            createState(dpRoot + '.mode', {read: true, write: true,  type: "string", states: "-1:off;0:cool;1:heat;2:auto", name: "Modus", def: ""});
                            createState(dpRoot + '.rotor', {read: true, write: false,  type: "number", unit:"rpm", def: 0, name: "Lüfterdrehzahl"});
                            createState(dpRoot + '.silent', {read: true, write: true,  type: "boolean", role: "state", name: "Silent", def: false});
                            createState(dpRoot + '.state', {read: true, write: false,  type: "boolean", role: "state", name: "Status", def: false});
                            createState(dpRoot + '.tempIn', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Eingangstemperatur"});
                            createState(dpRoot + '.tempOut', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Ausgangstemperatur"});
                            createState(dpRoot + '.tempSet', {read: true, write: true,  type: "number", unit:"°C", role: "level.temperature", name: "Solltemperatur"});
                            createState(dpRoot + '.suctionTemp', {read: true, write: false,  type: "number", unit:"°C", name: "Luftansaugtemperatur"});
                            createState(dpRoot + '.coilTemp', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Kompressortemperatur"});
                            
                            createState(dpRoot + '.rawJSON', {read: true, write: false,  type: "array", name: "komplette Rückgabe"});
                        }
                         
                        function updateToken() {
                         
                            if(token=="") {
                                //log("Token Neuanforderung");
                                var request = require('request');
                                var options;
                            
                                if(apilevel<3) {
                                    options = {
                                        url: cloudURL + '/app/user/login.json',
                                        method: 'POST',
                                        json: { "user_name": username, "password": password, "type": "2" },
                                        rejectUnauthorized: false
                                    };
                                } else {
                                    options = {
                                        url: cloudURL + '/app/user/login',
                                        method: 'POST',
                                        json: { "userName": username, "password": password, "type": "2" },
                                        rejectUnauthorized: false
                                    };
                                }
                                
                        
                                //log(JSON.stringify(options));
                                
                                request(options,function (error, response, body){
                                
                                    //log(JSON.stringify(response));
                                    if(parseInt(body.error_code)==0) {
                                        
                                        if(apilevel<3) {
                                            token = body.object_result["x-token"];
                                        } else {
                                            token = body.objectResult["x-token"];
                                        }
                                        
                                        //log("Login ok! Token " + token);
                                        updateDeviceID();
                                    } else {
                                        // Login-Fehler
                                        //log("Login-Fehler in updateToken(): " + response.body, "error");
                                        token = "";
                                        saveValue("connection", false, "boolean");
                                    }
                                    
                                });
                            } else {
                                updateDeviceID();
                            }
                         
                            
                         
                            
                         
                        }
                         
                        function updateDeviceID() {
                            if(token!="") {
                                var optionsDev;
                                if(apilevel<3) {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/deviceList.json',
                                        headers: { "x-token": token },
                                        body: {"product_ids": [
                                                "1132174963097280512",
                                                "1186904563333062656",
                                                "1158905952238313472",
                                                "1245226668902080512",
                                                "1442284873216843776",
                                                "1548963836789501952",
                                                ]},
                                        method: 'POST',
                                        json: true,
                                        rejectUnauthorized: false  
                                    };
                                } else {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/deviceList',
                                        headers: { "x-token": token },
                                        body: {"productIds": [
                                                "1132174963097280512",
                                                "1186904563333062656",
                                                "1158905952238313472",
                                                "1245226668902080512",
                                                "1442284873216843776",
                                                "1548963836789501952",
                                                ]},
                                        method: 'POST',
                                        json: true,
                                        rejectUnauthorized: false  
                                    };
                                }
                        
                                var request = require('request');
                         
                                request(optionsDev,function (error, response, body){
                            
                                    //log(JSON.stringify(response));
                                    //log(JSON.stringify(body.object_result));
                         
                                    if(parseInt(body.error_code)==0) {
                                        
                                        //token = body.object_result["x-token"];
                                        //log("Login ok! Token " + token);
                                        
                                        if(apilevel<3) {
                                            device = body.object_result[0].device_code;
                                            product = body.object_result[0].product_id;
                                            reachable = (body.object_result[0].device_status=="ONLINE");
                                        } else {
                                            device = body.objectResult[0].deviceCode;
                                            product = body.object_result[0].productId;
                                            reachable = (body.objectResult[0].deviceStatus=="ONLINE");
                                        }
                        
                                        //log(product);
                                        
                                        if(reachable) {
                                            saveValue("connection", true, "boolean");
                                            if(device!="") updateDeviceStatus(device);
                                        } else {
                                            // offline
                                            device = "";
                                            saveValue("connection", false, "boolean");
                                        }
                                        
                                    } else {
                                        // Login-Fehler
                                        //log("Fehler in updateDeviceID(): " + response.body, "error");
                                        token = "";
                                        device = "";
                                        reachable = false;
                                        saveValue("connection", false, "boolean");
                                    }
                                    
                                });
                            }
                        }
                         
                        function updateDeviceStatus(devicecode) {
                            if(token!="") {
                                var optionsDev;
                        
                                if(apilevel<3) {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/getDeviceStatus.json',
                                        headers: { "x-token": token },
                                        json: { "device_code": devicecode },
                                        method: 'POST',
                                        rejectUnauthorized: false
                                    };
                                } else {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/getDeviceStatus',
                                        headers: { "x-token": token },
                                        json: { "deviceCode": devicecode },
                                        method: 'POST',
                                        rejectUnauthorized: false
                                    };
                                }
                                
                         
                                var request = require('request');
                         
                                request(optionsDev,function (error, response, body){
                            
                                    //log(JSON.stringify(response));
                                    //log(JSON.stringify(body.object_result));
                         
                                    if(parseInt(body.error_code)==0) {
                        
                                        if(apilevel<3) {
                                            if(body.object_result["is_fault"]==true) {
                                                // TODO: Fehlerbeschreibung abrufen
                                                //clearValues();
                                                saveValue("error", true, "boolean");
                                                updateDeviceDetails(devicecode);
                                                updateDeviceErrorMsg(devicecode);
                                            } else {
                                                // kein Fehler
                                                saveValue("error", false, "boolean");
                                                saveValue("errorMessage", "", "string");
                                                saveValue("errorCode", "", "string");
                                                saveValue("errorLevel", 0, "number");
                                                updateDeviceDetails(devicecode);
                                            }
                                        } else {
                                            if(body.objectResult["is_fault"]==true) {
                                                // TODO: Fehlerbeschreibung abrufen
                                                //clearValues();
                                                saveValue("error", true, "boolean");
                                                updateDeviceDetails(devicecode);
                                                updateDeviceErrorMsg(devicecode);
                                            } else {
                                                // kein Fehler
                                                saveValue("error", false, "boolean");
                                                saveValue("errorMessage", "", "string");
                                                saveValue("errorCode", "", "string");
                                                saveValue("errorLevel", 0, "number");
                                                updateDeviceDetails(devicecode);
                                            }
                                        }
                         
                                        
                                        
                                        //token = body.object_result["x-token"];
                                        //log("Login ok! Token " + token);
                                        
                                    } else {
                                        // Login-Fehler
                                        //log("Fehler in updateDeviceStatus(): " + response.body, "error");
                                        token = "";
                                        device = "";
                                        saveValue("connection", false, "boolean");
                                    }
                                    
                                });
                            }
                        }
                         
                        function updateDeviceErrorMsg(devicecode) {
                            if(token!="") {
                                var optionsDev;
                        
                                if(apilevel<3) {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/getFaultDataByDeviceCode.json',
                                        headers: { "x-token": token },
                                        json: { "device_code": devicecode },
                                        method: 'POST',
                                        rejectUnauthorized: false
                                        //headers: {"content-type": "application/json"},
                                        //charset: 'utf8',
                                        //json: true
                                        
                                    };
                                } else {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/getFaultDataByDeviceCode',
                                        headers: { "x-token": token },
                                        json: { "deviceCode": devicecode },
                                        method: 'POST',
                                        rejectUnauthorized: false
                                        //headers: {"content-type": "application/json"},
                                        //charset: 'utf8',
                                        //json: true
                                        
                                    };
                                }
                                
                         
                                var request = require('request');
                         
                                request(optionsDev,function (error, response, body){
                            
                                    //log(JSON.stringify(response));
                                    //log(JSON.stringify(body.object_result));
                         
                                    if(parseInt(body.error_code)==0) {
                         
                                        
                                        saveValue("error", true, "boolean");
                        
                                        if(apilevel<3) {
                                            saveValue("errorMessage", body.object_result[0].description, "string");
                                            saveValue("errorCode", body.object_result[0].fault_code, "string");
                                            saveValue("errorLevel", body.object_result[0].error_level, "string");
                                        } else {
                                            saveValue("errorMessage", body.objectResult[0].description, "string");
                                            saveValue("errorCode", body.objectResult[0].fault_code, "string");
                                            saveValue("errorLevel", body.objectResult[0].error_level, "string");
                                        }
                                        
                                        
                                    } else {
                                        // Login-Fehler
                                        //log("Fehler in updateDeviceErrorMsg(): " + response.body, "error");
                                        token = "";
                                        device = "";
                                        saveValue("connection", false, "boolean");
                                    }
                                    
                                });
                            }
                        }
                         
                        function updateDeviceDetails(devicecode) {
                            if(token!="") {
                                var optionsDev;
                        
                                if(apilevel<3) {
                                    if(product==AQUATEMP_POOLSANA) {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/getDataByCode.json',
                                            headers: { "x-token": token },
                                            json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                            // "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05"]
                                            method: 'POST',
                                            rejectUnauthorized: false
                                        
                                        };
                                    } else if(product==AQUATEMP_OTHER1) {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/getDataByCode.json',
                                            headers: { "x-token": token },
                                            json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T7","T14","T17"] },
                                            method: 'POST',
                                            rejectUnauthorized: false
                                        
                                        };
                                    }
                                    
                                } else {
                                    if(product==AQUATEMP_POOLSANA) {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/getDataByCode',
                                            headers: { "x-token": token },
                                            json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                            method: 'POST',
                                            rejectUnauthorized: false
                                        
                                        };
                                    } else if (product==AQUATEMP_OTHER1) {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/getDataByCode',
                                            headers: { "x-token": token },
                                            json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T7","T14","T17"] },
                                            method: 'POST',
                                            rejectUnauthorized: false
                                        
                                        };
                                    }
                                    
                        
                                }
                                
                         
                                var request = require('request');
                         
                                request(optionsDev,function (error, response, body){
                         
                         
                                    if(parseInt(body.error_code)==0) {
                        
                                        if(apilevel<3) {
                                            saveValue("rawJSON", body.object_result, "string");
                                            
                                            if(findCodeVal(body.object_result, "Power")=="1") {
                                                if(product==AQUATEMP_POOLSANA) {
                                                    // Stromverbrauch T07 x T14 in Watt
                                                    saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T07")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                                    // Luftansaug-Temperatur T01
                                                    saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T01")), "number");
                                                    // Inlet-Temperatur T02
                                                    saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T02")), "number");
                                                    // outlet-Temperatur T03
                                                    saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T03")), "number");
                                                    // Coil-Temperatur T04
                                                    saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T04")), "number");
                                                    // Umgebungs-Temperatur T05
                                                    saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T05")), "number");
                                                } else if (product==AQUATEMP_OTHER1) {
                                                    // Stromverbrauch T7 x T14 in Watt
                                                    saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T7")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                                    // Luftansaug-Temperatur T1
                                                    saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T1")), "number");
                                                    // Inlet-Temperatur T2
                                                    saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T2")), "number");
                                                    // outlet-Temperatur T3
                                                    saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T3")), "number");
                                                    // Coil-Temperatur T4
                                                    saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T4")), "number");
                                                    // Umgebungs-Temperatur T5
                                                    saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T5")), "number");
                                                }
                                            
                                                // Lüfter-Drehzahl T17
                                                saveValue("rotor", parseInt(findCodeVal(body.object_result, "T17")), "number");
                                              
                                                
                                            } else {
                                                saveValue("consumption", 0, "number");
                                                saveValue("rotor", 0, "number");
                                            }
                            
                                            // Ziel-Temperatur Set_Temp
                                            saveValue("tempSet", parseFloat(findCodeVal(body.object_result, "Set_Temp")), "number");
                                
                                            // Flüstermodus Manual-mute
                                            if(findCodeVal(body.object_result, "Manual-mute")=="1") {
                                                saveValue("silent", true, "boolean");
                                            } else {
                                                saveValue("silent", false, "boolean");
                                            }
                            
                                            // Zustand Power
                                            if(findCodeVal(body.object_result, "Power")=="1") {
                                                saveValue("state", true, "boolean");
                                                saveValue("mode", findCodeVal(body.object_result,"Mode"), "string");
                                            } else {
                                                saveValue("state", false, "boolean");
                                                saveValue("mode", "-1", "string");
                                            }
                                            
                                            saveValue("connection", true, "boolean");
                        
                                            // Durchlauf ENDE
                            
                                            
                                        } else {
                                            saveValue("rawJSON", body.objectResult, "string");
                                            
                                            if(findCodeVal(body.objectResult, "Power")=="1") {
                                                if(product==AQUATEMP_POOLSANA) {
                                                    // Stromverbrauch T07 x T14 in Watt
                                                    saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T07")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
                                                    // Luftansaug-Temperatur T01
                                                    saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T01")), "number");
                                                    // Inlet-Temperatur T02
                                                    saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T02")), "number");
                                                    // outlet-Temperatur T03
                                                    saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T03")), "number");
                                                    // Coil-Temperatur T04
                                                    saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T04")), "number");
                                                    // Umgebungs-Temperatur T05
                                                    saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T05")), "number");
                                                } else if (product==AQUATEMP_OTHER1) {
                                                    // Stromverbrauch T7 x T14 in Watt
                                                    saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T7")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
                                                    // Luftansaug-Temperatur T1
                                                    saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T1")), "number");
                                                    // Inlet-Temperatur T2
                                                    saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T2")), "number");
                                                    // outlet-Temperatur T3
                                                    saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T3")), "number");
                                                    // Coil-Temperatur T4
                                                    saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T4")), "number");
                                                    // Umgebungs-Temperatur T5
                                                    saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T5")), "number");
                                                }
                                            
                                                // Lüfter-Drehzahl T17
                                                saveValue("rotor", parseInt(findCodeVal(body.objectResult, "T17")), "number");
                                              
                                                
                                            } else {
                                                saveValue("consumption", 0, "number");
                                                saveValue("rotor", 0, "number");
                                            }
                            
                                            // Ziel-Temperatur Set_Temp
                                            saveValue("tempSet", parseFloat(findCodeVal(body.objectResult, "Set_Temp")), "number");
                                
                                            // Flüstermodus Manual-mute
                                            if(findCodeVal(body.objectResult, "Manual-mute")=="1") {
                                                saveValue("silent", true, "boolean");
                                            } else {
                                                saveValue("silent", false, "boolean");
                                            }
                            
                                            // Zustand Power
                                            if(findCodeVal(body.objectResult, "Power")=="1") {
                                                saveValue("state", true, "boolean");
                                                saveValue("mode", findCodeVal(body.objectResult,"Mode"), "string");
                                            } else {
                                                saveValue("state", false, "boolean");
                                                saveValue("mode", "-1", "string");
                                            }
                                            
                                            saveValue("connection", true, "boolean");
                        
                                            // Durchlauf ENDE
                            
                                            
                                        }
                        
                                        
                                    } else {
                                        // Login-Fehler
                                        //log("Fehler in updateDeviceDetails(): " + response.body, "error");
                                        token = "";
                                        device = "";
                                        saveValue("connection", false, "boolean");
                                    }
                                    
                                });
                            }
                        }
                         
                        function updateDevicePower(devicecode, power) {
                            var powerOpt;
                            var powerMode = 2;
                         
                            if(power==-1) {
                                // aus
                                powerOpt = 0;
                                powerMode = -1;
                            } else if(power==0) {
                                // an und kühlen
                                powerOpt = 1;
                                powerMode = 0;
                            } else if(power==1) {
                                // an und heizen
                                powerOpt = 1;
                                powerMode = 1;
                            } else if(power==2) {
                                // an und auto
                                powerOpt = 1;
                                powerMode = 2;
                            } else {
                                log("ungülter Zustand!");
                                return;
                            }
                         
                            if(token!="") {
                                var optionsDev;
                        
                                if(apilevel<3) {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/control.json',
                                        headers: { "x-token": token },
                                        json: {"param":[{ "device_code": devicecode, "protocol_code": "Power","value": powerOpt }]},
                                        method: 'POST',
                                        rejectUnauthorized: false
                                    };
                                } else {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/control',
                                        headers: { "x-token": token },
                                        json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Power","value": powerOpt }]},
                                        method: 'POST',
                                        rejectUnauthorized: false
                                    };
                        
                                }
                                
                         
                                var request = require('request');
                         
                                request(optionsDev,function (error, response, body){
                                    //log(devicecode);
                                    //log(JSON.stringify(response));
                                    //log(JSON.stringify(body.object_result));
                         
                                    if(parseInt(body.error_code)==0) {
                                        saveValue("mode", power, "string");
                                        if(power>=0) updateDeviceMode(device, power);
                                        
                                    } else {
                                        log("Zustandsänderung fehlgeschlagen!", "error");
                                    }
                                    
                                });
                            }
                        }
                         
                        function updateDeviceMode(devicecode, mode) {
                            
                         
                            if(token!="") {
                                var optionsDev;
                        
                                if(apilevel<3) {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/control.json',
                                        headers: { "x-token": token },
                                        json: {"param":[{ "device_code": devicecode, "protocol_code": "mode","value": mode }]},
                                        method: 'POST',
                                        rejectUnauthorized: false
                                        //headers: {"content-type": "application/json"},
                                        //charset: 'utf8',
                                        //json: true
                                        
                                    };
                                } else {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/control',
                                        headers: { "x-token": token },
                                        json: {"param":[{ "deviceCode": devicecode, "protocolCode": "mode","value": mode }]},
                                        method: 'POST',
                                        rejectUnauthorized: false
                                        //headers: {"content-type": "application/json"},
                                        //charset: 'utf8',
                                        //json: true
                                        
                                    };
                                }
                                
                         
                                var request = require('request');
                         
                                request(optionsDev,function (error, response, body){
                                    //log(devicecode);
                                    //log(JSON.stringify(response));
                                    //log(JSON.stringify(body.object_result));
                         
                                    if(parseInt(body.error_code)==0) {
                                        saveValue("mode", mode, "string");
                                        
                                        
                                    } else {
                                        log("Zustandsänderung fehlgeschlagen!", "error");
                                        token = "";
                                        device = "";
                                        saveValue("connection", false, "boolean");
                                    }
                                    
                                });
                            }
                        }
                         
                        function updateDeviceSilent(devicecode, silent) {
                            
                            var silentMode;
                         
                            if(silent) {
                                silentMode = "1";
                            } else {
                                silentMode = "0";
                            }
                         
                            if(token!="") {
                        
                                var optionsDev;
                        
                                if(apilevel<3) {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/control.json',
                                        headers: { "x-token": token },
                                        json: {"param":[{ "device_code": devicecode, "protocol_code": "Manual-mute","value": silentMode }]},
                                        method: 'POST',
                                        rejectUnauthorized: false
                                        //headers: {"content-type": "application/json"},
                                        //charset: 'utf8',
                                        //json: true
                                        
                                    };
                                } else {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/control',
                                        headers: { "x-token": token },
                                        json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Manual-mute","value": silentMode }]},
                                        method: 'POST',
                                        rejectUnauthorized: false
                                        //headers: {"content-type": "application/json"},
                                        //charset: 'utf8',
                                        //json: true
                                        
                                    };
                                }
                                
                         
                                var request = require('request');
                         
                                request(optionsDev,function (error, response, body){
                                    //log(devicecode);
                                    //log(JSON.stringify(response));
                                    //log(JSON.stringify(body.object_result));
                         
                                    if(parseInt(body.error_code)==0) {
                                        saveValue("silent", silent, "boolean");
                                        
                                        
                                    } else {
                                        log("Zustandsänderung fehlgeschlagen!", "error");
                                        token = "";
                                        device = "";
                                        saveValue("connection", false, "boolean");
                                    }
                                    
                                });
                            }
                        }
                         
                        function updateDeviceSetTemp(devicecode, temperature) {
                         
                            var sTemperature = temperature.toString().replace(",", ".");
                            var sMode = getState(dpRoot + ".mode").val;
                            if(sMode=="-1") {
                                //log("Gerät einschalten um Temperatur zu ändern!", 'warn');
                                return;
                            } else if(sMode=="0") {
                                sMode = "R01"; // Kühlen
                            } else if(sMode=="1") {
                                sMode = "R02"; // Heizen
                            } else if(sMode=="2") {
                                sMode = "R03"; // Auto
                            }
                         
                            
                         
                         
                            if(token!="") {
                                var optionsDev;
                        
                                if(apilevel<3) {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/control.json',
                                        headers: { "x-token": token },
                                        json: {"param":[{ "device_code": devicecode, "protocol_code": "R01","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R02","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R03","value": sTemperature },{ "device_code": devicecode, "protocol_code": "Set_Temp","value": sTemperature }]},
                                        method: 'POST',
                                        rejectUnauthorized: false
                                        //headers: {"content-type": "application/json"},
                                        //charset: 'utf8',
                                        //json: true
                                        
                                    };
                                } else {
                                    optionsDev = {
                                        url: cloudURL + '/app/device/control',
                                        headers: { "x-token": token },
                                        json: {"param":[{ "deviceCode": devicecode, "protocolCode": "R01","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R02","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R03","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "Set_Temp","value": sTemperature }]},
                                        method: 'POST',
                                        rejectUnauthorized: false
                                        //headers: {"content-type": "application/json"},
                                        //charset: 'utf8',
                                        //json: true
                                        
                                    };
                        
                                }
                                
                         
                                var request = require('request');
                         
                                request(optionsDev,function (error, response, body){
                                    //log(devicecode);
                                    //log(JSON.stringify(response));
                                    //log(JSON.stringify(body.object_result));
                         
                                    if(parseInt(body.error_code)==0) {
                                        saveValue("tempSet", temperature, "number");
                                        
                                        
                                    } else {
                                        log("Zustandsänderung fehlgeschlagen!", "error");
                                        token = "";
                                        device = "";
                                        saveValue("connection", false, "boolean");
                                        //log(JSON.stringify(response));
                                    }
                                    
                                });
                            }
                        }
                         
                        // Beginn des Skripts
                        
                        setupEndpoints();
                        createobjects(); // DPs anlegen
                         
                        updateToken(); // Zugriffstoken erfragen und aktuelle Werte lesen
                         
                        schedule('*/' + interval + ' * * * * *', function () {
                            // regelmäßig Token und Zustand abfragen
                            updateToken();
                         
                            // gewünschte Änderungen ausführen
                            if(!getState(dpRoot + ".mode").ack) {
                                updateDevicePower(device, getState(dpRoot + ".mode").val);
                            }
                            if(!getState(dpRoot + ".silent").ack) {
                                updateDevicePower(device, getState(dpRoot + ".silent").val);
                            }
                        });
                         
                        tokenRefreshTimer = setInterval(function () {
                            // Token verfällt nach 60min
                            token = "";
                            //log("Token nach Intervall verworfen.")
                            updateToken();
                        }, 3600000);
                         
                        on({id: dpRoot + ".mode", change: "ne", ack: false}, function (obj) {
                            updateToken();
                            updateDevicePower(device, getState(dpRoot + ".mode").val);
                        });
                         
                        on({id: dpRoot + ".silent", change: "ne", ack: false}, function (obj) {
                            updateToken();
                            updateDeviceSilent(device, getState(dpRoot + ".silent").val);
                        });
                         
                        on({id: dpRoot + ".tempSet", change: "ne", ack: false}, function (obj) {
                            updateToken();
                            updateDeviceSetTemp(device, getState(dpRoot + ".tempSet").val);
                        });
                        
                        
                        P Offline
                        P Offline
                        PietNB
                        schrieb am zuletzt editiert von
                        #157

                        @oxident Leider bekomme ich mit dem Script keine Verbindung.

                        avascript.0
                        2023-07-04 18:16:00.117	error	Error in request callback: TypeError: Cannot read property '0' of undefined
                        
                        javascript.0
                        2023-07-04 18:15:34.367	error	Error in request callback: TypeError: Cannot read property '0' of undefined
                        
                        javascript.0
                        2023-07-04 18:15:34.032	info	script.js.Poolheizung: registered 3 subscriptions, 1 schedule, 0 messages, 0 logs and 0 file subscriptions
                        
                        javascript.0
                        2023-07-04 18:15:34.024	info	script.js.Poolheizung: erstelle Objekte
                        
                        javascript.0
                        2023-07-04 18:15:34.007	info	Start javascript script.js.Poolheizung
                        
                        javascript.0
                        2023-07-04 18:15:30.135	info	Stop script script.js.Poolheizung
                        
                        javascript.0
                        2023-07-04 18:15:30.126	error	Error in request callback: TypeError: Cannot read property '0' of undefine
                        

                        Hab das alte davor wieder installiert und es geht das was vorher auch ging.

                        1 Antwort Letzte Antwort
                        0
                        • O oxident

                          @pietnb Ich habe jetzt mal angefangen, das ein wenig "in Form" zu gießen.
                          Vielleicht machst Du Dir lieber vorher eine Kopie Deines aktuellen Skripts ;-)

                          // Midas Poolheizung
                          // v0.0.8c
                          // Changelog:
                          // 0.0.8: Testweise Unterstützung von neu registrierten Anlagen
                          // 0.0.7: Kleinigkeiten überarbeitet
                          //        weitere Modelle hinzugefügt
                          // 0.0.6: Gültigkeitsprüfung des Zertifikats deaktiviert (Dank an znyde)
                          //        Kompatibilität mit Promo Next Modellen durch generische Product-ID (Dank an znyde)
                          // 0.0.5: weitere Abfragewerte hinzugefügt (Kompressor- und Ansaugtemperatur)
                          // 0.0.4: Tokenverfall jetzt 60min nach Skriptstart und nicht zu jeder vollen Stunde (Dank an dering)
                          // 0.0.3: Datenpunkte beim Start automatisch anlegen (Dank an Andy200877)
                          // 0.0.2: Token bei jedem Set-Vorgang prüfen und ggf. neu anfordern (Dank an dering)
                          
                          // ANFANG konfigurierbare Elemente -----
                          const username = "EMAIL";
                          var password = "KENNWORT";
                          const interval = 30; // Abfrageintervall in Sekunden
                          const dpRoot = "0_userdata.0.Poolheizung"; // Stammordner der Datenpunkte
                          var apilevel = 1;   // 1: AquaTemp-Accounts, die vor v.1.5.8 erstellt wurden
                                              // 2: HiTemp-Accounts
                                              // 3: AquaTemp-Accounts, die mit neueren App-Versionen erstellt wurden
                                              
                          
                          // ENDE --------------------------------
                           
                          var cloudURL;
                          
                          var token = "";
                          var tokenRefreshTimer;
                          var device = "";
                          
                          // ProductIDs:
                          // Gruppe 1:
                          // 1132174963097280512: Midas/Poolsana InverPro
                          const AQUATEMP_POOLSANA="1132174963097280512";
                          // Gruppe 2:
                          // 1442284873216843776: 
                          const AQUATEMP_OTHER1="1442284873216843776";
                          
                          var product = "";
                          var reachable = false;
                          
                          function setupEndpoints() {
                              if(apilevel==1) {
                                  cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                              } else if(apilevel==2) {
                                  cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                              } else if(apilevel==3) {
                                  cloudURL = "https://cloud.linked-go.com:449/crmservice/api";
                                  password = require('crypto').createHash('md5').update(password).digest("hex");
                          
                              }
                          }
                           
                          function clearValues() {
                              saveValue("error", true, "boolean");
                              saveValue("consumption", 0, "number");
                              saveValue("state", false, "boolean");
                          }
                           
                          function saveValue(key, value, sType) {
                              var dp = dpRoot + "." + key;
                           
                              if ( !existsState(dp )) {
                                  createState(dp,value,{name: key,  type: 'number', role: 'value'}, function () {}); 
                              } else {
                                  setState(dp,value,true);
                              }
                          }
                           
                          function findCodeVal(result, code) {
                              //log(code);
                              for(var i=0; i<result.length; i++) {
                                  //log(result[i].code);
                                  
                                  if(result[i].code.indexOf(code) >= 0) {
                                      return result[i].value;
                                  }
                              }
                              return "";
                          }
                           
                          function createobjects() {
                              log ("erstelle Objekte");
                              createState(dpRoot + '.ambient', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Umgebungstemperatur"});
                              createState(dpRoot + '.connection', {read: true, write: false,  type: "boolean", role: "state", name: "Verbindung", def: false});
                              createState(dpRoot + '.consumption', {read: true, write: false,  type: "number", unit:"W", role: "value.power", name: "Stromverbrauch", def: 0});
                              createState(dpRoot + '.error', {read: true, write: false,  type: "boolean", role: "state", name: "Fehler", def: false});
                              createState(dpRoot + '.errorCode', {read: true, write: false,  type: "string", name: "Fehlercode", def: ""});
                              createState(dpRoot + '.errorLevel', {read: true, write: false,  type: "number", name: "Fehlerlevel"});
                              createState(dpRoot + '.errorMessage', {read: true, write: false,  type: "string", name: "Fehlermeldung", def: ""});
                              createState(dpRoot + '.mode', {read: true, write: true,  type: "string", states: "-1:off;0:cool;1:heat;2:auto", name: "Modus", def: ""});
                              createState(dpRoot + '.rotor', {read: true, write: false,  type: "number", unit:"rpm", def: 0, name: "Lüfterdrehzahl"});
                              createState(dpRoot + '.silent', {read: true, write: true,  type: "boolean", role: "state", name: "Silent", def: false});
                              createState(dpRoot + '.state', {read: true, write: false,  type: "boolean", role: "state", name: "Status", def: false});
                              createState(dpRoot + '.tempIn', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Eingangstemperatur"});
                              createState(dpRoot + '.tempOut', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Ausgangstemperatur"});
                              createState(dpRoot + '.tempSet', {read: true, write: true,  type: "number", unit:"°C", role: "level.temperature", name: "Solltemperatur"});
                              createState(dpRoot + '.suctionTemp', {read: true, write: false,  type: "number", unit:"°C", name: "Luftansaugtemperatur"});
                              createState(dpRoot + '.coilTemp', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Kompressortemperatur"});
                              
                              createState(dpRoot + '.rawJSON', {read: true, write: false,  type: "array", name: "komplette Rückgabe"});
                          }
                           
                          function updateToken() {
                           
                              if(token=="") {
                                  //log("Token Neuanforderung");
                                  var request = require('request');
                                  var options;
                              
                                  if(apilevel<3) {
                                      options = {
                                          url: cloudURL + '/app/user/login.json',
                                          method: 'POST',
                                          json: { "user_name": username, "password": password, "type": "2" },
                                          rejectUnauthorized: false
                                      };
                                  } else {
                                      options = {
                                          url: cloudURL + '/app/user/login',
                                          method: 'POST',
                                          json: { "userName": username, "password": password, "type": "2" },
                                          rejectUnauthorized: false
                                      };
                                  }
                                  
                          
                                  //log(JSON.stringify(options));
                                  
                                  request(options,function (error, response, body){
                                  
                                      //log(JSON.stringify(response));
                                      if(parseInt(body.error_code)==0) {
                                          
                                          if(apilevel<3) {
                                              token = body.object_result["x-token"];
                                          } else {
                                              token = body.objectResult["x-token"];
                                          }
                                          
                                          //log("Login ok! Token " + token);
                                          updateDeviceID();
                                      } else {
                                          // Login-Fehler
                                          //log("Login-Fehler in updateToken(): " + response.body, "error");
                                          token = "";
                                          saveValue("connection", false, "boolean");
                                      }
                                      
                                  });
                              } else {
                                  updateDeviceID();
                              }
                           
                              
                           
                              
                           
                          }
                           
                          function updateDeviceID() {
                              if(token!="") {
                                  var optionsDev;
                                  if(apilevel<3) {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/deviceList.json',
                                          headers: { "x-token": token },
                                          body: {"product_ids": [
                                                  "1132174963097280512",
                                                  "1186904563333062656",
                                                  "1158905952238313472",
                                                  "1245226668902080512",
                                                  "1442284873216843776",
                                                  "1548963836789501952",
                                                  ]},
                                          method: 'POST',
                                          json: true,
                                          rejectUnauthorized: false  
                                      };
                                  } else {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/deviceList',
                                          headers: { "x-token": token },
                                          body: {"productIds": [
                                                  "1132174963097280512",
                                                  "1186904563333062656",
                                                  "1158905952238313472",
                                                  "1245226668902080512",
                                                  "1442284873216843776",
                                                  "1548963836789501952",
                                                  ]},
                                          method: 'POST',
                                          json: true,
                                          rejectUnauthorized: false  
                                      };
                                  }
                          
                                  var request = require('request');
                           
                                  request(optionsDev,function (error, response, body){
                              
                                      //log(JSON.stringify(response));
                                      //log(JSON.stringify(body.object_result));
                           
                                      if(parseInt(body.error_code)==0) {
                                          
                                          //token = body.object_result["x-token"];
                                          //log("Login ok! Token " + token);
                                          
                                          if(apilevel<3) {
                                              device = body.object_result[0].device_code;
                                              product = body.object_result[0].product_id;
                                              reachable = (body.object_result[0].device_status=="ONLINE");
                                          } else {
                                              device = body.objectResult[0].deviceCode;
                                              product = body.object_result[0].productId;
                                              reachable = (body.objectResult[0].deviceStatus=="ONLINE");
                                          }
                          
                                          //log(product);
                                          
                                          if(reachable) {
                                              saveValue("connection", true, "boolean");
                                              if(device!="") updateDeviceStatus(device);
                                          } else {
                                              // offline
                                              device = "";
                                              saveValue("connection", false, "boolean");
                                          }
                                          
                                      } else {
                                          // Login-Fehler
                                          //log("Fehler in updateDeviceID(): " + response.body, "error");
                                          token = "";
                                          device = "";
                                          reachable = false;
                                          saveValue("connection", false, "boolean");
                                      }
                                      
                                  });
                              }
                          }
                           
                          function updateDeviceStatus(devicecode) {
                              if(token!="") {
                                  var optionsDev;
                          
                                  if(apilevel<3) {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/getDeviceStatus.json',
                                          headers: { "x-token": token },
                                          json: { "device_code": devicecode },
                                          method: 'POST',
                                          rejectUnauthorized: false
                                      };
                                  } else {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/getDeviceStatus',
                                          headers: { "x-token": token },
                                          json: { "deviceCode": devicecode },
                                          method: 'POST',
                                          rejectUnauthorized: false
                                      };
                                  }
                                  
                           
                                  var request = require('request');
                           
                                  request(optionsDev,function (error, response, body){
                              
                                      //log(JSON.stringify(response));
                                      //log(JSON.stringify(body.object_result));
                           
                                      if(parseInt(body.error_code)==0) {
                          
                                          if(apilevel<3) {
                                              if(body.object_result["is_fault"]==true) {
                                                  // TODO: Fehlerbeschreibung abrufen
                                                  //clearValues();
                                                  saveValue("error", true, "boolean");
                                                  updateDeviceDetails(devicecode);
                                                  updateDeviceErrorMsg(devicecode);
                                              } else {
                                                  // kein Fehler
                                                  saveValue("error", false, "boolean");
                                                  saveValue("errorMessage", "", "string");
                                                  saveValue("errorCode", "", "string");
                                                  saveValue("errorLevel", 0, "number");
                                                  updateDeviceDetails(devicecode);
                                              }
                                          } else {
                                              if(body.objectResult["is_fault"]==true) {
                                                  // TODO: Fehlerbeschreibung abrufen
                                                  //clearValues();
                                                  saveValue("error", true, "boolean");
                                                  updateDeviceDetails(devicecode);
                                                  updateDeviceErrorMsg(devicecode);
                                              } else {
                                                  // kein Fehler
                                                  saveValue("error", false, "boolean");
                                                  saveValue("errorMessage", "", "string");
                                                  saveValue("errorCode", "", "string");
                                                  saveValue("errorLevel", 0, "number");
                                                  updateDeviceDetails(devicecode);
                                              }
                                          }
                           
                                          
                                          
                                          //token = body.object_result["x-token"];
                                          //log("Login ok! Token " + token);
                                          
                                      } else {
                                          // Login-Fehler
                                          //log("Fehler in updateDeviceStatus(): " + response.body, "error");
                                          token = "";
                                          device = "";
                                          saveValue("connection", false, "boolean");
                                      }
                                      
                                  });
                              }
                          }
                           
                          function updateDeviceErrorMsg(devicecode) {
                              if(token!="") {
                                  var optionsDev;
                          
                                  if(apilevel<3) {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/getFaultDataByDeviceCode.json',
                                          headers: { "x-token": token },
                                          json: { "device_code": devicecode },
                                          method: 'POST',
                                          rejectUnauthorized: false
                                          //headers: {"content-type": "application/json"},
                                          //charset: 'utf8',
                                          //json: true
                                          
                                      };
                                  } else {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/getFaultDataByDeviceCode',
                                          headers: { "x-token": token },
                                          json: { "deviceCode": devicecode },
                                          method: 'POST',
                                          rejectUnauthorized: false
                                          //headers: {"content-type": "application/json"},
                                          //charset: 'utf8',
                                          //json: true
                                          
                                      };
                                  }
                                  
                           
                                  var request = require('request');
                           
                                  request(optionsDev,function (error, response, body){
                              
                                      //log(JSON.stringify(response));
                                      //log(JSON.stringify(body.object_result));
                           
                                      if(parseInt(body.error_code)==0) {
                           
                                          
                                          saveValue("error", true, "boolean");
                          
                                          if(apilevel<3) {
                                              saveValue("errorMessage", body.object_result[0].description, "string");
                                              saveValue("errorCode", body.object_result[0].fault_code, "string");
                                              saveValue("errorLevel", body.object_result[0].error_level, "string");
                                          } else {
                                              saveValue("errorMessage", body.objectResult[0].description, "string");
                                              saveValue("errorCode", body.objectResult[0].fault_code, "string");
                                              saveValue("errorLevel", body.objectResult[0].error_level, "string");
                                          }
                                          
                                          
                                      } else {
                                          // Login-Fehler
                                          //log("Fehler in updateDeviceErrorMsg(): " + response.body, "error");
                                          token = "";
                                          device = "";
                                          saveValue("connection", false, "boolean");
                                      }
                                      
                                  });
                              }
                          }
                           
                          function updateDeviceDetails(devicecode) {
                              if(token!="") {
                                  var optionsDev;
                          
                                  if(apilevel<3) {
                                      if(product==AQUATEMP_POOLSANA) {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/getDataByCode.json',
                                              headers: { "x-token": token },
                                              json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                              // "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05"]
                                              method: 'POST',
                                              rejectUnauthorized: false
                                          
                                          };
                                      } else if(product==AQUATEMP_OTHER1) {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/getDataByCode.json',
                                              headers: { "x-token": token },
                                              json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T4","T5","T7","T14","T17"] },
                                              method: 'POST',
                                              rejectUnauthorized: false
                                          
                                          };
                                      }
                                      
                                  } else {
                                      if(product==AQUATEMP_POOLSANA) {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/getDataByCode',
                                              headers: { "x-token": token },
                                              json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                              method: 'POST',
                                              rejectUnauthorized: false
                                          
                                          };
                                      } else if (product==AQUATEMP_OTHER1) {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/getDataByCode',
                                              headers: { "x-token": token },
                                              json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T4","T5","T7","T14","T17"] },
                                              method: 'POST',
                                              rejectUnauthorized: false
                                          
                                          };
                                      }
                                      
                          
                                  }
                                  
                           
                                  var request = require('request');
                           
                                  request(optionsDev,function (error, response, body){
                           
                           
                                      if(parseInt(body.error_code)==0) {
                          
                                          if(apilevel<3) {
                                              saveValue("rawJSON", body.object_result, "string");
                                              
                                              if(findCodeVal(body.object_result, "Power")=="1") {
                                                  if(product==AQUATEMP_POOLSANA) {
                                                      // Stromverbrauch T07 x T14 in Watt
                                                      saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T07")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                                      // Luftansaug-Temperatur T01
                                                      saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T01")), "number");
                                                      // Inlet-Temperatur T02
                                                      saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T02")), "number");
                                                      // outlet-Temperatur T03
                                                      saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T03")), "number");
                                                      // Coil-Temperatur T04
                                                      saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T04")), "number");
                                                      // Umgebungs-Temperatur T05
                                                      saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T05")), "number");
                                                  } else if (product==AQUATEMP_OTHER1) {
                                                      // Stromverbrauch T7 x T14 in Watt
                                                      saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T7")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                                      // Luftansaug-Temperatur T1
                                                      saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T1")), "number");
                                                      // Inlet-Temperatur T2
                                                      saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T2")), "number");
                                                      // outlet-Temperatur T3
                                                      saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T3")), "number");
                                                      // Coil-Temperatur T4
                                                      saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T4")), "number");
                                                      // Umgebungs-Temperatur T5
                                                      saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T5")), "number");
                                                  }
                                              
                                                  // Lüfter-Drehzahl T17
                                                  saveValue("rotor", parseInt(findCodeVal(body.object_result, "T17")), "number");
                                                
                                                  
                                              } else {
                                                  saveValue("consumption", 0, "number");
                                                  saveValue("rotor", 0, "number");
                                              }
                              
                                              // Ziel-Temperatur Set_Temp
                                              saveValue("tempSet", parseFloat(findCodeVal(body.object_result, "Set_Temp")), "number");
                                  
                                              // Flüstermodus Manual-mute
                                              if(findCodeVal(body.object_result, "Manual-mute")=="1") {
                                                  saveValue("silent", true, "boolean");
                                              } else {
                                                  saveValue("silent", false, "boolean");
                                              }
                              
                                              // Zustand Power
                                              if(findCodeVal(body.object_result, "Power")=="1") {
                                                  saveValue("state", true, "boolean");
                                                  saveValue("mode", findCodeVal(body.object_result,"Mode"), "string");
                                              } else {
                                                  saveValue("state", false, "boolean");
                                                  saveValue("mode", "-1", "string");
                                              }
                                              
                                              saveValue("connection", true, "boolean");
                          
                                              // Durchlauf ENDE
                              
                                              //log(findCodeVal(body.object_result, "T07"));
                                          } else {
                                              saveValue("rawJSON", body.objectResult, "string");
                                          
                                              if(findCodeVal(body.objectResult, "Power")=="1") {
                                                  // Stromverbrauch T07 x T14 in Watt
                                                  saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T07")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
                          
                                                  // Lüfter-Drehzahl T17
                                                  saveValue("rotor", parseInt(findCodeVal(body.objectResult, "T17")), "number");
                                                  // Luftansaug-Temperatur T01
                                                  saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T01")), "number");
                                                  // Inlet-Temperatur T02
                                                  saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T02")), "number");
                                                  // outlet-Temperatur T03
                                                  saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T03")), "number");
                                                  // Coil-Temperatur T04
                                                  saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T04")), "number");
                                              } else {
                                                  saveValue("consumption", 0, "number");
                                                  saveValue("rotor", 0, "number");
                                              }
                          
                          
                              
                                              // Ziel-Temperatur Set_Temp
                                              saveValue("tempSet", parseFloat(findCodeVal(body.objectResult, "Set_Temp")), "number");
                              
                                              // Umgebungs-Temperatur T05
                                              saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T05")), "number");
                              
                                              // Flüstermodus Manual-mute
                                              if(findCodeVal(body.objectResult, "Manual-mute")=="1") {
                                                  saveValue("silent", true, "boolean");
                                              } else {
                                                  saveValue("silent", false, "boolean");
                                              }
                              
                                              // Zustand Power
                                              if(findCodeVal(body.objectResult, "Power")=="1") {
                                                  saveValue("state", true, "boolean");
                                                  saveValue("mode", findCodeVal(body.objectResult,"Mode"), "string");
                                              } else {
                                                  saveValue("state", false, "boolean");
                                                  saveValue("mode", "-1", "string");
                                              }
                                              
                                              saveValue("connection", true, "boolean");
                          
                                              // Durchlauf ENDE
                              
                                              //log(findCodeVal(body.object_result, "T07"));
                                          }
                          
                                          
                                      } else {
                                          // Login-Fehler
                                          //log("Fehler in updateDeviceDetails(): " + response.body, "error");
                                          token = "";
                                          device = "";
                                          saveValue("connection", false, "boolean");
                                      }
                                      
                                  });
                              }
                          }
                           
                          function updateDevicePower(devicecode, power) {
                              var powerOpt;
                              var powerMode = 2;
                           
                              if(power==-1) {
                                  // aus
                                  powerOpt = 0;
                                  powerMode = -1;
                              } else if(power==0) {
                                  // an und kühlen
                                  powerOpt = 1;
                                  powerMode = 0;
                              } else if(power==1) {
                                  // an und heizen
                                  powerOpt = 1;
                                  powerMode = 1;
                              } else if(power==2) {
                                  // an und auto
                                  powerOpt = 1;
                                  powerMode = 2;
                              } else {
                                  log("ungülter Zustand!");
                                  return;
                              }
                           
                              if(token!="") {
                                  var optionsDev;
                          
                                  if(apilevel<3) {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/control.json',
                                          headers: { "x-token": token },
                                          json: {"param":[{ "device_code": devicecode, "protocol_code": "Power","value": powerOpt }]},
                                          method: 'POST',
                                          rejectUnauthorized: false
                                      };
                                  } else {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/control',
                                          headers: { "x-token": token },
                                          json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Power","value": powerOpt }]},
                                          method: 'POST',
                                          rejectUnauthorized: false
                                      };
                          
                                  }
                                  
                           
                                  var request = require('request');
                           
                                  request(optionsDev,function (error, response, body){
                                      //log(devicecode);
                                      //log(JSON.stringify(response));
                                      //log(JSON.stringify(body.object_result));
                           
                                      if(parseInt(body.error_code)==0) {
                                          saveValue("mode", power, "string");
                                          if(power>=0) updateDeviceMode(device, power);
                                          
                                      } else {
                                          log("Zustandsänderung fehlgeschlagen!", "error");
                                      }
                                      
                                  });
                              }
                          }
                           
                          function updateDeviceMode(devicecode, mode) {
                              
                           
                              if(token!="") {
                                  var optionsDev;
                          
                                  if(apilevel<3) {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/control.json',
                                          headers: { "x-token": token },
                                          json: {"param":[{ "device_code": devicecode, "protocol_code": "mode","value": mode }]},
                                          method: 'POST',
                                          rejectUnauthorized: false
                                          //headers: {"content-type": "application/json"},
                                          //charset: 'utf8',
                                          //json: true
                                          
                                      };
                                  } else {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/control',
                                          headers: { "x-token": token },
                                          json: {"param":[{ "deviceCode": devicecode, "protocolCode": "mode","value": mode }]},
                                          method: 'POST',
                                          rejectUnauthorized: false
                                          //headers: {"content-type": "application/json"},
                                          //charset: 'utf8',
                                          //json: true
                                          
                                      };
                                  }
                                  
                           
                                  var request = require('request');
                           
                                  request(optionsDev,function (error, response, body){
                                      //log(devicecode);
                                      //log(JSON.stringify(response));
                                      //log(JSON.stringify(body.object_result));
                           
                                      if(parseInt(body.error_code)==0) {
                                          saveValue("mode", mode, "string");
                                          
                                          
                                      } else {
                                          log("Zustandsänderung fehlgeschlagen!", "error");
                                          token = "";
                                          device = "";
                                          saveValue("connection", false, "boolean");
                                      }
                                      
                                  });
                              }
                          }
                           
                          function updateDeviceSilent(devicecode, silent) {
                              
                              var silentMode;
                           
                              if(silent) {
                                  silentMode = "1";
                              } else {
                                  silentMode = "0";
                              }
                           
                              if(token!="") {
                          
                                  var optionsDev;
                          
                                  if(apilevel<3) {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/control.json',
                                          headers: { "x-token": token },
                                          json: {"param":[{ "device_code": devicecode, "protocol_code": "Manual-mute","value": silentMode }]},
                                          method: 'POST',
                                          rejectUnauthorized: false
                                          //headers: {"content-type": "application/json"},
                                          //charset: 'utf8',
                                          //json: true
                                          
                                      };
                                  } else {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/control',
                                          headers: { "x-token": token },
                                          json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Manual-mute","value": silentMode }]},
                                          method: 'POST',
                                          rejectUnauthorized: false
                                          //headers: {"content-type": "application/json"},
                                          //charset: 'utf8',
                                          //json: true
                                          
                                      };
                                  }
                                  
                           
                                  var request = require('request');
                           
                                  request(optionsDev,function (error, response, body){
                                      //log(devicecode);
                                      //log(JSON.stringify(response));
                                      //log(JSON.stringify(body.object_result));
                           
                                      if(parseInt(body.error_code)==0) {
                                          saveValue("silent", silent, "boolean");
                                          
                                          
                                      } else {
                                          log("Zustandsänderung fehlgeschlagen!", "error");
                                          token = "";
                                          device = "";
                                          saveValue("connection", false, "boolean");
                                      }
                                      
                                  });
                              }
                          }
                           
                          function updateDeviceSetTemp(devicecode, temperature) {
                           
                              var sTemperature = temperature.toString().replace(",", ".");
                              var sMode = getState(dpRoot + ".mode").val;
                              if(sMode=="-1") {
                                  //log("Gerät einschalten um Temperatur zu ändern!", 'warn');
                                  return;
                              } else if(sMode=="0") {
                                  sMode = "R01"; // Kühlen
                              } else if(sMode=="1") {
                                  sMode = "R02"; // Heizen
                              } else if(sMode=="2") {
                                  sMode = "R03"; // Auto
                              }
                           
                              
                           
                           
                              if(token!="") {
                                  var optionsDev;
                          
                                  if(apilevel<3) {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/control.json',
                                          headers: { "x-token": token },
                                          json: {"param":[{ "device_code": devicecode, "protocol_code": "R01","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R02","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R03","value": sTemperature },{ "device_code": devicecode, "protocol_code": "Set_Temp","value": sTemperature }]},
                                          method: 'POST',
                                          rejectUnauthorized: false
                                          //headers: {"content-type": "application/json"},
                                          //charset: 'utf8',
                                          //json: true
                                          
                                      };
                                  } else {
                                      optionsDev = {
                                          url: cloudURL + '/app/device/control',
                                          headers: { "x-token": token },
                                          json: {"param":[{ "deviceCode": devicecode, "protocolCode": "R01","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R02","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R03","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "Set_Temp","value": sTemperature }]},
                                          method: 'POST',
                                          rejectUnauthorized: false
                                          //headers: {"content-type": "application/json"},
                                          //charset: 'utf8',
                                          //json: true
                                          
                                      };
                          
                                  }
                                  
                           
                                  var request = require('request');
                           
                                  request(optionsDev,function (error, response, body){
                                      //log(devicecode);
                                      //log(JSON.stringify(response));
                                      //log(JSON.stringify(body.object_result));
                           
                                      if(parseInt(body.error_code)==0) {
                                          saveValue("tempSet", temperature, "number");
                                          
                                          
                                      } else {
                                          log("Zustandsänderung fehlgeschlagen!", "error");
                                          token = "";
                                          device = "";
                                          saveValue("connection", false, "boolean");
                                          //log(JSON.stringify(response));
                                      }
                                      
                                  });
                              }
                          }
                           
                          // Beginn des Skripts
                          
                          setupEndpoints();
                          createobjects(); // DPs anlegen
                           
                          updateToken(); // Zugriffstoken erfragen und aktuelle Werte lesen
                           
                          schedule('*/' + interval + ' * * * * *', function () {
                              // regelmäßig Token und Zustand abfragen
                              updateToken();
                           
                              // gewünschte Änderungen ausführen
                              if(!getState(dpRoot + ".mode").ack) {
                                  updateDevicePower(device, getState(dpRoot + ".mode").val);
                              }
                              if(!getState(dpRoot + ".silent").ack) {
                                  updateDevicePower(device, getState(dpRoot + ".silent").val);
                              }
                          });
                           
                          tokenRefreshTimer = setInterval(function () {
                              // Token verfällt nach 60min
                              token = "";
                              //log("Token nach Intervall verworfen.")
                              updateToken();
                          }, 3600000);
                           
                          on({id: dpRoot + ".mode", change: "ne", ack: false}, function (obj) {
                              updateToken();
                              updateDevicePower(device, getState(dpRoot + ".mode").val);
                          });
                           
                          on({id: dpRoot + ".silent", change: "ne", ack: false}, function (obj) {
                              updateToken();
                              updateDeviceSilent(device, getState(dpRoot + ".silent").val);
                          });
                           
                          on({id: dpRoot + ".tempSet", change: "ne", ack: false}, function (obj) {
                              updateToken();
                              updateDeviceSetTemp(device, getState(dpRoot + ".tempSet").val);
                          });
                          
                          
                          R Offline
                          R Offline
                          radi71
                          schrieb am zuletzt editiert von
                          #158

                          @oxident Also ich habe jetzt mal die Version c ausprobiert, in der Hoffnung das es die aktuellste ist.

                          Der Login funktionert jetzt, aber ich bekomme keine Werte zurück. So wie ich das sehe passen einige Varaiblen nicht, die nach dem Login zurückgegeben werden.

                          {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"deviceType":null,"device_status":"ONLINE","is_fault":false,"device_id":"1671163101518499840","productId":"1132174963097280512","deviceNickName":"Poolwärmepumpe Rade","device_type":null,"deviceCode":"34EAE7F5D014","isFault":false,"deviceName":null,"deviceId":"1671163101518499840","deviceStatus":"ONLINE","device_name":null,"device_code":"34EAE7F5D014","product_id":"1132174963097280512","model":"PASRW050-P-BP6II-K","sn":"B052203060151","device_nick_name":"Poolwärmepumpe Rade","projectId":null}],"isReusltSuc":true},"headers":{"date":"Wed, 05 Jul 2023 07:05:30 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/deviceList","path":"/crmservice/api/app/device/deviceList","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/deviceList"},"method":"POST","headers":{"x-token":"UjlXO73fc6XlssM+8aWeHR1j9ytFwG6Q3QT/4BBUFiEKOdw/1OPH7w1BfQ9QitemS2i7dJBJA7OhbqhZMOyfvQ==","accept":"application/json","content-type":"application/json","content-length":148}}}
                          

                          Also was kann ich zur Unterstützung leisten?

                          VG
                          Thomas

                          1 Antwort Letzte Antwort
                          0
                          • O Offline
                            O Offline
                            oxident
                            schrieb am zuletzt editiert von
                            #159

                            So, neuer Tag, neues Glück. Ich habe in der Tat schon einen krassen Fehler gefunden, der auf jeden Fall die Nutzer mit der neuen App betrafen. Außerdem habe ich jetzt eine Option für intensives Debugging hinzugefügt. Bitte mal den Wert bei debugLevel kurzzeitig (am besten nur bis zum Auftreten des Fehlers) auf 1 stellen:

                            // Midas Poolheizung
                            // v0.0.8d
                            // Changelog:
                            // 0.0.8: Testweise Unterstützung von neu registrierten Anlagen
                            // 0.0.7: Kleinigkeiten überarbeitet
                            //        weitere Modelle hinzugefügt
                            // 0.0.6: Gültigkeitsprüfung des Zertifikats deaktiviert (Dank an znyde)
                            //        Kompatibilität mit Promo Next Modellen durch generische Product-ID (Dank an znyde)
                            // 0.0.5: weitere Abfragewerte hinzugefügt (Kompressor- und Ansaugtemperatur)
                            // 0.0.4: Tokenverfall jetzt 60min nach Skriptstart und nicht zu jeder vollen Stunde (Dank an dering)
                            // 0.0.3: Datenpunkte beim Start automatisch anlegen (Dank an Andy200877)
                            // 0.0.2: Token bei jedem Set-Vorgang prüfen und ggf. neu anfordern (Dank an dering)
                            
                            // ANFANG konfigurierbare Elemente -----
                            const username = "EMAIL";
                            var password = "KENNWORT";
                            
                            const interval = 30; // Abfrageintervall in Sekunden
                            
                            const dpRoot = "0_userdata.0.Poolheizung"; // Stammordner der Datenpunkte
                            
                            const apilevel = 1;   // 1: AquaTemp-Accounts, die vor v.1.5.8 erstellt wurden
                                                  // 2: HiTemp-Accounts
                                                  // 3: AquaTemp-Accounts, die mit neueren App-Versionen erstellt wurden
                            
                            const debugLevel = 0;   // 0: keine erweiterten Informationen protokollieren
                                                    // 1: Debug-Informationen protokollieren
                            
                            // ENDE --------------------------------
                             
                            var cloudURL;
                            
                            var token = "";
                            var tokenRefreshTimer;
                            var device = "";
                            
                            // ProductIDs:
                            // Gruppe 1:
                            // 1132174963097280512: Midas/Poolsana InverPro
                            const AQUATEMP_POOLSANA="1132174963097280512";
                            // Gruppe 2:
                            // 1442284873216843776: 
                            const AQUATEMP_OTHER1="1442284873216843776";
                            
                            var product = "";
                            var reachable = false;
                            
                            function setupEndpoints() {
                                if(apilevel==1) {
                                    cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                                } else if(apilevel==2) {
                                    cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                                } else if(apilevel==3) {
                                    cloudURL = "https://cloud.linked-go.com:449/crmservice/api";
                                    password = require('crypto').createHash('md5').update(password).digest("hex");
                                }
                                printLog("API-Level " + apilevel, 1);
                            }
                             
                            function clearValues() {
                                saveValue("error", true, "boolean");
                                saveValue("consumption", 0, "number");
                                saveValue("state", false, "boolean");
                            }
                             
                            function saveValue(key, value, sType) {
                                var dp = dpRoot + "." + key;
                             
                                if ( !existsState(dp )) {
                                    printLog("Schreibe in NEUEN Datenpunkt: " + dp + " - " + value, 1);
                                    createState(dp,value,{name: key,  type: 'number', role: 'value'}, function () {}); 
                                } else {
                                    printLog("Schreibe in Datenpunkt: " + dp + " - " + value, 1);
                                    setState(dp,value,true);
                                }
                            }
                             
                            function findCodeVal(result, code) {
                                //log(code);
                                printLog("Suche Wert " + code, 1);
                                for(var i=0; i<result.length; i++) {
                                    //log(result[i].code);
                                    printLog(result[i].code, 1);
                                    if(result[i].code.indexOf(code) >= 0) {
                                        printLog("Wert gefunden: " + result[i].value, 1);
                                        return result[i].value;
                                    }
                                }
                                return "";
                            }
                             
                            function createobjects() {
                                log ("erstelle Objekte");
                                createState(dpRoot + '.ambient', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Umgebungstemperatur"});
                                createState(dpRoot + '.connection', {read: true, write: false,  type: "boolean", role: "state", name: "Verbindung", def: false});
                                createState(dpRoot + '.consumption', {read: true, write: false,  type: "number", unit:"W", role: "value.power", name: "Stromverbrauch", def: 0});
                                createState(dpRoot + '.error', {read: true, write: false,  type: "boolean", role: "state", name: "Fehler", def: false});
                                createState(dpRoot + '.errorCode', {read: true, write: false,  type: "string", name: "Fehlercode", def: ""});
                                createState(dpRoot + '.errorLevel', {read: true, write: false,  type: "number", name: "Fehlerlevel"});
                                createState(dpRoot + '.errorMessage', {read: true, write: false,  type: "string", name: "Fehlermeldung", def: ""});
                                createState(dpRoot + '.mode', {read: true, write: true,  type: "string", states: "-1:off;0:cool;1:heat;2:auto", name: "Modus", def: ""});
                                createState(dpRoot + '.rotor', {read: true, write: false,  type: "number", unit:"rpm", def: 0, name: "Lüfterdrehzahl"});
                                createState(dpRoot + '.silent', {read: true, write: true,  type: "boolean", role: "state", name: "Silent", def: false});
                                createState(dpRoot + '.state', {read: true, write: false,  type: "boolean", role: "state", name: "Status", def: false});
                                createState(dpRoot + '.tempIn', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Eingangstemperatur"});
                                createState(dpRoot + '.tempOut', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Ausgangstemperatur"});
                                createState(dpRoot + '.tempSet', {read: true, write: true,  type: "number", unit:"°C", role: "level.temperature", name: "Solltemperatur"});
                                createState(dpRoot + '.suctionTemp', {read: true, write: false,  type: "number", unit:"°C", name: "Luftansaugtemperatur"});
                                createState(dpRoot + '.coilTemp', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Kompressortemperatur"});
                                
                                createState(dpRoot + '.rawJSON', {read: true, write: false,  type: "array", name: "komplette Rückgabe"});
                            }
                             
                            function updateToken() {
                             
                                if(token=="") {
                                    printLog("Token Neuanforderung");
                                    var request = require('request');
                                    var options;
                                
                                    if(apilevel<3) {
                                        options = {
                                            url: cloudURL + '/app/user/login.json',
                                            method: 'POST',
                                            json: { "user_name": username, "password": password, "type": "2" },
                                            rejectUnauthorized: false
                                        };
                                    } else {
                                        options = {
                                            url: cloudURL + '/app/user/login',
                                            method: 'POST',
                                            json: { "userName": username, "password": password, "type": "2" },
                                            rejectUnauthorized: false
                                        };
                                    }
                                    
                            
                                    //log(JSON.stringify(options));
                                    
                                    request(options,function (error, response, body){
                                    
                                        printLog("Login-Antwort: " + JSON.stringify(response));
                                        if(parseInt(body.error_code)==0) {
                                            
                                            if(apilevel<3) {
                                                token = body.object_result["x-token"];
                                            } else {
                                                token = body.objectResult["x-token"];
                                            }
                                            
                                            printLog("Login ok! Token " + token);
                                            updateDeviceID();
                                        } else {
                                            // Login-Fehler
                                            printLog("Login-Fehler in updateToken(): " + response.body);
                                            token = "";
                                            saveValue("connection", false, "boolean");
                                        }
                                        
                                    });
                                } else {
                                    updateDeviceID();
                                }
                             
                                
                             
                                
                             
                            }
                             
                            function updateDeviceID() {
                                if(token!="") {
                                    var optionsDev;
                                    if(apilevel<3) {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/deviceList.json',
                                            headers: { "x-token": token },
                                            body: {"product_ids": [
                                                    "1132174963097280512",
                                                    "1186904563333062656",
                                                    "1158905952238313472",
                                                    "1245226668902080512",
                                                    "1442284873216843776",
                                                    "1548963836789501952",
                                                    ]},
                                            method: 'POST',
                                            json: true,
                                            rejectUnauthorized: false  
                                        };
                                    } else {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/deviceList',
                                            headers: { "x-token": token },
                                            body: {"productIds": [
                                                    "1132174963097280512",
                                                    "1186904563333062656",
                                                    "1158905952238313472",
                                                    "1245226668902080512",
                                                    "1442284873216843776",
                                                    "1548963836789501952",
                                                    ]},
                                            method: 'POST',
                                            json: true,
                                            rejectUnauthorized: false  
                                        };
                                    }
                            
                                    var request = require('request');
                             
                                    request(optionsDev,function (error, response, body){
                                
                                        printLog("DeviceList: " + JSON.stringify(response));
                                        //log(JSON.stringify(body.object_result));
                             
                                        if(parseInt(body.error_code)==0) {
                                            
                                            //token = body.object_result["x-token"];
                                            //log("Login ok! Token " + token);
                                            
                                            if(apilevel<3) {
                                                device = body.object_result[0].device_code;
                                                product = body.object_result[0].product_id;
                                                reachable = (body.object_result[0].device_status=="ONLINE");
                                            } else {
                                                device = body.objectResult[0].deviceCode;
                                                product = body.objectResult[0].productId;
                                                reachable = (body.objectResult[0].deviceStatus=="ONLINE");
                                            }
                            
                                            printLog("DeviceCode: " + device + ", ProductID: " + product + ", DeviceStatus: " + reachable);
                                            
                                            if(reachable) {
                                                saveValue("connection", true, "boolean");
                                                if(device!="") updateDeviceStatus(device);
                                            } else {
                                                // offline
                                                device = "";
                                                saveValue("connection", false, "boolean");
                                            }
                                            
                                        } else {
                                            // Login-Fehler
                                            //log("Fehler in updateDeviceID(): " + response.body, "error");
                                            token = "";
                                            device = "";
                                            reachable = false;
                                            saveValue("connection", false, "boolean");
                                        }
                                        
                                    });
                                }
                            }
                             
                            function updateDeviceStatus(devicecode) {
                                if(token!="") {
                                    var optionsDev;
                            
                                    if(apilevel<3) {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/getDeviceStatus.json',
                                            headers: { "x-token": token },
                                            json: { "device_code": devicecode },
                                            method: 'POST',
                                            rejectUnauthorized: false
                                        };
                                    } else {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/getDeviceStatus',
                                            headers: { "x-token": token },
                                            json: { "deviceCode": devicecode },
                                            method: 'POST',
                                            rejectUnauthorized: false
                                        };
                                    }
                                    
                             
                                    var request = require('request');
                             
                                    request(optionsDev,function (error, response, body){
                                
                                        printLog("DeviceStatus: " + JSON.stringify(response));
                                        //log(JSON.stringify(body.object_result));
                             
                                        if(parseInt(body.error_code)==0) {
                            
                                            if(apilevel<3) {
                                                if(body.object_result["is_fault"]==true) {
                                                    // TODO: Fehlerbeschreibung abrufen
                                                    //clearValues();
                                                    saveValue("error", true, "boolean");
                                                    updateDeviceDetails(devicecode);
                                                    updateDeviceErrorMsg(devicecode);
                                                } else {
                                                    // kein Fehler
                                                    saveValue("error", false, "boolean");
                                                    saveValue("errorMessage", "", "string");
                                                    saveValue("errorCode", "", "string");
                                                    saveValue("errorLevel", 0, "number");
                                                    updateDeviceDetails(devicecode);
                                                }
                                            } else {
                                                if(body.objectResult["is_fault"]==true) {
                                                    // TODO: Fehlerbeschreibung abrufen
                                                    //clearValues();
                                                    saveValue("error", true, "boolean");
                                                    updateDeviceDetails(devicecode);
                                                    updateDeviceErrorMsg(devicecode);
                                                } else {
                                                    // kein Fehler
                                                    saveValue("error", false, "boolean");
                                                    saveValue("errorMessage", "", "string");
                                                    saveValue("errorCode", "", "string");
                                                    saveValue("errorLevel", 0, "number");
                                                    updateDeviceDetails(devicecode);
                                                }
                                            }
                             
                                            
                                            
                                            //token = body.object_result["x-token"];
                                            //log("Login ok! Token " + token);
                                            
                                        } else {
                                            // Login-Fehler
                                            //log("Fehler in updateDeviceStatus(): " + response.body, "error");
                                            token = "";
                                            device = "";
                                            saveValue("connection", false, "boolean");
                                        }
                                        
                                    });
                                }
                            }
                             
                            function updateDeviceErrorMsg(devicecode) {
                                if(token!="") {
                                    var optionsDev;
                            
                                    if(apilevel<3) {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/getFaultDataByDeviceCode.json',
                                            headers: { "x-token": token },
                                            json: { "device_code": devicecode },
                                            method: 'POST',
                                            rejectUnauthorized: false
                                            //headers: {"content-type": "application/json"},
                                            //charset: 'utf8',
                                            //json: true
                                            
                                        };
                                    } else {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/getFaultDataByDeviceCode',
                                            headers: { "x-token": token },
                                            json: { "deviceCode": devicecode },
                                            method: 'POST',
                                            rejectUnauthorized: false
                                            //headers: {"content-type": "application/json"},
                                            //charset: 'utf8',
                                            //json: true
                                            
                                        };
                                    }
                                    
                             
                                    var request = require('request');
                             
                                    request(optionsDev,function (error, response, body){
                                
                                        //log(JSON.stringify(response));
                                        //log(JSON.stringify(body.object_result));
                             
                                        if(parseInt(body.error_code)==0) {
                             
                                            
                                            saveValue("error", true, "boolean");
                            
                                            if(apilevel<3) {
                                                saveValue("errorMessage", body.object_result[0].description, "string");
                                                saveValue("errorCode", body.object_result[0].fault_code, "string");
                                                saveValue("errorLevel", body.object_result[0].error_level, "string");
                                            } else {
                                                saveValue("errorMessage", body.objectResult[0].description, "string");
                                                saveValue("errorCode", body.objectResult[0].fault_code, "string");
                                                saveValue("errorLevel", body.objectResult[0].error_level, "string");
                                            }
                                            
                                            
                                        } else {
                                            // Login-Fehler
                                            //log("Fehler in updateDeviceErrorMsg(): " + response.body, "error");
                                            token = "";
                                            device = "";
                                            saveValue("connection", false, "boolean");
                                        }
                                        
                                    });
                                }
                            }
                             
                            function updateDeviceDetails(devicecode) {
                                if(token!="") {
                                    var optionsDev;
                            
                                    if(apilevel<3) {
                                        if(product==AQUATEMP_POOLSANA) {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/getDataByCode.json',
                                                headers: { "x-token": token },
                                                json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                                // "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05"]
                                                method: 'POST',
                                                rejectUnauthorized: false
                                            
                                            };
                                        } else if(product==AQUATEMP_OTHER1) {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/getDataByCode.json',
                                                headers: { "x-token": token },
                                                json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T7","T14","T17"] },
                                                method: 'POST',
                                                rejectUnauthorized: false
                                            
                                            };
                                        }
                                        
                                    } else {
                                        if(product==AQUATEMP_POOLSANA) {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/getDataByCode',
                                                headers: { "x-token": token },
                                                json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                                method: 'POST',
                                                rejectUnauthorized: false
                                            
                                            };
                                        } else if (product==AQUATEMP_OTHER1) {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/getDataByCode',
                                                headers: { "x-token": token },
                                                json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T7","T14","T17"] },
                                                method: 'POST',
                                                rejectUnauthorized: false
                                            
                                            };
                                        }
                                        
                            
                                    }
                                    
                             
                                    var request = require('request');
                             
                                    request(optionsDev,function (error, response, body){
                             
                                        printLog("DeviceDetails: " + JSON.stringify(response));
                             
                                        if(parseInt(body.error_code)==0) {
                            
                                            if(apilevel<3) {
                                                saveValue("rawJSON", body.object_result, "string");
                                                
                                                if(findCodeVal(body.object_result, "Power")=="1") {
                                                    if(product==AQUATEMP_POOLSANA) {
                                                        // Stromverbrauch T07 x T14 in Watt
                                                        saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T07")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                                        // Luftansaug-Temperatur T01
                                                        saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T01")), "number");
                                                        // Inlet-Temperatur T02
                                                        saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T02")), "number");
                                                        // outlet-Temperatur T03
                                                        saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T03")), "number");
                                                        // Coil-Temperatur T04
                                                        saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T04")), "number");
                                                        // Umgebungs-Temperatur T05
                                                        saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T05")), "number");
                                                    } else if (product==AQUATEMP_OTHER1) {
                                                        // Stromverbrauch T7 x T14 in Watt
                                                        saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T7")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                                        // Luftansaug-Temperatur T1
                                                        saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T1")), "number");
                                                        // Inlet-Temperatur T2
                                                        saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T2")), "number");
                                                        // outlet-Temperatur T3
                                                        saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T3")), "number");
                                                        // Coil-Temperatur T4
                                                        saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T4")), "number");
                                                        // Umgebungs-Temperatur T5
                                                        saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T5")), "number");
                                                    }
                                                
                                                    // Lüfter-Drehzahl T17
                                                    saveValue("rotor", parseInt(findCodeVal(body.object_result, "T17")), "number");
                                                  
                                                    
                                                } else {
                                                    saveValue("consumption", 0, "number");
                                                    saveValue("rotor", 0, "number");
                                                }
                                
                                                // Ziel-Temperatur Set_Temp
                                                saveValue("tempSet", parseFloat(findCodeVal(body.object_result, "Set_Temp")), "number");
                                    
                                                // Flüstermodus Manual-mute
                                                if(findCodeVal(body.object_result, "Manual-mute")=="1") {
                                                    saveValue("silent", true, "boolean");
                                                } else {
                                                    saveValue("silent", false, "boolean");
                                                }
                                
                                                // Zustand Power
                                                if(findCodeVal(body.object_result, "Power")=="1") {
                                                    saveValue("state", true, "boolean");
                                                    saveValue("mode", findCodeVal(body.object_result,"Mode"), "string");
                                                } else {
                                                    saveValue("state", false, "boolean");
                                                    saveValue("mode", "-1", "string");
                                                }
                                                
                                                saveValue("connection", true, "boolean");
                            
                                                // Durchlauf ENDE
                                
                                                
                                            } else {
                                                saveValue("rawJSON", body.objectResult, "string");
                                                
                                                if(findCodeVal(body.objectResult, "Power")=="1") {
                                                    if(product==AQUATEMP_POOLSANA) {
                                                        // Stromverbrauch T07 x T14 in Watt
                                                        saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T07")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
                                                        // Luftansaug-Temperatur T01
                                                        saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T01")), "number");
                                                        // Inlet-Temperatur T02
                                                        saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T02")), "number");
                                                        // outlet-Temperatur T03
                                                        saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T03")), "number");
                                                        // Coil-Temperatur T04
                                                        saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T04")), "number");
                                                        // Umgebungs-Temperatur T05
                                                        saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T05")), "number");
                                                    } else if (product==AQUATEMP_OTHER1) {
                                                        // Stromverbrauch T7 x T14 in Watt
                                                        saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T7")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
                                                        // Luftansaug-Temperatur T1
                                                        saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T1")), "number");
                                                        // Inlet-Temperatur T2
                                                        saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T2")), "number");
                                                        // outlet-Temperatur T3
                                                        saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T3")), "number");
                                                        // Coil-Temperatur T4
                                                        saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T4")), "number");
                                                        // Umgebungs-Temperatur T5
                                                        saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T5")), "number");
                                                    }
                                                
                                                    // Lüfter-Drehzahl T17
                                                    saveValue("rotor", parseInt(findCodeVal(body.objectResult, "T17")), "number");
                                                  
                                                    
                                                } else {
                                                    saveValue("consumption", 0, "number");
                                                    saveValue("rotor", 0, "number");
                                                }
                                
                                                // Ziel-Temperatur Set_Temp
                                                saveValue("tempSet", parseFloat(findCodeVal(body.objectResult, "Set_Temp")), "number");
                                    
                                                // Flüstermodus Manual-mute
                                                if(findCodeVal(body.objectResult, "Manual-mute")=="1") {
                                                    saveValue("silent", true, "boolean");
                                                } else {
                                                    saveValue("silent", false, "boolean");
                                                }
                                
                                                // Zustand Power
                                                if(findCodeVal(body.objectResult, "Power")=="1") {
                                                    saveValue("state", true, "boolean");
                                                    saveValue("mode", findCodeVal(body.objectResult,"Mode"), "string");
                                                } else {
                                                    saveValue("state", false, "boolean");
                                                    saveValue("mode", "-1", "string");
                                                }
                                                
                                                saveValue("connection", true, "boolean");
                            
                                                // Durchlauf ENDE
                                
                                                
                                            }
                            
                                            
                                        } else {
                                            // Login-Fehler
                                            //log("Fehler in updateDeviceDetails(): " + response.body, "error");
                                            token = "";
                                            device = "";
                                            saveValue("connection", false, "boolean");
                                        }
                                        
                                    });
                                }
                            }
                             
                            function updateDevicePower(devicecode, power) {
                                var powerOpt;
                                var powerMode = 2;
                             
                                if(power==-1) {
                                    // aus
                                    powerOpt = 0;
                                    powerMode = -1;
                                } else if(power==0) {
                                    // an und kühlen
                                    powerOpt = 1;
                                    powerMode = 0;
                                } else if(power==1) {
                                    // an und heizen
                                    powerOpt = 1;
                                    powerMode = 1;
                                } else if(power==2) {
                                    // an und auto
                                    powerOpt = 1;
                                    powerMode = 2;
                                } else {
                                    log("ungülter Zustand!");
                                    return;
                                }
                             
                                if(token!="") {
                                    var optionsDev;
                            
                                    if(apilevel<3) {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/control.json',
                                            headers: { "x-token": token },
                                            json: {"param":[{ "device_code": devicecode, "protocol_code": "Power","value": powerOpt }]},
                                            method: 'POST',
                                            rejectUnauthorized: false
                                        };
                                    } else {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/control',
                                            headers: { "x-token": token },
                                            json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Power","value": powerOpt }]},
                                            method: 'POST',
                                            rejectUnauthorized: false
                                        };
                            
                                    }
                                    
                             
                                    var request = require('request');
                             
                                    request(optionsDev,function (error, response, body){
                                        //log(devicecode);
                                        //log(JSON.stringify(response));
                                        //log(JSON.stringify(body.object_result));
                             
                                        if(parseInt(body.error_code)==0) {
                                            saveValue("mode", power, "string");
                                            if(power>=0) updateDeviceMode(device, power);
                                            
                                        } else {
                                            log("Zustandsänderung fehlgeschlagen!", "error");
                                        }
                                        
                                    });
                                }
                            }
                             
                            function updateDeviceMode(devicecode, mode) {
                                
                             
                                if(token!="") {
                                    var optionsDev;
                            
                                    if(apilevel<3) {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/control.json',
                                            headers: { "x-token": token },
                                            json: {"param":[{ "device_code": devicecode, "protocol_code": "mode","value": mode }]},
                                            method: 'POST',
                                            rejectUnauthorized: false
                                            //headers: {"content-type": "application/json"},
                                            //charset: 'utf8',
                                            //json: true
                                            
                                        };
                                    } else {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/control',
                                            headers: { "x-token": token },
                                            json: {"param":[{ "deviceCode": devicecode, "protocolCode": "mode","value": mode }]},
                                            method: 'POST',
                                            rejectUnauthorized: false
                                            //headers: {"content-type": "application/json"},
                                            //charset: 'utf8',
                                            //json: true
                                            
                                        };
                                    }
                                    
                             
                                    var request = require('request');
                             
                                    request(optionsDev,function (error, response, body){
                                        //log(devicecode);
                                        //log(JSON.stringify(response));
                                        //log(JSON.stringify(body.object_result));
                             
                                        if(parseInt(body.error_code)==0) {
                                            saveValue("mode", mode, "string");
                                            
                                            
                                        } else {
                                            log("Zustandsänderung fehlgeschlagen!", "error");
                                            token = "";
                                            device = "";
                                            saveValue("connection", false, "boolean");
                                        }
                                        
                                    });
                                }
                            }
                             
                            function updateDeviceSilent(devicecode, silent) {
                                
                                var silentMode;
                             
                                if(silent) {
                                    silentMode = "1";
                                } else {
                                    silentMode = "0";
                                }
                             
                                if(token!="") {
                            
                                    var optionsDev;
                            
                                    if(apilevel<3) {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/control.json',
                                            headers: { "x-token": token },
                                            json: {"param":[{ "device_code": devicecode, "protocol_code": "Manual-mute","value": silentMode }]},
                                            method: 'POST',
                                            rejectUnauthorized: false
                                            //headers: {"content-type": "application/json"},
                                            //charset: 'utf8',
                                            //json: true
                                            
                                        };
                                    } else {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/control',
                                            headers: { "x-token": token },
                                            json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Manual-mute","value": silentMode }]},
                                            method: 'POST',
                                            rejectUnauthorized: false
                                            //headers: {"content-type": "application/json"},
                                            //charset: 'utf8',
                                            //json: true
                                            
                                        };
                                    }
                                    
                             
                                    var request = require('request');
                             
                                    request(optionsDev,function (error, response, body){
                                        //log(devicecode);
                                        //log(JSON.stringify(response));
                                        //log(JSON.stringify(body.object_result));
                             
                                        if(parseInt(body.error_code)==0) {
                                            saveValue("silent", silent, "boolean");
                                            
                                            
                                        } else {
                                            log("Zustandsänderung fehlgeschlagen!", "error");
                                            token = "";
                                            device = "";
                                            saveValue("connection", false, "boolean");
                                        }
                                        
                                    });
                                }
                            }
                             
                            function updateDeviceSetTemp(devicecode, temperature) {
                             
                                var sTemperature = temperature.toString().replace(",", ".");
                                var sMode = getState(dpRoot + ".mode").val;
                                if(sMode=="-1") {
                                    //log("Gerät einschalten um Temperatur zu ändern!", 'warn');
                                    return;
                                } else if(sMode=="0") {
                                    sMode = "R01"; // Kühlen
                                } else if(sMode=="1") {
                                    sMode = "R02"; // Heizen
                                } else if(sMode=="2") {
                                    sMode = "R03"; // Auto
                                }
                             
                                
                             
                             
                                if(token!="") {
                                    var optionsDev;
                            
                                    if(apilevel<3) {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/control.json',
                                            headers: { "x-token": token },
                                            json: {"param":[{ "device_code": devicecode, "protocol_code": "R01","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R02","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R03","value": sTemperature },{ "device_code": devicecode, "protocol_code": "Set_Temp","value": sTemperature }]},
                                            method: 'POST',
                                            rejectUnauthorized: false
                                            //headers: {"content-type": "application/json"},
                                            //charset: 'utf8',
                                            //json: true
                                            
                                        };
                                    } else {
                                        optionsDev = {
                                            url: cloudURL + '/app/device/control',
                                            headers: { "x-token": token },
                                            json: {"param":[{ "deviceCode": devicecode, "protocolCode": "R01","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R02","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R03","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "Set_Temp","value": sTemperature }]},
                                            method: 'POST',
                                            rejectUnauthorized: false
                                            //headers: {"content-type": "application/json"},
                                            //charset: 'utf8',
                                            //json: true
                                            
                                        };
                            
                                    }
                                    
                             
                                    var request = require('request');
                             
                                    request(optionsDev,function (error, response, body){
                                        //log(devicecode);
                                        //log(JSON.stringify(response));
                                        //log(JSON.stringify(body.object_result));
                             
                                        if(parseInt(body.error_code)==0) {
                                            saveValue("tempSet", temperature, "number");
                                            
                                            
                                        } else {
                                            log("Zustandsänderung fehlgeschlagen!", "error");
                                            token = "";
                                            device = "";
                                            saveValue("connection", false, "boolean");
                                            //log(JSON.stringify(response));
                                        }
                                        
                                    });
                                }
                            }
                            
                            function printLog(sMsg, minLevel = 1) {
                                if(debugLevel>=minLevel) {
                                    log(sMsg);
                                }
                            }
                             
                            // Beginn des Skripts
                            
                            setupEndpoints();
                            createobjects(); // DPs anlegen
                             
                            updateToken(); // Zugriffstoken erfragen und aktuelle Werte lesen
                             
                            schedule('*/' + interval + ' * * * * *', function () {
                                // regelmäßig Token und Zustand abfragen
                                updateToken();
                             
                                // gewünschte Änderungen ausführen
                                if(!getState(dpRoot + ".mode").ack) {
                                    updateDevicePower(device, getState(dpRoot + ".mode").val);
                                }
                                if(!getState(dpRoot + ".silent").ack) {
                                    updateDevicePower(device, getState(dpRoot + ".silent").val);
                                }
                            });
                             
                            tokenRefreshTimer = setInterval(function () {
                                // Token verfällt nach 60min
                                token = "";
                                //log("Token nach Intervall verworfen.")
                                updateToken();
                            }, 3600000);
                             
                            on({id: dpRoot + ".mode", change: "ne", ack: false}, function (obj) {
                                updateToken();
                                updateDevicePower(device, getState(dpRoot + ".mode").val);
                            });
                             
                            on({id: dpRoot + ".silent", change: "ne", ack: false}, function (obj) {
                                updateToken();
                                updateDeviceSilent(device, getState(dpRoot + ".silent").val);
                            });
                             
                            on({id: dpRoot + ".tempSet", change: "ne", ack: false}, function (obj) {
                                updateToken();
                                updateDeviceSetTemp(device, getState(dpRoot + ".tempSet").val);
                            });
                            
                            
                            P R 2 Antworten Letzte Antwort
                            0
                            • O oxident

                              So, neuer Tag, neues Glück. Ich habe in der Tat schon einen krassen Fehler gefunden, der auf jeden Fall die Nutzer mit der neuen App betrafen. Außerdem habe ich jetzt eine Option für intensives Debugging hinzugefügt. Bitte mal den Wert bei debugLevel kurzzeitig (am besten nur bis zum Auftreten des Fehlers) auf 1 stellen:

                              // Midas Poolheizung
                              // v0.0.8d
                              // Changelog:
                              // 0.0.8: Testweise Unterstützung von neu registrierten Anlagen
                              // 0.0.7: Kleinigkeiten überarbeitet
                              //        weitere Modelle hinzugefügt
                              // 0.0.6: Gültigkeitsprüfung des Zertifikats deaktiviert (Dank an znyde)
                              //        Kompatibilität mit Promo Next Modellen durch generische Product-ID (Dank an znyde)
                              // 0.0.5: weitere Abfragewerte hinzugefügt (Kompressor- und Ansaugtemperatur)
                              // 0.0.4: Tokenverfall jetzt 60min nach Skriptstart und nicht zu jeder vollen Stunde (Dank an dering)
                              // 0.0.3: Datenpunkte beim Start automatisch anlegen (Dank an Andy200877)
                              // 0.0.2: Token bei jedem Set-Vorgang prüfen und ggf. neu anfordern (Dank an dering)
                              
                              // ANFANG konfigurierbare Elemente -----
                              const username = "EMAIL";
                              var password = "KENNWORT";
                              
                              const interval = 30; // Abfrageintervall in Sekunden
                              
                              const dpRoot = "0_userdata.0.Poolheizung"; // Stammordner der Datenpunkte
                              
                              const apilevel = 1;   // 1: AquaTemp-Accounts, die vor v.1.5.8 erstellt wurden
                                                    // 2: HiTemp-Accounts
                                                    // 3: AquaTemp-Accounts, die mit neueren App-Versionen erstellt wurden
                              
                              const debugLevel = 0;   // 0: keine erweiterten Informationen protokollieren
                                                      // 1: Debug-Informationen protokollieren
                              
                              // ENDE --------------------------------
                               
                              var cloudURL;
                              
                              var token = "";
                              var tokenRefreshTimer;
                              var device = "";
                              
                              // ProductIDs:
                              // Gruppe 1:
                              // 1132174963097280512: Midas/Poolsana InverPro
                              const AQUATEMP_POOLSANA="1132174963097280512";
                              // Gruppe 2:
                              // 1442284873216843776: 
                              const AQUATEMP_OTHER1="1442284873216843776";
                              
                              var product = "";
                              var reachable = false;
                              
                              function setupEndpoints() {
                                  if(apilevel==1) {
                                      cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                                  } else if(apilevel==2) {
                                      cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                                  } else if(apilevel==3) {
                                      cloudURL = "https://cloud.linked-go.com:449/crmservice/api";
                                      password = require('crypto').createHash('md5').update(password).digest("hex");
                                  }
                                  printLog("API-Level " + apilevel, 1);
                              }
                               
                              function clearValues() {
                                  saveValue("error", true, "boolean");
                                  saveValue("consumption", 0, "number");
                                  saveValue("state", false, "boolean");
                              }
                               
                              function saveValue(key, value, sType) {
                                  var dp = dpRoot + "." + key;
                               
                                  if ( !existsState(dp )) {
                                      printLog("Schreibe in NEUEN Datenpunkt: " + dp + " - " + value, 1);
                                      createState(dp,value,{name: key,  type: 'number', role: 'value'}, function () {}); 
                                  } else {
                                      printLog("Schreibe in Datenpunkt: " + dp + " - " + value, 1);
                                      setState(dp,value,true);
                                  }
                              }
                               
                              function findCodeVal(result, code) {
                                  //log(code);
                                  printLog("Suche Wert " + code, 1);
                                  for(var i=0; i<result.length; i++) {
                                      //log(result[i].code);
                                      printLog(result[i].code, 1);
                                      if(result[i].code.indexOf(code) >= 0) {
                                          printLog("Wert gefunden: " + result[i].value, 1);
                                          return result[i].value;
                                      }
                                  }
                                  return "";
                              }
                               
                              function createobjects() {
                                  log ("erstelle Objekte");
                                  createState(dpRoot + '.ambient', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Umgebungstemperatur"});
                                  createState(dpRoot + '.connection', {read: true, write: false,  type: "boolean", role: "state", name: "Verbindung", def: false});
                                  createState(dpRoot + '.consumption', {read: true, write: false,  type: "number", unit:"W", role: "value.power", name: "Stromverbrauch", def: 0});
                                  createState(dpRoot + '.error', {read: true, write: false,  type: "boolean", role: "state", name: "Fehler", def: false});
                                  createState(dpRoot + '.errorCode', {read: true, write: false,  type: "string", name: "Fehlercode", def: ""});
                                  createState(dpRoot + '.errorLevel', {read: true, write: false,  type: "number", name: "Fehlerlevel"});
                                  createState(dpRoot + '.errorMessage', {read: true, write: false,  type: "string", name: "Fehlermeldung", def: ""});
                                  createState(dpRoot + '.mode', {read: true, write: true,  type: "string", states: "-1:off;0:cool;1:heat;2:auto", name: "Modus", def: ""});
                                  createState(dpRoot + '.rotor', {read: true, write: false,  type: "number", unit:"rpm", def: 0, name: "Lüfterdrehzahl"});
                                  createState(dpRoot + '.silent', {read: true, write: true,  type: "boolean", role: "state", name: "Silent", def: false});
                                  createState(dpRoot + '.state', {read: true, write: false,  type: "boolean", role: "state", name: "Status", def: false});
                                  createState(dpRoot + '.tempIn', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Eingangstemperatur"});
                                  createState(dpRoot + '.tempOut', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Ausgangstemperatur"});
                                  createState(dpRoot + '.tempSet', {read: true, write: true,  type: "number", unit:"°C", role: "level.temperature", name: "Solltemperatur"});
                                  createState(dpRoot + '.suctionTemp', {read: true, write: false,  type: "number", unit:"°C", name: "Luftansaugtemperatur"});
                                  createState(dpRoot + '.coilTemp', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Kompressortemperatur"});
                                  
                                  createState(dpRoot + '.rawJSON', {read: true, write: false,  type: "array", name: "komplette Rückgabe"});
                              }
                               
                              function updateToken() {
                               
                                  if(token=="") {
                                      printLog("Token Neuanforderung");
                                      var request = require('request');
                                      var options;
                                  
                                      if(apilevel<3) {
                                          options = {
                                              url: cloudURL + '/app/user/login.json',
                                              method: 'POST',
                                              json: { "user_name": username, "password": password, "type": "2" },
                                              rejectUnauthorized: false
                                          };
                                      } else {
                                          options = {
                                              url: cloudURL + '/app/user/login',
                                              method: 'POST',
                                              json: { "userName": username, "password": password, "type": "2" },
                                              rejectUnauthorized: false
                                          };
                                      }
                                      
                              
                                      //log(JSON.stringify(options));
                                      
                                      request(options,function (error, response, body){
                                      
                                          printLog("Login-Antwort: " + JSON.stringify(response));
                                          if(parseInt(body.error_code)==0) {
                                              
                                              if(apilevel<3) {
                                                  token = body.object_result["x-token"];
                                              } else {
                                                  token = body.objectResult["x-token"];
                                              }
                                              
                                              printLog("Login ok! Token " + token);
                                              updateDeviceID();
                                          } else {
                                              // Login-Fehler
                                              printLog("Login-Fehler in updateToken(): " + response.body);
                                              token = "";
                                              saveValue("connection", false, "boolean");
                                          }
                                          
                                      });
                                  } else {
                                      updateDeviceID();
                                  }
                               
                                  
                               
                                  
                               
                              }
                               
                              function updateDeviceID() {
                                  if(token!="") {
                                      var optionsDev;
                                      if(apilevel<3) {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/deviceList.json',
                                              headers: { "x-token": token },
                                              body: {"product_ids": [
                                                      "1132174963097280512",
                                                      "1186904563333062656",
                                                      "1158905952238313472",
                                                      "1245226668902080512",
                                                      "1442284873216843776",
                                                      "1548963836789501952",
                                                      ]},
                                              method: 'POST',
                                              json: true,
                                              rejectUnauthorized: false  
                                          };
                                      } else {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/deviceList',
                                              headers: { "x-token": token },
                                              body: {"productIds": [
                                                      "1132174963097280512",
                                                      "1186904563333062656",
                                                      "1158905952238313472",
                                                      "1245226668902080512",
                                                      "1442284873216843776",
                                                      "1548963836789501952",
                                                      ]},
                                              method: 'POST',
                                              json: true,
                                              rejectUnauthorized: false  
                                          };
                                      }
                              
                                      var request = require('request');
                               
                                      request(optionsDev,function (error, response, body){
                                  
                                          printLog("DeviceList: " + JSON.stringify(response));
                                          //log(JSON.stringify(body.object_result));
                               
                                          if(parseInt(body.error_code)==0) {
                                              
                                              //token = body.object_result["x-token"];
                                              //log("Login ok! Token " + token);
                                              
                                              if(apilevel<3) {
                                                  device = body.object_result[0].device_code;
                                                  product = body.object_result[0].product_id;
                                                  reachable = (body.object_result[0].device_status=="ONLINE");
                                              } else {
                                                  device = body.objectResult[0].deviceCode;
                                                  product = body.objectResult[0].productId;
                                                  reachable = (body.objectResult[0].deviceStatus=="ONLINE");
                                              }
                              
                                              printLog("DeviceCode: " + device + ", ProductID: " + product + ", DeviceStatus: " + reachable);
                                              
                                              if(reachable) {
                                                  saveValue("connection", true, "boolean");
                                                  if(device!="") updateDeviceStatus(device);
                                              } else {
                                                  // offline
                                                  device = "";
                                                  saveValue("connection", false, "boolean");
                                              }
                                              
                                          } else {
                                              // Login-Fehler
                                              //log("Fehler in updateDeviceID(): " + response.body, "error");
                                              token = "";
                                              device = "";
                                              reachable = false;
                                              saveValue("connection", false, "boolean");
                                          }
                                          
                                      });
                                  }
                              }
                               
                              function updateDeviceStatus(devicecode) {
                                  if(token!="") {
                                      var optionsDev;
                              
                                      if(apilevel<3) {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/getDeviceStatus.json',
                                              headers: { "x-token": token },
                                              json: { "device_code": devicecode },
                                              method: 'POST',
                                              rejectUnauthorized: false
                                          };
                                      } else {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/getDeviceStatus',
                                              headers: { "x-token": token },
                                              json: { "deviceCode": devicecode },
                                              method: 'POST',
                                              rejectUnauthorized: false
                                          };
                                      }
                                      
                               
                                      var request = require('request');
                               
                                      request(optionsDev,function (error, response, body){
                                  
                                          printLog("DeviceStatus: " + JSON.stringify(response));
                                          //log(JSON.stringify(body.object_result));
                               
                                          if(parseInt(body.error_code)==0) {
                              
                                              if(apilevel<3) {
                                                  if(body.object_result["is_fault"]==true) {
                                                      // TODO: Fehlerbeschreibung abrufen
                                                      //clearValues();
                                                      saveValue("error", true, "boolean");
                                                      updateDeviceDetails(devicecode);
                                                      updateDeviceErrorMsg(devicecode);
                                                  } else {
                                                      // kein Fehler
                                                      saveValue("error", false, "boolean");
                                                      saveValue("errorMessage", "", "string");
                                                      saveValue("errorCode", "", "string");
                                                      saveValue("errorLevel", 0, "number");
                                                      updateDeviceDetails(devicecode);
                                                  }
                                              } else {
                                                  if(body.objectResult["is_fault"]==true) {
                                                      // TODO: Fehlerbeschreibung abrufen
                                                      //clearValues();
                                                      saveValue("error", true, "boolean");
                                                      updateDeviceDetails(devicecode);
                                                      updateDeviceErrorMsg(devicecode);
                                                  } else {
                                                      // kein Fehler
                                                      saveValue("error", false, "boolean");
                                                      saveValue("errorMessage", "", "string");
                                                      saveValue("errorCode", "", "string");
                                                      saveValue("errorLevel", 0, "number");
                                                      updateDeviceDetails(devicecode);
                                                  }
                                              }
                               
                                              
                                              
                                              //token = body.object_result["x-token"];
                                              //log("Login ok! Token " + token);
                                              
                                          } else {
                                              // Login-Fehler
                                              //log("Fehler in updateDeviceStatus(): " + response.body, "error");
                                              token = "";
                                              device = "";
                                              saveValue("connection", false, "boolean");
                                          }
                                          
                                      });
                                  }
                              }
                               
                              function updateDeviceErrorMsg(devicecode) {
                                  if(token!="") {
                                      var optionsDev;
                              
                                      if(apilevel<3) {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/getFaultDataByDeviceCode.json',
                                              headers: { "x-token": token },
                                              json: { "device_code": devicecode },
                                              method: 'POST',
                                              rejectUnauthorized: false
                                              //headers: {"content-type": "application/json"},
                                              //charset: 'utf8',
                                              //json: true
                                              
                                          };
                                      } else {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/getFaultDataByDeviceCode',
                                              headers: { "x-token": token },
                                              json: { "deviceCode": devicecode },
                                              method: 'POST',
                                              rejectUnauthorized: false
                                              //headers: {"content-type": "application/json"},
                                              //charset: 'utf8',
                                              //json: true
                                              
                                          };
                                      }
                                      
                               
                                      var request = require('request');
                               
                                      request(optionsDev,function (error, response, body){
                                  
                                          //log(JSON.stringify(response));
                                          //log(JSON.stringify(body.object_result));
                               
                                          if(parseInt(body.error_code)==0) {
                               
                                              
                                              saveValue("error", true, "boolean");
                              
                                              if(apilevel<3) {
                                                  saveValue("errorMessage", body.object_result[0].description, "string");
                                                  saveValue("errorCode", body.object_result[0].fault_code, "string");
                                                  saveValue("errorLevel", body.object_result[0].error_level, "string");
                                              } else {
                                                  saveValue("errorMessage", body.objectResult[0].description, "string");
                                                  saveValue("errorCode", body.objectResult[0].fault_code, "string");
                                                  saveValue("errorLevel", body.objectResult[0].error_level, "string");
                                              }
                                              
                                              
                                          } else {
                                              // Login-Fehler
                                              //log("Fehler in updateDeviceErrorMsg(): " + response.body, "error");
                                              token = "";
                                              device = "";
                                              saveValue("connection", false, "boolean");
                                          }
                                          
                                      });
                                  }
                              }
                               
                              function updateDeviceDetails(devicecode) {
                                  if(token!="") {
                                      var optionsDev;
                              
                                      if(apilevel<3) {
                                          if(product==AQUATEMP_POOLSANA) {
                                              optionsDev = {
                                                  url: cloudURL + '/app/device/getDataByCode.json',
                                                  headers: { "x-token": token },
                                                  json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                                  // "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05"]
                                                  method: 'POST',
                                                  rejectUnauthorized: false
                                              
                                              };
                                          } else if(product==AQUATEMP_OTHER1) {
                                              optionsDev = {
                                                  url: cloudURL + '/app/device/getDataByCode.json',
                                                  headers: { "x-token": token },
                                                  json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T7","T14","T17"] },
                                                  method: 'POST',
                                                  rejectUnauthorized: false
                                              
                                              };
                                          }
                                          
                                      } else {
                                          if(product==AQUATEMP_POOLSANA) {
                                              optionsDev = {
                                                  url: cloudURL + '/app/device/getDataByCode',
                                                  headers: { "x-token": token },
                                                  json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                                  method: 'POST',
                                                  rejectUnauthorized: false
                                              
                                              };
                                          } else if (product==AQUATEMP_OTHER1) {
                                              optionsDev = {
                                                  url: cloudURL + '/app/device/getDataByCode',
                                                  headers: { "x-token": token },
                                                  json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T7","T14","T17"] },
                                                  method: 'POST',
                                                  rejectUnauthorized: false
                                              
                                              };
                                          }
                                          
                              
                                      }
                                      
                               
                                      var request = require('request');
                               
                                      request(optionsDev,function (error, response, body){
                               
                                          printLog("DeviceDetails: " + JSON.stringify(response));
                               
                                          if(parseInt(body.error_code)==0) {
                              
                                              if(apilevel<3) {
                                                  saveValue("rawJSON", body.object_result, "string");
                                                  
                                                  if(findCodeVal(body.object_result, "Power")=="1") {
                                                      if(product==AQUATEMP_POOLSANA) {
                                                          // Stromverbrauch T07 x T14 in Watt
                                                          saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T07")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                                          // Luftansaug-Temperatur T01
                                                          saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T01")), "number");
                                                          // Inlet-Temperatur T02
                                                          saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T02")), "number");
                                                          // outlet-Temperatur T03
                                                          saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T03")), "number");
                                                          // Coil-Temperatur T04
                                                          saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T04")), "number");
                                                          // Umgebungs-Temperatur T05
                                                          saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T05")), "number");
                                                      } else if (product==AQUATEMP_OTHER1) {
                                                          // Stromverbrauch T7 x T14 in Watt
                                                          saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T7")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                                          // Luftansaug-Temperatur T1
                                                          saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T1")), "number");
                                                          // Inlet-Temperatur T2
                                                          saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T2")), "number");
                                                          // outlet-Temperatur T3
                                                          saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T3")), "number");
                                                          // Coil-Temperatur T4
                                                          saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T4")), "number");
                                                          // Umgebungs-Temperatur T5
                                                          saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T5")), "number");
                                                      }
                                                  
                                                      // Lüfter-Drehzahl T17
                                                      saveValue("rotor", parseInt(findCodeVal(body.object_result, "T17")), "number");
                                                    
                                                      
                                                  } else {
                                                      saveValue("consumption", 0, "number");
                                                      saveValue("rotor", 0, "number");
                                                  }
                                  
                                                  // Ziel-Temperatur Set_Temp
                                                  saveValue("tempSet", parseFloat(findCodeVal(body.object_result, "Set_Temp")), "number");
                                      
                                                  // Flüstermodus Manual-mute
                                                  if(findCodeVal(body.object_result, "Manual-mute")=="1") {
                                                      saveValue("silent", true, "boolean");
                                                  } else {
                                                      saveValue("silent", false, "boolean");
                                                  }
                                  
                                                  // Zustand Power
                                                  if(findCodeVal(body.object_result, "Power")=="1") {
                                                      saveValue("state", true, "boolean");
                                                      saveValue("mode", findCodeVal(body.object_result,"Mode"), "string");
                                                  } else {
                                                      saveValue("state", false, "boolean");
                                                      saveValue("mode", "-1", "string");
                                                  }
                                                  
                                                  saveValue("connection", true, "boolean");
                              
                                                  // Durchlauf ENDE
                                  
                                                  
                                              } else {
                                                  saveValue("rawJSON", body.objectResult, "string");
                                                  
                                                  if(findCodeVal(body.objectResult, "Power")=="1") {
                                                      if(product==AQUATEMP_POOLSANA) {
                                                          // Stromverbrauch T07 x T14 in Watt
                                                          saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T07")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
                                                          // Luftansaug-Temperatur T01
                                                          saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T01")), "number");
                                                          // Inlet-Temperatur T02
                                                          saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T02")), "number");
                                                          // outlet-Temperatur T03
                                                          saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T03")), "number");
                                                          // Coil-Temperatur T04
                                                          saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T04")), "number");
                                                          // Umgebungs-Temperatur T05
                                                          saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T05")), "number");
                                                      } else if (product==AQUATEMP_OTHER1) {
                                                          // Stromverbrauch T7 x T14 in Watt
                                                          saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T7")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
                                                          // Luftansaug-Temperatur T1
                                                          saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T1")), "number");
                                                          // Inlet-Temperatur T2
                                                          saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T2")), "number");
                                                          // outlet-Temperatur T3
                                                          saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T3")), "number");
                                                          // Coil-Temperatur T4
                                                          saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T4")), "number");
                                                          // Umgebungs-Temperatur T5
                                                          saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T5")), "number");
                                                      }
                                                  
                                                      // Lüfter-Drehzahl T17
                                                      saveValue("rotor", parseInt(findCodeVal(body.objectResult, "T17")), "number");
                                                    
                                                      
                                                  } else {
                                                      saveValue("consumption", 0, "number");
                                                      saveValue("rotor", 0, "number");
                                                  }
                                  
                                                  // Ziel-Temperatur Set_Temp
                                                  saveValue("tempSet", parseFloat(findCodeVal(body.objectResult, "Set_Temp")), "number");
                                      
                                                  // Flüstermodus Manual-mute
                                                  if(findCodeVal(body.objectResult, "Manual-mute")=="1") {
                                                      saveValue("silent", true, "boolean");
                                                  } else {
                                                      saveValue("silent", false, "boolean");
                                                  }
                                  
                                                  // Zustand Power
                                                  if(findCodeVal(body.objectResult, "Power")=="1") {
                                                      saveValue("state", true, "boolean");
                                                      saveValue("mode", findCodeVal(body.objectResult,"Mode"), "string");
                                                  } else {
                                                      saveValue("state", false, "boolean");
                                                      saveValue("mode", "-1", "string");
                                                  }
                                                  
                                                  saveValue("connection", true, "boolean");
                              
                                                  // Durchlauf ENDE
                                  
                                                  
                                              }
                              
                                              
                                          } else {
                                              // Login-Fehler
                                              //log("Fehler in updateDeviceDetails(): " + response.body, "error");
                                              token = "";
                                              device = "";
                                              saveValue("connection", false, "boolean");
                                          }
                                          
                                      });
                                  }
                              }
                               
                              function updateDevicePower(devicecode, power) {
                                  var powerOpt;
                                  var powerMode = 2;
                               
                                  if(power==-1) {
                                      // aus
                                      powerOpt = 0;
                                      powerMode = -1;
                                  } else if(power==0) {
                                      // an und kühlen
                                      powerOpt = 1;
                                      powerMode = 0;
                                  } else if(power==1) {
                                      // an und heizen
                                      powerOpt = 1;
                                      powerMode = 1;
                                  } else if(power==2) {
                                      // an und auto
                                      powerOpt = 1;
                                      powerMode = 2;
                                  } else {
                                      log("ungülter Zustand!");
                                      return;
                                  }
                               
                                  if(token!="") {
                                      var optionsDev;
                              
                                      if(apilevel<3) {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/control.json',
                                              headers: { "x-token": token },
                                              json: {"param":[{ "device_code": devicecode, "protocol_code": "Power","value": powerOpt }]},
                                              method: 'POST',
                                              rejectUnauthorized: false
                                          };
                                      } else {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/control',
                                              headers: { "x-token": token },
                                              json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Power","value": powerOpt }]},
                                              method: 'POST',
                                              rejectUnauthorized: false
                                          };
                              
                                      }
                                      
                               
                                      var request = require('request');
                               
                                      request(optionsDev,function (error, response, body){
                                          //log(devicecode);
                                          //log(JSON.stringify(response));
                                          //log(JSON.stringify(body.object_result));
                               
                                          if(parseInt(body.error_code)==0) {
                                              saveValue("mode", power, "string");
                                              if(power>=0) updateDeviceMode(device, power);
                                              
                                          } else {
                                              log("Zustandsänderung fehlgeschlagen!", "error");
                                          }
                                          
                                      });
                                  }
                              }
                               
                              function updateDeviceMode(devicecode, mode) {
                                  
                               
                                  if(token!="") {
                                      var optionsDev;
                              
                                      if(apilevel<3) {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/control.json',
                                              headers: { "x-token": token },
                                              json: {"param":[{ "device_code": devicecode, "protocol_code": "mode","value": mode }]},
                                              method: 'POST',
                                              rejectUnauthorized: false
                                              //headers: {"content-type": "application/json"},
                                              //charset: 'utf8',
                                              //json: true
                                              
                                          };
                                      } else {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/control',
                                              headers: { "x-token": token },
                                              json: {"param":[{ "deviceCode": devicecode, "protocolCode": "mode","value": mode }]},
                                              method: 'POST',
                                              rejectUnauthorized: false
                                              //headers: {"content-type": "application/json"},
                                              //charset: 'utf8',
                                              //json: true
                                              
                                          };
                                      }
                                      
                               
                                      var request = require('request');
                               
                                      request(optionsDev,function (error, response, body){
                                          //log(devicecode);
                                          //log(JSON.stringify(response));
                                          //log(JSON.stringify(body.object_result));
                               
                                          if(parseInt(body.error_code)==0) {
                                              saveValue("mode", mode, "string");
                                              
                                              
                                          } else {
                                              log("Zustandsänderung fehlgeschlagen!", "error");
                                              token = "";
                                              device = "";
                                              saveValue("connection", false, "boolean");
                                          }
                                          
                                      });
                                  }
                              }
                               
                              function updateDeviceSilent(devicecode, silent) {
                                  
                                  var silentMode;
                               
                                  if(silent) {
                                      silentMode = "1";
                                  } else {
                                      silentMode = "0";
                                  }
                               
                                  if(token!="") {
                              
                                      var optionsDev;
                              
                                      if(apilevel<3) {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/control.json',
                                              headers: { "x-token": token },
                                              json: {"param":[{ "device_code": devicecode, "protocol_code": "Manual-mute","value": silentMode }]},
                                              method: 'POST',
                                              rejectUnauthorized: false
                                              //headers: {"content-type": "application/json"},
                                              //charset: 'utf8',
                                              //json: true
                                              
                                          };
                                      } else {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/control',
                                              headers: { "x-token": token },
                                              json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Manual-mute","value": silentMode }]},
                                              method: 'POST',
                                              rejectUnauthorized: false
                                              //headers: {"content-type": "application/json"},
                                              //charset: 'utf8',
                                              //json: true
                                              
                                          };
                                      }
                                      
                               
                                      var request = require('request');
                               
                                      request(optionsDev,function (error, response, body){
                                          //log(devicecode);
                                          //log(JSON.stringify(response));
                                          //log(JSON.stringify(body.object_result));
                               
                                          if(parseInt(body.error_code)==0) {
                                              saveValue("silent", silent, "boolean");
                                              
                                              
                                          } else {
                                              log("Zustandsänderung fehlgeschlagen!", "error");
                                              token = "";
                                              device = "";
                                              saveValue("connection", false, "boolean");
                                          }
                                          
                                      });
                                  }
                              }
                               
                              function updateDeviceSetTemp(devicecode, temperature) {
                               
                                  var sTemperature = temperature.toString().replace(",", ".");
                                  var sMode = getState(dpRoot + ".mode").val;
                                  if(sMode=="-1") {
                                      //log("Gerät einschalten um Temperatur zu ändern!", 'warn');
                                      return;
                                  } else if(sMode=="0") {
                                      sMode = "R01"; // Kühlen
                                  } else if(sMode=="1") {
                                      sMode = "R02"; // Heizen
                                  } else if(sMode=="2") {
                                      sMode = "R03"; // Auto
                                  }
                               
                                  
                               
                               
                                  if(token!="") {
                                      var optionsDev;
                              
                                      if(apilevel<3) {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/control.json',
                                              headers: { "x-token": token },
                                              json: {"param":[{ "device_code": devicecode, "protocol_code": "R01","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R02","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R03","value": sTemperature },{ "device_code": devicecode, "protocol_code": "Set_Temp","value": sTemperature }]},
                                              method: 'POST',
                                              rejectUnauthorized: false
                                              //headers: {"content-type": "application/json"},
                                              //charset: 'utf8',
                                              //json: true
                                              
                                          };
                                      } else {
                                          optionsDev = {
                                              url: cloudURL + '/app/device/control',
                                              headers: { "x-token": token },
                                              json: {"param":[{ "deviceCode": devicecode, "protocolCode": "R01","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R02","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R03","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "Set_Temp","value": sTemperature }]},
                                              method: 'POST',
                                              rejectUnauthorized: false
                                              //headers: {"content-type": "application/json"},
                                              //charset: 'utf8',
                                              //json: true
                                              
                                          };
                              
                                      }
                                      
                               
                                      var request = require('request');
                               
                                      request(optionsDev,function (error, response, body){
                                          //log(devicecode);
                                          //log(JSON.stringify(response));
                                          //log(JSON.stringify(body.object_result));
                               
                                          if(parseInt(body.error_code)==0) {
                                              saveValue("tempSet", temperature, "number");
                                              
                                              
                                          } else {
                                              log("Zustandsänderung fehlgeschlagen!", "error");
                                              token = "";
                                              device = "";
                                              saveValue("connection", false, "boolean");
                                              //log(JSON.stringify(response));
                                          }
                                          
                                      });
                                  }
                              }
                              
                              function printLog(sMsg, minLevel = 1) {
                                  if(debugLevel>=minLevel) {
                                      log(sMsg);
                                  }
                              }
                               
                              // Beginn des Skripts
                              
                              setupEndpoints();
                              createobjects(); // DPs anlegen
                               
                              updateToken(); // Zugriffstoken erfragen und aktuelle Werte lesen
                               
                              schedule('*/' + interval + ' * * * * *', function () {
                                  // regelmäßig Token und Zustand abfragen
                                  updateToken();
                               
                                  // gewünschte Änderungen ausführen
                                  if(!getState(dpRoot + ".mode").ack) {
                                      updateDevicePower(device, getState(dpRoot + ".mode").val);
                                  }
                                  if(!getState(dpRoot + ".silent").ack) {
                                      updateDevicePower(device, getState(dpRoot + ".silent").val);
                                  }
                              });
                               
                              tokenRefreshTimer = setInterval(function () {
                                  // Token verfällt nach 60min
                                  token = "";
                                  //log("Token nach Intervall verworfen.")
                                  updateToken();
                              }, 3600000);
                               
                              on({id: dpRoot + ".mode", change: "ne", ack: false}, function (obj) {
                                  updateToken();
                                  updateDevicePower(device, getState(dpRoot + ".mode").val);
                              });
                               
                              on({id: dpRoot + ".silent", change: "ne", ack: false}, function (obj) {
                                  updateToken();
                                  updateDeviceSilent(device, getState(dpRoot + ".silent").val);
                              });
                               
                              on({id: dpRoot + ".tempSet", change: "ne", ack: false}, function (obj) {
                                  updateToken();
                                  updateDeviceSetTemp(device, getState(dpRoot + ".tempSet").val);
                              });
                              
                              
                              P Offline
                              P Offline
                              PietNB
                              schrieb am zuletzt editiert von PietNB
                              #160

                              @oxident Okay. Habe ich gleich mal getestet.

                              avascript.0
                              2023-07-06 17:45:00.538	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:45:00.537	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.mode - -1
                              
                              javascript.0
                              2023-07-06 17:45:00.537	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.state - false
                              
                              javascript.0
                              2023-07-06 17:45:00.537	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:45:00.536	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:45:00.536	info	script.js.Poolheizung: Suche Wert Power
                              
                              javascript.0
                              2023-07-06 17:45:00.535	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.silent - false
                              
                              javascript.0
                              2023-07-06 17:45:00.534	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:45:00.534	info	script.js.Poolheizung: Manual-mute
                              
                              javascript.0
                              2023-07-06 17:45:00.534	info	script.js.Poolheizung: Mode
                              
                              javascript.0
                              2023-07-06 17:45:00.534	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:45:00.533	info	script.js.Poolheizung: Suche Wert Manual-mute
                              
                              javascript.0
                              2023-07-06 17:45:00.533	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempSet - 0
                              
                              javascript.0
                              2023-07-06 17:45:00.533	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:45:00.533	info	script.js.Poolheizung: Set_Temp
                              
                              javascript.0
                              2023-07-06 17:45:00.532	info	script.js.Poolheizung: H03
                              
                              javascript.0
                              2023-07-06 17:45:00.532	info	script.js.Poolheizung: 2077
                              
                              javascript.0
                              2023-07-06 17:45:00.532	info	script.js.Poolheizung: 2076
                              
                              javascript.0
                              2023-07-06 17:45:00.532	info	script.js.Poolheizung: 2075
                              
                              javascript.0
                              2023-07-06 17:45:00.532	info	script.js.Poolheizung: 2074
                              
                              javascript.0
                              2023-07-06 17:45:00.531	info	script.js.Poolheizung: T5
                              
                              javascript.0
                              2023-07-06 17:45:00.531	info	script.js.Poolheizung: T4
                              
                              javascript.0
                              2023-07-06 17:45:00.531	info	script.js.Poolheizung: T3
                              
                              javascript.0
                              2023-07-06 17:45:00.531	info	script.js.Poolheizung: T2
                              
                              javascript.0
                              2023-07-06 17:45:00.531	info	script.js.Poolheizung: T1
                              
                              javascript.0
                              2023-07-06 17:45:00.530	info	script.js.Poolheizung: Manual-mute
                              
                              javascript.0
                              2023-07-06 17:45:00.530	info	script.js.Poolheizung: Mode
                              
                              javascript.0
                              2023-07-06 17:45:00.530	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:45:00.530	info	script.js.Poolheizung: Suche Wert Set_Temp
                              
                              javascript.0
                              2023-07-06 17:45:00.529	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rotor - 0
                              
                              javascript.0
                              2023-07-06 17:45:00.529	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.consumption - 0
                              
                              javascript.0
                              2023-07-06 17:45:00.529	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:45:00.529	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:45:00.528	info	script.js.Poolheizung: Suche Wert Power
                              
                              javascript.0
                              2023-07-06 17:45:00.528	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rawJSON - [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
                              
                              javascript.0
                              2023-07-06 17:45:00.527	info	script.js.Poolheizung: DeviceDetails: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"value":"0","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"21.5","code":"T2"},{"value":"21.5","code":"T3"},{"value":"24.0","code":"T4"},{"value":"30.5","code":"T5"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"0","code":"T03"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:45:11 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDataByCode","path":"/crmservice/api/app/device/getDataByCode","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDataByCode"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":237}}}
                              
                              javascript.0
                              2023-07-06 17:45:00.192	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorLevel - 0
                              
                              javascript.0
                              2023-07-06 17:45:00.192	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorCode -
                              
                              javascript.0
                              2023-07-06 17:45:00.191	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorMessage -
                              
                              javascript.0
                              2023-07-06 17:45:00.191	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.error - false
                              
                              javascript.0
                              2023-07-06 17:45:00.190	info	script.js.Poolheizung: DeviceStatus: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"is_fault":false,"isFault":false,"status":"ONLINE"},"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:45:10 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDeviceStatus","path":"/crmservice/api/app/device/getDeviceStatus","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDeviceStatus"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":29}}}
                              
                              javascript.0
                              2023-07-06 17:45:00.088	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:45:00.088	info	script.js.Poolheizung: DeviceCode: 0C7FEDC2A9F5, ProductID: 1442284873216843776, DeviceStatus: true
                              
                              javascript.0
                              2023-07-06 17:45:00.087	info	script.js.Poolheizung: DeviceList: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"deviceType":"","device_status":"ONLINE","is_fault":false,"device_id":"1640588423515365376","productId":"1442284873216843776","deviceNickName":"Poolheizung","device_type":"","deviceCode":"0C7FEDC2A9F5","isFault":false,"deviceName":"0C7FEDC2A9F5","deviceId":"1640588423515365376","deviceStatus":"ONLINE","device_name":"0C7FEDC2A9F5","device_code":"0C7FEDC2A9F5","product_id":"1442284873216843776","model":null,"sn":null,"device_nick_name":"Poolheizung","projectId":null}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:45:10 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/deviceList","path":"/crmservice/api/app/device/deviceList","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/deviceList"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":148}}}
                              host.raspberrypi
                              2023-07-06 17:45:00.056	info	instance system.adapter.daswetter.0 started with pid 17966
                              
                              javascript.0
                              2023-07-06 17:44:30.567	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:44:30.566	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.mode - -1
                              
                              javascript.0
                              2023-07-06 17:44:30.566	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.state - false
                              
                              javascript.0
                              2023-07-06 17:44:30.566	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:44:30.566	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:44:30.565	info	script.js.Poolheizung: Suche Wert Power
                              
                              javascript.0
                              2023-07-06 17:44:30.565	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.silent - false
                              
                              javascript.0
                              2023-07-06 17:44:30.565	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:44:30.565	info	script.js.Poolheizung: Manual-mute
                              
                              javascript.0
                              2023-07-06 17:44:30.565	info	script.js.Poolheizung: Mode
                              
                              javascript.0
                              2023-07-06 17:44:30.565	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:44:30.564	info	script.js.Poolheizung: Suche Wert Manual-mute
                              
                              javascript.0
                              2023-07-06 17:44:30.564	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempSet - 0
                              
                              javascript.0
                              2023-07-06 17:44:30.564	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:44:30.564	info	script.js.Poolheizung: Set_Temp
                              
                              javascript.0
                              2023-07-06 17:44:30.564	info	script.js.Poolheizung: H03
                              
                              javascript.0
                              2023-07-06 17:44:30.564	info	script.js.Poolheizung: 2077
                              
                              javascript.0
                              2023-07-06 17:44:30.563	info	script.js.Poolheizung: 2076
                              
                              javascript.0
                              2023-07-06 17:44:30.563	info	script.js.Poolheizung: 2075
                              
                              javascript.0
                              2023-07-06 17:44:30.563	info	script.js.Poolheizung: 2074
                              
                              javascript.0
                              2023-07-06 17:44:30.563	info	script.js.Poolheizung: T5
                              
                              javascript.0
                              2023-07-06 17:44:30.563	info	script.js.Poolheizung: T4
                              
                              javascript.0
                              2023-07-06 17:44:30.563	info	script.js.Poolheizung: T3
                              
                              javascript.0
                              2023-07-06 17:44:30.563	info	script.js.Poolheizung: T2
                              
                              javascript.0
                              2023-07-06 17:44:30.562	info	script.js.Poolheizung: T1
                              
                              javascript.0
                              2023-07-06 17:44:30.562	info	script.js.Poolheizung: Manual-mute
                              
                              javascript.0
                              2023-07-06 17:44:30.562	info	script.js.Poolheizung: Mode
                              
                              javascript.0
                              2023-07-06 17:44:30.562	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:44:30.562	info	script.js.Poolheizung: Suche Wert Set_Temp
                              
                              javascript.0
                              2023-07-06 17:44:30.562	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rotor - 0
                              
                              javascript.0
                              2023-07-06 17:44:30.561	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.consumption - 0
                              
                              javascript.0
                              2023-07-06 17:44:30.561	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:44:30.561	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:44:30.561	info	script.js.Poolheizung: Suche Wert Power
                              
                              javascript.0
                              2023-07-06 17:44:30.560	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rawJSON - [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
                              
                              javascript.0
                              2023-07-06 17:44:30.560	info	script.js.Poolheizung: DeviceDetails: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"value":"0","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"21.5","code":"T2"},{"value":"21.5","code":"T3"},{"value":"24.0","code":"T4"},{"value":"30.5","code":"T5"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"0","code":"T03"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:44:41 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDataByCode","path":"/crmservice/api/app/device/getDataByCode","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDataByCode"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":237}}}
                              
                              javascript.0
                              2023-07-06 17:44:30.253	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorLevel - 0
                              
                              javascript.0
                              2023-07-06 17:44:30.253	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorCode -
                              
                              javascript.0
                              2023-07-06 17:44:30.252	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorMessage -
                              
                              javascript.0
                              2023-07-06 17:44:30.252	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.error - false
                              
                              javascript.0
                              2023-07-06 17:44:30.252	info	script.js.Poolheizung: DeviceStatus: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"is_fault":false,"isFault":false,"status":"ONLINE"},"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:44:40 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDeviceStatus","path":"/crmservice/api/app/device/getDeviceStatus","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDeviceStatus"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":29}}}
                              
                              javascript.0
                              2023-07-06 17:44:30.156	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:44:30.156	info	script.js.Poolheizung: DeviceCode: 0C7FEDC2A9F5, ProductID: 1442284873216843776, DeviceStatus: true
                              
                              javascript.0
                              2023-07-06 17:44:30.154	info	script.js.Poolheizung: DeviceList: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"deviceType":"","device_status":"ONLINE","is_fault":false,"device_id":"1640588423515365376","productId":"1442284873216843776","deviceNickName":"Poolheizung","device_type":"","deviceCode":"0C7FEDC2A9F5","isFault":false,"deviceName":"0C7FEDC2A9F5","deviceId":"1640588423515365376","deviceStatus":"ONLINE","device_name":"0C7FEDC2A9F5","device_code":"0C7FEDC2A9F5","product_id":"1442284873216843776","model":null,"sn":null,"device_nick_name":"Poolheizung","projectId":null}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:44:40 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/deviceList","path":"/crmservice/api/app/device/deviceList","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/deviceList"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":148}}}
                              
                              javascript.0
                              2023-07-06 17:44:00.576	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:44:00.576	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.mode - -1
                              
                              javascript.0
                              2023-07-06 17:44:00.575	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.state - false
                              
                              javascript.0
                              2023-07-06 17:44:00.575	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:44:00.574	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:44:00.574	info	script.js.Poolheizung: Suche Wert Power
                              
                              javascript.0
                              2023-07-06 17:44:00.573	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.silent - false
                              
                              javascript.0
                              2023-07-06 17:44:00.573	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:44:00.573	info	script.js.Poolheizung: Manual-mute
                              
                              javascript.0
                              2023-07-06 17:44:00.572	info	script.js.Poolheizung: Mode
                              
                              javascript.0
                              2023-07-06 17:44:00.572	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:44:00.572	info	script.js.Poolheizung: Suche Wert Manual-mute
                              
                              javascript.0
                              2023-07-06 17:44:00.571	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempSet - 0
                              
                              javascript.0
                              2023-07-06 17:44:00.571	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:44:00.570	info	script.js.Poolheizung: Set_Temp
                              
                              javascript.0
                              2023-07-06 17:44:00.570	info	script.js.Poolheizung: H03
                              
                              javascript.0
                              2023-07-06 17:44:00.569	info	script.js.Poolheizung: 2077
                              
                              javascript.0
                              2023-07-06 17:44:00.569	info	script.js.Poolheizung: 2076
                              
                              javascript.0
                              2023-07-06 17:44:00.569	info	script.js.Poolheizung: 2075
                              
                              javascript.0
                              2023-07-06 17:44:00.568	info	script.js.Poolheizung: 2074
                              
                              javascript.0
                              2023-07-06 17:44:00.568	info	script.js.Poolheizung: T5
                              
                              javascript.0
                              2023-07-06 17:44:00.568	info	script.js.Poolheizung: T4
                              
                              javascript.0
                              2023-07-06 17:44:00.567	info	script.js.Poolheizung: T3
                              
                              javascript.0
                              2023-07-06 17:44:00.567	info	script.js.Poolheizung: T2
                              
                              javascript.0
                              2023-07-06 17:44:00.567	info	script.js.Poolheizung: T1
                              
                              javascript.0
                              2023-07-06 17:44:00.566	info	script.js.Poolheizung: Manual-mute
                              
                              javascript.0
                              2023-07-06 17:44:00.566	info	script.js.Poolheizung: Mode
                              
                              javascript.0
                              2023-07-06 17:44:00.565	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:44:00.565	info	script.js.Poolheizung: Suche Wert Set_Temp
                              
                              javascript.0
                              2023-07-06 17:44:00.562	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rotor - 0
                              
                              javascript.0
                              2023-07-06 17:44:00.562	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.consumption - 0
                              
                              javascript.0
                              2023-07-06 17:44:00.561	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:44:00.561	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:44:00.560	info	script.js.Poolheizung: Suche Wert Power
                              
                              javascript.0
                              2023-07-06 17:44:00.560	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rawJSON - [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
                              
                              javascript.0
                              2023-07-06 17:44:00.553	info	script.js.Poolheizung: DeviceDetails: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"value":"0","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"21.5","code":"T2"},{"value":"21.5","code":"T3"},{"value":"24.0","code":"T4"},{"value":"30.5","code":"T5"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"0","code":"T03"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:44:11 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDataByCode","path":"/crmservice/api/app/device/getDataByCode","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDataByCode"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":237}}}
                              
                              javascript.0
                              2023-07-06 17:44:00.192	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorLevel - 0
                              
                              javascript.0
                              2023-07-06 17:44:00.191	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorCode -
                              
                              javascript.0
                              2023-07-06 17:44:00.191	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorMessage -
                              
                              javascript.0
                              2023-07-06 17:44:00.191	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.error - false
                              
                              javascript.0
                              2023-07-06 17:44:00.190	info	script.js.Poolheizung: DeviceStatus: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"is_fault":false,"isFault":false,"status":"ONLINE"},"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:44:10 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDeviceStatus","path":"/crmservice/api/app/device/getDeviceStatus","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDeviceStatus"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":29}}}
                              
                              javascript.0
                              2023-07-06 17:44:00.093	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:44:00.093	info	script.js.Poolheizung: DeviceCode: 0C7FEDC2A9F5, ProductID: 1442284873216843776, DeviceStatus: true
                              
                              javascript.0
                              2023-07-06 17:44:00.092	info	script.js.Poolheizung: DeviceList: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"deviceType":"","device_status":"ONLINE","is_fault":false,"device_id":"1640588423515365376","productId":"1442284873216843776","deviceNickName":"Poolheizung","device_type":"","deviceCode":"0C7FEDC2A9F5","isFault":false,"deviceName":"0C7FEDC2A9F5","deviceId":"1640588423515365376","deviceStatus":"ONLINE","device_name":"0C7FEDC2A9F5","device_code":"0C7FEDC2A9F5","product_id":"1442284873216843776","model":null,"sn":null,"device_nick_name":"Poolheizung","projectId":null}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:44:10 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/deviceList","path":"/crmservice/api/app/device/deviceList","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/deviceList"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":148}}}
                              
                              javascript.0
                              2023-07-06 17:43:30.476	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:43:30.476	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.mode - -1
                              
                              javascript.0
                              2023-07-06 17:43:30.476	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.state - false
                              
                              javascript.0
                              2023-07-06 17:43:30.476	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:43:30.475	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:43:30.475	info	script.js.Poolheizung: Suche Wert Power
                              
                              javascript.0
                              2023-07-06 17:43:30.475	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.silent - false
                              
                              javascript.0
                              2023-07-06 17:43:30.475	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:43:30.475	info	script.js.Poolheizung: Manual-mute
                              
                              javascript.0
                              2023-07-06 17:43:30.474	info	script.js.Poolheizung: Mode
                              
                              javascript.0
                              2023-07-06 17:43:30.474	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:43:30.474	info	script.js.Poolheizung: Suche Wert Manual-mute
                              
                              javascript.0
                              2023-07-06 17:43:30.474	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempSet - 0
                              
                              javascript.0
                              2023-07-06 17:43:30.474	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:43:30.474	info	script.js.Poolheizung: Set_Temp
                              
                              javascript.0
                              2023-07-06 17:43:30.473	info	script.js.Poolheizung: H03
                              
                              javascript.0
                              2023-07-06 17:43:30.473	info	script.js.Poolheizung: 2077
                              
                              javascript.0
                              2023-07-06 17:43:30.473	info	script.js.Poolheizung: 2076
                              
                              javascript.0
                              2023-07-06 17:43:30.473	info	script.js.Poolheizung: 2075
                              
                              javascript.0
                              2023-07-06 17:43:30.473	info	script.js.Poolheizung: 2074
                              
                              javascript.0
                              2023-07-06 17:43:30.473	info	script.js.Poolheizung: T5
                              
                              javascript.0
                              2023-07-06 17:43:30.472	info	script.js.Poolheizung: T4
                              
                              javascript.0
                              2023-07-06 17:43:30.472	info	script.js.Poolheizung: T3
                              
                              javascript.0
                              2023-07-06 17:43:30.472	info	script.js.Poolheizung: T2
                              
                              javascript.0
                              2023-07-06 17:43:30.472	info	script.js.Poolheizung: T1
                              
                              javascript.0
                              2023-07-06 17:43:30.472	info	script.js.Poolheizung: Manual-mute
                              
                              javascript.0
                              2023-07-06 17:43:30.472	info	script.js.Poolheizung: Mode
                              
                              javascript.0
                              2023-07-06 17:43:30.471	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:43:30.471	info	script.js.Poolheizung: Suche Wert Set_Temp
                              
                              javascript.0
                              2023-07-06 17:43:30.471	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rotor - 0
                              
                              javascript.0
                              2023-07-06 17:43:30.471	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.consumption - 0
                              
                              javascript.0
                              2023-07-06 17:43:30.471	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:43:30.470	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:43:30.470	info	script.js.Poolheizung: Suche Wert Power
                              
                              javascript.0
                              2023-07-06 17:43:30.470	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rawJSON - [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
                              
                              javascript.0
                              2023-07-06 17:43:30.469	info	script.js.Poolheizung: DeviceDetails: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"value":"0","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"21.5","code":"T2"},{"value":"21.5","code":"T3"},{"value":"24.0","code":"T4"},{"value":"30.5","code":"T5"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"0","code":"T03"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:43:41 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDataByCode","path":"/crmservice/api/app/device/getDataByCode","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDataByCode"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":237}}}
                              
                              javascript.0
                              2023-07-06 17:43:30.181	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorLevel - 0
                              
                              javascript.0
                              2023-07-06 17:43:30.181	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorCode -
                              
                              javascript.0
                              2023-07-06 17:43:30.181	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorMessage -
                              
                              javascript.0
                              2023-07-06 17:43:30.181	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.error - false
                              
                              javascript.0
                              2023-07-06 17:43:30.180	info	script.js.Poolheizung: DeviceStatus: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"is_fault":false,"isFault":false,"status":"ONLINE"},"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:43:40 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDeviceStatus","path":"/crmservice/api/app/device/getDeviceStatus","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDeviceStatus"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":29}}}
                              
                              javascript.0
                              2023-07-06 17:43:30.091	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:43:30.091	info	script.js.Poolheizung: DeviceCode: 0C7FEDC2A9F5, ProductID: 1442284873216843776, DeviceStatus: true
                              
                              javascript.0
                              2023-07-06 17:43:30.090	info	script.js.Poolheizung: DeviceList: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"deviceType":"","device_status":"ONLINE","is_fault":false,"device_id":"1640588423515365376","productId":"1442284873216843776","deviceNickName":"Poolheizung","device_type":"","deviceCode":"0C7FEDC2A9F5","isFault":false,"deviceName":"0C7FEDC2A9F5","deviceId":"1640588423515365376","deviceStatus":"ONLINE","device_name":"0C7FEDC2A9F5","device_code":"0C7FEDC2A9F5","product_id":"1442284873216843776","model":null,"sn":null,"device_nick_name":"Poolheizung","projectId":null}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:43:40 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/deviceList","path":"/crmservice/api/app/device/deviceList","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/deviceList"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":148}}}
                              
                              javascript.0
                              2023-07-06 17:43:00.507	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:43:00.506	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.mode - -1
                              
                              javascript.0
                              2023-07-06 17:43:00.505	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.state - false
                              
                              javascript.0
                              2023-07-06 17:43:00.505	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:43:00.505	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:43:00.504	info	script.js.Poolheizung: Suche Wert Power
                              
                              javascript.0
                              2023-07-06 17:43:00.504	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.silent - false
                              
                              javascript.0
                              2023-07-06 17:43:00.503	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:43:00.502	info	script.js.Poolheizung: Manual-mute
                              
                              javascript.0
                              2023-07-06 17:43:00.502	info	script.js.Poolheizung: Mode
                              
                              javascript.0
                              2023-07-06 17:43:00.501	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:43:00.501	info	script.js.Poolheizung: Suche Wert Manual-mute
                              
                              javascript.0
                              2023-07-06 17:43:00.500	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempSet - 0
                              
                              javascript.0
                              2023-07-06 17:43:00.500	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:43:00.499	info	script.js.Poolheizung: Set_Temp
                              
                              javascript.0
                              2023-07-06 17:43:00.499	info	script.js.Poolheizung: H03
                              
                              javascript.0
                              2023-07-06 17:43:00.499	info	script.js.Poolheizung: 2077
                              
                              javascript.0
                              2023-07-06 17:43:00.498	info	script.js.Poolheizung: 2076
                              
                              javascript.0
                              2023-07-06 17:43:00.498	info	script.js.Poolheizung: 2075
                              
                              javascript.0
                              2023-07-06 17:43:00.497	info	script.js.Poolheizung: 2074
                              
                              javascript.0
                              2023-07-06 17:43:00.497	info	script.js.Poolheizung: T5
                              
                              javascript.0
                              2023-07-06 17:43:00.497	info	script.js.Poolheizung: T4
                              
                              javascript.0
                              2023-07-06 17:43:00.496	info	script.js.Poolheizung: T3
                              
                              javascript.0
                              2023-07-06 17:43:00.496	info	script.js.Poolheizung: T2
                              
                              javascript.0
                              2023-07-06 17:43:00.495	info	script.js.Poolheizung: T1
                              
                              javascript.0
                              2023-07-06 17:43:00.495	info	script.js.Poolheizung: Manual-mute
                              
                              javascript.0
                              2023-07-06 17:43:00.493	info	script.js.Poolheizung: Mode
                              
                              javascript.0
                              2023-07-06 17:43:00.493	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:43:00.492	info	script.js.Poolheizung: Suche Wert Set_Temp
                              
                              javascript.0
                              2023-07-06 17:43:00.492	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rotor - 0
                              
                              javascript.0
                              2023-07-06 17:43:00.492	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.consumption - 0
                              
                              javascript.0
                              2023-07-06 17:43:00.491	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:43:00.491	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:43:00.490	info	script.js.Poolheizung: Suche Wert Power
                              
                              javascript.0
                              2023-07-06 17:43:00.489	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rawJSON - [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
                              
                              javascript.0
                              2023-07-06 17:43:00.488	info	script.js.Poolheizung: DeviceDetails: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"value":"0","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"21.5","code":"T2"},{"value":"21.5","code":"T3"},{"value":"24.0","code":"T4"},{"value":"30.5","code":"T5"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"0","code":"T03"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:43:11 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDataByCode","path":"/crmservice/api/app/device/getDataByCode","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDataByCode"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":237}}}
                              
                              javascript.0
                              2023-07-06 17:43:00.182	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorLevel - 0
                              
                              javascript.0
                              2023-07-06 17:43:00.181	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorCode -
                              
                              javascript.0
                              2023-07-06 17:43:00.181	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorMessage -
                              
                              javascript.0
                              2023-07-06 17:43:00.181	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.error - false
                              
                              javascript.0
                              2023-07-06 17:43:00.180	info	script.js.Poolheizung: DeviceStatus: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"is_fault":false,"isFault":false,"status":"ONLINE"},"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:43:10 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDeviceStatus","path":"/crmservice/api/app/device/getDeviceStatus","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDeviceStatus"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":29}}}
                              
                              javascript.0
                              2023-07-06 17:43:00.090	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:43:00.089	info	script.js.Poolheizung: DeviceCode: 0C7FEDC2A9F5, ProductID: 1442284873216843776, DeviceStatus: true
                              
                              javascript.0
                              2023-07-06 17:43:00.089	info	script.js.Poolheizung: DeviceList: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"deviceType":"","device_status":"ONLINE","is_fault":false,"device_id":"1640588423515365376","productId":"1442284873216843776","deviceNickName":"Poolheizung","device_type":"","deviceCode":"0C7FEDC2A9F5","isFault":false,"deviceName":"0C7FEDC2A9F5","deviceId":"1640588423515365376","deviceStatus":"ONLINE","device_name":"0C7FEDC2A9F5","device_code":"0C7FEDC2A9F5","product_id":"1442284873216843776","model":null,"sn":null,"device_nick_name":"Poolheizung","projectId":null}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:43:10 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/deviceList","path":"/crmservice/api/app/device/deviceList","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/deviceList"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":148}}}
                              
                              javascript.0
                              2023-07-06 17:42:30.693	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:42:30.693	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.mode - -1
                              
                              javascript.0
                              2023-07-06 17:42:30.692	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.state - false
                              
                              javascript.0
                              2023-07-06 17:42:30.692	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:42:30.691	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:42:30.691	info	script.js.Poolheizung: Suche Wert Power
                              
                              javascript.0
                              2023-07-06 17:42:30.690	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.silent - false
                              
                              javascript.0
                              2023-07-06 17:42:30.689	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:42:30.689	info	script.js.Poolheizung: Manual-mute
                              
                              javascript.0
                              2023-07-06 17:42:30.688	info	script.js.Poolheizung: Mode
                              
                              javascript.0
                              2023-07-06 17:42:30.688	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:42:30.687	info	script.js.Poolheizung: Suche Wert Manual-mute
                              
                              javascript.0
                              2023-07-06 17:42:30.687	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempSet - 0
                              
                              javascript.0
                              2023-07-06 17:42:30.686	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:42:30.686	info	script.js.Poolheizung: Set_Temp
                              
                              javascript.0
                              2023-07-06 17:42:30.685	info	script.js.Poolheizung: H03
                              
                              javascript.0
                              2023-07-06 17:42:30.684	info	script.js.Poolheizung: 2077
                              
                              javascript.0
                              2023-07-06 17:42:30.684	info	script.js.Poolheizung: 2076
                              
                              javascript.0
                              2023-07-06 17:42:30.683	info	script.js.Poolheizung: 2075
                              
                              javascript.0
                              2023-07-06 17:42:30.683	info	script.js.Poolheizung: 2074
                              
                              javascript.0
                              2023-07-06 17:42:30.682	info	script.js.Poolheizung: T5
                              
                              javascript.0
                              2023-07-06 17:42:30.682	info	script.js.Poolheizung: T4
                              
                              javascript.0
                              2023-07-06 17:42:30.681	info	script.js.Poolheizung: T3
                              
                              javascript.0
                              2023-07-06 17:42:30.681	info	script.js.Poolheizung: T2
                              
                              javascript.0
                              2023-07-06 17:42:30.680	info	script.js.Poolheizung: T1
                              
                              javascript.0
                              2023-07-06 17:42:30.680	info	script.js.Poolheizung: Manual-mute
                              
                              javascript.0
                              2023-07-06 17:42:30.679	info	script.js.Poolheizung: Mode
                              
                              javascript.0
                              2023-07-06 17:42:30.679	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:42:30.678	info	script.js.Poolheizung: Suche Wert Set_Temp
                              
                              javascript.0
                              2023-07-06 17:42:30.677	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rotor - 0
                              
                              javascript.0
                              2023-07-06 17:42:30.677	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.consumption - 0
                              
                              javascript.0
                              2023-07-06 17:42:30.676	info	script.js.Poolheizung: Wert gefunden: 0
                              
                              javascript.0
                              2023-07-06 17:42:30.676	info	script.js.Poolheizung: Power
                              
                              javascript.0
                              2023-07-06 17:42:30.675	info	script.js.Poolheizung: Suche Wert Power
                              
                              javascript.0
                              2023-07-06 17:42:30.674	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rawJSON - [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
                              
                              javascript.0
                              2023-07-06 17:42:30.672	info	script.js.Poolheizung: DeviceDetails: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"value":"0","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"21.5","code":"T2"},{"value":"21.5","code":"T3"},{"value":"24.0","code":"T4"},{"value":"31.0","code":"T5"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"0","code":"T03"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:42:41 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDataByCode","path":"/crmservice/api/app/device/getDataByCode","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDataByCode"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":237}}}
                              
                              javascript.0
                              2023-07-06 17:42:30.386	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorLevel - 0
                              
                              javascript.0
                              2023-07-06 17:42:30.386	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorCode -
                              
                              javascript.0
                              2023-07-06 17:42:30.385	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorMessage -
                              
                              javascript.0
                              2023-07-06 17:42:30.385	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.error - false
                              
                              javascript.0
                              2023-07-06 17:42:30.384	info	script.js.Poolheizung: DeviceStatus: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"is_fault":false,"isFault":false,"status":"ONLINE"},"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:42:41 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDeviceStatus","path":"/crmservice/api/app/device/getDeviceStatus","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDeviceStatus"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":29}}}
                              
                              javascript.0
                              2023-07-06 17:42:30.297	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:42:30.297	info	script.js.Poolheizung: DeviceCode: 0C7FEDC2A9F5, ProductID: 1442284873216843776, DeviceStatus: true
                              
                              javascript.0
                              2023-07-06 17:42:30.296	info	script.js.Poolheizung: DeviceList: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"deviceType":"","device_status":"ONLINE","is_fault":false,"device_id":"1640588423515365376","productId":"1442284873216843776","deviceNickName":"Poolheizung","device_type":"","deviceCode":"0C7FEDC2A9F5","isFault":false,"deviceName":"0C7FEDC2A9F5","deviceId":"1640588423515365376","deviceStatus":"ONLINE","device_name":"0C7FEDC2A9F5","device_code":"0C7FEDC2A9F5","product_id":"1442284873216843776","model":null,"sn":null,"device_nick_name":"Poolheizung","projectId":null}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:42:41 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/deviceList","path":"/crmservice/api/app/device/deviceList","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/deviceList"},"method":"POST","headers":{"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":148}}}
                              
                              javascript.0
                              2023-07-06 17:42:30.206	info	script.js.Poolheizung: Login ok! Token l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==
                              
                              javascript.0
                              2023-07-06 17:42:30.206	info	script.js.Poolheizung: Login-Antwort: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"userId":"1673351056027705344","userName":"p.s****8@arcor.de","nickName":"PietNB","realName":null,"userPassword":null,"x-token":"l+G1gsEQB+acXOj0Wy682d8a9gvthqdo3byBcNRZiLM8C3UQf8y/zBRCHpxeTft0qOxLXNUeG8QdwxEcodA41Q==","user_id":"1673351056027705344","user_name":"p.s****8@arcor.de","nick_name":"PietNB","real_name":null,"user_type":"Customer","accessKey":"9a42f5a95fce47088f050f1a55dd4f3a"},"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:42:40 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/user/login","path":"/crmservice/api/app/user/login","href":"https://cloud.linked-go.com:449/crmservice/api/app/user/login"},"method":"POST","headers":{"accept":"application/json","content-type":"application/json","content-length":91}}}
                              
                              javascript.0
                              2023-07-06 17:42:30.007	info	script.js.Poolheizung: Token Neuanforderung
                              
                              admin.0
                              2023-07-06 17:42:25.838	info	<== Disconnect system.user.admin from ::ffff:192.168.178.69 javascript
                              
                              javascript.0
                              2023-07-06 17:42:15.890	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:42:15.890	info	script.js.Poolheizung: DeviceCode: 0C7FEDC2A9F5, ProductID: 1442284873216843776, DeviceStatus: true
                              
                              javascript.0
                              2023-07-06 17:42:15.889	info	script.js.Poolheizung: DeviceList: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"deviceType":"","device_status":"ONLINE","is_fault":false,"device_id":"1640588423515365376","productId":"1442284873216843776","deviceNickName":"Poolheizung","device_type":"","deviceCode":"0C7FEDC2A9F5","isFault":false,"deviceName":"0C7FEDC2A9F5","deviceId":"1640588423515365376","deviceStatus":"ONLINE","device_name":"0C7FEDC2A9F5","device_code":"0C7FEDC2A9F5","product_id":"1442284873216843776","model":null,"sn":null,"device_nick_name":"Poolheizung","projectId":null}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:42:26 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/deviceList","path":"/crmservice/api/app/device/deviceList","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/deviceList"},"method":"POST","headers":{"x-token":"Pa+0QHgzEc3+INx5QMIBDSKBEFr0k7yOr9Sm/FQZAAsUggKp7PhTzytNWQhoqOyWqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":148}}}
                              
                              javascript.0
                              2023-07-06 17:42:15.838	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - false
                              
                              javascript.0
                              2023-07-06 17:42:15.838	info	script.js.Poolheizung: DeviceStatus: {"statusCode":200,"body":{"error_msg":"请重新登录","error_msg_code":"","isReusltSuc":false,"objectResult":null,"error_code":"-100"},"headers":{"date":"Thu, 06 Jul 2023 15:42:26 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-service-error-code":"3000","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDeviceStatus","path":"/crmservice/api/app/device/getDeviceStatus","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDeviceStatus"},"method":"POST","headers":{"x-token":"rQvrYTqO/Zzu0fNkRtJ8c8iE4jUlWSdVzsxmS6FluF0d6LFo9GDiYMjuU6N8Q7plqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":29}}}
                              
                              javascript.0
                              2023-07-06 17:42:15.804	info	script.js.Poolheizung: Login ok! Token Pa+0QHgzEc3+INx5QMIBDSKBEFr0k7yOr9Sm/FQZAAsUggKp7PhTzytNWQhoqOyWqOxLXNUeG8QdwxEcodA41Q==
                              
                              javascript.0
                              2023-07-06 17:42:15.803	info	script.js.Poolheizung: Login-Antwort: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"userId":"1673351056027705344","userName":"p.s****8@arcor.de","nickName":"PietNB","realName":null,"userPassword":null,"x-token":"Pa+0QHgzEc3+INx5QMIBDSKBEFr0k7yOr9Sm/FQZAAsUggKp7PhTzytNWQhoqOyWqOxLXNUeG8QdwxEcodA41Q==","user_id":"1673351056027705344","user_name":"p.s****8@arcor.de","nick_name":"PietNB","real_name":null,"user_type":"Customer","accessKey":"6d0f298674fd4e0e8cd9afb17cc51407"},"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:42:26 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/user/login","path":"/crmservice/api/app/user/login","href":"https://cloud.linked-go.com:449/crmservice/api/app/user/login"},"method":"POST","headers":{"accept":"application/json","content-type":"application/json","content-length":91}}}
                              
                              javascript.0
                              2023-07-06 17:42:15.763	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                              
                              javascript.0
                              2023-07-06 17:42:15.762	info	script.js.Poolheizung: DeviceCode: 0C7FEDC2A9F5, ProductID: 1442284873216843776, DeviceStatus: true
                              
                              javascript.0
                              2023-07-06 17:42:15.761	info	script.js.Poolheizung: DeviceList: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"deviceType":"","device_status":"ONLINE","is_fault":false,"device_id":"1640588423515365376","productId":"1442284873216843776","deviceNickName":"Poolheizung","device_type":"","deviceCode":"0C7FEDC2A9F5","isFault":false,"deviceName":"0C7FEDC2A9F5","deviceId":"1640588423515365376","deviceStatus":"ONLINE","device_name":"0C7FEDC2A9F5","device_code":"0C7FEDC2A9F5","product_id":"1442284873216843776","model":null,"sn":null,"device_nick_name":"Poolheizung","projectId":null}],"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:42:26 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/deviceList","path":"/crmservice/api/app/device/deviceList","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/deviceList"},"method":"POST","headers":{"x-token":"rQvrYTqO/Zzu0fNkRtJ8c8iE4jUlWSdVzsxmS6FluF0d6LFo9GDiYMjuU6N8Q7plqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":148}}}
                              
                              javascript.0
                              2023-07-06 17:42:15.672	info	script.js.Poolheizung: Login ok! Token rQvrYTqO/Zzu0fNkRtJ8c8iE4jUlWSdVzsxmS6FluF0d6LFo9GDiYMjuU6N8Q7plqOxLXNUeG8QdwxEcodA41Q==
                              
                              javascript.0
                              2023-07-06 17:42:15.671	info	script.js.Poolheizung: Login-Antwort: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"userId":"1673351056027705344","userName":"p.s****8@arcor.de","nickName":"PietNB","realName":null,"userPassword":null,"x-token":"rQvrYTqO/Zzu0fNkRtJ8c8iE4jUlWSdVzsxmS6FluF0d6LFo9GDiYMjuU6N8Q7plqOxLXNUeG8QdwxEcodA41Q==","user_id":"1673351056027705344","user_name":"p.s****8@arcor.de","nick_name":"PietNB","real_name":null,"user_type":"Customer","accessKey":"818d83b336b1459b8485d4e429e38c30"},"isReusltSuc":true},"headers":{"date":"Thu, 06 Jul 2023 15:42:26 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/user/login","path":"/crmservice/api/app/user/login","href":"https://cloud.linked-go.com:449/crmservice/api/app/user/login"},"method":"POST","headers":{"accept":"application/json","content-type":"application/json","content-length":91}}}
                              
                              javascript.0
                              2023-07-06 17:42:15.598	error	at processImmediate (internal/timers.js:464:21)
                              
                              javascript.0
                              2023-07-06 17:42:15.598	error	at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:5708:41)
                              
                              javascript.0
                              2023-07-06 17:42:15.598	error	at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:596:29)
                              
                              javascript.0
                              2023-07-06 17:42:15.598	error	at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1214:38)
                              
                              javascript.0
                              2023-07-06 17:42:15.598	error	at Object.<anonymous> (script.js.Poolheizung:907:5)
                              
                              javascript.0
                              2023-07-06 17:42:15.597	error	at updateDeviceSetTemp (script.js.Poolheizung:792:36)
                              
                              javascript.0
                              2023-07-06 17:42:15.596	error	Error in callback: TypeError: Cannot read property 'toString' of null
                              
                              javascript.0
                              2023-07-06 17:42:15.588	info	script.js.Poolheizung: Token Neuanforderung
                              
                              javascript.0
                              2023-07-06 17:42:15.574	warn	Read-only state "0_userdata.0.Poolheizung.rawJSON" has been written without ack-flag with value "null"
                              
                              javascript.0
                              2023-07-06 17:42:15.573	warn	Read-only state "0_userdata.0.Poolheizung.coilTemp" has been written without ack-flag with value "null"
                              
                              javascript.0
                              2023-07-06 17:42:15.572	warn	Read-only state "0_userdata.0.Poolheizung.suctionTemp" has been written without ack-flag with value "null"
                              
                              javascript.0
                              2023-07-06 17:42:15.569	warn	Read-only state "0_userdata.0.Poolheizung.tempOut" has been written without ack-flag with value "null"
                              
                              javascript.0
                              2023-07-06 17:42:15.567	warn	Read-only state "0_userdata.0.Poolheizung.tempIn" has been written without ack-flag with value "null"
                              
                              javascript.0
                              2023-07-06 17:42:15.564	warn	Read-only state "0_userdata.0.Poolheizung.errorLevel" has been written without ack-flag with value "null"
                              
                              javascript.0
                              2023-07-06 17:42:15.560	warn	Read-only state "0_userdata.0.Poolheizung.ambient" has been written without ack-flag with value "null"
                              
                              javascript.0
                              2023-07-06 17:42:15.457	info	script.js.Poolheizung: registered 3 subscriptions, 1 schedule, 0 messages, 0 logs and 0 file subscriptions
                              
                              javascript.0
                              2023-07-06 17:42:15.432	info	script.js.Poolheizung: Token Neuanforderung
                              
                              javascript.0
                              2023-07-06 17:42:15.429	info	script.js.Poolheizung: erstelle Objekte
                              
                              javascript.0
                              2023-07-06 17:42:15.429	info	script.js.Poolheizung: API-Level 3
                              
                              javascript.0
                              2023-07-06 17:42:15.403	info	Start javascript script.js.Poolheizung
                              
                              javascript.0
                              2023-07-06 17:42:13.864	info	Stop script script.js.Poolheizung
                              
                              javascript.0
                              2023-07-06 17:41:19.908	info	Stop script script.js.Poolheizung
                              

                              Die Verbindung steht, aber in den Objekten sind wieder keine Werte. In der rawJSON stehen aber die Werte wieder drin?

                              1 Antwort Letzte Antwort
                              0
                              • O oxident

                                So, neuer Tag, neues Glück. Ich habe in der Tat schon einen krassen Fehler gefunden, der auf jeden Fall die Nutzer mit der neuen App betrafen. Außerdem habe ich jetzt eine Option für intensives Debugging hinzugefügt. Bitte mal den Wert bei debugLevel kurzzeitig (am besten nur bis zum Auftreten des Fehlers) auf 1 stellen:

                                // Midas Poolheizung
                                // v0.0.8d
                                // Changelog:
                                // 0.0.8: Testweise Unterstützung von neu registrierten Anlagen
                                // 0.0.7: Kleinigkeiten überarbeitet
                                //        weitere Modelle hinzugefügt
                                // 0.0.6: Gültigkeitsprüfung des Zertifikats deaktiviert (Dank an znyde)
                                //        Kompatibilität mit Promo Next Modellen durch generische Product-ID (Dank an znyde)
                                // 0.0.5: weitere Abfragewerte hinzugefügt (Kompressor- und Ansaugtemperatur)
                                // 0.0.4: Tokenverfall jetzt 60min nach Skriptstart und nicht zu jeder vollen Stunde (Dank an dering)
                                // 0.0.3: Datenpunkte beim Start automatisch anlegen (Dank an Andy200877)
                                // 0.0.2: Token bei jedem Set-Vorgang prüfen und ggf. neu anfordern (Dank an dering)
                                
                                // ANFANG konfigurierbare Elemente -----
                                const username = "EMAIL";
                                var password = "KENNWORT";
                                
                                const interval = 30; // Abfrageintervall in Sekunden
                                
                                const dpRoot = "0_userdata.0.Poolheizung"; // Stammordner der Datenpunkte
                                
                                const apilevel = 1;   // 1: AquaTemp-Accounts, die vor v.1.5.8 erstellt wurden
                                                      // 2: HiTemp-Accounts
                                                      // 3: AquaTemp-Accounts, die mit neueren App-Versionen erstellt wurden
                                
                                const debugLevel = 0;   // 0: keine erweiterten Informationen protokollieren
                                                        // 1: Debug-Informationen protokollieren
                                
                                // ENDE --------------------------------
                                 
                                var cloudURL;
                                
                                var token = "";
                                var tokenRefreshTimer;
                                var device = "";
                                
                                // ProductIDs:
                                // Gruppe 1:
                                // 1132174963097280512: Midas/Poolsana InverPro
                                const AQUATEMP_POOLSANA="1132174963097280512";
                                // Gruppe 2:
                                // 1442284873216843776: 
                                const AQUATEMP_OTHER1="1442284873216843776";
                                
                                var product = "";
                                var reachable = false;
                                
                                function setupEndpoints() {
                                    if(apilevel==1) {
                                        cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                                    } else if(apilevel==2) {
                                        cloudURL = "https://cloud.linked-go.com/cloudservice/api";
                                    } else if(apilevel==3) {
                                        cloudURL = "https://cloud.linked-go.com:449/crmservice/api";
                                        password = require('crypto').createHash('md5').update(password).digest("hex");
                                    }
                                    printLog("API-Level " + apilevel, 1);
                                }
                                 
                                function clearValues() {
                                    saveValue("error", true, "boolean");
                                    saveValue("consumption", 0, "number");
                                    saveValue("state", false, "boolean");
                                }
                                 
                                function saveValue(key, value, sType) {
                                    var dp = dpRoot + "." + key;
                                 
                                    if ( !existsState(dp )) {
                                        printLog("Schreibe in NEUEN Datenpunkt: " + dp + " - " + value, 1);
                                        createState(dp,value,{name: key,  type: 'number', role: 'value'}, function () {}); 
                                    } else {
                                        printLog("Schreibe in Datenpunkt: " + dp + " - " + value, 1);
                                        setState(dp,value,true);
                                    }
                                }
                                 
                                function findCodeVal(result, code) {
                                    //log(code);
                                    printLog("Suche Wert " + code, 1);
                                    for(var i=0; i<result.length; i++) {
                                        //log(result[i].code);
                                        printLog(result[i].code, 1);
                                        if(result[i].code.indexOf(code) >= 0) {
                                            printLog("Wert gefunden: " + result[i].value, 1);
                                            return result[i].value;
                                        }
                                    }
                                    return "";
                                }
                                 
                                function createobjects() {
                                    log ("erstelle Objekte");
                                    createState(dpRoot + '.ambient', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Umgebungstemperatur"});
                                    createState(dpRoot + '.connection', {read: true, write: false,  type: "boolean", role: "state", name: "Verbindung", def: false});
                                    createState(dpRoot + '.consumption', {read: true, write: false,  type: "number", unit:"W", role: "value.power", name: "Stromverbrauch", def: 0});
                                    createState(dpRoot + '.error', {read: true, write: false,  type: "boolean", role: "state", name: "Fehler", def: false});
                                    createState(dpRoot + '.errorCode', {read: true, write: false,  type: "string", name: "Fehlercode", def: ""});
                                    createState(dpRoot + '.errorLevel', {read: true, write: false,  type: "number", name: "Fehlerlevel"});
                                    createState(dpRoot + '.errorMessage', {read: true, write: false,  type: "string", name: "Fehlermeldung", def: ""});
                                    createState(dpRoot + '.mode', {read: true, write: true,  type: "string", states: "-1:off;0:cool;1:heat;2:auto", name: "Modus", def: ""});
                                    createState(dpRoot + '.rotor', {read: true, write: false,  type: "number", unit:"rpm", def: 0, name: "Lüfterdrehzahl"});
                                    createState(dpRoot + '.silent', {read: true, write: true,  type: "boolean", role: "state", name: "Silent", def: false});
                                    createState(dpRoot + '.state', {read: true, write: false,  type: "boolean", role: "state", name: "Status", def: false});
                                    createState(dpRoot + '.tempIn', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Eingangstemperatur"});
                                    createState(dpRoot + '.tempOut', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Ausgangstemperatur"});
                                    createState(dpRoot + '.tempSet', {read: true, write: true,  type: "number", unit:"°C", role: "level.temperature", name: "Solltemperatur"});
                                    createState(dpRoot + '.suctionTemp', {read: true, write: false,  type: "number", unit:"°C", name: "Luftansaugtemperatur"});
                                    createState(dpRoot + '.coilTemp', {read: true, write: false,  type: "number", unit:"°C", role: "value.temperature", name: "Kompressortemperatur"});
                                    
                                    createState(dpRoot + '.rawJSON', {read: true, write: false,  type: "array", name: "komplette Rückgabe"});
                                }
                                 
                                function updateToken() {
                                 
                                    if(token=="") {
                                        printLog("Token Neuanforderung");
                                        var request = require('request');
                                        var options;
                                    
                                        if(apilevel<3) {
                                            options = {
                                                url: cloudURL + '/app/user/login.json',
                                                method: 'POST',
                                                json: { "user_name": username, "password": password, "type": "2" },
                                                rejectUnauthorized: false
                                            };
                                        } else {
                                            options = {
                                                url: cloudURL + '/app/user/login',
                                                method: 'POST',
                                                json: { "userName": username, "password": password, "type": "2" },
                                                rejectUnauthorized: false
                                            };
                                        }
                                        
                                
                                        //log(JSON.stringify(options));
                                        
                                        request(options,function (error, response, body){
                                        
                                            printLog("Login-Antwort: " + JSON.stringify(response));
                                            if(parseInt(body.error_code)==0) {
                                                
                                                if(apilevel<3) {
                                                    token = body.object_result["x-token"];
                                                } else {
                                                    token = body.objectResult["x-token"];
                                                }
                                                
                                                printLog("Login ok! Token " + token);
                                                updateDeviceID();
                                            } else {
                                                // Login-Fehler
                                                printLog("Login-Fehler in updateToken(): " + response.body);
                                                token = "";
                                                saveValue("connection", false, "boolean");
                                            }
                                            
                                        });
                                    } else {
                                        updateDeviceID();
                                    }
                                 
                                    
                                 
                                    
                                 
                                }
                                 
                                function updateDeviceID() {
                                    if(token!="") {
                                        var optionsDev;
                                        if(apilevel<3) {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/deviceList.json',
                                                headers: { "x-token": token },
                                                body: {"product_ids": [
                                                        "1132174963097280512",
                                                        "1186904563333062656",
                                                        "1158905952238313472",
                                                        "1245226668902080512",
                                                        "1442284873216843776",
                                                        "1548963836789501952",
                                                        ]},
                                                method: 'POST',
                                                json: true,
                                                rejectUnauthorized: false  
                                            };
                                        } else {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/deviceList',
                                                headers: { "x-token": token },
                                                body: {"productIds": [
                                                        "1132174963097280512",
                                                        "1186904563333062656",
                                                        "1158905952238313472",
                                                        "1245226668902080512",
                                                        "1442284873216843776",
                                                        "1548963836789501952",
                                                        ]},
                                                method: 'POST',
                                                json: true,
                                                rejectUnauthorized: false  
                                            };
                                        }
                                
                                        var request = require('request');
                                 
                                        request(optionsDev,function (error, response, body){
                                    
                                            printLog("DeviceList: " + JSON.stringify(response));
                                            //log(JSON.stringify(body.object_result));
                                 
                                            if(parseInt(body.error_code)==0) {
                                                
                                                //token = body.object_result["x-token"];
                                                //log("Login ok! Token " + token);
                                                
                                                if(apilevel<3) {
                                                    device = body.object_result[0].device_code;
                                                    product = body.object_result[0].product_id;
                                                    reachable = (body.object_result[0].device_status=="ONLINE");
                                                } else {
                                                    device = body.objectResult[0].deviceCode;
                                                    product = body.objectResult[0].productId;
                                                    reachable = (body.objectResult[0].deviceStatus=="ONLINE");
                                                }
                                
                                                printLog("DeviceCode: " + device + ", ProductID: " + product + ", DeviceStatus: " + reachable);
                                                
                                                if(reachable) {
                                                    saveValue("connection", true, "boolean");
                                                    if(device!="") updateDeviceStatus(device);
                                                } else {
                                                    // offline
                                                    device = "";
                                                    saveValue("connection", false, "boolean");
                                                }
                                                
                                            } else {
                                                // Login-Fehler
                                                //log("Fehler in updateDeviceID(): " + response.body, "error");
                                                token = "";
                                                device = "";
                                                reachable = false;
                                                saveValue("connection", false, "boolean");
                                            }
                                            
                                        });
                                    }
                                }
                                 
                                function updateDeviceStatus(devicecode) {
                                    if(token!="") {
                                        var optionsDev;
                                
                                        if(apilevel<3) {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/getDeviceStatus.json',
                                                headers: { "x-token": token },
                                                json: { "device_code": devicecode },
                                                method: 'POST',
                                                rejectUnauthorized: false
                                            };
                                        } else {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/getDeviceStatus',
                                                headers: { "x-token": token },
                                                json: { "deviceCode": devicecode },
                                                method: 'POST',
                                                rejectUnauthorized: false
                                            };
                                        }
                                        
                                 
                                        var request = require('request');
                                 
                                        request(optionsDev,function (error, response, body){
                                    
                                            printLog("DeviceStatus: " + JSON.stringify(response));
                                            //log(JSON.stringify(body.object_result));
                                 
                                            if(parseInt(body.error_code)==0) {
                                
                                                if(apilevel<3) {
                                                    if(body.object_result["is_fault"]==true) {
                                                        // TODO: Fehlerbeschreibung abrufen
                                                        //clearValues();
                                                        saveValue("error", true, "boolean");
                                                        updateDeviceDetails(devicecode);
                                                        updateDeviceErrorMsg(devicecode);
                                                    } else {
                                                        // kein Fehler
                                                        saveValue("error", false, "boolean");
                                                        saveValue("errorMessage", "", "string");
                                                        saveValue("errorCode", "", "string");
                                                        saveValue("errorLevel", 0, "number");
                                                        updateDeviceDetails(devicecode);
                                                    }
                                                } else {
                                                    if(body.objectResult["is_fault"]==true) {
                                                        // TODO: Fehlerbeschreibung abrufen
                                                        //clearValues();
                                                        saveValue("error", true, "boolean");
                                                        updateDeviceDetails(devicecode);
                                                        updateDeviceErrorMsg(devicecode);
                                                    } else {
                                                        // kein Fehler
                                                        saveValue("error", false, "boolean");
                                                        saveValue("errorMessage", "", "string");
                                                        saveValue("errorCode", "", "string");
                                                        saveValue("errorLevel", 0, "number");
                                                        updateDeviceDetails(devicecode);
                                                    }
                                                }
                                 
                                                
                                                
                                                //token = body.object_result["x-token"];
                                                //log("Login ok! Token " + token);
                                                
                                            } else {
                                                // Login-Fehler
                                                //log("Fehler in updateDeviceStatus(): " + response.body, "error");
                                                token = "";
                                                device = "";
                                                saveValue("connection", false, "boolean");
                                            }
                                            
                                        });
                                    }
                                }
                                 
                                function updateDeviceErrorMsg(devicecode) {
                                    if(token!="") {
                                        var optionsDev;
                                
                                        if(apilevel<3) {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/getFaultDataByDeviceCode.json',
                                                headers: { "x-token": token },
                                                json: { "device_code": devicecode },
                                                method: 'POST',
                                                rejectUnauthorized: false
                                                //headers: {"content-type": "application/json"},
                                                //charset: 'utf8',
                                                //json: true
                                                
                                            };
                                        } else {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/getFaultDataByDeviceCode',
                                                headers: { "x-token": token },
                                                json: { "deviceCode": devicecode },
                                                method: 'POST',
                                                rejectUnauthorized: false
                                                //headers: {"content-type": "application/json"},
                                                //charset: 'utf8',
                                                //json: true
                                                
                                            };
                                        }
                                        
                                 
                                        var request = require('request');
                                 
                                        request(optionsDev,function (error, response, body){
                                    
                                            //log(JSON.stringify(response));
                                            //log(JSON.stringify(body.object_result));
                                 
                                            if(parseInt(body.error_code)==0) {
                                 
                                                
                                                saveValue("error", true, "boolean");
                                
                                                if(apilevel<3) {
                                                    saveValue("errorMessage", body.object_result[0].description, "string");
                                                    saveValue("errorCode", body.object_result[0].fault_code, "string");
                                                    saveValue("errorLevel", body.object_result[0].error_level, "string");
                                                } else {
                                                    saveValue("errorMessage", body.objectResult[0].description, "string");
                                                    saveValue("errorCode", body.objectResult[0].fault_code, "string");
                                                    saveValue("errorLevel", body.objectResult[0].error_level, "string");
                                                }
                                                
                                                
                                            } else {
                                                // Login-Fehler
                                                //log("Fehler in updateDeviceErrorMsg(): " + response.body, "error");
                                                token = "";
                                                device = "";
                                                saveValue("connection", false, "boolean");
                                            }
                                            
                                        });
                                    }
                                }
                                 
                                function updateDeviceDetails(devicecode) {
                                    if(token!="") {
                                        var optionsDev;
                                
                                        if(apilevel<3) {
                                            if(product==AQUATEMP_POOLSANA) {
                                                optionsDev = {
                                                    url: cloudURL + '/app/device/getDataByCode.json',
                                                    headers: { "x-token": token },
                                                    json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                                    // "protocal_codes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05"]
                                                    method: 'POST',
                                                    rejectUnauthorized: false
                                                
                                                };
                                            } else if(product==AQUATEMP_OTHER1) {
                                                optionsDev = {
                                                    url: cloudURL + '/app/device/getDataByCode.json',
                                                    headers: { "x-token": token },
                                                    json: { "device_code": devicecode, "protocal_codes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T7","T14","T17"] },
                                                    method: 'POST',
                                                    rejectUnauthorized: false
                                                
                                                };
                                            }
                                            
                                        } else {
                                            if(product==AQUATEMP_POOLSANA) {
                                                optionsDev = {
                                                    url: cloudURL + '/app/device/getDataByCode',
                                                    headers: { "x-token": token },
                                                    json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T01","T02","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T04","T05","T07","T14","T17"] },
                                                    method: 'POST',
                                                    rejectUnauthorized: false
                                                
                                                };
                                            } else if (product==AQUATEMP_OTHER1) {
                                                optionsDev = {
                                                    url: cloudURL + '/app/device/getDataByCode',
                                                    headers: { "x-token": token },
                                                    json: { "deviceCode": devicecode, "protocalCodes":["Power","Mode","Manual-mute","T1","T2","T3","T4","T5","2074","2075","2076","2077","H03","Set_Temp","R08","R09","R10","R11","R01","R02","R03","T03","1158","1159","F17","H02","T7","T14","T17"] },
                                                    method: 'POST',
                                                    rejectUnauthorized: false
                                                
                                                };
                                            }
                                            
                                
                                        }
                                        
                                 
                                        var request = require('request');
                                 
                                        request(optionsDev,function (error, response, body){
                                 
                                            printLog("DeviceDetails: " + JSON.stringify(response));
                                 
                                            if(parseInt(body.error_code)==0) {
                                
                                                if(apilevel<3) {
                                                    saveValue("rawJSON", body.object_result, "string");
                                                    
                                                    if(findCodeVal(body.object_result, "Power")=="1") {
                                                        if(product==AQUATEMP_POOLSANA) {
                                                            // Stromverbrauch T07 x T14 in Watt
                                                            saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T07")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                                            // Luftansaug-Temperatur T01
                                                            saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T01")), "number");
                                                            // Inlet-Temperatur T02
                                                            saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T02")), "number");
                                                            // outlet-Temperatur T03
                                                            saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T03")), "number");
                                                            // Coil-Temperatur T04
                                                            saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T04")), "number");
                                                            // Umgebungs-Temperatur T05
                                                            saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T05")), "number");
                                                        } else if (product==AQUATEMP_OTHER1) {
                                                            // Stromverbrauch T7 x T14 in Watt
                                                            saveValue("consumption", parseFloat(findCodeVal(body.object_result, "T7")) * parseFloat(findCodeVal(body.object_result, "T14")), "number");
                                                            // Luftansaug-Temperatur T1
                                                            saveValue("suctionTemp", parseFloat(findCodeVal(body.object_result, "T1")), "number");
                                                            // Inlet-Temperatur T2
                                                            saveValue("tempIn", parseFloat(findCodeVal(body.object_result, "T2")), "number");
                                                            // outlet-Temperatur T3
                                                            saveValue("tempOut", parseFloat(findCodeVal(body.object_result, "T3")), "number");
                                                            // Coil-Temperatur T4
                                                            saveValue("coilTemp", parseFloat(findCodeVal(body.object_result, "T4")), "number");
                                                            // Umgebungs-Temperatur T5
                                                            saveValue("ambient", parseFloat(findCodeVal(body.object_result, "T5")), "number");
                                                        }
                                                    
                                                        // Lüfter-Drehzahl T17
                                                        saveValue("rotor", parseInt(findCodeVal(body.object_result, "T17")), "number");
                                                      
                                                        
                                                    } else {
                                                        saveValue("consumption", 0, "number");
                                                        saveValue("rotor", 0, "number");
                                                    }
                                    
                                                    // Ziel-Temperatur Set_Temp
                                                    saveValue("tempSet", parseFloat(findCodeVal(body.object_result, "Set_Temp")), "number");
                                        
                                                    // Flüstermodus Manual-mute
                                                    if(findCodeVal(body.object_result, "Manual-mute")=="1") {
                                                        saveValue("silent", true, "boolean");
                                                    } else {
                                                        saveValue("silent", false, "boolean");
                                                    }
                                    
                                                    // Zustand Power
                                                    if(findCodeVal(body.object_result, "Power")=="1") {
                                                        saveValue("state", true, "boolean");
                                                        saveValue("mode", findCodeVal(body.object_result,"Mode"), "string");
                                                    } else {
                                                        saveValue("state", false, "boolean");
                                                        saveValue("mode", "-1", "string");
                                                    }
                                                    
                                                    saveValue("connection", true, "boolean");
                                
                                                    // Durchlauf ENDE
                                    
                                                    
                                                } else {
                                                    saveValue("rawJSON", body.objectResult, "string");
                                                    
                                                    if(findCodeVal(body.objectResult, "Power")=="1") {
                                                        if(product==AQUATEMP_POOLSANA) {
                                                            // Stromverbrauch T07 x T14 in Watt
                                                            saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T07")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
                                                            // Luftansaug-Temperatur T01
                                                            saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T01")), "number");
                                                            // Inlet-Temperatur T02
                                                            saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T02")), "number");
                                                            // outlet-Temperatur T03
                                                            saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T03")), "number");
                                                            // Coil-Temperatur T04
                                                            saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T04")), "number");
                                                            // Umgebungs-Temperatur T05
                                                            saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T05")), "number");
                                                        } else if (product==AQUATEMP_OTHER1) {
                                                            // Stromverbrauch T7 x T14 in Watt
                                                            saveValue("consumption", parseFloat(findCodeVal(body.objectResult, "T7")) * parseFloat(findCodeVal(body.objectResult, "T14")), "number");
                                                            // Luftansaug-Temperatur T1
                                                            saveValue("suctionTemp", parseFloat(findCodeVal(body.objectResult, "T1")), "number");
                                                            // Inlet-Temperatur T2
                                                            saveValue("tempIn", parseFloat(findCodeVal(body.objectResult, "T2")), "number");
                                                            // outlet-Temperatur T3
                                                            saveValue("tempOut", parseFloat(findCodeVal(body.objectResult, "T3")), "number");
                                                            // Coil-Temperatur T4
                                                            saveValue("coilTemp", parseFloat(findCodeVal(body.objectResult, "T4")), "number");
                                                            // Umgebungs-Temperatur T5
                                                            saveValue("ambient", parseFloat(findCodeVal(body.objectResult, "T5")), "number");
                                                        }
                                                    
                                                        // Lüfter-Drehzahl T17
                                                        saveValue("rotor", parseInt(findCodeVal(body.objectResult, "T17")), "number");
                                                      
                                                        
                                                    } else {
                                                        saveValue("consumption", 0, "number");
                                                        saveValue("rotor", 0, "number");
                                                    }
                                    
                                                    // Ziel-Temperatur Set_Temp
                                                    saveValue("tempSet", parseFloat(findCodeVal(body.objectResult, "Set_Temp")), "number");
                                        
                                                    // Flüstermodus Manual-mute
                                                    if(findCodeVal(body.objectResult, "Manual-mute")=="1") {
                                                        saveValue("silent", true, "boolean");
                                                    } else {
                                                        saveValue("silent", false, "boolean");
                                                    }
                                    
                                                    // Zustand Power
                                                    if(findCodeVal(body.objectResult, "Power")=="1") {
                                                        saveValue("state", true, "boolean");
                                                        saveValue("mode", findCodeVal(body.objectResult,"Mode"), "string");
                                                    } else {
                                                        saveValue("state", false, "boolean");
                                                        saveValue("mode", "-1", "string");
                                                    }
                                                    
                                                    saveValue("connection", true, "boolean");
                                
                                                    // Durchlauf ENDE
                                    
                                                    
                                                }
                                
                                                
                                            } else {
                                                // Login-Fehler
                                                //log("Fehler in updateDeviceDetails(): " + response.body, "error");
                                                token = "";
                                                device = "";
                                                saveValue("connection", false, "boolean");
                                            }
                                            
                                        });
                                    }
                                }
                                 
                                function updateDevicePower(devicecode, power) {
                                    var powerOpt;
                                    var powerMode = 2;
                                 
                                    if(power==-1) {
                                        // aus
                                        powerOpt = 0;
                                        powerMode = -1;
                                    } else if(power==0) {
                                        // an und kühlen
                                        powerOpt = 1;
                                        powerMode = 0;
                                    } else if(power==1) {
                                        // an und heizen
                                        powerOpt = 1;
                                        powerMode = 1;
                                    } else if(power==2) {
                                        // an und auto
                                        powerOpt = 1;
                                        powerMode = 2;
                                    } else {
                                        log("ungülter Zustand!");
                                        return;
                                    }
                                 
                                    if(token!="") {
                                        var optionsDev;
                                
                                        if(apilevel<3) {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/control.json',
                                                headers: { "x-token": token },
                                                json: {"param":[{ "device_code": devicecode, "protocol_code": "Power","value": powerOpt }]},
                                                method: 'POST',
                                                rejectUnauthorized: false
                                            };
                                        } else {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/control',
                                                headers: { "x-token": token },
                                                json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Power","value": powerOpt }]},
                                                method: 'POST',
                                                rejectUnauthorized: false
                                            };
                                
                                        }
                                        
                                 
                                        var request = require('request');
                                 
                                        request(optionsDev,function (error, response, body){
                                            //log(devicecode);
                                            //log(JSON.stringify(response));
                                            //log(JSON.stringify(body.object_result));
                                 
                                            if(parseInt(body.error_code)==0) {
                                                saveValue("mode", power, "string");
                                                if(power>=0) updateDeviceMode(device, power);
                                                
                                            } else {
                                                log("Zustandsänderung fehlgeschlagen!", "error");
                                            }
                                            
                                        });
                                    }
                                }
                                 
                                function updateDeviceMode(devicecode, mode) {
                                    
                                 
                                    if(token!="") {
                                        var optionsDev;
                                
                                        if(apilevel<3) {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/control.json',
                                                headers: { "x-token": token },
                                                json: {"param":[{ "device_code": devicecode, "protocol_code": "mode","value": mode }]},
                                                method: 'POST',
                                                rejectUnauthorized: false
                                                //headers: {"content-type": "application/json"},
                                                //charset: 'utf8',
                                                //json: true
                                                
                                            };
                                        } else {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/control',
                                                headers: { "x-token": token },
                                                json: {"param":[{ "deviceCode": devicecode, "protocolCode": "mode","value": mode }]},
                                                method: 'POST',
                                                rejectUnauthorized: false
                                                //headers: {"content-type": "application/json"},
                                                //charset: 'utf8',
                                                //json: true
                                                
                                            };
                                        }
                                        
                                 
                                        var request = require('request');
                                 
                                        request(optionsDev,function (error, response, body){
                                            //log(devicecode);
                                            //log(JSON.stringify(response));
                                            //log(JSON.stringify(body.object_result));
                                 
                                            if(parseInt(body.error_code)==0) {
                                                saveValue("mode", mode, "string");
                                                
                                                
                                            } else {
                                                log("Zustandsänderung fehlgeschlagen!", "error");
                                                token = "";
                                                device = "";
                                                saveValue("connection", false, "boolean");
                                            }
                                            
                                        });
                                    }
                                }
                                 
                                function updateDeviceSilent(devicecode, silent) {
                                    
                                    var silentMode;
                                 
                                    if(silent) {
                                        silentMode = "1";
                                    } else {
                                        silentMode = "0";
                                    }
                                 
                                    if(token!="") {
                                
                                        var optionsDev;
                                
                                        if(apilevel<3) {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/control.json',
                                                headers: { "x-token": token },
                                                json: {"param":[{ "device_code": devicecode, "protocol_code": "Manual-mute","value": silentMode }]},
                                                method: 'POST',
                                                rejectUnauthorized: false
                                                //headers: {"content-type": "application/json"},
                                                //charset: 'utf8',
                                                //json: true
                                                
                                            };
                                        } else {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/control',
                                                headers: { "x-token": token },
                                                json: {"param":[{ "deviceCode": devicecode, "protocolCode": "Manual-mute","value": silentMode }]},
                                                method: 'POST',
                                                rejectUnauthorized: false
                                                //headers: {"content-type": "application/json"},
                                                //charset: 'utf8',
                                                //json: true
                                                
                                            };
                                        }
                                        
                                 
                                        var request = require('request');
                                 
                                        request(optionsDev,function (error, response, body){
                                            //log(devicecode);
                                            //log(JSON.stringify(response));
                                            //log(JSON.stringify(body.object_result));
                                 
                                            if(parseInt(body.error_code)==0) {
                                                saveValue("silent", silent, "boolean");
                                                
                                                
                                            } else {
                                                log("Zustandsänderung fehlgeschlagen!", "error");
                                                token = "";
                                                device = "";
                                                saveValue("connection", false, "boolean");
                                            }
                                            
                                        });
                                    }
                                }
                                 
                                function updateDeviceSetTemp(devicecode, temperature) {
                                 
                                    var sTemperature = temperature.toString().replace(",", ".");
                                    var sMode = getState(dpRoot + ".mode").val;
                                    if(sMode=="-1") {
                                        //log("Gerät einschalten um Temperatur zu ändern!", 'warn');
                                        return;
                                    } else if(sMode=="0") {
                                        sMode = "R01"; // Kühlen
                                    } else if(sMode=="1") {
                                        sMode = "R02"; // Heizen
                                    } else if(sMode=="2") {
                                        sMode = "R03"; // Auto
                                    }
                                 
                                    
                                 
                                 
                                    if(token!="") {
                                        var optionsDev;
                                
                                        if(apilevel<3) {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/control.json',
                                                headers: { "x-token": token },
                                                json: {"param":[{ "device_code": devicecode, "protocol_code": "R01","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R02","value": sTemperature },{ "device_code": devicecode, "protocol_code": "R03","value": sTemperature },{ "device_code": devicecode, "protocol_code": "Set_Temp","value": sTemperature }]},
                                                method: 'POST',
                                                rejectUnauthorized: false
                                                //headers: {"content-type": "application/json"},
                                                //charset: 'utf8',
                                                //json: true
                                                
                                            };
                                        } else {
                                            optionsDev = {
                                                url: cloudURL + '/app/device/control',
                                                headers: { "x-token": token },
                                                json: {"param":[{ "deviceCode": devicecode, "protocolCode": "R01","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R02","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "R03","value": sTemperature },{ "deviceCode": devicecode, "protocolCode": "Set_Temp","value": sTemperature }]},
                                                method: 'POST',
                                                rejectUnauthorized: false
                                                //headers: {"content-type": "application/json"},
                                                //charset: 'utf8',
                                                //json: true
                                                
                                            };
                                
                                        }
                                        
                                 
                                        var request = require('request');
                                 
                                        request(optionsDev,function (error, response, body){
                                            //log(devicecode);
                                            //log(JSON.stringify(response));
                                            //log(JSON.stringify(body.object_result));
                                 
                                            if(parseInt(body.error_code)==0) {
                                                saveValue("tempSet", temperature, "number");
                                                
                                                
                                            } else {
                                                log("Zustandsänderung fehlgeschlagen!", "error");
                                                token = "";
                                                device = "";
                                                saveValue("connection", false, "boolean");
                                                //log(JSON.stringify(response));
                                            }
                                            
                                        });
                                    }
                                }
                                
                                function printLog(sMsg, minLevel = 1) {
                                    if(debugLevel>=minLevel) {
                                        log(sMsg);
                                    }
                                }
                                 
                                // Beginn des Skripts
                                
                                setupEndpoints();
                                createobjects(); // DPs anlegen
                                 
                                updateToken(); // Zugriffstoken erfragen und aktuelle Werte lesen
                                 
                                schedule('*/' + interval + ' * * * * *', function () {
                                    // regelmäßig Token und Zustand abfragen
                                    updateToken();
                                 
                                    // gewünschte Änderungen ausführen
                                    if(!getState(dpRoot + ".mode").ack) {
                                        updateDevicePower(device, getState(dpRoot + ".mode").val);
                                    }
                                    if(!getState(dpRoot + ".silent").ack) {
                                        updateDevicePower(device, getState(dpRoot + ".silent").val);
                                    }
                                });
                                 
                                tokenRefreshTimer = setInterval(function () {
                                    // Token verfällt nach 60min
                                    token = "";
                                    //log("Token nach Intervall verworfen.")
                                    updateToken();
                                }, 3600000);
                                 
                                on({id: dpRoot + ".mode", change: "ne", ack: false}, function (obj) {
                                    updateToken();
                                    updateDevicePower(device, getState(dpRoot + ".mode").val);
                                });
                                 
                                on({id: dpRoot + ".silent", change: "ne", ack: false}, function (obj) {
                                    updateToken();
                                    updateDeviceSilent(device, getState(dpRoot + ".silent").val);
                                });
                                 
                                on({id: dpRoot + ".tempSet", change: "ne", ack: false}, function (obj) {
                                    updateToken();
                                    updateDeviceSetTemp(device, getState(dpRoot + ".tempSet").val);
                                });
                                
                                
                                R Offline
                                R Offline
                                radi71
                                schrieb am zuletzt editiert von
                                #161

                                @oxident Bei mir funktioniert es jetzt super, hab die WP Variante 3

                                Noch einen kleinen Tip am Rande: wenn ihr parallel die Aqua Temp App benutzen wollt, legt euch einen 2. User an und dann könnt ihr die Anlage sharen. So fliegt ihr nicht alle 30 Sekunden raus :-)

                                Vielen Dank @oxident

                                O 1 Antwort Letzte Antwort
                                1
                                • R radi71

                                  @oxident Bei mir funktioniert es jetzt super, hab die WP Variante 3

                                  Noch einen kleinen Tip am Rande: wenn ihr parallel die Aqua Temp App benutzen wollt, legt euch einen 2. User an und dann könnt ihr die Anlage sharen. So fliegt ihr nicht alle 30 Sekunden raus :-)

                                  Vielen Dank @oxident

                                  O Offline
                                  O Offline
                                  oxident
                                  schrieb am zuletzt editiert von oxident
                                  #162

                                  @radi71 Puhh, wenigstens schon ein kleiner Erfolg. Danke für die Rückmeldung und den Tipp mit dem Zweitaccount!

                                  @PietNB Blöde Frage: War die Heizung während dem Testlauf eingeschaltet?

                                  P 1 Antwort Letzte Antwort
                                  0
                                  • O oxident

                                    @radi71 Puhh, wenigstens schon ein kleiner Erfolg. Danke für die Rückmeldung und den Tipp mit dem Zweitaccount!

                                    @PietNB Blöde Frage: War die Heizung während dem Testlauf eingeschaltet?

                                    P Offline
                                    P Offline
                                    PietNB
                                    schrieb am zuletzt editiert von
                                    #163

                                    @oxident Die Heizung war "Off" aber unter Strom. Die Steuerung müsste doch trotzdem funktionieren? Wenn die Pumpe wieder angeht schaltet die WP doch auch wieder automatisch an?

                                    P 1 Antwort Letzte Antwort
                                    0
                                    • P PietNB

                                      @oxident Die Heizung war "Off" aber unter Strom. Die Steuerung müsste doch trotzdem funktionieren? Wenn die Pumpe wieder angeht schaltet die WP doch auch wieder automatisch an?

                                      P Offline
                                      P Offline
                                      PietNB
                                      schrieb am zuletzt editiert von
                                      #164

                                      @pietnb Hier nochmal der Log bei laufender WP

                                      avascript.0
                                      2023-07-07 06:25:30.652	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.651	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.mode - 1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.651	info	script.js.Poolheizung: Wert gefunden: 1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.651	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.651	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.650	info	script.js.Poolheizung: Suche Wert Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.650	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.state - true
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.650	info	script.js.Poolheizung: Wert gefunden: 1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.649	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.649	info	script.js.Poolheizung: Suche Wert Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.649	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.silent - false
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.649	info	script.js.Poolheizung: Wert gefunden: 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.648	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.648	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.648	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.647	info	script.js.Poolheizung: Suche Wert Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.647	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempSet - 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.647	info	script.js.Poolheizung: Wert gefunden: 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.647	info	script.js.Poolheizung: Set_Temp
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.646	info	script.js.Poolheizung: H03
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.646	info	script.js.Poolheizung: 2077
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.646	info	script.js.Poolheizung: 2076
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.646	info	script.js.Poolheizung: 2075
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.645	info	script.js.Poolheizung: 2074
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.645	info	script.js.Poolheizung: T5
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.645	info	script.js.Poolheizung: T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.644	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.644	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.644	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.644	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.643	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.643	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.643	info	script.js.Poolheizung: Suche Wert Set_Temp
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.642	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rotor - 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.642	info	script.js.Poolheizung: Wert gefunden: 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.642	info	script.js.Poolheizung: T17
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.641	info	script.js.Poolheizung: T14
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.641	info	script.js.Poolheizung: T7
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.641	info	script.js.Poolheizung: H02
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.641	info	script.js.Poolheizung: F17
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.640	info	script.js.Poolheizung: 1159
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.640	info	script.js.Poolheizung: 1158
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.640	info	script.js.Poolheizung: T03
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.640	info	script.js.Poolheizung: R03
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.639	info	script.js.Poolheizung: R02
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.639	info	script.js.Poolheizung: R01
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.639	info	script.js.Poolheizung: R11
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.639	info	script.js.Poolheizung: R10
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.638	info	script.js.Poolheizung: R09
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.638	info	script.js.Poolheizung: R08
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.638	info	script.js.Poolheizung: Set_Temp
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.638	info	script.js.Poolheizung: H03
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.637	info	script.js.Poolheizung: 2077
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.637	info	script.js.Poolheizung: 2076
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.637	info	script.js.Poolheizung: 2075
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.636	info	script.js.Poolheizung: 2074
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.636	info	script.js.Poolheizung: T5
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.636	info	script.js.Poolheizung: T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.633	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.633	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.632	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.632	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.632	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.632	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.631	info	script.js.Poolheizung: Suche Wert T17
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.631	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.ambient - 11.5
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.631	info	script.js.Poolheizung: Wert gefunden: 11.5
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.630	info	script.js.Poolheizung: T5
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.630	info	script.js.Poolheizung: T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.630	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.630	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.629	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.629	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.629	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.629	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.628	info	script.js.Poolheizung: Suche Wert T5
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.628	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.coilTemp - 6
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.628	info	script.js.Poolheizung: Wert gefunden: 6.0
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.627	info	script.js.Poolheizung: T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.627	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.627	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.627	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.626	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.626	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.626	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.626	info	script.js.Poolheizung: Suche Wert T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.625	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempOut - 16
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.625	info	script.js.Poolheizung: Wert gefunden: 16.0
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.625	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.624	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.624	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.624	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.624	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.623	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.623	info	script.js.Poolheizung: Suche Wert T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.623	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempIn - 16
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.622	info	script.js.Poolheizung: Wert gefunden: 16.0
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.622	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.622	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.622	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.621	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.621	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.621	info	script.js.Poolheizung: Suche Wert T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.621	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.suctionTemp - 17
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.620	info	script.js.Poolheizung: Wert gefunden: 17.0
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.620	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.620	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.619	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.619	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.619	info	script.js.Poolheizung: Suche Wert T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.619	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.consumption - 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.618	info	script.js.Poolheizung: Wert gefunden: 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.618	info	script.js.Poolheizung: T14
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.618	info	script.js.Poolheizung: T7
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.617	info	script.js.Poolheizung: H02
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.617	info	script.js.Poolheizung: F17
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.617	info	script.js.Poolheizung: 1159
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.617	info	script.js.Poolheizung: 1158
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.616	info	script.js.Poolheizung: T03
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.616	info	script.js.Poolheizung: R03
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.616	info	script.js.Poolheizung: R02
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.616	info	script.js.Poolheizung: R01
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.615	info	script.js.Poolheizung: R11
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.615	info	script.js.Poolheizung: R10
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.615	info	script.js.Poolheizung: R09
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.615	info	script.js.Poolheizung: R08
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.614	info	script.js.Poolheizung: Set_Temp
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.614	info	script.js.Poolheizung: H03
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.614	info	script.js.Poolheizung: 2077
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.613	info	script.js.Poolheizung: 2076
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.613	info	script.js.Poolheizung: 2075
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.613	info	script.js.Poolheizung: 2074
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.613	info	script.js.Poolheizung: T5
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.612	info	script.js.Poolheizung: T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.612	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.612	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.612	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.611	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.611	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.611	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.611	info	script.js.Poolheizung: Suche Wert T14
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.610	info	script.js.Poolheizung: Wert gefunden: 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.610	info	script.js.Poolheizung: T7
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.610	info	script.js.Poolheizung: H02
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.610	info	script.js.Poolheizung: F17
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.609	info	script.js.Poolheizung: 1159
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.609	info	script.js.Poolheizung: 1158
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.609	info	script.js.Poolheizung: T03
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.609	info	script.js.Poolheizung: R03
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.608	info	script.js.Poolheizung: R02
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.608	info	script.js.Poolheizung: R01
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.608	info	script.js.Poolheizung: R11
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.607	info	script.js.Poolheizung: R10
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.607	info	script.js.Poolheizung: R09
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.607	info	script.js.Poolheizung: R08
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.607	info	script.js.Poolheizung: Set_Temp
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.604	info	script.js.Poolheizung: H03
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.604	info	script.js.Poolheizung: 2077
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.604	info	script.js.Poolheizung: 2076
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.603	info	script.js.Poolheizung: 2075
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.603	info	script.js.Poolheizung: 2074
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.603	info	script.js.Poolheizung: T5
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.603	info	script.js.Poolheizung: T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.602	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.602	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.602	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.602	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.601	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.601	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.601	info	script.js.Poolheizung: Suche Wert T7
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.600	info	script.js.Poolheizung: Wert gefunden: 1
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.600	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.600	info	script.js.Poolheizung: Suche Wert Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.599	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rawJSON - [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.598	info	script.js.Poolheizung: DeviceDetails: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"value":"1","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"16.0","code":"T2"},{"value":"16.0","code":"T3"},{"value":"6.0","code":"T4"},{"value":"11.5","code":"T5"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"0","code":"T03"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}],"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:41 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDataByCode","path":"/crmservice/api/app/device/getDataByCode","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDataByCode"},"method":"POST","headers":{"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":237}}}
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.251	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorLevel - 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.251	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorCode -
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.250	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorMessage -
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.250	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.error - false
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.250	info	script.js.Poolheizung: DeviceStatus: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"is_fault":false,"isFault":false,"status":"ONLINE"},"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:41 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDeviceStatus","path":"/crmservice/api/app/device/getDeviceStatus","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDeviceStatus"},"method":"POST","headers":{"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":29}}}
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.128	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.128	info	script.js.Poolheizung: DeviceCode: 0C7FEDC2A9F5, ProductID: 1442284873216843776, DeviceStatus: true
                                      
                                      javascript.0
                                      2023-07-07 06:25:30.127	info	script.js.Poolheizung: DeviceList: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"deviceType":"","device_status":"ONLINE","is_fault":false,"device_id":"1640588423515365376","productId":"1442284873216843776","deviceNickName":"Poolheizung","device_type":"","deviceCode":"0C7FEDC2A9F5","isFault":false,"deviceName":"0C7FEDC2A9F5","deviceId":"1640588423515365376","deviceStatus":"ONLINE","device_name":"0C7FEDC2A9F5","device_code":"0C7FEDC2A9F5","product_id":"1442284873216843776","model":null,"sn":null,"device_nick_name":"Poolheizung","projectId":null}],"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:41 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/deviceList","path":"/crmservice/api/app/device/deviceList","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/deviceList"},"method":"POST","headers":{"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":148}}}
                                      
                                      admin.0
                                      2023-07-07 06:25:26.347	info	<== Disconnect system.user.admin from ::ffff:192.168.178.69 javascript
                                      
                                      admin.0
                                      2023-07-07 06:25:26.347	info	<== Disconnect system.user.admin from ::ffff:192.168.178.69 javascript
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.451	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.449	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.mode - 1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.449	info	script.js.Poolheizung: Wert gefunden: 1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.449	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.448	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.448	info	script.js.Poolheizung: Suche Wert Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.448	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.state - true
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.448	info	script.js.Poolheizung: Wert gefunden: 1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.448	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.447	info	script.js.Poolheizung: Suche Wert Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.447	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.silent - false
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.447	info	script.js.Poolheizung: Wert gefunden: 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.447	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.447	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.447	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.446	info	script.js.Poolheizung: Suche Wert Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.446	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempSet - 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.446	info	script.js.Poolheizung: Wert gefunden: 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.446	info	script.js.Poolheizung: Set_Temp
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.446	info	script.js.Poolheizung: H03
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.446	info	script.js.Poolheizung: 2077
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.445	info	script.js.Poolheizung: 2076
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.445	info	script.js.Poolheizung: 2075
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.445	info	script.js.Poolheizung: 2074
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.445	info	script.js.Poolheizung: T5
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.445	info	script.js.Poolheizung: T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.445	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.444	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.444	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.444	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.444	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.444	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.444	info	script.js.Poolheizung: Suche Wert Set_Temp
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.443	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rotor - 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.443	info	script.js.Poolheizung: Wert gefunden: 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.443	info	script.js.Poolheizung: T17
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.443	info	script.js.Poolheizung: T14
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.443	info	script.js.Poolheizung: T7
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.443	info	script.js.Poolheizung: H02
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.442	info	script.js.Poolheizung: F17
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.442	info	script.js.Poolheizung: 1159
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.442	info	script.js.Poolheizung: 1158
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.442	info	script.js.Poolheizung: T03
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.442	info	script.js.Poolheizung: R03
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.442	info	script.js.Poolheizung: R02
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.441	info	script.js.Poolheizung: R01
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.441	info	script.js.Poolheizung: R11
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.441	info	script.js.Poolheizung: R10
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.441	info	script.js.Poolheizung: R09
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.441	info	script.js.Poolheizung: R08
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.441	info	script.js.Poolheizung: Set_Temp
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.441	info	script.js.Poolheizung: H03
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.440	info	script.js.Poolheizung: 2077
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.440	info	script.js.Poolheizung: 2076
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.440	info	script.js.Poolheizung: 2075
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.440	info	script.js.Poolheizung: 2074
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.440	info	script.js.Poolheizung: T5
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.439	info	script.js.Poolheizung: T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.439	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.438	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.438	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.438	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.437	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.437	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.436	info	script.js.Poolheizung: Suche Wert T17
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.435	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.ambient - 12
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.435	info	script.js.Poolheizung: Wert gefunden: 12.0
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.434	info	script.js.Poolheizung: T5
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.434	info	script.js.Poolheizung: T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.433	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.433	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.432	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.432	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.431	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.431	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.431	info	script.js.Poolheizung: Suche Wert T5
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.430	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.coilTemp - 12
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.429	info	script.js.Poolheizung: Wert gefunden: 12.0
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.429	info	script.js.Poolheizung: T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.429	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.428	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.428	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.427	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.427	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.426	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.426	info	script.js.Poolheizung: Suche Wert T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.425	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempOut - 12.5
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.424	info	script.js.Poolheizung: Wert gefunden: 12.5
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.424	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.423	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.423	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.423	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.422	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.422	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.421	info	script.js.Poolheizung: Suche Wert T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.420	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempIn - 12
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.419	info	script.js.Poolheizung: Wert gefunden: 12.0
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.419	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.418	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.417	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.413	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.412	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.411	info	script.js.Poolheizung: Suche Wert T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.409	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.suctionTemp - 17
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.408	info	script.js.Poolheizung: Wert gefunden: 17.0
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.407	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.407	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.406	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.406	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.406	info	script.js.Poolheizung: Suche Wert T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.405	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.consumption - 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.404	info	script.js.Poolheizung: Wert gefunden: 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.404	info	script.js.Poolheizung: T14
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.403	info	script.js.Poolheizung: T7
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.403	info	script.js.Poolheizung: H02
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.402	info	script.js.Poolheizung: F17
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.402	info	script.js.Poolheizung: 1159
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.401	info	script.js.Poolheizung: 1158
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.401	info	script.js.Poolheizung: T03
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.400	info	script.js.Poolheizung: R03
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.400	info	script.js.Poolheizung: R02
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.400	info	script.js.Poolheizung: R01
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.399	info	script.js.Poolheizung: R11
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.399	info	script.js.Poolheizung: R10
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.398	info	script.js.Poolheizung: R09
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.398	info	script.js.Poolheizung: R08
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.397	info	script.js.Poolheizung: Set_Temp
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.397	info	script.js.Poolheizung: H03
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.396	info	script.js.Poolheizung: 2077
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.396	info	script.js.Poolheizung: 2076
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.395	info	script.js.Poolheizung: 2075
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.395	info	script.js.Poolheizung: 2074
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.395	info	script.js.Poolheizung: T5
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.394	info	script.js.Poolheizung: T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.394	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.393	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.393	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.392	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.392	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.391	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.391	info	script.js.Poolheizung: Suche Wert T14
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.390	info	script.js.Poolheizung: Wert gefunden: 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.390	info	script.js.Poolheizung: T7
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.389	info	script.js.Poolheizung: H02
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.389	info	script.js.Poolheizung: F17
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.388	info	script.js.Poolheizung: 1159
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.388	info	script.js.Poolheizung: 1158
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.388	info	script.js.Poolheizung: T03
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.387	info	script.js.Poolheizung: R03
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.387	info	script.js.Poolheizung: R02
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.386	info	script.js.Poolheizung: R01
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.386	info	script.js.Poolheizung: R11
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.385	info	script.js.Poolheizung: R10
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.385	info	script.js.Poolheizung: R09
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.384	info	script.js.Poolheizung: R08
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.384	info	script.js.Poolheizung: Set_Temp
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.383	info	script.js.Poolheizung: H03
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.383	info	script.js.Poolheizung: 2077
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.382	info	script.js.Poolheizung: 2076
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.382	info	script.js.Poolheizung: 2075
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.381	info	script.js.Poolheizung: 2074
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.381	info	script.js.Poolheizung: T5
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.380	info	script.js.Poolheizung: T4
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.380	info	script.js.Poolheizung: T3
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.379	info	script.js.Poolheizung: T2
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.379	info	script.js.Poolheizung: T1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.378	info	script.js.Poolheizung: Manual-mute
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.378	info	script.js.Poolheizung: Mode
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.377	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.377	info	script.js.Poolheizung: Suche Wert T7
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.376	info	script.js.Poolheizung: Wert gefunden: 1
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.376	info	script.js.Poolheizung: Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.375	info	script.js.Poolheizung: Suche Wert Power
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.374	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rawJSON - [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.372	info	script.js.Poolheizung: DeviceDetails: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"value":"1","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"12.0","code":"T2"},{"value":"12.5","code":"T3"},{"value":"12.0","code":"T4"},{"value":"12.0","code":"T5"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"0","code":"T03"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}],"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:30 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDataByCode","path":"/crmservice/api/app/device/getDataByCode","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDataByCode"},"method":"POST","headers":{"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":237}}}
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.023	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorLevel - 0
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.022	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorCode -
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.022	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorMessage -
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.021	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.error - false
                                      
                                      javascript.0
                                      2023-07-07 06:25:19.020	info	script.js.Poolheizung: DeviceStatus: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"is_fault":false,"isFault":false,"status":"ONLINE"},"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:30 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDeviceStatus","path":"/crmservice/api/app/device/getDeviceStatus","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDeviceStatus"},"method":"POST","headers":{"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":29}}}
                                      
                                      javascript.0
                                      2023-07-07 06:25:18.880	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                                      
                                      javascript.0
                                      2023-07-07 06:25:18.879	info	script.js.Poolheizung: DeviceCode: 0C7FEDC2A9F5, ProductID: 1442284873216843776, DeviceStatus: true
                                      
                                      javascript.0
                                      2023-07-07 06:25:18.878	info	script.js.Poolheizung: DeviceList: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"deviceType":"","device_status":"ONLINE","is_fault":false,"device_id":"1640588423515365376","productId":"1442284873216843776","deviceNickName":"Poolheizung","device_type":"","deviceCode":"0C7FEDC2A9F5","isFault":false,"deviceName":"0C7FEDC2A9F5","deviceId":"1640588423515365376","deviceStatus":"ONLINE","device_name":"0C7FEDC2A9F5","device_code":"0C7FEDC2A9F5","product_id":"1442284873216843776","model":null,"sn":null,"device_nick_name":"Poolheizung","projectId":null}],"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:30 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/deviceList","path":"/crmservice/api/app/device/deviceList","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/deviceList"},"method":"POST","headers":{"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":148}}}
                                      
                                      javascript.0
                                      2023-07-07 06:25:18.761	info	script.js.Poolheizung: Login ok! Token RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==
                                      
                                      javascript.0
                                      2023-07-07 06:25:18.759	info	script.js.Poolheizung: Login-Antwort: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"userId":"1673351056027705344","userName":"p.s****8@arcor.de","nickName":"PietNB","realName":null,"userPassword":null,"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","user_id":"1673351056027705344","user_name":"p.s****8@arcor.de","nick_name":"PietNB","real_name":null,"user_type":"Customer","accessKey":"1faf7677723f4d47b714818593127c8d"},"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:30 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/user/login","path":"/crmservice/api/app/user/login","href":"https://cloud.linked-go.com:449/crmservice/api/app/user/login"},"method":"POST","headers":{"accept":"application/json","content-type":"application/json","content-length":91}}}
                                      
                                      javascript.0
                                      2023-07-07 06:25:18.547	info	script.js.Poolheizung: registered 3 subscriptions, 1 schedule, 0 messages, 0 logs and 0 file subscriptions
                                      
                                      javascript.0
                                      2023-07-07 06:25:18.538	info	script.js.Poolheizung: Token Neuanforderung
                                      
                                      javascript.0
                                      2023-07-07 06:25:18.536	info	script.js.Poolheizung: erstelle Objekte
                                      
                                      javascript.0
                                      2023-07-07 06:25:18.535	info	script.js.Poolheizung: API-Level 3
                                      
                                      javascript.0
                                      2023-07-07 06:25:18.510	info	Start javascript script.js.Poolheizung
                                      

                                      Es kommen jetzt auch Werte. Prima. Nur die Zieltemeratur fehlt noch?

                                      Bildschirm­foto 2023-07-07 um 06.28.07.png

                                      O 1 Antwort Letzte Antwort
                                      0
                                      • P PietNB

                                        @pietnb Hier nochmal der Log bei laufender WP

                                        avascript.0
                                        2023-07-07 06:25:30.652	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.651	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.mode - 1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.651	info	script.js.Poolheizung: Wert gefunden: 1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.651	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.651	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.650	info	script.js.Poolheizung: Suche Wert Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.650	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.state - true
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.650	info	script.js.Poolheizung: Wert gefunden: 1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.649	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.649	info	script.js.Poolheizung: Suche Wert Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.649	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.silent - false
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.649	info	script.js.Poolheizung: Wert gefunden: 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.648	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.648	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.648	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.647	info	script.js.Poolheizung: Suche Wert Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.647	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempSet - 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.647	info	script.js.Poolheizung: Wert gefunden: 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.647	info	script.js.Poolheizung: Set_Temp
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.646	info	script.js.Poolheizung: H03
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.646	info	script.js.Poolheizung: 2077
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.646	info	script.js.Poolheizung: 2076
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.646	info	script.js.Poolheizung: 2075
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.645	info	script.js.Poolheizung: 2074
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.645	info	script.js.Poolheizung: T5
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.645	info	script.js.Poolheizung: T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.644	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.644	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.644	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.644	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.643	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.643	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.643	info	script.js.Poolheizung: Suche Wert Set_Temp
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.642	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rotor - 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.642	info	script.js.Poolheizung: Wert gefunden: 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.642	info	script.js.Poolheizung: T17
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.641	info	script.js.Poolheizung: T14
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.641	info	script.js.Poolheizung: T7
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.641	info	script.js.Poolheizung: H02
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.641	info	script.js.Poolheizung: F17
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.640	info	script.js.Poolheizung: 1159
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.640	info	script.js.Poolheizung: 1158
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.640	info	script.js.Poolheizung: T03
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.640	info	script.js.Poolheizung: R03
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.639	info	script.js.Poolheizung: R02
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.639	info	script.js.Poolheizung: R01
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.639	info	script.js.Poolheizung: R11
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.639	info	script.js.Poolheizung: R10
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.638	info	script.js.Poolheizung: R09
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.638	info	script.js.Poolheizung: R08
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.638	info	script.js.Poolheizung: Set_Temp
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.638	info	script.js.Poolheizung: H03
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.637	info	script.js.Poolheizung: 2077
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.637	info	script.js.Poolheizung: 2076
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.637	info	script.js.Poolheizung: 2075
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.636	info	script.js.Poolheizung: 2074
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.636	info	script.js.Poolheizung: T5
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.636	info	script.js.Poolheizung: T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.633	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.633	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.632	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.632	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.632	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.632	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.631	info	script.js.Poolheizung: Suche Wert T17
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.631	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.ambient - 11.5
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.631	info	script.js.Poolheizung: Wert gefunden: 11.5
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.630	info	script.js.Poolheizung: T5
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.630	info	script.js.Poolheizung: T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.630	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.630	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.629	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.629	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.629	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.629	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.628	info	script.js.Poolheizung: Suche Wert T5
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.628	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.coilTemp - 6
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.628	info	script.js.Poolheizung: Wert gefunden: 6.0
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.627	info	script.js.Poolheizung: T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.627	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.627	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.627	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.626	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.626	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.626	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.626	info	script.js.Poolheizung: Suche Wert T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.625	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempOut - 16
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.625	info	script.js.Poolheizung: Wert gefunden: 16.0
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.625	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.624	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.624	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.624	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.624	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.623	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.623	info	script.js.Poolheizung: Suche Wert T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.623	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempIn - 16
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.622	info	script.js.Poolheizung: Wert gefunden: 16.0
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.622	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.622	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.622	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.621	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.621	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.621	info	script.js.Poolheizung: Suche Wert T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.621	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.suctionTemp - 17
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.620	info	script.js.Poolheizung: Wert gefunden: 17.0
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.620	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.620	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.619	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.619	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.619	info	script.js.Poolheizung: Suche Wert T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.619	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.consumption - 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.618	info	script.js.Poolheizung: Wert gefunden: 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.618	info	script.js.Poolheizung: T14
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.618	info	script.js.Poolheizung: T7
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.617	info	script.js.Poolheizung: H02
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.617	info	script.js.Poolheizung: F17
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.617	info	script.js.Poolheizung: 1159
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.617	info	script.js.Poolheizung: 1158
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.616	info	script.js.Poolheizung: T03
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.616	info	script.js.Poolheizung: R03
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.616	info	script.js.Poolheizung: R02
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.616	info	script.js.Poolheizung: R01
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.615	info	script.js.Poolheizung: R11
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.615	info	script.js.Poolheizung: R10
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.615	info	script.js.Poolheizung: R09
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.615	info	script.js.Poolheizung: R08
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.614	info	script.js.Poolheizung: Set_Temp
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.614	info	script.js.Poolheizung: H03
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.614	info	script.js.Poolheizung: 2077
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.613	info	script.js.Poolheizung: 2076
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.613	info	script.js.Poolheizung: 2075
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.613	info	script.js.Poolheizung: 2074
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.613	info	script.js.Poolheizung: T5
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.612	info	script.js.Poolheizung: T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.612	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.612	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.612	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.611	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.611	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.611	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.611	info	script.js.Poolheizung: Suche Wert T14
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.610	info	script.js.Poolheizung: Wert gefunden: 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.610	info	script.js.Poolheizung: T7
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.610	info	script.js.Poolheizung: H02
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.610	info	script.js.Poolheizung: F17
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.609	info	script.js.Poolheizung: 1159
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.609	info	script.js.Poolheizung: 1158
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.609	info	script.js.Poolheizung: T03
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.609	info	script.js.Poolheizung: R03
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.608	info	script.js.Poolheizung: R02
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.608	info	script.js.Poolheizung: R01
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.608	info	script.js.Poolheizung: R11
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.607	info	script.js.Poolheizung: R10
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.607	info	script.js.Poolheizung: R09
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.607	info	script.js.Poolheizung: R08
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.607	info	script.js.Poolheizung: Set_Temp
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.604	info	script.js.Poolheizung: H03
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.604	info	script.js.Poolheizung: 2077
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.604	info	script.js.Poolheizung: 2076
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.603	info	script.js.Poolheizung: 2075
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.603	info	script.js.Poolheizung: 2074
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.603	info	script.js.Poolheizung: T5
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.603	info	script.js.Poolheizung: T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.602	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.602	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.602	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.602	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.601	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.601	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.601	info	script.js.Poolheizung: Suche Wert T7
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.600	info	script.js.Poolheizung: Wert gefunden: 1
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.600	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.600	info	script.js.Poolheizung: Suche Wert Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.599	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rawJSON - [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.598	info	script.js.Poolheizung: DeviceDetails: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"value":"1","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"16.0","code":"T2"},{"value":"16.0","code":"T3"},{"value":"6.0","code":"T4"},{"value":"11.5","code":"T5"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"0","code":"T03"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}],"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:41 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDataByCode","path":"/crmservice/api/app/device/getDataByCode","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDataByCode"},"method":"POST","headers":{"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":237}}}
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.251	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorLevel - 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.251	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorCode -
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.250	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorMessage -
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.250	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.error - false
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.250	info	script.js.Poolheizung: DeviceStatus: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"is_fault":false,"isFault":false,"status":"ONLINE"},"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:41 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDeviceStatus","path":"/crmservice/api/app/device/getDeviceStatus","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDeviceStatus"},"method":"POST","headers":{"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":29}}}
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.128	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.128	info	script.js.Poolheizung: DeviceCode: 0C7FEDC2A9F5, ProductID: 1442284873216843776, DeviceStatus: true
                                        
                                        javascript.0
                                        2023-07-07 06:25:30.127	info	script.js.Poolheizung: DeviceList: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"deviceType":"","device_status":"ONLINE","is_fault":false,"device_id":"1640588423515365376","productId":"1442284873216843776","deviceNickName":"Poolheizung","device_type":"","deviceCode":"0C7FEDC2A9F5","isFault":false,"deviceName":"0C7FEDC2A9F5","deviceId":"1640588423515365376","deviceStatus":"ONLINE","device_name":"0C7FEDC2A9F5","device_code":"0C7FEDC2A9F5","product_id":"1442284873216843776","model":null,"sn":null,"device_nick_name":"Poolheizung","projectId":null}],"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:41 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/deviceList","path":"/crmservice/api/app/device/deviceList","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/deviceList"},"method":"POST","headers":{"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":148}}}
                                        
                                        admin.0
                                        2023-07-07 06:25:26.347	info	<== Disconnect system.user.admin from ::ffff:192.168.178.69 javascript
                                        
                                        admin.0
                                        2023-07-07 06:25:26.347	info	<== Disconnect system.user.admin from ::ffff:192.168.178.69 javascript
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.451	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.449	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.mode - 1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.449	info	script.js.Poolheizung: Wert gefunden: 1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.449	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.448	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.448	info	script.js.Poolheizung: Suche Wert Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.448	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.state - true
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.448	info	script.js.Poolheizung: Wert gefunden: 1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.448	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.447	info	script.js.Poolheizung: Suche Wert Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.447	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.silent - false
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.447	info	script.js.Poolheizung: Wert gefunden: 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.447	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.447	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.447	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.446	info	script.js.Poolheizung: Suche Wert Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.446	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempSet - 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.446	info	script.js.Poolheizung: Wert gefunden: 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.446	info	script.js.Poolheizung: Set_Temp
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.446	info	script.js.Poolheizung: H03
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.446	info	script.js.Poolheizung: 2077
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.445	info	script.js.Poolheizung: 2076
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.445	info	script.js.Poolheizung: 2075
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.445	info	script.js.Poolheizung: 2074
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.445	info	script.js.Poolheizung: T5
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.445	info	script.js.Poolheizung: T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.445	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.444	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.444	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.444	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.444	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.444	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.444	info	script.js.Poolheizung: Suche Wert Set_Temp
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.443	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rotor - 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.443	info	script.js.Poolheizung: Wert gefunden: 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.443	info	script.js.Poolheizung: T17
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.443	info	script.js.Poolheizung: T14
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.443	info	script.js.Poolheizung: T7
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.443	info	script.js.Poolheizung: H02
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.442	info	script.js.Poolheizung: F17
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.442	info	script.js.Poolheizung: 1159
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.442	info	script.js.Poolheizung: 1158
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.442	info	script.js.Poolheizung: T03
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.442	info	script.js.Poolheizung: R03
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.442	info	script.js.Poolheizung: R02
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.441	info	script.js.Poolheizung: R01
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.441	info	script.js.Poolheizung: R11
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.441	info	script.js.Poolheizung: R10
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.441	info	script.js.Poolheizung: R09
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.441	info	script.js.Poolheizung: R08
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.441	info	script.js.Poolheizung: Set_Temp
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.441	info	script.js.Poolheizung: H03
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.440	info	script.js.Poolheizung: 2077
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.440	info	script.js.Poolheizung: 2076
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.440	info	script.js.Poolheizung: 2075
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.440	info	script.js.Poolheizung: 2074
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.440	info	script.js.Poolheizung: T5
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.439	info	script.js.Poolheizung: T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.439	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.438	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.438	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.438	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.437	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.437	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.436	info	script.js.Poolheizung: Suche Wert T17
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.435	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.ambient - 12
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.435	info	script.js.Poolheizung: Wert gefunden: 12.0
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.434	info	script.js.Poolheizung: T5
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.434	info	script.js.Poolheizung: T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.433	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.433	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.432	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.432	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.431	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.431	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.431	info	script.js.Poolheizung: Suche Wert T5
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.430	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.coilTemp - 12
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.429	info	script.js.Poolheizung: Wert gefunden: 12.0
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.429	info	script.js.Poolheizung: T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.429	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.428	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.428	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.427	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.427	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.426	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.426	info	script.js.Poolheizung: Suche Wert T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.425	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempOut - 12.5
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.424	info	script.js.Poolheizung: Wert gefunden: 12.5
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.424	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.423	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.423	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.423	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.422	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.422	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.421	info	script.js.Poolheizung: Suche Wert T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.420	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.tempIn - 12
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.419	info	script.js.Poolheizung: Wert gefunden: 12.0
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.419	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.418	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.417	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.413	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.412	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.411	info	script.js.Poolheizung: Suche Wert T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.409	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.suctionTemp - 17
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.408	info	script.js.Poolheizung: Wert gefunden: 17.0
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.407	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.407	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.406	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.406	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.406	info	script.js.Poolheizung: Suche Wert T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.405	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.consumption - 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.404	info	script.js.Poolheizung: Wert gefunden: 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.404	info	script.js.Poolheizung: T14
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.403	info	script.js.Poolheizung: T7
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.403	info	script.js.Poolheizung: H02
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.402	info	script.js.Poolheizung: F17
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.402	info	script.js.Poolheizung: 1159
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.401	info	script.js.Poolheizung: 1158
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.401	info	script.js.Poolheizung: T03
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.400	info	script.js.Poolheizung: R03
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.400	info	script.js.Poolheizung: R02
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.400	info	script.js.Poolheizung: R01
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.399	info	script.js.Poolheizung: R11
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.399	info	script.js.Poolheizung: R10
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.398	info	script.js.Poolheizung: R09
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.398	info	script.js.Poolheizung: R08
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.397	info	script.js.Poolheizung: Set_Temp
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.397	info	script.js.Poolheizung: H03
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.396	info	script.js.Poolheizung: 2077
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.396	info	script.js.Poolheizung: 2076
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.395	info	script.js.Poolheizung: 2075
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.395	info	script.js.Poolheizung: 2074
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.395	info	script.js.Poolheizung: T5
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.394	info	script.js.Poolheizung: T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.394	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.393	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.393	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.392	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.392	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.391	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.391	info	script.js.Poolheizung: Suche Wert T14
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.390	info	script.js.Poolheizung: Wert gefunden: 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.390	info	script.js.Poolheizung: T7
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.389	info	script.js.Poolheizung: H02
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.389	info	script.js.Poolheizung: F17
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.388	info	script.js.Poolheizung: 1159
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.388	info	script.js.Poolheizung: 1158
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.388	info	script.js.Poolheizung: T03
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.387	info	script.js.Poolheizung: R03
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.387	info	script.js.Poolheizung: R02
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.386	info	script.js.Poolheizung: R01
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.386	info	script.js.Poolheizung: R11
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.385	info	script.js.Poolheizung: R10
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.385	info	script.js.Poolheizung: R09
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.384	info	script.js.Poolheizung: R08
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.384	info	script.js.Poolheizung: Set_Temp
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.383	info	script.js.Poolheizung: H03
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.383	info	script.js.Poolheizung: 2077
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.382	info	script.js.Poolheizung: 2076
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.382	info	script.js.Poolheizung: 2075
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.381	info	script.js.Poolheizung: 2074
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.381	info	script.js.Poolheizung: T5
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.380	info	script.js.Poolheizung: T4
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.380	info	script.js.Poolheizung: T3
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.379	info	script.js.Poolheizung: T2
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.379	info	script.js.Poolheizung: T1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.378	info	script.js.Poolheizung: Manual-mute
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.378	info	script.js.Poolheizung: Mode
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.377	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.377	info	script.js.Poolheizung: Suche Wert T7
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.376	info	script.js.Poolheizung: Wert gefunden: 1
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.376	info	script.js.Poolheizung: Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.375	info	script.js.Poolheizung: Suche Wert Power
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.374	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.rawJSON - [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.372	info	script.js.Poolheizung: DeviceDetails: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"value":"1","code":"Power"},{"value":"1","code":"Mode"},{"value":"0","code":"Manual-mute"},{"value":"17.0","code":"T1"},{"value":"12.0","code":"T2"},{"value":"12.5","code":"T3"},{"value":"12.0","code":"T4"},{"value":"12.0","code":"T5"},{"value":"0","code":"2074"},{"value":"0","code":"2075"},{"value":"0","code":"2076"},{"value":"0","code":"2077"},{"value":"0","code":"H03"},{"value":"0","code":"Set_Temp"},{"value":"8.0","code":"R08"},{"value":"35.0","code":"R09"},{"value":"15.0","code":"R10"},{"value":"40.0","code":"R11"},{"value":"27.0","code":"R01"},{"value":"27.0","code":"R02"},{"value":"27.0","code":"R03"},{"value":"0","code":"T03"},{"value":"0","code":"1158"},{"value":"0","code":"1159"},{"value":"114","code":"F17"},{"value":"1","code":"H02"},{"value":"0","code":"T7"},{"value":"0","code":"T14"},{"value":"0","code":"T17"}],"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:30 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDataByCode","path":"/crmservice/api/app/device/getDataByCode","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDataByCode"},"method":"POST","headers":{"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":237}}}
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.023	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorLevel - 0
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.022	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorCode -
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.022	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.errorMessage -
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.021	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.error - false
                                        
                                        javascript.0
                                        2023-07-07 06:25:19.020	info	script.js.Poolheizung: DeviceStatus: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"is_fault":false,"isFault":false,"status":"ONLINE"},"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:30 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/getDeviceStatus","path":"/crmservice/api/app/device/getDeviceStatus","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/getDeviceStatus"},"method":"POST","headers":{"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":29}}}
                                        
                                        javascript.0
                                        2023-07-07 06:25:18.880	info	script.js.Poolheizung: Schreibe in Datenpunkt: 0_userdata.0.Poolheizung.connection - true
                                        
                                        javascript.0
                                        2023-07-07 06:25:18.879	info	script.js.Poolheizung: DeviceCode: 0C7FEDC2A9F5, ProductID: 1442284873216843776, DeviceStatus: true
                                        
                                        javascript.0
                                        2023-07-07 06:25:18.878	info	script.js.Poolheizung: DeviceList: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":[{"deviceType":"","device_status":"ONLINE","is_fault":false,"device_id":"1640588423515365376","productId":"1442284873216843776","deviceNickName":"Poolheizung","device_type":"","deviceCode":"0C7FEDC2A9F5","isFault":false,"deviceName":"0C7FEDC2A9F5","deviceId":"1640588423515365376","deviceStatus":"ONLINE","device_name":"0C7FEDC2A9F5","device_code":"0C7FEDC2A9F5","product_id":"1442284873216843776","model":null,"sn":null,"device_nick_name":"Poolheizung","projectId":null}],"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:30 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/device/deviceList","path":"/crmservice/api/app/device/deviceList","href":"https://cloud.linked-go.com:449/crmservice/api/app/device/deviceList"},"method":"POST","headers":{"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","accept":"application/json","content-type":"application/json","content-length":148}}}
                                        
                                        javascript.0
                                        2023-07-07 06:25:18.761	info	script.js.Poolheizung: Login ok! Token RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==
                                        
                                        javascript.0
                                        2023-07-07 06:25:18.759	info	script.js.Poolheizung: Login-Antwort: {"statusCode":200,"body":{"sessionid":null,"error_code":"0","error_msg":"Success","error_msg_code":"","totalSize":null,"totalPage":null,"nextPage":null,"objectResult":{"userId":"1673351056027705344","userName":"p.s****8@arcor.de","nickName":"PietNB","realName":null,"userPassword":null,"x-token":"RxWSGqDDXnzfK7IyYHagL0fHcVXrKeOsJTFh4VyakTlmI+islBrrMiXXCk/CpsdWqOxLXNUeG8QdwxEcodA41Q==","user_id":"1673351056027705344","user_name":"p.s****8@arcor.de","nick_name":"PietNB","real_name":null,"user_type":"Customer","accessKey":"1faf7677723f4d47b714818593127c8d"},"isReusltSuc":true},"headers":{"date":"Fri, 07 Jul 2023 04:25:30 GMT","content-type":"application/json;charset=UTF-8","transfer-encoding":"chunked","connection":"close","vary":"Origin, Access-Control-Request-Method, Access-Control-Request-Headers","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","x-frame-options":"DENY"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"cloud.linked-go.com:449","port":"449","hostname":"cloud.linked-go.com","hash":null,"search":null,"query":null,"pathname":"/crmservice/api/app/user/login","path":"/crmservice/api/app/user/login","href":"https://cloud.linked-go.com:449/crmservice/api/app/user/login"},"method":"POST","headers":{"accept":"application/json","content-type":"application/json","content-length":91}}}
                                        
                                        javascript.0
                                        2023-07-07 06:25:18.547	info	script.js.Poolheizung: registered 3 subscriptions, 1 schedule, 0 messages, 0 logs and 0 file subscriptions
                                        
                                        javascript.0
                                        2023-07-07 06:25:18.538	info	script.js.Poolheizung: Token Neuanforderung
                                        
                                        javascript.0
                                        2023-07-07 06:25:18.536	info	script.js.Poolheizung: erstelle Objekte
                                        
                                        javascript.0
                                        2023-07-07 06:25:18.535	info	script.js.Poolheizung: API-Level 3
                                        
                                        javascript.0
                                        2023-07-07 06:25:18.510	info	Start javascript script.js.Poolheizung
                                        

                                        Es kommen jetzt auch Werte. Prima. Nur die Zieltemeratur fehlt noch?

                                        Bildschirm­foto 2023-07-07 um 06.28.07.png

                                        O Offline
                                        O Offline
                                        oxident
                                        schrieb am zuletzt editiert von
                                        #165

                                        @pietnb Klar, das Skript sollte immer funktionieren. Vielleicht sendet aber Deine Heizung keine oder 0-Werte, wenn sie aus ist.

                                        Das müssen wir mal beobachten.

                                        Die Set-Temp schau ich mir nochmal an!

                                        P 1 Antwort Letzte Antwort
                                        0
                                        • O oxident

                                          @pietnb Klar, das Skript sollte immer funktionieren. Vielleicht sendet aber Deine Heizung keine oder 0-Werte, wenn sie aus ist.

                                          Das müssen wir mal beobachten.

                                          Die Set-Temp schau ich mir nochmal an!

                                          P Offline
                                          P Offline
                                          PietNB
                                          schrieb am zuletzt editiert von
                                          #166

                                          @oxident Prima Danke:+1:

                                          1 Antwort Letzte Antwort
                                          0
                                          Antworten
                                          • In einem neuen Thema antworten
                                          Anmelden zum Antworten
                                          • Älteste zuerst
                                          • Neuste zuerst
                                          • Meiste Stimmen


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate

                                          872

                                          Online

                                          32.4k

                                          Benutzer

                                          81.5k

                                          Themen

                                          1.3m

                                          Beiträge
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                          ioBroker Community 2014-2025
                                          logo
                                          • Anmelden

                                          • Du hast noch kein Konto? Registrieren

                                          • Anmelden oder registrieren, um zu suchen
                                          • Erster Beitrag
                                            Letzter Beitrag
                                          0
                                          • Home
                                          • Aktuell
                                          • Tags
                                          • Ungelesen 0
                                          • Kategorien
                                          • Unreplied
                                          • Beliebt
                                          • GitHub
                                          • Docu
                                          • Hilfe