Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. seb2010

    NEWS

    • Neues Video "KI im Smart Home" - ioBroker plus n8n

    • Neues Video über Aliase, virtuelle Geräte und Kategorien

    • Wir empfehlen: Node.js 22.x

    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 22
    • Posts 77
    • Best 6
    • Groups 1

    seb2010

    @seb2010

    Starter

    5
    Reputation
    40
    Profile views
    77
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    seb2010 Follow
    Starter

    Best posts made by seb2010

    • RE: Tado und HAM Adapter

      @coffeelover gute Frage, werde ich probieren. Danke!
      Die Frage bzgl. des deinstallierens von Ham-Plugins bleibt dann aber noch offen. Jemand eine Ahnung wie ich die einzeln deinstallieren kann?

      posted in ioBroker Allgemein
      S
      seb2010
    • RE: Test Adapter VW Connect für VW, ID, Audi, Seat, Skoda

      @seb2010 AHA. Also du musst unter den Adaptern nach "Einfache RESTful API" Suchen und mit dem "+" eine eigene Instanz erzeugen. Das musste man vorher nicht. In der Instanzeinstellung von der RESTful API stellst du dann auf Web-Erweiterung von web.0 um und das getPlainValue geht dann wieder

      posted in Tester
      S
      seb2010
    • RE: Zeigt her eure Dashboards

      Hallo @En1ac,

      anbei mein Dashboard.

      • Links die Heizungssteuerung, Steuerung per Wischen
      • in der Mitte Rolladen mit Zwischenpositionen.
      • unten in der Mitte Kalender. Dahinter kann die Karte des Saugroboters aufpoppen, wenn dieser aktiv ist
      • Rechts oben Lichtsteuerung Wohnzimmer mit link zur Detailsteuerung (kleiner Pfeil nach unten)
      • Mitte rechts die Controls um Chromecast-Streams/Spotify auf den Boxen zu starten und zu steuern
      • unten rechts die Saugrobotersteuerung mit vordefinierten Zonen
        Untitled-1.jpg
      posted in Visualisierung
      S
      seb2010
    • RE: schedules löschen bei Script Neustart

      Hab ein Enhancement issue erzeugt. Kannst dich ja dran hängen:
      https://github.com/ioBroker/ioBroker.js-controller/issues/2957

      seb2010 created this issue in ioBroker/ioBroker.js-controller

      open [enhancement]: Be aware of running schedules and kill them properly on Script-restart #1756

      posted in JavaScript
      S
      seb2010
    • RE: [gelöst] Widget für RTSP Stream

      Hallo zusammen,

      ich habe in meinem Dashboard im Wohnzimmer bei der Aktion "klingeln" oder "Person erkannt" ein Vollbild-Popup, welches mir die Kamera im Eingang einzeigt. Der Quellstream der Kamera ist auch RTSP.
      Wie oft vorgeschlagen, habe ich bisher MotionEye eingesetzt, um den RTSP-Stream in einen MJPEG Stream umzuwandeln. Das funktioniert auch, hat allerdings ein paar Nachteile:

      • das Transcodieren kostet Rechenleistung, welche auf meinem Pi4 nicht unendlich sind
      • Das schnellzyklische Laden eines JPEGs in VIS erzeugt streifen im Bild
      • Das Verwenden des MotionEye-eigenen Frames für den Stream klappt besser, allerdings wird das Bild auch nie wirklich flüssig.

      Daher habe ich nach zwei Jahren jetzt nochmal gesucht und wollte mich nochmal den neuen Technologien wie WebRTC und HLS Streaming widmen. Bisherige Versuche scheiterten immer an der zu hohen Latenz, also einem Zeitversatz im Bild.
      Jetzt habe ich folgendes Projekt gefunden: https://github.com/vladmandic/stream-rtsp
      Vorteile:

      • es verpackt (encapsulates) den Stream nur neu und wandelt ihn nicht um
      • das mitgelieferte frame ist ready-to-go und kann direkt in ioBroker eingebunden werden
      • der Stream läuft flüssig, wie ein echter RTSP stream
      • die zu beobachtende Latenz ist bei mir kleiner als 0,5s
      • es ist ein kleines Projekt was recht einfach zu konfigurieren ist
      • es verbraucht ~2% CPU auf meinem Pi4
        Nachteil:
      • man muss es noch als service verpacken, damit es schön im Hintergrund laufen kann

      Ich finde die Lösung vom Ergebnis viel besser als die MotionEye Lösung. Wobei man dann natürlich den ganzen Recording schnick-Schnack nicht hat. Wer aber nur den Stream flüssig durchleiten will (und wie ich dabei ggf. trotzdem MotionEye für das Recording laufen lässt), der sollte sich das mal ansehen.

      Viele Grüße
      SEB

      posted in Visualisierung
      S
      seb2010
    • Vis-2 control-commands

      Hallo zusammen,

      ich benutze IOBroker nun wirklich schon lange, Skripte dort exzessiv und habe eine komplexe Visualisierung. Ich würde mich mal als sehr fortgeschritten bezeichnen.

      Was ich allerdings ums verrecken nicht hinbekomme: Bestimmte Vis-Instanzen per vis-2.control.command zu steuern.
      Egal was ich sende, es kommt irgendwie nicht an. Ich benutze das Screen Dimension Widget um die Instanz-ID zu ermitteln. Damit sende ich dann bspw. den folgenden Command, indem ich "vis-2.0.control.command" auf "{'instance': '99.209df', 'command': 'reload', 'data': ''}" setze. Doch es passiert einfach nichts. Weder reload, noch changeView noch playSound.

      Ich benutze wie gesagt die Vis-2 und angezeigt wird das ganze auf einem Android-Gerät im Fully Browser. Aber auch wenn ich die View im Browser am PC öffne und versuche diese Instanz zu steuern, passiert nichts. Mit Vis (ohne 2) funktionierte das...

      Könnt ihr mich hier einmal unterstützen den Fehler zu finden?

      Viele Grüße
      Sebastian

      posted in Visualisierung
      S
      seb2010

    Latest posts made by seb2010

    • RE: Test Adapter VW Connect für VW, ID, Audi, Seat, Skoda

      @carsten_65 mM nach steuerst du das besser von der Wallbox aus, oder?
      Aber interessant. Wusste gar nicht, dass dies auch mal von Auto-Seite aus mit dem Adapter ging.

      posted in Tester
      S
      seb2010
    • Fritz!Box Daten auslesen, Gerätetraffic und Filter setzen

      Hallo zusammen,

      um den Kindern ihren Medienkonsum etwas besser vor die Augen zu halten und ggf. nach Überschreiten von Zeitlimits das Internet zu sperren, habe ich aufbauend auf einem Script aus dem Netz dieses erweitert.
      Im Prinzip spricht es das Fritzbox GUI an und holt

      • Die Geräteinformationen
      • Listet die Profile auf
      • Speichert Traffic von Geräten mit aktivem Trafficmonitoring in der InfluxDB-History auf
      • Berechnet und speichert die Nutzungsdauer der Geräte in Minuten (Nutzung über Threshold b/s)
      • Kann Filtern Geräten zuordnen, bspw. bei überschreiten eines Nutzungslimits von Gerätegruppen

      Der Code ist nicht superschön und man sieht vermutlich, dass ich auf etwas anderem aufgesetzt habe, aber die Funktionen sind schon ganz nützlich.

      Achso: setStateNotExist ist eine Funktion von mir. Müsste man mit setState ersetzen.

      const Version = "2.0";
      const InfluxClient = require('@influxdata/influxdb-client');
      const limits = [{name: 'Ben',
                      limit: 2*60,
                      devices: ['Switch01','PS5_Ben','Fernseher_Ben','Ben_Laptop']},
                      {name: 'Max',
                      limit: 2*60,
                      devices: ['FireTVStick','Max Handy','Switch_2']},
                      ]
       
      // TODO
      // * Liste erzeugen mit Devices und aktuellem Filter
      //   > als JSON in einen DP speichern -> für Tabellenauswertung
       
      // https://forum.iobroker.net/topic/16184/http-request-in-javascript/5
      var request = require('request');
      var headers = { 
          'Content-Type': 'application/x-www-form-urlencoded', 
          'User-Agent': 'curl/7.64.0', 
          'Accept': '*/*'
      }; 
       
      /*******************************************************
      * E I N S T E L L U N G E N 
      *******************************************************/
       
      // Die IP Der Fritzbox
      const FbIp          = "192.168.178.1";              
      // Der User der Fritzbox 
      // HINWEIS : Den Benutzer leer lassen wenn die Anmeldung an der FB nur mit Passwort erfolgt !
      const FbUser        = "**************";  //Anmeldebenutzername für WebGUI, default unter den Users heraussuchen
      // Das Password der Fritzbox                  
      const FbPassword    = "***************";   //Anmeldepasswort für WebGUI
      const FbDebugging   = false;
      // Keine Änderung an der Fritzbox (true) -> Listet dann nur alle Profile und Rechner               
      const FbListOnly    = true; 
      // Device / Filter Liste erzeugen Ja (true), Nein (false)
        
      var secChallenge;
      var secMd5;
      var secLogin;
      var secSid;
      var secProfileNames = [];
      var secProfileIds   = [];
      var secDeviceNames  = [];
      var secDeviceIds    = [];
      var secDeviceData   = [];
      var JsonList        = "";
       
      /*******************************************************
      * Object Trigger Version
      * Wenn auf einen Datenpunkt getriggert werden soll, dann muss der folgende Block auskommentiert werden. 
      * FbIobObject muss mit einem string Datenpunkt versehen werden.
      * Den Static Teil dann auskommentieren !
      * Diese Variante erlaubt es das Script dynamisch für alle Devices / Profile der FB zu verwenden. 
      *******************************************************/
      getFbChallenge();
      var s1 = schedule('4,9,14,19,24,29,34,39,44,49,54,59 * * * *', function(){
          secProfileNames = [];
          secProfileIds   = [];
          secDeviceNames  = [];
          secDeviceIds    = [];
          secDeviceData   = [];
          getFbChallenge();
      })
      
      /*******************************************************
      * Static Version
      * Die folgenden 3 Zeilen lassen das Script  sofort laufen. 
      * Dabei sollte der Object Trigger Block auskommentiert werden. 
      *******************************************************/
      // console.log("Profile Changer started ... (Version : " + Version + ")");
      // getFbChallenge();
      // console.log("Profile Changer done");
       
      // Get the Challenge String from the FritzBox
      // Compute the md5 Hash
      function getFbChallenge(){
          console.log("function getFbChallenge");
          request.get({
              url:        'http://' + FbIp + '/login_sid.lua?username=' + FbUser,
              headers:    headers
          }, function(error, response, body) {
              if (error) log(error, 'error');
              //console.log(response);
              secChallenge = body.match(/Challenge>(.*)<\/Challenge/)[1];
              console.log(" > Challenge : " + secChallenge);
       
              var uft16le = str2rstr_utf16le(secChallenge + "-" +FbPassword );
              var md5     = rstr_md5(uft16le);
              secMd5      = rstr2hex(md5);
                      
              console.log(" > MD5       : " + secMd5);   
       
              secLogin = "response=" + secChallenge + "-" + secMd5 + "&username=" + FbUser;
       
              console.log(" > Login     : " + secLogin);
       
              getFbSid();
          });
      }
       
      // Get the SID from the Fritzbox
      function getFbSid() {
          console.log("function getFbSid");
       
          request.post({
              url:        'http://' + FbIp,
              headers:    headers, 
              form:       secLogin
          }, function(error, response, body) {
              if (error) log(error, 'error');
              // SID filtern 
              // "sid":"c503b24dae458086"
              try {
                  secSid = response.body.match(/\"sid\":\"(.*)\"/)[1];
              }
              catch (e) {
                  if (secSid == undefined) {
                      console.log("Your login was not successful. End Script", Error)
                      return;
                  }
              }
       
              console.log(" > SID       : " + secSid);
       
              //getFbDeviceInfos();
              getFbProfiles();
          });
      } 
       
      // TBD: 
      // Netzwerkinfos mit allen Devices lesen: 
      // var req = "xhr=1&sid=" + secSid + "&lang=de&page=netDev&xhrId=cleanup&useajax=1&no_sidrenew=" 
      function getFbDeviceInfos(){
          console.log("function getFbDeviceInfos");
          var req = "xhr=1&sid=" + secSid + "&lang=de&page=netDev&xhrId=cleanup&useajax=1&no_sidrenew=" 
       
          request.post({
              url:        'http://' + FbIp + '/data.lua',
              headers:    headers, 
              form:       req
          }, function(error, response, body) {
              if (error) log(error, 'error');
              //console.log(response.body);
              var data = JSON.parse(response.body)
              for(var i = 0;i < data['data']['active'].length;i++){
                  var dataset = {"active":true}
                  setStateNotExist('javascript.0.FritzBox.Devices.'+ data['data']['active'][i]['name']+'.active',true,true,true)
                  for (let [key, value] of Object.entries( data['data']['active'][i])) {
                      dataset[key] = value
                      if(typeof value === "object"){
                          value = JSON.stringify(value)
                      }
                      setStateNotExist('javascript.0.FritzBox.Devices.'+ data['data']['active'][i]['name']+'.'+key,value,true,true)
                  }
                  secDeviceData.push(dataset)
              }
              for(var i = 0;i < data['data']['passive'].length;i++){
                  var dataset = {"active":true}
                  setStateNotExist('javascript.0.FritzBox.Devices.'+ data['data']['passive'][i]['name']+'.active',false,true,true)
                  for (let [key, value] of Object.entries( data['data']['passive'][i])) {
                      dataset[key] = value
                      if(typeof value === "object"){
                          value = JSON.stringify(value)
                      }
                      setStateNotExist('javascript.0.FritzBox.Devices.'+ data['data']['passive'][i]['name']+'.'+key,value,true,true)
                  }
                  secDeviceData.push(dataset)
              }
              //log(secDeviceData)
              getFbDeviceInfos2();
          });    
      }
      
      function TrafficAboveThreshold(devName,value){
          var threshold = 300*1024
          for(var i = 0;i < thresholds.length;i++){
              if(thresholds[i].name == devName){
                  threshold = thresholds[i].threshold
              }
          }
          if(value >= threshold){
              return true
          }else{
              return false
          }
      }
      
      async function getFbMointorDatasets(){
          const influx_connection = new InfluxClient.InfluxDB({url:'http://192.168.178.46:8086',token:'_8XmsZizKYP35JNXhAI3pWYgOqWxMu425r1fw_93oQO6q0XebI1UBsdCGcLW6k1T52JnS7ewYDvobKYoz8sdow==',timeout:120000})
          const influx_write = await influx_connection.getWriteApi('pi4', 'network','ms')
          console.log("function getFbMointorDatasets");
          var custom_header = { 
              'Content-Type': 'application/json', 
              'User-Agent': 'curl/7.64.0', 
              'Accept': '*/*',
              'Authorization': 'AVM-SID '+secSid,
              'Referer': 'http://' + FbIp + '/'
          }; 
          request.get({
              url:        'http://' + FbIp + '/api/v0/monitor/datasets',
              headers:    custom_header,
          }, async function(error, response, body) {
              if (error) log(error, 'error');
              var data = JSON.parse(response.body)
              var urls = ['/api/v0/monitor/macaddrs/subset0000','/api/v0/monitor/onlinemonitor_dsl_0/subset0000','/api/v0/monitor/macaddrs/subset0002','/api/v0/monitor/onlinemonitor_dsl_0/subset0002']
              for(var x = 0;x<urls.length;x++){
                  var subset = await getFbMointorDatasubsets(urls[x])
                  for(var i = 0; i < subset.length;i++){
                      for(var j = 0;j < data.length;j++){
                          for(var k = 0;k < data[j]['dataSources'].length;k++){
                              if(data[j]['dataSources'][k]['dataSourceName'] == subset[i]['dataSourceName']){
                                  var bfound = false
                                  if(data[j]['dataSources'][k]['landeviceUid'] != ''){
                                      for(var z = 0;z < secDeviceData.length;z++){
                                          if(secDeviceData[z]['UID'] == data[j]['dataSources'][k]['landeviceUid']){
                                              //log(subset[i]['dataSourceName'] + ' -> ' + data[j]['dataSources'][k]['landeviceUid'] + ' -> ' + secDeviceData[z]['name'] + ' ' + data[j]['dataSources'][k]['type'])
                                              bfound = true
                                              data[j]['dataSources'][k]['name'] = secDeviceData[z]['name']
                                          }
                                      }
                                  }
                                  if(bfound){
                                      data[j]['dataSources'][k]['subset000'+x] = subset[i]
                                      if(urls[x].search('subset0000') > 0){
                                          var d = Date.parse(subset[i]['timestamp'])
                                          for(var t = subset[i]['measurements'].length-1; t >= 0;t--){
                                              var ts = d - (subset[i]['measurements'].length-1-t) * 5*1000
                                              if(subset[i]['measurements'][t] != null && data[j]['dataSources'][k]['name'] != undefined && data[j]['dataSources'][k]['name'] != 'undefinded'){
                                                  //if(data[j]['dataSources'][k]['name'] == "FireTVStick" && data[j]['dataSources'][k]['type'] == "downstream")log(new Date(ts).toLocaleString()+ ' ' +subset[i]['measurements'][t])
                                                  var point1 = new InfluxClient.Point(data[j]['dataSources'][k]['name'])
                                                      .floatField(data[j]['dataSources'][k]['type'], subset[i]['measurements'][t])
                                                      .timestamp(ts)
                                                  influx_write.writePoint(point1)
                                              }
                                          }
                                      }
                                  }
                              }
                          }
                      }
                  }
              }
              await influx_write.flush()
              await influx_write.close()        
              await update_utilization();
          });   
      }
      
      async function getFbMointorDatasubsets(subsetURL){
          console.log("function getFbMointorDatasets "+subsetURL);
          var custom_header = { 
              'Content-Type': 'application/json', 
              'User-Agent': 'curl/7.64.0', 
              'Accept': '*/*',
              'Authorization': 'AVM-SID '+secSid,
              'Referer': 'http://' + FbIp + '/'
          }; 
          return new Promise(resolve => {  
              request.get({
                  url:        'http://' + FbIp + subsetURL,
                  headers:    custom_header,
              }, function(error, response, body) {
                  if (error){log(error, 'error');resolve([])}
                  //console.log(response.body);
                  resolve(JSON.parse(response.body))
              });    
          })
      }
       
      // Get all Profiles from the Fritzbox
      function getFbProfiles() {
          console.log("function getFbProfiles");
          // #curl -d "xhr=1&sid=${sid}&lang=de&no_sidrenew=&page=kidPro" "http://$1/data.lua"
          var req = "xhr=1&sid=" + secSid + "&lang=de&no_sidrenew=&page=kidPro";
       
          request.post({
              url:        'http://' + FbIp + '/data.lua',
              headers:    headers, 
              form:       req
          }, function(error, response, body) {
              if (error) log(error, 'error');
              
              if (FbDebugging){
                  console.log(" > response.body : \n" + response.body);
              }
       
              console.log(" > Decode Names")
              var rx = new RegExp( /class=\"name\"\stitle=\"([a-zA-Z0-9 äöüÄÖÜ\-\_\.]*)\"\sdatalabel/g );
              while( (match = rx.exec( body )) != null ) {
                  secProfileNames.push(match[1]);
              }
              if (FbDebugging){
                  console.log(" > secProfileNames : \n" + secProfileNames);
              }
       
              console.log(" > Decode Filters")
              // submit" name="edit" value="
              rx = new RegExp( /submit\"\sname=\"edit\"\svalue=\"([a-zA-Z0-9 äöüÄÖÜ\-\_\.]*)\"\sclass=\"icon/g );
              while( (match = rx.exec( body )) != null ) {
                  secProfileIds.push(match[1]);
              }
              if (FbDebugging){
                  console.log(" > secProfileIds : \n" + secProfileIds);
              }
       
              if (FbListOnly) {
                  console.log("Filter Count : " + secProfileIds.length);
                  for (var i = 0; i < secProfileIds.length; i++) {
                      //console.log("Filter named '"+ secProfileNames[i] + "' has ID : " + secProfileIds[i]);
                      setStateNotExist('javascript.0.FritzBox.Profiles.' + secProfileNames[i] + '.UID',secProfileIds[i],true,true)
                  }
              }
              getFbProfilesInfo();
           });
      }
      
      async function getFbProfilesInfo() {
          console.log("function getFbProfilesInfo");
          // xhr=1&sid=5f5ba302815594d8&lang=de&no_sidrenew=&page=kidLis
          for (var i = 0; i < secProfileIds.length; i++) {
              log('listing Profile ' + secProfileNames[i] + ' ' + secProfileIds[i])
              var req = "xhr=1&back_to_page=kidPro&sid=" + secSid + "&lang=de&no_sidrenew=&page=kids_profileedit&edit=" + secProfileIds[i];
          
              await request.post({
                  url:        'http://' + FbIp + '/data.lua',
                  headers:    headers, 
                  form:       req
              }, function(error, response, body) {
                  if (error) log(error, 'error');
                  if (FbDebugging){
                      console.log(" > response.body : \n" + response.body);
                  }
                  //log(response.body)
                  let rx
                  let match
                  var profileName = "undefinded"
                  
                  rx = new RegExp( /<input\stype=\"text\".*id=\"uiName\"\svalue=\"(?<name>.*)\"\s/g );
                  if( (match = rx.exec( body )) != null ) {
                      var { name } = match.groups
                      profileName = name
                  }
      
                  //log(profileName)
      
                  //Decode
                  rx = new RegExp( /<input\s+type="radio"\s(?<checked>checked\s)?id="uiTime:(?<id>\w+)"/g );
                  while( (match = rx.exec( body )) != null ) {
                      const { id, checked } = match.groups
                      setStateNotExist('javascript.0.FritzBox.Profiles.' + profileName + '.uiTime_'+ id,checked == undefined ? false : true,true,true)
                  }
      
                  rx = new RegExp( /<input\s+type="radio"\s(?<checked>checked\s)?id="uiBudget:(?<id>\w+)"/g );
                  while( (match = rx.exec( body )) != null ) {
                      const { id, checked } = match.groups
                      setStateNotExist('javascript.0.FritzBox.Profiles.' + profileName + '.uiBudget_'+ id,checked == undefined ? false : true,true,true)
                  }
      
                  body = body.slice(body.search('Zugeordnete Netzwerkgeräte'))
                  rx = /<table[\s\S]*?<div id="js-add-more-network-devices-container"/;
      
                  if (rx.test(body)) {
                      //already linked devices available
                      var linked = []
                      rx = new RegExp( /<td>(?<link>[a-zA-Z0-9 äöüÄÖÜ\-\_\.]*)<\/td>/g );
                      while( (match = rx.exec( body )) != null ) {
                          const { link } = match.groups
                          linked.push(link)
                          setStateNotExist('javascript.0.FritzBox.Devices.' + link + '.profile',profileName,true,true)
                      }
                      //log(linked)
                      setStateNotExist('javascript.0.FritzBox.Profiles.' + profileName + '.linked',JSON.stringify(linked),true,true)
                  }
              });
          }
          getFbDevices();
      }
       
      // IMPORTANT: 
      // The DeviceId changes when you switch the profile. 
      // If you use default profiles it is something like "landevice308962"
      // If you use your own profiles it is something like "user7749"
      function getFbDevices() {
          console.log("function getFbDevices");
          // xhr=1&sid=5f5ba302815594d8&lang=de&no_sidrenew=&page=kidLis
          var req = "xhr=1&sid=" + secSid + "&lang=de&no_sidrenew=&page=kidLis";
       
          request.post({
              url:        'http://' + FbIp + '/data.lua',
              headers:    headers, 
              form:       req
          }, function(error, response, body) {
              if (error) log(error, 'error');
              if (FbDebugging){
                  console.log(" > response.body : \n" + response.body);
              }
       
              // TESTING
              //body = getState("Global.0.Testing.StringValue").val;
       
              secDeviceNames = [];
              secDeviceIds   = [];
       
              console.log(" > Decode Device Names")
              var rx = new RegExp( /class=\"name"\stitle=\"([a-zA-Z0-9 äöüÄÖÜ\-\_\.]*)\"\sdatalabel/g );
              while( (match = rx.exec( body )) != null ) {
                  secDeviceNames.push(match[1]);
              }
              if (FbDebugging){
                  console.log(" > secDeviceNames : \n" + secDeviceNames);
              }
       
              console.log(" > Decode Device Ids")
              rx = new RegExp( /name=\"profile:([a-zA-Z0-9 äöüÄÖÜ\-\_\.]*)\"><option/g );
              while( (match = rx.exec( body )) != null ) {
                  secDeviceIds.push(match[1]);
              }
              if (FbDebugging){
                  console.log(" > secDeviceIds : \n" + secDeviceIds);
              }
      
              console.log("Device Count : " + secDeviceIds.length);
              for (var i = 0; i < secDeviceNames.length; i++) {
                  setStateNotExist('javascript.0.FritzBox.Devices.'+secDeviceNames[i]+'.UID',secDeviceIds[i],true,true)
                  if(!existsState('javascript.0.FritzBox.Devices.'+secDeviceNames[i]+'.profile'))setStateNotExist('javascript.0.FritzBox.Devices.'+secDeviceNames[i]+'.profile','Standard',true,true)
                  //console.log(i + " - Device named '"+ secDeviceNames[i] + "' has ID : " + secDeviceIds[i]);
              }
       
              console.log("DONE : Listmode - No Device blocking ..."); 
              getFbDeviceInfos();
          });
      }
      
      function getFbDeviceInfos2() {
          console.log("function getFbDeviceInfos2");
      
          var custom_header = { 
              'Accept': '*/*',
              'Authorization': 'AVM-SID '+secSid,
              'Origin': 'http://' + FbIp,
              'Referer': 'http://' + FbIp + '/',
              'Content-Type': 'application/json', 
              'User-Agent': 'curl/7.64.0', 
          }; 
       
          request.get({
              url: 'http://' + FbIp  + '/api/v0/landevice',
              headers:    custom_header
          }, function(error, response, body) {
              if (error) log(error, 'error');
              if (FbDebugging){
                  console.log(" > response : \n" + response);
              }
              var data = JSON.parse(response.body)
              //log('Devices2: '+ data['landevice'].length)
              var fields = []
              for(var i = 0;i < data['landevice'].length;i++){
                  for(const key in data['landevice'][i]){
                      if(fields.indexOf(key) == -1)fields[key] = false
                  }
              }
              for(var i = 0;i < data['landevice'].length;i++){
                  var fields_tmp = fields.slice()
                  for(const key in data['landevice'][i]){
                      fields_tmp[key] = true
                      setStateNotExist('javascript.0.FritzBox.Devices.'+ data['landevice'][i]['friendly_name'] +'.' + key, data['landevice'][i][key],true,true)
                  }
                  for(const key in fields_tmp){
                      if(fields_tmp[key] == false)setStateNotExist('javascript.0.FritzBox.Devices.'+ data['landevice'][i]['friendly_name'] +'.' + key, "",true,true)
                  }
              }
              getFbMointorDatasets();
          });    
      }
      
      function setFbSperre(devName,profileName) {
          console.log("function setFbSperre");
      
          var devID = getState('javascript.0.FritzBox.Devices.' + devName + '.UID').val
          var profileID = getState('javascript.0.FritzBox.Profiles.'+profileName+'.UID').val
          var userID = getState('javascript.0.FritzBox.Devices.' + devName + '.user_UIDs').val
          var current_profile = getState('javascript.0.FritzBox.Devices.' + devName + '.profile').val
          if(profileID == null || devID == null){
              log('error resolving FBSperre Vars:'+profileID+' '+profileName+' '+devID+' '+devName)
          }
       
          var custom_header = { 
              'Accept': '*/*',
              'Authorization': 'AVM-SID '+secSid,
              'Origin': 'http://' + FbIp,
              'Referer': 'http://' + FbIp + '/',
              'Content-Type': 'application/json', 
              'User-Agent': 'curl/7.64.0', 
          }; 
      
          //log(data)
          var method = 'POST'
          var url = 'http://' + FbIp  + '/api/v0/user/user'
          var data = {"type":"1","landeviceUID":devID,"filter_profile_UID":profileID}
          if(userID != '' && current_profile != 'Standard'){
              method = 'PUT'
              url = 'http://' + FbIp  + '/api/v0/user/user/'+userID
              data = {"filter_profile_UID":profileID,"disallowed":"0"}
          }
      
          request({
              method: method,
              url: url,
              headers:    custom_header, 
              body: JSON.stringify(data)
          }, function(error, response, body) {
              if (error) log(error, 'error');
              if (FbDebugging){
                  console.log(" > response : \n" + response);
              }
              //log(response.body.length)
              if(response.body.length < 10){
                  setStateNotExist('javascript.0.FritzBox.Devices.'+ devName +'.profile',profileName,true,true)
              }else{
                  log(response.body)
                  log(devName + ' -> ' + profileName)
                  log(userID)
                  log(data)
              }
          });    
      }
      
      
      function check_limits(){
          for(var i = 0;i < limits.length;i++){
              log('Checking limits for '+limits[i].name)
              var active_sum = 0
              for(var d = 0;d < limits[i].devices.length;d++){
                  var value = getState('javascript.0.FritzBox.Monitor.'+ limits[i].devices[d] +'.activeduration_in_min').val
                  if(value !== null && value !== undefined){
                      active_sum += value
                  }
              }
              log(limits[i].name+ ' used up '+ active_sum +'min of his '+limits[i].limit +'min limit')
              var sProfile = 'Begrenztes Youtube_Tiktok'
              if(limits[i].limit <= active_sum){
                  log('locking devices:')
                  sProfile = 'Kein Internet'
              }else{
                  log('unlocking devices (if needed):')
                  sProfile = 'Begrenztes Youtube_Tiktok'
              }
              for(var d = 0;d < limits[i].devices.length;d++){
                  //log(limits[i].devices[d])
                  var value = getState('javascript.0.FritzBox.Devices.'+ limits[i].devices[d] +'.profile').val
                  if(value !== null && value !== undefined){
                      if(value != sProfile){
                          log('Switching profile for '+limits[i].devices[d]+': ' +value+' -> '+sProfile)
                          setFbSperre(limits[i].devices[d],sProfile)
                      }
                  }
              }
          }
      }
      
      async function update_utilization(start = new Date().setHours(0,0,0,0)){
          var query = `data = from(bucket: "network") 
              |> range(start: `+start/1000+`, stop: 0m) 
              |> filter(fn: (r) => r._field == "downstream" or r._field == "upstream")
              |> pivot(
                  rowKey: ["_time", "_measurement"], 
                  columnKey: ["_field"], 
                  valueColumn: "_value"
              )
              |> map(fn: (r) => ({
                  _time: r._time,
                  _measurement: r._measurement,
                  _value: r.downstream + r.upstream
              }))
      
              sumAgg = data
              |> aggregateWindow(
                  every: 1m,
                  fn: sum,
                  offset: 1m,
                  createEmpty: false
              )
              |> set(key: "_field", value: "total_sum")
      
              maxAgg = data
              |> aggregateWindow(
                  every: 1m,
                  fn: max,
                  offset: 1m,
                  createEmpty: false
              )
              |> set(key: "_field", value: "total_max")
      
              union(tables: [sumAgg, maxAgg])
              |> pivot(
                  rowKey: ["_time", "_measurement"],
                  columnKey: ["_field"],
                  valueColumn: "_value"
              )
              |> rename(columns: {
                  total_sum: "total_sum",
                  total_max: "total_max"
              })
              |> keep(columns: ["_time", "_measurement", "total_sum", "total_max"])`
          try{
              var result = await new Promise(resolve => {  
                  sendTo('influxdb.0', 'query', query
                  , {timeout: 120000}, function (res) {
                      resolve(res)
                  })})
              var t = result['result'][0]
              var data = {}
              for(var i = t.length-1; i>=1;i--){
                  data[t[i]['_measurement']] = {}
                  data[t[i]['_measurement']]['active_count'] = 0
                  data[t[i]['_measurement']]['inactive_count'] = 0
              }
              for(var i = t.length-1; i>=1;i--){
                  if(t[i]['total_max'] != null){
                      if(TrafficAboveThreshold(t[i]['_measurement'],t[i]['total_max'])){
                          //log(data[j]['dataSources'][k]['name']+' '+data[j]['dataSources'][k]['type']+' '+new Date(ts).toLocaleString()+': '+subset[i]['measurements'][t])
                          data[t[i]['_measurement']]['active_count'] += 1
                          if(data[t[i]['_measurement']]['inactive_count'] > 0 && data[t[i]['_measurement']]['inactive_count'] <= 10){
                              log('expanded staggered usage '+ t[i]['_measurement'] + ': '+ data[t[i]['_measurement']]['active_count'] + 'active  '+data[t[i]['_measurement']]['inactive_count']+'inactive')
                              data[t[i]['_measurement']]['active_count'] += data[t[i]['_measurement']]['inactive_count']
                          }
                          data[t[i]['_measurement']]['inactive_count'] = 0
                      }else{
                          data[t[i]['_measurement']]['inactive_count'] += 1
                          if(data[t[i]['_measurement']]['active_count'] > 0 && data[t[i]['_measurement']]['inactive_count'] >= 15 && data[t[i]['_measurement']]['active_count'] <= 10){
                              log('skipped small usage '+ t[i]['_measurement'] + ': '+ data[t[i]['_measurement']]['active_count'] + 'active  '+data[t[i]['_measurement']]['inactive_count']+'inactive')
                              data[t[i]['_measurement']]['active_count'] = 0
                          }
                      }
                  }
              }
              log(data)
              for(const key in data){
                  setStateNotExist('javascript.0.FritzBox.Monitor.'+ key +'.activeduration_in_min',data[key]['active_count'],true,true)
                  setStateNotExist('javascript.0.FritzBox.Monitor.'+ key +'.inactiveduration_in_min',data[key]['inactive_count'],true,true)
                  setStateNotExist('javascript.0.FritzBox.Monitor.'+ key +'.activeduration_in_percent',data[key]['active_count']/2/60*100,true,true)
                  setStateNotExist('javascript.0.FritzBox.Monitor.'+ key +'.inactiveduration_in_percent',data[key]['inactive_count']/2/20*100,true,true)
              }
              check_limits();
          }catch(e){
              log('error fetching data: '+e)
          }
          return null
      }
       
      // https://gist.githubusercontent.com/josedaniel/951664/raw/33c7a6b44d6cc53dc75cb5230fb551bc4ba7a46a/md5.js
      // http://pajhome.org.uk/crypt/md5/instructions.html
       
      /*
       * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
       * Digest Algorithm, as defined in RFC 1321.
       * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
       * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
       * Distributed under the BSD License
       * See http://pajhome.org.uk/crypt/md5 for more info.
       */
       
      /*
       * Configurable variables. You may need to tweak these to be compatible with
       * the server-side, but the defaults work in most cases.
       */
      var hexcase = 0;   /* hex output format. 0 - lowercase; 1 - uppercase        */
      var b64pad  = "";  /* base-64 pad character. "=" for strict RFC compliance   */
       
      /*
       * These are the functions you'll usually want to call
       * They take string arguments and return either hex or base-64 encoded strings
       */
      function hex_md5(s)    { return rstr2hex(rstr_md5(str2rstr_utf8(s))); }
      function b64_md5(s)    { return rstr2b64(rstr_md5(str2rstr_utf8(s))); }
      function any_md5(s, e) { return rstr2any(rstr_md5(str2rstr_utf8(s)), e); }
      function hex_hmac_md5(k, d)
        { return rstr2hex(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
      function b64_hmac_md5(k, d)
        { return rstr2b64(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
      function any_hmac_md5(k, d, e)
        { return rstr2any(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)), e); }
       
      /*
       * Perform a simple self-test to see if the VM is working
       */
      function md5_vm_test()
      {
        return hex_md5("abc").toLowerCase() == "900150983cd24fb0d6963f7d28e17f72";
      }
       
      /*
       * Calculate the MD5 of a raw string
       */
      function rstr_md5(s)
      {
        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
      }
       
      /*
       * Calculate the HMAC-MD5, of a key and some data (raw strings)
       */
      function rstr_hmac_md5(key, data)
      {
        var bkey = rstr2binl(key);
        if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);
       
        var ipad = Array(16), opad = Array(16);
        for(var i = 0; i < 16; i++)
        {
          ipad[i] = bkey[i] ^ 0x36363636;
          opad[i] = bkey[i] ^ 0x5C5C5C5C;
        }
       
        var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
      }
       
      /*
       * Convert a raw string to a hex string
       */
      function rstr2hex(input)
      {
        try { hexcase } catch(e) { hexcase=0; }
        var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
        var output = "";
        var x;
        for(var i = 0; i < input.length; i++)
        {
          x = input.charCodeAt(i);
          output += hex_tab.charAt((x >>> 4) & 0x0F)
                 +  hex_tab.charAt( x        & 0x0F);
        }
        return output;
      }
       
      /*
       * Convert a raw string to a base-64 string
       */
      function rstr2b64(input)
      {
        try { b64pad } catch(e) { b64pad=''; }
        var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
        var output = "";
        var len = input.length;
        for(var i = 0; i < len; i += 3)
        {
          var triplet = (input.charCodeAt(i) << 16)
                      | (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)
                      | (i + 2 < len ? input.charCodeAt(i+2)      : 0);
          for(var j = 0; j < 4; j++)
          {
            if(i * 8 + j * 6 > input.length * 8) output += b64pad;
            else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);
          }
        }
        return output;
      }
       
      /*
       * Convert a raw string to an arbitrary string encoding
       */
      function rstr2any(input, encoding)
      {
        var divisor = encoding.length;
        var i, j, q, x, quotient;
       
        /* Convert to an array of 16-bit big-endian values, forming the dividend */
        var dividend = Array(Math.ceil(input.length / 2));
        for(i = 0; i < dividend.length; i++)
        {
          dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
        }
       
        /*
         * Repeatedly perform a long division. The binary array forms the dividend,
         * the length of the encoding is the divisor. Once computed, the quotient
         * forms the dividend for the next step. All remainders are stored for later
         * use.
         */
        var full_length = Math.ceil(input.length * 8 /
                                          (Math.log(encoding.length) / Math.log(2)));
        var remainders = Array(full_length);
        for(j = 0; j < full_length; j++)
        {
          quotient = Array();
          x = 0;
          for(i = 0; i < dividend.length; i++)
          {
            x = (x << 16) + dividend[i];
            q = Math.floor(x / divisor);
            x -= q * divisor;
            if(quotient.length > 0 || q > 0)
              quotient[quotient.length] = q;
          }
          remainders[j] = x;
          dividend = quotient;
        }
       
        /* Convert the remainders to the output string */
        var output = "";
        for(i = remainders.length - 1; i >= 0; i--)
          output += encoding.charAt(remainders[i]);
       
        return output;
      }
       
      /*
       * Encode a string as utf-8.
       * For efficiency, this assumes the input is valid utf-16.
       */
      function str2rstr_utf8(input)
      {
        var output = "";
        var i = -1;
        var x, y;
       
        while(++i < input.length)
        {
          /* Decode utf-16 surrogate pairs */
          x = input.charCodeAt(i);
          y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
          if(0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF)
          {
            x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
            i++;
          }
       
          /* Encode output as utf-8 */
          if(x <= 0x7F)
            output += String.fromCharCode(x);
          else if(x <= 0x7FF)
            output += String.fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F),
                                          0x80 | ( x         & 0x3F));
          else if(x <= 0xFFFF)
            output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),
                                          0x80 | ((x >>> 6 ) & 0x3F),
                                          0x80 | ( x         & 0x3F));
          else if(x <= 0x1FFFFF)
            output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),
                                          0x80 | ((x >>> 12) & 0x3F),
                                          0x80 | ((x >>> 6 ) & 0x3F),
                                          0x80 | ( x         & 0x3F));
        }
        return output;
      }
       
      /*
       * Encode a string as utf-16
       */
      function str2rstr_utf16le(input)
      {
        var output = "";
        for(var i = 0; i < input.length; i++)
          output += String.fromCharCode( input.charCodeAt(i)        & 0xFF,
                                        (input.charCodeAt(i) >>> 8) & 0xFF);
        return output;
      }
       
      function str2rstr_utf16be(input)
      {
        var output = "";
        for(var i = 0; i < input.length; i++)
          output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,
                                         input.charCodeAt(i)        & 0xFF);
        return output;
      }
       
      /*
       * Convert a raw string to an array of little-endian words
       * Characters >255 have their high-byte silently ignored.
       */
      function rstr2binl(input)
      {
        var output = Array(input.length >> 2);
        for(var i = 0; i < output.length; i++)
          output[i] = 0;
        for(var i = 0; i < input.length * 8; i += 8)
          output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);
        return output;
      }
       
      /*
       * Convert an array of little-endian words to a string
       */
      function binl2rstr(input)
      {
        var output = "";
        for(var i = 0; i < input.length * 32; i += 8)
          output += String.fromCharCode((input[i>>5] >>> (i % 32)) & 0xFF);
        return output;
      }
       
      /*
       * Calculate the MD5 of an array of little-endian words, and a bit length.
       */
      function binl_md5(x, len)
      {
        /* append padding */
        x[len >> 5] |= 0x80 << ((len) % 32);
        x[(((len + 64) >>> 9) << 4) + 14] = len;
       
        var a =  1732584193;
        var b = -271733879;
        var c = -1732584194;
        var d =  271733878;
       
        for(var i = 0; i < x.length; i += 16)
        {
          var olda = a;
          var oldb = b;
          var oldc = c;
          var oldd = d;
       
          a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
          d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
          c = md5_ff(c, d, a, b, x[i+ 2], 17,  606105819);
          b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
          a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
          d = md5_ff(d, a, b, c, x[i+ 5], 12,  1200080426);
          c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
          b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
          a = md5_ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
          d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
          c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
          b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
          a = md5_ff(a, b, c, d, x[i+12], 7 ,  1804603682);
          d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
          c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
          b = md5_ff(b, c, d, a, x[i+15], 22,  1236535329);
       
          a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
          d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
          c = md5_gg(c, d, a, b, x[i+11], 14,  643717713);
          b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
          a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
          d = md5_gg(d, a, b, c, x[i+10], 9 ,  38016083);
          c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
          b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
          a = md5_gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
          d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
          c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
          b = md5_gg(b, c, d, a, x[i+ 8], 20,  1163531501);
          a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
          d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
          c = md5_gg(c, d, a, b, x[i+ 7], 14,  1735328473);
          b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
       
          a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
          d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
          c = md5_hh(c, d, a, b, x[i+11], 16,  1839030562);
          b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
          a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
          d = md5_hh(d, a, b, c, x[i+ 4], 11,  1272893353);
          c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
          b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
          a = md5_hh(a, b, c, d, x[i+13], 4 ,  681279174);
          d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
          c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
          b = md5_hh(b, c, d, a, x[i+ 6], 23,  76029189);
          a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
          d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
          c = md5_hh(c, d, a, b, x[i+15], 16,  530742520);
          b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
       
          a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
          d = md5_ii(d, a, b, c, x[i+ 7], 10,  1126891415);
          c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
          b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
          a = md5_ii(a, b, c, d, x[i+12], 6 ,  1700485571);
          d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
          c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
          b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
          a = md5_ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
          d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
          c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
          b = md5_ii(b, c, d, a, x[i+13], 21,  1309151649);
          a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
          d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
          c = md5_ii(c, d, a, b, x[i+ 2], 15,  718787259);
          b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
       
          a = safe_add(a, olda);
          b = safe_add(b, oldb);
          c = safe_add(c, oldc);
          d = safe_add(d, oldd);
        }
        return Array(a, b, c, d);
      }
       
      /*
       * These functions implement the four basic operations the algorithm uses.
       */
      function md5_cmn(q, a, b, x, s, t)
      {
        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
      }
      function md5_ff(a, b, c, d, x, s, t)
      {
        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
      }
      function md5_gg(a, b, c, d, x, s, t)
      {
        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
      }
      function md5_hh(a, b, c, d, x, s, t)
      {
        return md5_cmn(b ^ c ^ d, a, b, x, s, t);
      }
      function md5_ii(a, b, c, d, x, s, t)
      {
        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
      }
       
      /*
       * Add integers, wrapping at 2^32. This uses 16-bit operations internally
       * to work around bugs in some JS interpreters.
       */
      function safe_add(x, y)
      {
        var lsw = (x & 0xFFFF) + (y & 0xFFFF);
        var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
        return (msw << 16) | (lsw & 0xFFFF);
      }
       
      /*
       * Bitwise rotate a 32-bit number to the left.
       */
      function bit_rol(num, cnt)
      {
        return (num << cnt) | (num >>> (32 - cnt));
      }
      
      onStop (function scriptStop () {
          clearSchedule(s1);
      }, 1000);
      
      posted in JavaScript
      S
      seb2010
    • RE: Resize Proxmox LVM um Backup zu ermöglichen

      @arteck
      Ich habe keine stale dumps oder locks. Das habe ich schon alles bereinigt. Die Lösungen aus dem Thread tun es nicht. Es liegt nicht an verwaisten Dumps oder Locks.

      posted in Proxmox
      S
      seb2010
    • RE: Resize Proxmox LVM um Backup zu ermöglichen

      @arteck
      Das Backup geht auf ein google-drive was ich in /mnt/gdrive mit rclone mounte (storage Gdrive). Das ist auch das eigentliche Ziel (storage) des Backups. Das local backup hab ich nur erwähnt/getestet um Probleme mit der remote-location auszuschließen. Ich glaube aber auch, dass trotz des remote-targets er local Speicher benötigt. Und der ist nicht mehr ausreichend vorhanden...

      posted in Proxmox
      S
      seb2010
    • RE: Resize Proxmox LVM um Backup zu ermöglichen

      @arteck auf der VM 128GB läuft alles mögliche incl. Live-Video-Processing, InfluxDB etc. Die 64GB hat "nur" iobroker und influxdb. Beide sind ca. 70% voll.
      Ich bin einfach von SD-Karten auf Proxmox migriert und habe dann einfach die Größen der SD-Karten genommen...
      Aber wie gesagt, kam als Newbie auf Proxmox ohne einen Plan von best-practise.

      Oder was stößt dir hier auf?

      posted in Proxmox
      S
      seb2010
    • Resize Proxmox LVM um Backup zu ermöglichen

      Hallo zusammen,.
      ich verzweifle gerade an einer Situation auf meinem Proxmox 8.3.1 server, welcher 2 Debian LXC-Container mit iobroker hostet.
      Das Problem das ich lösen will ist, dass es in dieser Konfiguration seit 2 Wochen nicht mehr möglich ist für die Container im Snapshot-Modus vzdump-backups zu erstellen.
      Das Backup bricht mit dem error

      • ERROR: Backup of VM 100 failed - no lock found trying to remove 'backup' lock

      ab. Ich habe sehr viel um und mit den Locks probiert und das Problem scheint mit dem vzdump und der Speicherkalkulation zusammenzuhängen und nur durch unzureichende Error-Messages wird das Problem auf die locks geschoben. Auch ohne Lock-Dateien und Einträge in der Conf und ohne verwaiste Dumps kann kein Backup ausgeführt werden.

      Die Vermutung liegt nahe, dass für das Erstellen des dumps nicht genug Speicherplatz verfügbar ist.

      Folgendes Setup:
      Server mit 500GB SSD.
      Ein LXC-Container mit 128GB und einer mit 64GB Speicherplatz.
      Wie genau die Thin-Pools konfiguriert wurden, kann ich nicht mehr sagen, das hab ich im absoluten Newbie-Zustand durchgeführt. Vielleicht könnt ihr das in den Outputs unten sehen. Wenn ihr weitere braucht, sagt Bescheid.

      Ich GLAUBE, dass ich das pve-root von 96GB auf mindestens 128GB vergrößern muss, damit er den Snapshot der 100er VM erstellen kann. Dazu müsste ich also irgendwie an dem LVM, dem Thin-Pool oder was auch immer resizen, um das hinzubekommen. Ich habe aber null Ahnung wie das geht.
      Ich kann auch total falsch liegen oder es muss ein Umweg über einen neu zu erstellenden Thin-Pool gegangen werden. Ich kenne mich mit dem Konzept dahinter aber kaum aus und hab beim Einlesen auch irgendwie ein Brett vor dem Kopf.

      folgende Outputs kann ich schonmal liefern:

      lsblk:

      NAME                         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
      nvme0n1                      259:0    0 476.9G  0 disk
      ├─nvme0n1p1                  259:1    0  1007K  0 part
      ├─nvme0n1p2                  259:2    0     1G  0 part /boot/efi
      └─nvme0n1p3                  259:3    0 475.9G  0 part
        ├─pve-swap                 252:0    0     8G  0 lvm  [SWAP]
        ├─pve-root                 252:1    0    96G  0 lvm  /
        ├─pve-data_tmeta           252:2    0   3.6G  0 lvm
        │ └─pve-data-tpool         252:4    0 348.8G  0 lvm
        │   ├─pve-data             252:5    0 348.8G  1 lvm
        │   ├─pve-vm--100--disk--0 252:6    0   128G  0 lvm
        │   └─pve-vm--101--disk--0 252:7    0    64G  0 lvm
        └─pve-data_tdata           252:3    0 348.8G  0 lvm
          └─pve-data-tpool         252:4    0 348.8G  0 lvm
            ├─pve-data             252:5    0 348.8G  1 lvm
            ├─pve-vm--100--disk--0 252:6    0   128G  0 lvm
            └─pve-vm--101--disk--0 252:7    0    64G  0 lvm
      
      

      lvdisplay

        --- Logical volume ---
        LV Name                data
        VG Name                pve
        LV UUID                X9mSND-ir1z-rEg8-nYc5-W0rR-jzt5-CDkXku
        LV Write Access        read/write (activated read only)
        LV Creation host, time proxmox, 2023-11-30 18:48:03 +0100
        LV Pool metadata       data_tmeta
        LV Pool data           data_tdata
        LV Status              available
        # open                 0
        LV Size                <348.82 GiB
        Allocated pool data    54.37%
        Allocated metadata     2.22%
        Current LE             89297
        Segments               1
        Allocation             inherit
        Read ahead sectors     auto
        - currently set to     256
        Block device           252:5
      
        --- Logical volume ---
        LV Path                /dev/pve/swap
        LV Name                swap
        VG Name                pve
        LV UUID                wqzvbV-TwHh-MNT8-7ood-BPwz-Td2d-53r6dF
        LV Write Access        read/write
        LV Creation host, time proxmox, 2023-11-30 18:48:02 +0100
        LV Status              available
        # open                 2
        LV Size                8.00 GiB
        Current LE             2048
        Segments               1
        Allocation             inherit
        Read ahead sectors     auto
        - currently set to     256
        Block device           252:0
      
        --- Logical volume ---
        LV Path                /dev/pve/root
        LV Name                root
        VG Name                pve
        LV UUID                FZlOpt-BCsO-x10L-hnDt-eLK6-P6yY-buYtQt
        LV Write Access        read/write
        LV Creation host, time proxmox, 2023-11-30 18:48:02 +0100
        LV Status              available
        # open                 1
        LV Size                96.00 GiB
        Current LE             24576
        Segments               1
        Allocation             inherit
        Read ahead sectors     auto
        - currently set to     256
        Block device           252:1
      
        --- Logical volume ---
        LV Path                /dev/pve/vm-100-disk-0
        LV Name                vm-100-disk-0
        VG Name                pve
        LV UUID                R7iCI2-zrIb-lWi9-eoUw-Mii3-wJie-Dfy7xZ
        LV Write Access        read/write
        LV Creation host, time SJSERVER, 2023-11-30 19:19:09 +0100
        LV Pool name           data
        LV Status              available
        # open                 1
        LV Size                128.00 GiB
        Mapped size            99.95%
        Current LE             32768
        Segments               1
        Allocation             inherit
        Read ahead sectors     auto
        - currently set to     256
        Block device           252:6
      
        --- Logical volume ---
        LV Path                /dev/pve/vm-101-disk-0
        LV Name                vm-101-disk-0
        VG Name                pve
        LV UUID                6hxVC1-o1ri-DuIz-Ke7P-e3Ni-fdMe-zN35JA
        LV Write Access        read/write
        LV Creation host, time SJSERVER, 2025-03-18 20:40:00 +0100
        LV Pool name           data
        LV Status              available
        # open                 1
        LV Size                64.00 GiB
        Mapped size            96.44%
        Current LE             16384
        Segments               1
        Allocation             inherit
        Read ahead sectors     auto
        - currently set to     256
        Block device           252:7
      
      

      vzdump error text (es wird hier zwar auf ein rclone-gdrive gedumpt, aber es funktioniert auch nicht mit dem local-storage):

      INFO: starting new backup job: vzdump 101 100 --mode snapshot --fleecing 0 --node SJSERVER --prune-backups 'keep-last=3' --notes-template '{{guestname}}' --mailnotification always --quiet 1 --compress zstd --storage GDrive
      INFO: filesystem type on dumpdir is 'fuse.rclone' -using /var/tmp/vzdumptmp73646_100 for temporary files
      INFO: Starting Backup of VM 100 (lxc)
      INFO: Backup started at 2025-05-06 00:15:01
      INFO: status = running
      INFO: CT Name: sjserver01
      INFO: including mount point rootfs ('/') in backup
      INFO: excluding bind mount point mp0 ('/media/NAS') from backup (not a volume)
      INFO: backup mode: snapshot
      INFO: ionice priority: 7
      INFO: no lock found trying to remove any lock
      INFO: create storage snapshot 'vzdump'
      no lock found trying to remove 'backup'  lock
      ERROR: Backup of VM 100 failed - no lock found trying to remove 'backup'  lock
      INFO: Failed at 2025-05-06 00:15:02
      INFO: filesystem type on dumpdir is 'fuse.rclone' -using /var/tmp/vzdumptmp73646_101 for temporary files
      INFO: Starting Backup of VM 101 (lxc)
      INFO: Backup started at 2025-05-06 00:15:03
      INFO: status = running
      INFO: CT Name: wschi
      INFO: including mount point rootfs ('/') in backup
      INFO: backup mode: snapshot
      INFO: ionice priority: 7
      INFO: no lock found trying to remove any lock
      INFO: create storage snapshot 'vzdump'
      no lock found trying to remove 'backup'  lock
      ERROR: Backup of VM 101 failed - no lock found trying to remove 'backup'  lock
      INFO: Failed at 2025-05-06 00:15:05
      INFO: Backup job finished with errors
      TASK ERROR: job errors
      

      Kann mir hier irgendjemand helfen
      a) besser herauszufinden woram es jetzt genau liegt
      b) wie man es Schritt für Schritt löst

      Ein backup im stop-mode funktioniert, die VMs müssen aber rund-um-die-Uhr laufen. Ich kann da nicht stundenlang pausieren...

      Viele Grüße und Danke euch im Voraus
      SEB

      posted in Proxmox
      S
      seb2010
    • RE: Test Adapter VW Connect für VW, ID, Audi, Seat, Skoda

      @seb2010 AHA. Also du musst unter den Adaptern nach "Einfache RESTful API" Suchen und mit dem "+" eine eigene Instanz erzeugen. Das musste man vorher nicht. In der Instanzeinstellung von der RESTful API stellst du dann auf Web-Erweiterung von web.0 um und das getPlainValue geht dann wieder

      posted in Tester
      S
      seb2010
    • RE: Test Adapter VW Connect für VW, ID, Audi, Seat, Skoda

      @pu Die getPlainValue Funktion wird meine ich durch die simple-API bereitgestellt. Der STATE Zugriff über den Web-Adapter. Auf welchem Repo bist du und welche Version hat der WEB-Adapter? Ich habe v7.0.6.

      Lese gerade auch im Config-Panel vom Web-Adapter:
      Simple API funktioniert nun als Web-Extension. Bitte erstellen Sie eine Instanz und nehmen Sie dort Einstellungen vor.
      was auch immer das heißt

      posted in Tester
      S
      seb2010
    • RE: Test Adapter VW Connect für VW, ID, Audi, Seat, Skoda

      @pu der Fehler den du siehst sagt doch, dass es das Object gar nicht gibt. Findest du den SoC denn in der Objekte Ansicht vom Admin-Panel?
      Habe es gerade bei mir getestet, es funktioniert:
      33100001-de0c-4a75-af40-5276b2f3809a-image.png

      Wo genau siehst du denn den Fehler:
      error: datapoint "vw-connect.0.<VIN>.status.charging.status.battery.stateOfChargeInPercent" not found
      und wie genau fragst du die http-Adresse ab?

      posted in Tester
      S
      seb2010
    • RE: Test Adapter VW Connect für VW, ID, Audi, Seat, Skoda

      @seb2010
      ehm, ich habe den Datenpunkt für den Ladekabel-Status jetzt durch Zufall gefunden. Er ist jetzt unter
      vw-connect.0.xxxxxxxxxx.status.air-conditioning.chargerConnectionState
      zu finden 🙈

      posted in Tester
      S
      seb2010
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
    The ioBroker Community 2014-2023
    logo