Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • 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

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. ioBroker Allgemein
  4. Forecast.solar mit dem Systeminfo Adapter

NEWS

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    18
    1
    689

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    18
    1
    5.8k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.5k

Forecast.solar mit dem Systeminfo Adapter

Scheduled Pinned Locked Moved ioBroker Allgemein
systeminfosolarjson
188 Posts 15 Posters 29.3k Views 16 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • GarganoG Gargano

    @jb_sullivan Nee , bin in Niederbayern, auch wenn das Nieder gleich ist. Nur ist die letzten Tage endlich schönes Wetter.

    Schau Dir mal die Rohdaten an, die werden die :00 Zeiten erst um 8 beginnen.

    Kannst aber mal schauen , ob das mit 30 Minuten zusätzlich auch geht, ansonsten geht noch interpolieren

    function makeResponse 
    ....
        for(let time in watts) {
            let pos1 = time.indexOf(':00:00');
            let pos2 = time.indexOf(':30:00');
            if((pos1 != -1) || (pos2 != -1)) {
    
    JB_SullivanJ Offline
    JB_SullivanJ Offline
    JB_Sullivan
    wrote on last edited by
    #89

    @gargano sagte in Forecast.solar mit dem Systeminfo Adapter:

    { let pos1 = time.indexOf(':00:00'); let pos2 = time.indexOf(':30:00'); if((pos1 != -1) || (pos2 != -1)) {

    Das scheint nicht zu gehen - er unterstreicht mir immer einen Klammerfehler in Zeile 90. Ich kann da aber nichts erkennen was falsch sein könnte.

    Genauso habe ich jetzt gesehen, das er bei

    var graphData = {"datalabel_rotation":-90,"datalabel_color":"lightgreen","datalabel_fontSize":10};

    Das graphData als Fehler? ~~~~ unterstreicht. Ausführen tut er es aber trotzdem.

    ioBroker (since 2018) auf Intel Core i3-5005U NUC und Windwos10 Pro

    GarganoG 1 Reply Last reply
    0
    • JB_SullivanJ JB_Sullivan

      @gargano sagte in Forecast.solar mit dem Systeminfo Adapter:

      { let pos1 = time.indexOf(':00:00'); let pos2 = time.indexOf(':30:00'); if((pos1 != -1) || (pos2 != -1)) {

      Das scheint nicht zu gehen - er unterstreicht mir immer einen Klammerfehler in Zeile 90. Ich kann da aber nichts erkennen was falsch sein könnte.

      Genauso habe ich jetzt gesehen, das er bei

      var graphData = {"datalabel_rotation":-90,"datalabel_color":"lightgreen","datalabel_fontSize":10};

      Das graphData als Fehler? ~~~~ unterstreicht. Ausführen tut er es aber trotzdem.

      GarganoG Offline
      GarganoG Offline
      Gargano
      wrote on last edited by
      #90

      @jb_sullivan Zeig nochmal den ganzen Code von

      function makeTable ()
      

      und

      function makeResponse
      
      JB_SullivanJ 1 Reply Last reply
      0
      • GarganoG Gargano

        @jb_sullivan Zeig nochmal den ganzen Code von

        function makeTable ()
        

        und

        function makeResponse
        
        JB_SullivanJ Offline
        JB_SullivanJ Offline
        JB_Sullivan
        wrote on last edited by
        #91

        @gargano

        const SolarJSON1        = "javascript.0.SolarForecast.JSON1";
        const SolarJSON2        = "javascript.0.SolarForecast.JSON2";
        const SolarJSONAll1        = "javascript.0.SolarForecast.JSONAll1";
        const SolarJSONAll2        = "javascript.0.SolarForecast.JSONAll2";
        const SolarJSONGraphAll1        = "javascript.0.SolarForecast.JSONGraphAll1";
        const SolarJSONGraphAll2        = "javascript.0.SolarForecast.JSONGraphAll2";
        const SolarJSONTable    = "javascript.0.SolarForecast.JSONTable";
        const SolarJSONGraph    = "javascript.0.SolarForecast.JSONGraph";
        
        const creatStateList = [
            {name :SolarJSON1, type:"string", role : "value"},
            {name :SolarJSON2, type:"string", role : "value"},
            {name :SolarJSONAll1, type:"string", role : "value"},
            {name :SolarJSONAll2, type:"string", role : "value"},
            {name :SolarJSONGraphAll1, type:"string", role : "value"},
            {name :SolarJSONGraphAll2, type:"string", role : "value"},
            {name :SolarJSONTable, type:"string", role : "value"},
            {name :SolarJSONGraph, type:"string", role : "value"}
        ]
        
        
        creatStateList.forEach (function(item) {
            createState(item.name, { 
                type: item.type,
                min: 0,
                def: 0,
                role: item.role
            });
        });
        
        var request = require('request');
        var options1 = {url: 'https://api.forecast.solar/estimate/xx.35/xx.24/40/90/7.26', method: 'GET', headers: { 'User-Agent': 'request' }};
        var options2 = {url: 'https://api.forecast.solar/estimate/xx.35/xx.24/40/-90/2.64', method: 'GET', headers: { 'User-Agent': 'request' }};
        
        
        var urls = [
          {myUrl:options1,mySolarJSON:SolarJSON1,mySolarJSONAll:SolarJSONAll1,mySolarJSONGraphAll:SolarJSONGraphAll1},
          {myUrl:options2,mySolarJSON:SolarJSON2,mySolarJSONAll:SolarJSONAll2,mySolarJSONGraphAll:SolarJSONGraphAll2}
        ]
        
        var promises = urls.map(myAsyncRequest);
        schedule('6 6-22 * * *', getSolar);
        
        getSolar();
        
        
        function myAsyncRequest(myUrl) {
          log('Request '+myUrl.myUrl.url);
          return new Promise((resolve, reject) => {
             request(myUrl.myUrl.url, function(error, response, body) {
                if (!error && response.statusCode == 200) {
                    let today = formatDate(new Date(), 'YYYY-MM-DD');
                    let watts = JSON.parse(body).result.watts;
                    setState(myUrl.mySolarJSONAll, JSON.stringify(watts), true);
                    let table = [];
                    for(let time in watts) {
                        let pos = time.indexOf(':00:00');
                        if(pos != -1) {
                            let entry = {};
                            entry.Uhrzeit = time;
                            entry.Leistung = watts[time];
                            table.push(entry);
                        }
                    }  
                    log ('JSON: '+myUrl.mySolarJSON);
                    setState(myUrl.mySolarJSON, JSON.stringify(table), true);
                // make GraphTable
        
                    let graphTimeData = [];
        
                    for(let time in watts) {
                            let graphEntry ={};
                            graphEntry.t = Date.parse(time);
                            graphEntry.y = watts[time];
                            graphTimeData.push(graphEntry);
                    } 
                    var graph = {};
                    var graphData ={};
                    var graphAllData = [];
                    graphData.data = graphTimeData;
                    graphAllData.push(graphData);
                    graph.graphs=graphAllData;
                    setState(myUrl.mySolarJSONGraphAll, JSON.stringify(graph), true);
        
                    resolve (body);
                }
            });  
          })
        }
        
        function makeTable () {
            log ('MakeTable');
            let watts1 = JSON.parse(getState(SolarJSON1).val);
            let watts2 = JSON.parse(getState(SolarJSON2).val); 
            log ('Items: '+watts1.length);
            let today = formatDate(new Date(), 'YYYY-MM-DD');
            let table = [];
            let graphTimeData = [];
        
            for(var n=0;n<watts1.length;n++) {
                    let entry = {};
                    let graphEntry ={};
                    let thisTime = watts1[n].Uhrzeit;
                    log (thisTime);
                    entry.Uhrzeit = watts1[n].Uhrzeit;
                    entry.Leistung1 = watts1[n].Leistung;
                    entry.Leistung2 = watts2[n].Leistung;
                    entry.Summe = watts1[n].Leistung + watts2[n].Leistung;
                    table.push(entry);
                    graphEntry.t = Date.parse(thisTime);
                    graphEntry.y = watts1[n].Leistung + watts2[n].Leistung;
                    graphTimeData.push(graphEntry);
            } 
        
            var graph = {};
            var graphData = {};
            var graphAllData = [];
            var graphData = {"datalabel_rotation":-90,"datalabel_color":"lightgreen","datalabel_fontSize":10};
            graphData.data = graphTimeData;
            graphAllData.push(graphData);
            graph.graphs=graphAllData;
            setState(SolarJSONTable, JSON.stringify(table), true);
            setState(SolarJSONGraph, JSON.stringify(graph), true);
        }
        
        function getSolar() {
          Promise.all(promises)
          .then(function(bodys) {
            console.log("All url loaded");
            makeTable();
          })
        }
        

        ioBroker (since 2018) auf Intel Core i3-5005U NUC und Windwos10 Pro

        GarganoG 1 Reply Last reply
        0
        • JB_SullivanJ JB_Sullivan

          @gargano

          const SolarJSON1        = "javascript.0.SolarForecast.JSON1";
          const SolarJSON2        = "javascript.0.SolarForecast.JSON2";
          const SolarJSONAll1        = "javascript.0.SolarForecast.JSONAll1";
          const SolarJSONAll2        = "javascript.0.SolarForecast.JSONAll2";
          const SolarJSONGraphAll1        = "javascript.0.SolarForecast.JSONGraphAll1";
          const SolarJSONGraphAll2        = "javascript.0.SolarForecast.JSONGraphAll2";
          const SolarJSONTable    = "javascript.0.SolarForecast.JSONTable";
          const SolarJSONGraph    = "javascript.0.SolarForecast.JSONGraph";
          
          const creatStateList = [
              {name :SolarJSON1, type:"string", role : "value"},
              {name :SolarJSON2, type:"string", role : "value"},
              {name :SolarJSONAll1, type:"string", role : "value"},
              {name :SolarJSONAll2, type:"string", role : "value"},
              {name :SolarJSONGraphAll1, type:"string", role : "value"},
              {name :SolarJSONGraphAll2, type:"string", role : "value"},
              {name :SolarJSONTable, type:"string", role : "value"},
              {name :SolarJSONGraph, type:"string", role : "value"}
          ]
          
          
          creatStateList.forEach (function(item) {
              createState(item.name, { 
                  type: item.type,
                  min: 0,
                  def: 0,
                  role: item.role
              });
          });
          
          var request = require('request');
          var options1 = {url: 'https://api.forecast.solar/estimate/xx.35/xx.24/40/90/7.26', method: 'GET', headers: { 'User-Agent': 'request' }};
          var options2 = {url: 'https://api.forecast.solar/estimate/xx.35/xx.24/40/-90/2.64', method: 'GET', headers: { 'User-Agent': 'request' }};
          
          
          var urls = [
            {myUrl:options1,mySolarJSON:SolarJSON1,mySolarJSONAll:SolarJSONAll1,mySolarJSONGraphAll:SolarJSONGraphAll1},
            {myUrl:options2,mySolarJSON:SolarJSON2,mySolarJSONAll:SolarJSONAll2,mySolarJSONGraphAll:SolarJSONGraphAll2}
          ]
          
          var promises = urls.map(myAsyncRequest);
          schedule('6 6-22 * * *', getSolar);
          
          getSolar();
          
          
          function myAsyncRequest(myUrl) {
            log('Request '+myUrl.myUrl.url);
            return new Promise((resolve, reject) => {
               request(myUrl.myUrl.url, function(error, response, body) {
                  if (!error && response.statusCode == 200) {
                      let today = formatDate(new Date(), 'YYYY-MM-DD');
                      let watts = JSON.parse(body).result.watts;
                      setState(myUrl.mySolarJSONAll, JSON.stringify(watts), true);
                      let table = [];
                      for(let time in watts) {
                          let pos = time.indexOf(':00:00');
                          if(pos != -1) {
                              let entry = {};
                              entry.Uhrzeit = time;
                              entry.Leistung = watts[time];
                              table.push(entry);
                          }
                      }  
                      log ('JSON: '+myUrl.mySolarJSON);
                      setState(myUrl.mySolarJSON, JSON.stringify(table), true);
                  // make GraphTable
          
                      let graphTimeData = [];
          
                      for(let time in watts) {
                              let graphEntry ={};
                              graphEntry.t = Date.parse(time);
                              graphEntry.y = watts[time];
                              graphTimeData.push(graphEntry);
                      } 
                      var graph = {};
                      var graphData ={};
                      var graphAllData = [];
                      graphData.data = graphTimeData;
                      graphAllData.push(graphData);
                      graph.graphs=graphAllData;
                      setState(myUrl.mySolarJSONGraphAll, JSON.stringify(graph), true);
          
                      resolve (body);
                  }
              });  
            })
          }
          
          function makeTable () {
              log ('MakeTable');
              let watts1 = JSON.parse(getState(SolarJSON1).val);
              let watts2 = JSON.parse(getState(SolarJSON2).val); 
              log ('Items: '+watts1.length);
              let today = formatDate(new Date(), 'YYYY-MM-DD');
              let table = [];
              let graphTimeData = [];
          
              for(var n=0;n<watts1.length;n++) {
                      let entry = {};
                      let graphEntry ={};
                      let thisTime = watts1[n].Uhrzeit;
                      log (thisTime);
                      entry.Uhrzeit = watts1[n].Uhrzeit;
                      entry.Leistung1 = watts1[n].Leistung;
                      entry.Leistung2 = watts2[n].Leistung;
                      entry.Summe = watts1[n].Leistung + watts2[n].Leistung;
                      table.push(entry);
                      graphEntry.t = Date.parse(thisTime);
                      graphEntry.y = watts1[n].Leistung + watts2[n].Leistung;
                      graphTimeData.push(graphEntry);
              } 
          
              var graph = {};
              var graphData = {};
              var graphAllData = [];
              var graphData = {"datalabel_rotation":-90,"datalabel_color":"lightgreen","datalabel_fontSize":10};
              graphData.data = graphTimeData;
              graphAllData.push(graphData);
              graph.graphs=graphAllData;
              setState(SolarJSONTable, JSON.stringify(table), true);
              setState(SolarJSONGraph, JSON.stringify(graph), true);
          }
          
          function getSolar() {
            Promise.all(promises)
            .then(function(bodys) {
              console.log("All url loaded");
              makeTable();
            })
          }
          
          GarganoG Offline
          GarganoG Offline
          Gargano
          wrote on last edited by Gargano
          #92

          @jb_sullivan Du hast zweimal graphData als Variable in
          function makeTable ()
          deklariert.
          Lösch mal die Zeile

          var graphData = {};
          
          JB_SullivanJ 2 Replies Last reply
          0
          • GarganoG Gargano

            @jb_sullivan Du hast zweimal graphData als Variable in
            function makeTable ()
            deklariert.
            Lösch mal die Zeile

            var graphData = {};
            
            JB_SullivanJ Offline
            JB_SullivanJ Offline
            JB_Sullivan
            wrote on last edited by
            #93

            @gargano Achso - mache ich schnell wieder rein - moment

            ioBroker (since 2018) auf Intel Core i3-5005U NUC und Windwos10 Pro

            1 Reply Last reply
            0
            • GarganoG Gargano

              @jb_sullivan Du hast zweimal graphData als Variable in
              function makeTable ()
              deklariert.
              Lösch mal die Zeile

              var graphData = {};
              
              JB_SullivanJ Offline
              JB_SullivanJ Offline
              JB_Sullivan
              wrote on last edited by JB_Sullivan
              #94

              @gargano sagte in Forecast.solar mit dem Systeminfo Adapter:

              Lösch mal die Zeile
              var graphData = {};

              OK, damit ist der Fehler aus Zeile 121 weg - ein fehler in Zeile 90 bleibt noch. Liegt bestimmt auch an meinen Drag & Drop "Künsten" ;)

              Im übrigen gibt es keine "makeResponse" - das hat mich sowieso gewundert.

              const SolarJSON1        = "javascript.0.SolarForecast.JSON1";
              const SolarJSON2        = "javascript.0.SolarForecast.JSON2";
              const SolarJSONAll1        = "javascript.0.SolarForecast.JSONAll1";
              const SolarJSONAll2        = "javascript.0.SolarForecast.JSONAll2";
              const SolarJSONGraphAll1        = "javascript.0.SolarForecast.JSONGraphAll1";
              const SolarJSONGraphAll2        = "javascript.0.SolarForecast.JSONGraphAll2";
              const SolarJSONTable    = "javascript.0.SolarForecast.JSONTable";
              const SolarJSONGraph    = "javascript.0.SolarForecast.JSONGraph";
              
              const creatStateList = [
                  {name :SolarJSON1, type:"string", role : "value"},
                  {name :SolarJSON2, type:"string", role : "value"},
                  {name :SolarJSONAll1, type:"string", role : "value"},
                  {name :SolarJSONAll2, type:"string", role : "value"},
                  {name :SolarJSONGraphAll1, type:"string", role : "value"},
                  {name :SolarJSONGraphAll2, type:"string", role : "value"},
                  {name :SolarJSONTable, type:"string", role : "value"},
                  {name :SolarJSONGraph, type:"string", role : "value"}
              ]
              
              
              creatStateList.forEach (function(item) {
                  createState(item.name, { 
                      type: item.type,
                      min: 0,
                      def: 0,
                      role: item.role
                  });
              });
              
              var request = require('request');
              var options1 = {url: 'https://api.forecast.solar/estimate/xx.35/xx.24/40/90/7.26', method: 'GET', headers: { 'User-Agent': 'request' }};
              var options2 = {url: 'https://api.forecast.solar/estimate/xx.35/xx.24/40/-90/2.64', method: 'GET', headers: { 'User-Agent': 'request' }};
              
              
              var urls = [
                {myUrl:options1,mySolarJSON:SolarJSON1,mySolarJSONAll:SolarJSONAll1,mySolarJSONGraphAll:SolarJSONGraphAll1},
                {myUrl:options2,mySolarJSON:SolarJSON2,mySolarJSONAll:SolarJSONAll2,mySolarJSONGraphAll:SolarJSONGraphAll2}
              ]
              
              var promises = urls.map(myAsyncRequest);
              schedule('6 6-22 * * *', getSolar);
              
              getSolar();
              
              
              function myAsyncRequest(myUrl) {
                log('Request '+myUrl.myUrl.url);
                return new Promise((resolve, reject) => {
                   request(myUrl.myUrl.url, function(error, response, body) {
                      if (!error && response.statusCode == 200) {
                          let today = formatDate(new Date(), 'YYYY-MM-DD');
                          let watts = JSON.parse(body).result.watts;
                          setState(myUrl.mySolarJSONAll, JSON.stringify(watts), true);
                          let table = [];
                          for(let time in watts) {
                              let pos = time.indexOf(':00:00');
                              if(pos != -1) {
                                  let entry = {};
                                  entry.Uhrzeit = time;
                                  entry.Leistung = watts[time];
                                  table.push(entry);
                              }
                          }  
                          log ('JSON: '+myUrl.mySolarJSON);
                          setState(myUrl.mySolarJSON, JSON.stringify(table), true);
                      // make GraphTable
              
                          let graphTimeData = [];
              
                              for(let time in watts) {
                                  let pos1 = time.indexOf(':00:00');
                                  let pos2 = time.indexOf(':30:00');
                                  if((pos1 != -1) || (pos2 != -1)) {
                                  let graphEntry ={};
                                  graphEntry.t = Date.parse(time);
                                  graphEntry.y = watts[time];
                                  graphTimeData.push(graphEntry);
                          } 
                          var graph = {};
                          var graphData ={};
                          var graphAllData = [];
                          graphData.data = graphTimeData;
                          graphAllData.push(graphData);
                          graph.graphs=graphAllData;
                          setState(myUrl.mySolarJSONGraphAll, JSON.stringify(graph), true);
              
                          resolve (body);
                      }
                  });  
                })
              }
              
              function makeTable () {
                  log ('MakeTable');
                  let watts1 = JSON.parse(getState(SolarJSON1).val);
                  let watts2 = JSON.parse(getState(SolarJSON2).val); 
                  log ('Items: '+watts1.length);
                  let today = formatDate(new Date(), 'YYYY-MM-DD');
                  let table = [];
                  let graphTimeData = [];
              
                  for(var n=0;n<watts1.length;n++) {
                          let entry = {};
                          let graphEntry ={};
                          let thisTime = watts1[n].Uhrzeit;
                          log (thisTime);
                          entry.Uhrzeit = watts1[n].Uhrzeit;
                          entry.Leistung1 = watts1[n].Leistung;
                          entry.Leistung2 = watts2[n].Leistung;
                          entry.Summe = watts1[n].Leistung + watts2[n].Leistung;
                          table.push(entry);
                          graphEntry.t = Date.parse(thisTime);
                          graphEntry.y = watts1[n].Leistung + watts2[n].Leistung;
                          graphTimeData.push(graphEntry);
                  } 
              
                  var graph = {};
                  var graphAllData = [];
                  var graphData = {"datalabel_rotation":-90,"datalabel_color":"lightgreen","datalabel_fontSize":10};
                  graphData.data = graphTimeData;
                  graphAllData.push(graphData);
                  graph.graphs=graphAllData;
                  setState(SolarJSONTable, JSON.stringify(table), true);
                  setState(SolarJSONGraph, JSON.stringify(graph), true);
              }
              
              function getSolar() {
                Promise.all(promises)
                .then(function(bodys) {
                  console.log("All url loaded");
                  makeTable();
                })
              }
              

              ioBroker (since 2018) auf Intel Core i3-5005U NUC und Windwos10 Pro

              GarganoG 1 Reply Last reply
              0
              • JB_SullivanJ JB_Sullivan

                @gargano sagte in Forecast.solar mit dem Systeminfo Adapter:

                Lösch mal die Zeile
                var graphData = {};

                OK, damit ist der Fehler aus Zeile 121 weg - ein fehler in Zeile 90 bleibt noch. Liegt bestimmt auch an meinen Drag & Drop "Künsten" ;)

                Im übrigen gibt es keine "makeResponse" - das hat mich sowieso gewundert.

                const SolarJSON1        = "javascript.0.SolarForecast.JSON1";
                const SolarJSON2        = "javascript.0.SolarForecast.JSON2";
                const SolarJSONAll1        = "javascript.0.SolarForecast.JSONAll1";
                const SolarJSONAll2        = "javascript.0.SolarForecast.JSONAll2";
                const SolarJSONGraphAll1        = "javascript.0.SolarForecast.JSONGraphAll1";
                const SolarJSONGraphAll2        = "javascript.0.SolarForecast.JSONGraphAll2";
                const SolarJSONTable    = "javascript.0.SolarForecast.JSONTable";
                const SolarJSONGraph    = "javascript.0.SolarForecast.JSONGraph";
                
                const creatStateList = [
                    {name :SolarJSON1, type:"string", role : "value"},
                    {name :SolarJSON2, type:"string", role : "value"},
                    {name :SolarJSONAll1, type:"string", role : "value"},
                    {name :SolarJSONAll2, type:"string", role : "value"},
                    {name :SolarJSONGraphAll1, type:"string", role : "value"},
                    {name :SolarJSONGraphAll2, type:"string", role : "value"},
                    {name :SolarJSONTable, type:"string", role : "value"},
                    {name :SolarJSONGraph, type:"string", role : "value"}
                ]
                
                
                creatStateList.forEach (function(item) {
                    createState(item.name, { 
                        type: item.type,
                        min: 0,
                        def: 0,
                        role: item.role
                    });
                });
                
                var request = require('request');
                var options1 = {url: 'https://api.forecast.solar/estimate/xx.35/xx.24/40/90/7.26', method: 'GET', headers: { 'User-Agent': 'request' }};
                var options2 = {url: 'https://api.forecast.solar/estimate/xx.35/xx.24/40/-90/2.64', method: 'GET', headers: { 'User-Agent': 'request' }};
                
                
                var urls = [
                  {myUrl:options1,mySolarJSON:SolarJSON1,mySolarJSONAll:SolarJSONAll1,mySolarJSONGraphAll:SolarJSONGraphAll1},
                  {myUrl:options2,mySolarJSON:SolarJSON2,mySolarJSONAll:SolarJSONAll2,mySolarJSONGraphAll:SolarJSONGraphAll2}
                ]
                
                var promises = urls.map(myAsyncRequest);
                schedule('6 6-22 * * *', getSolar);
                
                getSolar();
                
                
                function myAsyncRequest(myUrl) {
                  log('Request '+myUrl.myUrl.url);
                  return new Promise((resolve, reject) => {
                     request(myUrl.myUrl.url, function(error, response, body) {
                        if (!error && response.statusCode == 200) {
                            let today = formatDate(new Date(), 'YYYY-MM-DD');
                            let watts = JSON.parse(body).result.watts;
                            setState(myUrl.mySolarJSONAll, JSON.stringify(watts), true);
                            let table = [];
                            for(let time in watts) {
                                let pos = time.indexOf(':00:00');
                                if(pos != -1) {
                                    let entry = {};
                                    entry.Uhrzeit = time;
                                    entry.Leistung = watts[time];
                                    table.push(entry);
                                }
                            }  
                            log ('JSON: '+myUrl.mySolarJSON);
                            setState(myUrl.mySolarJSON, JSON.stringify(table), true);
                        // make GraphTable
                
                            let graphTimeData = [];
                
                                for(let time in watts) {
                                    let pos1 = time.indexOf(':00:00');
                                    let pos2 = time.indexOf(':30:00');
                                    if((pos1 != -1) || (pos2 != -1)) {
                                    let graphEntry ={};
                                    graphEntry.t = Date.parse(time);
                                    graphEntry.y = watts[time];
                                    graphTimeData.push(graphEntry);
                            } 
                            var graph = {};
                            var graphData ={};
                            var graphAllData = [];
                            graphData.data = graphTimeData;
                            graphAllData.push(graphData);
                            graph.graphs=graphAllData;
                            setState(myUrl.mySolarJSONGraphAll, JSON.stringify(graph), true);
                
                            resolve (body);
                        }
                    });  
                  })
                }
                
                function makeTable () {
                    log ('MakeTable');
                    let watts1 = JSON.parse(getState(SolarJSON1).val);
                    let watts2 = JSON.parse(getState(SolarJSON2).val); 
                    log ('Items: '+watts1.length);
                    let today = formatDate(new Date(), 'YYYY-MM-DD');
                    let table = [];
                    let graphTimeData = [];
                
                    for(var n=0;n<watts1.length;n++) {
                            let entry = {};
                            let graphEntry ={};
                            let thisTime = watts1[n].Uhrzeit;
                            log (thisTime);
                            entry.Uhrzeit = watts1[n].Uhrzeit;
                            entry.Leistung1 = watts1[n].Leistung;
                            entry.Leistung2 = watts2[n].Leistung;
                            entry.Summe = watts1[n].Leistung + watts2[n].Leistung;
                            table.push(entry);
                            graphEntry.t = Date.parse(thisTime);
                            graphEntry.y = watts1[n].Leistung + watts2[n].Leistung;
                            graphTimeData.push(graphEntry);
                    } 
                
                    var graph = {};
                    var graphAllData = [];
                    var graphData = {"datalabel_rotation":-90,"datalabel_color":"lightgreen","datalabel_fontSize":10};
                    graphData.data = graphTimeData;
                    graphAllData.push(graphData);
                    graph.graphs=graphAllData;
                    setState(SolarJSONTable, JSON.stringify(table), true);
                    setState(SolarJSONGraph, JSON.stringify(graph), true);
                }
                
                function getSolar() {
                  Promise.all(promises)
                  .then(function(bodys) {
                    console.log("All url loaded");
                    makeTable();
                  })
                }
                
                GarganoG Offline
                GarganoG Offline
                Gargano
                wrote on last edited by
                #95

                @jb_sullivan Da fehlt noch eine Klammer:

                                for(let time in watts) {
                                    let pos1 = time.indexOf(':00:00');
                                    let pos2 = time.indexOf(':30:00');
                                    if((pos1 != -1) || (pos2 != -1)) {
                                        let graphEntry ={};
                                        graphEntry.t = Date.parse(time);
                                        graphEntry.y = watts[time];
                                        graphTimeData.push(graphEntry);
                                    }  // -< die fehlt
                            } 
                
                JB_SullivanJ 1 Reply Last reply
                0
                • GarganoG Gargano

                  @jb_sullivan Da fehlt noch eine Klammer:

                                  for(let time in watts) {
                                      let pos1 = time.indexOf(':00:00');
                                      let pos2 = time.indexOf(':30:00');
                                      if((pos1 != -1) || (pos2 != -1)) {
                                          let graphEntry ={};
                                          graphEntry.t = Date.parse(time);
                                          graphEntry.y = watts[time];
                                          graphTimeData.push(graphEntry);
                                      }  // -< die fehlt
                              } 
                  
                  JB_SullivanJ Offline
                  JB_SullivanJ Offline
                  JB_Sullivan
                  wrote on last edited by JB_Sullivan
                  #96

                  @gargano Jupp - Fehler ist weg und in den Einzelgraphen wird auch die :30 gesetzt. Allerdings fehlt dieser Zeitraum dann in den Additiations Tabellen.

                  jsonGraph & jsonTable

                  ioBroker (since 2018) auf Intel Core i3-5005U NUC und Windwos10 Pro

                  GarganoG 1 Reply Last reply
                  0
                  • JB_SullivanJ JB_Sullivan

                    @gargano Jupp - Fehler ist weg und in den Einzelgraphen wird auch die :30 gesetzt. Allerdings fehlt dieser Zeitraum dann in den Additiations Tabellen.

                    jsonGraph & jsonTable

                    GarganoG Offline
                    GarganoG Offline
                    Gargano
                    wrote on last edited by Gargano
                    #97

                    @jb_sullivan Weiter oben Zeile 57 mußt Du noch das Gleiche machen

                                    let pos = time.indexOf(':00:00');
                                    if(pos != -1) {
                    

                    ändern in

                                    let pos1 = time.indexOf(':00:00');
                                     let pos2 = time.indexOf(':30:00');
                                    if((pos1 != -1) || (pos2 != -1)){
                    

                    Bei den Einzelgraphen brauchst Du eigentlich keine Abfrage der Zeit, da diese nur für die Synchronisation der Summenbildung benötigt wird. Zeile 72..74 kann entfallen, nicht vergessen wieder die Klammer unten zu entfernen.

                    JB_SullivanJ 1 Reply Last reply
                    0
                    • GarganoG Gargano

                      @jb_sullivan Weiter oben Zeile 57 mußt Du noch das Gleiche machen

                                      let pos = time.indexOf(':00:00');
                                      if(pos != -1) {
                      

                      ändern in

                                      let pos1 = time.indexOf(':00:00');
                                       let pos2 = time.indexOf(':30:00');
                                      if((pos1 != -1) || (pos2 != -1)){
                      

                      Bei den Einzelgraphen brauchst Du eigentlich keine Abfrage der Zeit, da diese nur für die Synchronisation der Summenbildung benötigt wird. Zeile 72..74 kann entfallen, nicht vergessen wieder die Klammer unten zu entfernen.

                      JB_SullivanJ Offline
                      JB_SullivanJ Offline
                      JB_Sullivan
                      wrote on last edited by
                      #98

                      @gargano

                      Auch das funktioniert jetzt 👍 - das wird ja immer perfekter ;)

                      Jetzt stellt sich mir nur noch eine Frage - in den Nachstunden wird es ja nachweislich nie zu PV Produktion kommen. Im Diagramm belegen diese Zeiten aber unnötigen Leerraum, was wiederum verhindert, das die Balken breiter und somit die Texte übersichtlicher daher kommen können.

                      Kann man den ganzen Zeitbereich der Darstellung (Ausgabe) evtl. noch irgendwie eingrenzen, sodaß die Tage nur von 6:00 - 21:30 dargestellt werden?

                      c5f14b8b-02b2-428b-9476-2d357c07809e-image.png

                      ioBroker (since 2018) auf Intel Core i3-5005U NUC und Windwos10 Pro

                      GarganoG 1 Reply Last reply
                      0
                      • JB_SullivanJ JB_Sullivan

                        @gargano

                        Auch das funktioniert jetzt 👍 - das wird ja immer perfekter ;)

                        Jetzt stellt sich mir nur noch eine Frage - in den Nachstunden wird es ja nachweislich nie zu PV Produktion kommen. Im Diagramm belegen diese Zeiten aber unnötigen Leerraum, was wiederum verhindert, das die Balken breiter und somit die Texte übersichtlicher daher kommen können.

                        Kann man den ganzen Zeitbereich der Darstellung (Ausgabe) evtl. noch irgendwie eingrenzen, sodaß die Tage nur von 6:00 - 21:30 dargestellt werden?

                        c5f14b8b-02b2-428b-9476-2d357c07809e-image.png

                        GarganoG Offline
                        GarganoG Offline
                        Gargano
                        wrote on last edited by Gargano
                        #99

                        @jb_sullivan Antwort vom Scrounger :
                        Das ist leider so, die zeitachse wird immer optimal für den Zeitraum (start / ende) erstellt.

                        Geht nur mit eigenem Ertsellen der x -Achse Labels :

                        function makeTable () {
                            log ('MakeTable');
                            let watts1 = JSON.parse(getState(SolarJSON1).val);
                            let watts2 = JSON.parse(getState(SolarJSON2).val); 
                            log ('Items: '+watts1.length);
                            let today = formatDate(new Date(), 'YYYY-MM-DD');
                            let table = [];
                            let graphTimeData = [];
                           let axisLabels = [];
                        
                            for(var n=0;n<watts1.length;n++) {
                           /*         let entry = {};
                                    let graphEntry ={};
                                    let thisTime = watts1[n].Uhrzeit;
                                    log (thisTime);
                                    entry.Uhrzeit = watts1[n].Uhrzeit;
                                    entry.Leistung1 = watts1[n].Leistung;
                                    entry.Leistung2 = watts2[n].Leistung;
                                    entry.Summe = watts1[n].Leistung + watts2[n].Leistung;
                        
                                    table.push(entry);
                                    graphEntry.t = Date.parse(thisTime);
                                    graphEntry.y = watts1[n].Leistung + watts2[n].Leistung;
                        
                                    graphTimeData.push(graphEntry);
                        */
                                   graphTimeData.push( watts1[n].Leistung + watts2[n].Leistung);
                                  let time = watts1[n].Uhrzeit.substr(11, 12);
                                  axisLabels.push(time);
                                  
                        
                            var graph = {};
                            var graphData = {};
                            var graphAllData = [];
                            var graphData = {"datalabel_rotation":-90,"datalabel_color":"lightgreen","datalabel_fontSize":10};
                        
                            graphData.data = graphTimeData;
                            graphAllData.push(graphData);
                            graph.graphs=graphAllData;
                            graph.axisLabels =  axisLabels;
                            setState(SolarJSONTable, JSON.stringify(table), true);
                            setState(SolarJSONGraph, JSON.stringify(graph), true);
                        }
                        
                        
                        JB_SullivanJ 1 Reply Last reply
                        0
                        • GarganoG Gargano

                          @jb_sullivan Antwort vom Scrounger :
                          Das ist leider so, die zeitachse wird immer optimal für den Zeitraum (start / ende) erstellt.

                          Geht nur mit eigenem Ertsellen der x -Achse Labels :

                          function makeTable () {
                              log ('MakeTable');
                              let watts1 = JSON.parse(getState(SolarJSON1).val);
                              let watts2 = JSON.parse(getState(SolarJSON2).val); 
                              log ('Items: '+watts1.length);
                              let today = formatDate(new Date(), 'YYYY-MM-DD');
                              let table = [];
                              let graphTimeData = [];
                             let axisLabels = [];
                          
                              for(var n=0;n<watts1.length;n++) {
                             /*         let entry = {};
                                      let graphEntry ={};
                                      let thisTime = watts1[n].Uhrzeit;
                                      log (thisTime);
                                      entry.Uhrzeit = watts1[n].Uhrzeit;
                                      entry.Leistung1 = watts1[n].Leistung;
                                      entry.Leistung2 = watts2[n].Leistung;
                                      entry.Summe = watts1[n].Leistung + watts2[n].Leistung;
                          
                                      table.push(entry);
                                      graphEntry.t = Date.parse(thisTime);
                                      graphEntry.y = watts1[n].Leistung + watts2[n].Leistung;
                          
                                      graphTimeData.push(graphEntry);
                          */
                                     graphTimeData.push( watts1[n].Leistung + watts2[n].Leistung);
                                    let time = watts1[n].Uhrzeit.substr(11, 12);
                                    axisLabels.push(time);
                                    
                          
                              var graph = {};
                              var graphData = {};
                              var graphAllData = [];
                              var graphData = {"datalabel_rotation":-90,"datalabel_color":"lightgreen","datalabel_fontSize":10};
                          
                              graphData.data = graphTimeData;
                              graphAllData.push(graphData);
                              graph.graphs=graphAllData;
                              graph.axisLabels =  axisLabels;
                              setState(SolarJSONTable, JSON.stringify(table), true);
                              setState(SolarJSONGraph, JSON.stringify(graph), true);
                          }
                          
                          
                          JB_SullivanJ Offline
                          JB_SullivanJ Offline
                          JB_Sullivan
                          wrote on last edited by
                          #100

                          @gargano

                          Kannst du nochmal den ganzen Code posten? Wenn ich diesen Code Schnippsel oben einfüge, wird mir an diversen Stellen wieder etwas als falsch unterstrichen ( Zeile 42,44,131,147)

                          ioBroker (since 2018) auf Intel Core i3-5005U NUC und Windwos10 Pro

                          1 Reply Last reply
                          0
                          • GarganoG Offline
                            GarganoG Offline
                            Gargano
                            wrote on last edited by Gargano
                            #101

                            @jb_sullivan

                            const SolarJSON1        = "javascript.0.SolarForecast.JSON1";
                            const SolarJSON2        = "javascript.0.SolarForecast.JSON2";
                            const SolarJSONAll1        = "javascript.0.SolarForecast.JSONAll1";
                            const SolarJSONAll2        = "javascript.0.SolarForecast.JSONAll2";
                            const SolarJSONGraphAll1        = "javascript.0.SolarForecast.JSONGraphAll1";
                            const SolarJSONGraphAll2        = "javascript.0.SolarForecast.JSONGraphAll2";
                            const SolarJSONTable    = "javascript.0.SolarForecast.JSONTable";
                            const SolarJSONGraph    = "javascript.0.SolarForecast.JSONGraph";
                             
                            const creatStateList = [
                                {name :SolarJSON1, type:"string", role : "value"},
                                {name :SolarJSON2, type:"string", role : "value"},
                                {name :SolarJSONAll1, type:"string", role : "value"},
                                {name :SolarJSONAll2, type:"string", role : "value"},
                                {name :SolarJSONGraphAll1, type:"string", role : "value"},
                                {name :SolarJSONGraphAll2, type:"string", role : "value"},
                                {name :SolarJSONTable, type:"string", role : "value"},
                                {name :SolarJSONGraph, type:"string", role : "value"}
                            ]
                             
                             
                            creatStateList.forEach (function(item) {
                                createState(item.name, { 
                                    type: item.type,
                                    min: 0,
                                    def: 0,
                                    role: item.role
                                });
                            });
                             
                            var request = require('request');
                            var options1 = {url: 'https://api.forecast.solar/estimate/xx.35/xx.24/40/90/7.26', method: 'GET', headers: { 'User-Agent': 'request' }};
                            var options2 = {url: 'https://api.forecast.solar/estimate/xx.35/xx.24/40/-90/2.64', method: 'GET', headers: { 'User-Agent': 'request' }};
                             
                             
                            var urls = [
                              {myUrl:options1,mySolarJSON:SolarJSON1,mySolarJSONAll:SolarJSONAll1,mySolarJSONGraphAll:SolarJSONGraphAll1},
                              {myUrl:options2,mySolarJSON:SolarJSON2,mySolarJSONAll:SolarJSONAll2,mySolarJSONGraphAll:SolarJSONGraphAll2}
                            ]
                             
                            var promises = urls.map(myAsyncRequest);
                            schedule('6 6-22 * * *', getSolar);
                             
                            getSolar();
                             
                             
                            function myAsyncRequest(myUrl) {
                              log('Request '+myUrl.myUrl.url);
                              return new Promise((resolve, reject) => {
                                 request(myUrl.myUrl.url, function(error, response, body) {
                                    if (!error && response.statusCode == 200) {
                                        let today = formatDate(new Date(), 'YYYY-MM-DD');
                                        let watts = JSON.parse(body).result.watts;
                                        setState(myUrl.mySolarJSONAll, JSON.stringify(watts), true);
                                        let table = [];
                                        for(let time in watts) {
                                                        let pos1 = time.indexOf(':00:00');
                                                        let pos2 = time.indexOf(':30:00');
                                                        if((pos1 != -1) || (pos2 != -1)) {
                                                            let entry = {};
                                                            entry.Uhrzeit = time;
                                                            entry.Leistung = watts[time];
                                                            table.push(entry);
                                                        }
                                                    }  
                                        log ('JSON: '+myUrl.mySolarJSON);
                                        setState(myUrl.mySolarJSON, JSON.stringify(table), true);
                                    // make GraphTable
                             
                                        let graphTimeData = [];
                             
                                            for(let time in watts) {
                                                let graphEntry ={};
                                                graphEntry.t = Date.parse(time);
                                                graphEntry.y = watts[time];
                                                graphTimeData.push(graphEntry);
                                        } 
                                        var graph = {};
                                        var graphData ={};
                                        var graphAllData = [];
                                        graphData.data = graphTimeData;
                                        graphAllData.push(graphData);
                                        graph.graphs=graphAllData;
                                        setState(myUrl.mySolarJSONGraphAll, JSON.stringify(graph), true);
                             
                                        resolve (body);
                                    }
                                });  
                              })
                            }
                             
                            function makeTable () {
                                log ('MakeTable');
                                let watts1 = JSON.parse(getState(SolarJSON1).val);
                                let watts2 = JSON.parse(getState(SolarJSON2).val); 
                                log ('Items: '+watts1.length);
                                let today = formatDate(new Date(), 'YYYY-MM-DD');
                                let table = [];
                                let graphTimeData = [];
                            	let axisLabels = [];
                            	
                                for(var n=0;n<watts1.length;n++) {
                                        let entry = {};
                                        let graphEntry ={};
                                        let thisTime = watts1[n].Uhrzeit;
                                        log (thisTime);
                                        entry.Uhrzeit = watts1[n].Uhrzeit;
                                        entry.Leistung1 = watts1[n].Leistung;
                                        entry.Leistung2 = watts2[n].Leistung;
                                        entry.Summe = watts1[n].Leistung + watts2[n].Leistung;
                                        table.push(entry);
                            //            graphEntry.t = Date.parse(thisTime);
                            //            graphEntry.y = watts1[n].Leistung + watts2[n].Leistung;
                            //            graphTimeData.push(graphEntry);
                            			
                            			graphTimeData.push(watts1[n].Leistung + watts2[n].Leistung);
                                        let time = watts1[n].Uhrzeit.substr(11, 5);
                                        axisLabels.push(time);		
                                } 
                             
                                var graph = {};
                                var graphAllData = [];
                                var graphData = {"datalabel_rotation":-90,"datalabel_color":"lightgreen","datalabel_fontSize":10};
                                graphData.data = graphTimeData;
                                graphAllData.push(graphData);
                                graph.graphs=graphAllData;
                            	graph.axisLabels =  axisLabels;
                                setState(SolarJSONTable, JSON.stringify(table), true);
                                setState(SolarJSONGraph, JSON.stringify(graph), true);
                            }
                             
                            function getSolar() {
                              Promise.all(promises)
                              .then(function(bodys) {
                                console.log("All url loaded");
                                makeTable();
                              })
                            }
                            
                            
                            JB_SullivanJ 1 Reply Last reply
                            0
                            • GarganoG Gargano

                              @jb_sullivan

                              const SolarJSON1        = "javascript.0.SolarForecast.JSON1";
                              const SolarJSON2        = "javascript.0.SolarForecast.JSON2";
                              const SolarJSONAll1        = "javascript.0.SolarForecast.JSONAll1";
                              const SolarJSONAll2        = "javascript.0.SolarForecast.JSONAll2";
                              const SolarJSONGraphAll1        = "javascript.0.SolarForecast.JSONGraphAll1";
                              const SolarJSONGraphAll2        = "javascript.0.SolarForecast.JSONGraphAll2";
                              const SolarJSONTable    = "javascript.0.SolarForecast.JSONTable";
                              const SolarJSONGraph    = "javascript.0.SolarForecast.JSONGraph";
                               
                              const creatStateList = [
                                  {name :SolarJSON1, type:"string", role : "value"},
                                  {name :SolarJSON2, type:"string", role : "value"},
                                  {name :SolarJSONAll1, type:"string", role : "value"},
                                  {name :SolarJSONAll2, type:"string", role : "value"},
                                  {name :SolarJSONGraphAll1, type:"string", role : "value"},
                                  {name :SolarJSONGraphAll2, type:"string", role : "value"},
                                  {name :SolarJSONTable, type:"string", role : "value"},
                                  {name :SolarJSONGraph, type:"string", role : "value"}
                              ]
                               
                               
                              creatStateList.forEach (function(item) {
                                  createState(item.name, { 
                                      type: item.type,
                                      min: 0,
                                      def: 0,
                                      role: item.role
                                  });
                              });
                               
                              var request = require('request');
                              var options1 = {url: 'https://api.forecast.solar/estimate/xx.35/xx.24/40/90/7.26', method: 'GET', headers: { 'User-Agent': 'request' }};
                              var options2 = {url: 'https://api.forecast.solar/estimate/xx.35/xx.24/40/-90/2.64', method: 'GET', headers: { 'User-Agent': 'request' }};
                               
                               
                              var urls = [
                                {myUrl:options1,mySolarJSON:SolarJSON1,mySolarJSONAll:SolarJSONAll1,mySolarJSONGraphAll:SolarJSONGraphAll1},
                                {myUrl:options2,mySolarJSON:SolarJSON2,mySolarJSONAll:SolarJSONAll2,mySolarJSONGraphAll:SolarJSONGraphAll2}
                              ]
                               
                              var promises = urls.map(myAsyncRequest);
                              schedule('6 6-22 * * *', getSolar);
                               
                              getSolar();
                               
                               
                              function myAsyncRequest(myUrl) {
                                log('Request '+myUrl.myUrl.url);
                                return new Promise((resolve, reject) => {
                                   request(myUrl.myUrl.url, function(error, response, body) {
                                      if (!error && response.statusCode == 200) {
                                          let today = formatDate(new Date(), 'YYYY-MM-DD');
                                          let watts = JSON.parse(body).result.watts;
                                          setState(myUrl.mySolarJSONAll, JSON.stringify(watts), true);
                                          let table = [];
                                          for(let time in watts) {
                                                          let pos1 = time.indexOf(':00:00');
                                                          let pos2 = time.indexOf(':30:00');
                                                          if((pos1 != -1) || (pos2 != -1)) {
                                                              let entry = {};
                                                              entry.Uhrzeit = time;
                                                              entry.Leistung = watts[time];
                                                              table.push(entry);
                                                          }
                                                      }  
                                          log ('JSON: '+myUrl.mySolarJSON);
                                          setState(myUrl.mySolarJSON, JSON.stringify(table), true);
                                      // make GraphTable
                               
                                          let graphTimeData = [];
                               
                                              for(let time in watts) {
                                                  let graphEntry ={};
                                                  graphEntry.t = Date.parse(time);
                                                  graphEntry.y = watts[time];
                                                  graphTimeData.push(graphEntry);
                                          } 
                                          var graph = {};
                                          var graphData ={};
                                          var graphAllData = [];
                                          graphData.data = graphTimeData;
                                          graphAllData.push(graphData);
                                          graph.graphs=graphAllData;
                                          setState(myUrl.mySolarJSONGraphAll, JSON.stringify(graph), true);
                               
                                          resolve (body);
                                      }
                                  });  
                                })
                              }
                               
                              function makeTable () {
                                  log ('MakeTable');
                                  let watts1 = JSON.parse(getState(SolarJSON1).val);
                                  let watts2 = JSON.parse(getState(SolarJSON2).val); 
                                  log ('Items: '+watts1.length);
                                  let today = formatDate(new Date(), 'YYYY-MM-DD');
                                  let table = [];
                                  let graphTimeData = [];
                              	let axisLabels = [];
                              	
                                  for(var n=0;n<watts1.length;n++) {
                                          let entry = {};
                                          let graphEntry ={};
                                          let thisTime = watts1[n].Uhrzeit;
                                          log (thisTime);
                                          entry.Uhrzeit = watts1[n].Uhrzeit;
                                          entry.Leistung1 = watts1[n].Leistung;
                                          entry.Leistung2 = watts2[n].Leistung;
                                          entry.Summe = watts1[n].Leistung + watts2[n].Leistung;
                                          table.push(entry);
                              //            graphEntry.t = Date.parse(thisTime);
                              //            graphEntry.y = watts1[n].Leistung + watts2[n].Leistung;
                              //            graphTimeData.push(graphEntry);
                              			
                              			graphTimeData.push(watts1[n].Leistung + watts2[n].Leistung);
                                          let time = watts1[n].Uhrzeit.substr(11, 5);
                                          axisLabels.push(time);		
                                  } 
                               
                                  var graph = {};
                                  var graphAllData = [];
                                  var graphData = {"datalabel_rotation":-90,"datalabel_color":"lightgreen","datalabel_fontSize":10};
                                  graphData.data = graphTimeData;
                                  graphAllData.push(graphData);
                                  graph.graphs=graphAllData;
                              	graph.axisLabels =  axisLabels;
                                  setState(SolarJSONTable, JSON.stringify(table), true);
                                  setState(SolarJSONGraph, JSON.stringify(graph), true);
                              }
                               
                              function getSolar() {
                                Promise.all(promises)
                                .then(function(bodys) {
                                  console.log("All url loaded");
                                  makeTable();
                                })
                              }
                              
                              
                              JB_SullivanJ Offline
                              JB_SullivanJ Offline
                              JB_Sullivan
                              wrote on last edited by
                              #102

                              @gargano

                              Welche Version hat dein js-engine? Ich habe 5.0.12.

                              Mit dem Code wird mir Zeile 113 (watts3) unterstrichen, das dass falsch sein soll

                              javascript.0	2021-03-09 12:52:04.412	error	(3804) at process._tickCallback (internal/process/next_tick.js:68:7)
                              javascript.0	2021-03-09 12:52:04.411	error	(3804) at script.js.Solar.SolarForcast:133:5
                              javascript.0	2021-03-09 12:52:04.411	error	(3804) at makeTable (script.js.Solar.SolarForcast:113:65)
                              javascript.0	2021-03-09 12:52:04.408	error	(3804) script.js.Solar.SolarForcast: ReferenceError: watts3 is not defined
                              

                              ioBroker (since 2018) auf Intel Core i3-5005U NUC und Windwos10 Pro

                              GarganoG 1 Reply Last reply
                              0
                              • JB_SullivanJ JB_Sullivan

                                @gargano

                                Welche Version hat dein js-engine? Ich habe 5.0.12.

                                Mit dem Code wird mir Zeile 113 (watts3) unterstrichen, das dass falsch sein soll

                                javascript.0	2021-03-09 12:52:04.412	error	(3804) at process._tickCallback (internal/process/next_tick.js:68:7)
                                javascript.0	2021-03-09 12:52:04.411	error	(3804) at script.js.Solar.SolarForcast:133:5
                                javascript.0	2021-03-09 12:52:04.411	error	(3804) at makeTable (script.js.Solar.SolarForcast:113:65)
                                javascript.0	2021-03-09 12:52:04.408	error	(3804) script.js.Solar.SolarForcast: ReferenceError: watts3 is not defined
                                
                                GarganoG Offline
                                GarganoG Offline
                                Gargano
                                wrote on last edited by Gargano
                                #103

                                @jb_sullivan ja, wirf mal das watts3 raus:

                                graphTimeData.push(watts1[n].Leistung + watts2[n].Leistung);
                                

                                Das ist von mir, ich benutze das um die Einstrahlung der Sonne in die Fenster zu schätzen und habe da 3 Seiten

                                JB_SullivanJ 1 Reply Last reply
                                0
                                • GarganoG Gargano

                                  @jb_sullivan ja, wirf mal das watts3 raus:

                                  graphTimeData.push(watts1[n].Leistung + watts2[n].Leistung);
                                  

                                  Das ist von mir, ich benutze das um die Einstrahlung der Sonne in die Fenster zu schätzen und habe da 3 Seiten

                                  JB_SullivanJ Offline
                                  JB_SullivanJ Offline
                                  JB_Sullivan
                                  wrote on last edited by
                                  #104

                                  @gargano

                                  Schräg - sieht schon ziemlich gut aus - aber irgendwas ist ja immer 😲

                                  Vorher fand ich die Time Line etwas aufgeräumter. Beim rüber hoovern mit der Maus bekommt man ja auch eine Legende mit Zeiten angezeigt. Von daher bedarf es für mich nicht unbedingt einer X-Achse mit allen Zeiten.

                                  ALT:

                                  2b59350a-5187-4d4b-bf94-244f5238474a-image.png

                                  NEU:

                                  2c978857-6655-42ce-a7b7-97671427073b-image.png

                                  ioBroker (since 2018) auf Intel Core i3-5005U NUC und Windwos10 Pro

                                  GarganoG 1 Reply Last reply
                                  0
                                  • JB_SullivanJ JB_Sullivan

                                    @gargano

                                    Schräg - sieht schon ziemlich gut aus - aber irgendwas ist ja immer 😲

                                    Vorher fand ich die Time Line etwas aufgeräumter. Beim rüber hoovern mit der Maus bekommt man ja auch eine Legende mit Zeiten angezeigt. Von daher bedarf es für mich nicht unbedingt einer X-Achse mit allen Zeiten.

                                    ALT:

                                    2b59350a-5187-4d4b-bf94-244f5238474a-image.png

                                    NEU:

                                    2c978857-6655-42ce-a7b7-97671427073b-image.png

                                    GarganoG Offline
                                    GarganoG Offline
                                    Gargano
                                    wrote on last edited by
                                    #105

                                    @jb_sullivan Das macht der JsonChart von alleine.
                                    Schau mal in den Editor Porperties der x-Achse. Evtl. kannst Du da noch was einstellen. Oder ganz weglassen

                                    JB_SullivanJ 1 Reply Last reply
                                    0
                                    • GarganoG Gargano

                                      @jb_sullivan Das macht der JsonChart von alleine.
                                      Schau mal in den Editor Porperties der x-Achse. Evtl. kannst Du da noch was einstellen. Oder ganz weglassen

                                      JB_SullivanJ Offline
                                      JB_SullivanJ Offline
                                      JB_Sullivan
                                      wrote on last edited by JB_Sullivan
                                      #106

                                      @gargano

                                      Einfach über die Widget Konfiguration scheint es nur begrenzt zu gehen. Allerdings kann man da wohl wieder was mit Code tweaken erzwingen wenn man spezielle Zeitabschnitte (z.B. Tag) haben will - aber da bin ich wieder raus.

                                      86733fb1-532d-4185-945c-05fab820ecb8-image.png

                                      EDIT: Ich sehe gerade die json Tabelle gibt es mit dem neuen Code nicht mehr? Der Datenpunkt ist leer.

                                      ioBroker (since 2018) auf Intel Core i3-5005U NUC und Windwos10 Pro

                                      GarganoG 1 Reply Last reply
                                      0
                                      • JB_SullivanJ JB_Sullivan

                                        @gargano

                                        Einfach über die Widget Konfiguration scheint es nur begrenzt zu gehen. Allerdings kann man da wohl wieder was mit Code tweaken erzwingen wenn man spezielle Zeitabschnitte (z.B. Tag) haben will - aber da bin ich wieder raus.

                                        86733fb1-532d-4185-945c-05fab820ecb8-image.png

                                        EDIT: Ich sehe gerade die json Tabelle gibt es mit dem neuen Code nicht mehr? Der Datenpunkt ist leer.

                                        GarganoG Offline
                                        GarganoG Offline
                                        Gargano
                                        wrote on last edited by
                                        #107

                                        @jb_sullivan Sorry, hab da was zuviel auskommentiert. Ich habs in dem Code oben geändert ab Zeile 102

                                        JB_SullivanJ 1 Reply Last reply
                                        0
                                        • GarganoG Gargano

                                          @jb_sullivan Sorry, hab da was zuviel auskommentiert. Ich habs in dem Code oben geändert ab Zeile 102

                                          JB_SullivanJ Offline
                                          JB_SullivanJ Offline
                                          JB_Sullivan
                                          wrote on last edited by
                                          #108

                                          @gargano

                                          Jupp, geht wieder 👍

                                          ioBroker (since 2018) auf Intel Core i3-5005U NUC und Windwos10 Pro

                                          1 Reply Last reply
                                          0

                                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                          With your input, this post could be even better 💗

                                          Register Login
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate
                                          FAQ Cloud / IOT
                                          HowTo: Node.js-Update
                                          HowTo: Backup/Restore
                                          Downloads
                                          BLOG

                                          417

                                          Online

                                          32.7k

                                          Users

                                          82.6k

                                          Topics

                                          1.3m

                                          Posts
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                          ioBroker Community 2014-2025
                                          logo
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Home
                                          • Recent
                                          • Tags
                                          • Unread 0
                                          • Categories
                                          • Unreplied
                                          • Popular
                                          • GitHub
                                          • Docu
                                          • Hilfe