Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Forecast.solar mit dem Systeminfo Adapter

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Forecast.solar mit dem Systeminfo Adapter

    This topic has been deleted. Only users with topic management privileges can see it.
    • JB_Sullivan
      JB_Sullivan @Gargano last edited by

      @Gargano Solar Wetter hatte ich mir schon angesehen, der sagt mir aber nicht so zu. Ich finde forcast.solar besser muss ich ehrlich sagen. Schade, ich dachte das es dafür ggf. auch einen Adapter gibt.

      Gargano 2 Replies Last reply Reply Quote 0
      • Gargano
        Gargano @JB_Sullivan last edited by

        @JB_Sullivan Ich find forecast.solar auch besser. Mal sehen, was ich mit JS anfangen kann.
        Einen Request kann ich schon abschicken und bekomme die Daten als JSON

        1 Reply Last reply Reply Quote 0
        • Gargano
          Gargano @JB_Sullivan last edited by

          @JB_Sullivan Was willst Du denn mit den Daten machen ?

          Ein erster Schritt :

          
          var request = require('request');
          var options = {url: 'https://api.forecast.solar/estimate/Dein-Lat/Dein-Lon/45/45/10', method: 'GET', headers: { 'User-Agent': 'request' }};
          request(options, function(error, response, body) {
             if (!error && response.statusCode == 200) {
                var info = JSON.parse(body);  // info ist ein Objekt
                log (info.result.watts);
             }
          });
          
          
          paul53 JB_Sullivan 2 Replies Last reply Reply Quote 0
          • paul53
            paul53 @Gargano last edited by

            @Gargano
            Was ergibt die Log-Ausgabe von ?

            const options = {url: 'https://api.forecast.solar/estimate/Dein-Lat/Dein-Lon/45/45/10', method: 'GET', headers: { 'User-Agent': 'request' }};
            
            request(options, function(error, response, body) {
               if (!error && response.statusCode == 200) {
                  let res = JSON.parse(body).result;  // res ist ein Objekt
                  log(res);
               }
            });
            
            Gargano 1 Reply Last reply Reply Quote 0
            • Gargano
              Gargano @paul53 last edited by

              @paul53 log (info.result)

              {'watts':{'2020-12-15 07:49:00':0,'2020-12-15 08:25:00':80,'2020-12-15 09:00:00':590,'2020-12-15 10:00:00':1230,'2020-12-15 11:00:00':1810,'2020-12-15 12:00:00':2040,'2020-12-15 13:00:00':1560,'2020-12-15 14:00:00':1120,'2020-12-15 15:00:00':570,'2020-12-15 15:41:00':80,'2020-12-15 16:22:00':0,'2020-12-16 07:50:00':0,'2020-12-16 08:25:00':60,'2020-12-16 09:00:00':380,'2020-12-16 10:00:00':770,'2020-12-16 11:00:00':1140,'2020-12-16 12:00:00':1400,'2020-12-16 13:00:00':1360,'2020-12-16 14:00:00':1080,'2020-12-16 15:00:00':560,'2020-12-16 15:41:00':80,'2020-12-16 16:22:00':0},'watt_hours':{'2020-12-15 07:49:00':0,'2020-12-15 08:25:00':50,'2020-12-15 09:00:00':390,'2020-12-15 10:00:00':1620,'2020-12-15 11:00:00':3430,'2020-12-15 12:00:00':5470,'2020-12-15 13:00:00':7030,'2020-12-15 14:00:00':8150,'2020-12-15 15:00:00':8720,'2020-12-15 15:41:00':8780,'2020-12-15 16:22:00':8780,'2020-12-16 07:50:00':0,'2020-12-16 08:25:00':40,'2020-12-16 09:00:00':260,'2020-12-16 10:00:00':1030,'2020-12-16 11:00:00':2170,'2020-12-16 12:00:00':3570,'2020-12-16 13:00:00':4930,'2020-12-16 14:00:00':6010,'2020-12-16 15:00:00':6570,'2020-12-16 15:41:00':6620,'2020-12-16 16:22:00':6620},'watt_hours_day':{'2020-12-15':8780,'2020-12-16':6620}}
              
              paul53 1 Reply Last reply Reply Quote 0
              • paul53
                paul53 @Gargano last edited by

                @Gargano
                Das sind einen Menge Daten, wobei zur Entscheidung, ob morgens der Puffer aufgeheizt werden soll, 'watt_hours_day' vom aktuellen Datum ausreichen sollte. Etwa:

                const options = {url: 'https://api.forecast.solar/estimate/Dein-Lat/Dein-Lon/45/45/10', method: 'GET', headers: { 'User-Agent': 'request' }};
                 
                request(options, function(error, response, body) {
                   if (!error && response.statusCode == 200) {
                      let res = JSON.parse(body).result;  // res ist ein Objekt
                      let today = formatDate(new Date(), 'YYYY-MM-DD');
                      log(res.watt_hours_day[today]);
                   }
                });
                
                Gargano JB_Sullivan 2 Replies Last reply Reply Quote 0
                • Gargano
                  Gargano @paul53 last edited by

                  @paul53 ok , Danke . Funktioniert. Muß ich nur schauen in welchen Verhältnis dann der Wert zu dem tatsächlichen Ertrag der Solarthermie ist. Nicht daß dann die Bude kalt ist, wäre dem WAF nicht sehr zuträglich.

                  1 Reply Last reply Reply Quote 0
                  • JB_Sullivan
                    JB_Sullivan @Gargano last edited by

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

                    @JB_Sullivan Was willst Du denn mit den Daten machen ?

                    Mein Plan war es via Übersichtsseite der Frau aufzuzeigen, wann es ggf. sinnvoller ist den Geschirrspüler, die Waschmaschine, oder Wäschetrockner einzuschalten. Auch die Poolpumpe könnte via Skript eine Option für den Sommer sein - da bin ich mir aber noch nicht sicher.

                    Es gibt für PV-Anlagen Besitzer zwar so Energiemanagement Hardware Tools die dann diese ganzen Geräte steuern können, jedoch machen diese das anhand des gemessenen PV Überschuss und nicht Prognose basiert.

                    Beides zusammen, also Prognose und reale Messung, wäre natürlich ideal. Allerdings braucht man dann so einen Solarmanager, welcher nochmal ~700 Euro kostet und alle Verbraucher müssen Kabel mäßig einzeln ansteuerbar sein.

                    Ist viel (Kosten) Aufwand, aber möglich. Warum also im Vorfeld nicht erstmal gucken, ob man anhand der Prognose Daten es ggf. händisch geregelt bekommt die unterschiedlichen Verbraucher zu nutzen oder nicht zu benutzen 😉

                    paul53 1 Reply Last reply Reply Quote 0
                    • JB_Sullivan
                      JB_Sullivan @paul53 last edited by

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

                      @Gargano
                      Das sind einen Menge Daten, wobei zur Entscheidung, ob morgens der Puffer aufgeheizt werden soll, 'watt_hours_day' vom aktuellen Datum ausreichen sollte. Etwa:

                      const options = {url: 'https://api.forecast.solar/estimate/Dein-Lat/Dein-Lon/45/45/10', method: 'GET', headers: { 'User-Agent': 'request' }};
                       
                      request(options, function(error, response, body) {
                         if (!error && response.statusCode == 200) {
                            let res = JSON.parse(body).result;  // res ist ein Objekt
                            let today = formatDate(new Date(), 'YYYY-MM-DD');
                            log(res.watt_hours_day[today]);
                         }
                      });
                      

                      Sorry, wenn ich dumm frage, aber ich habe von Javaskript NULL Ahnung - was machen die Codezeilen? Einen Datenpunkt erzeugen mit einer Json Tabelle? Was steht in der Tabelle so drin? Ist das VIS verwendbar?

                      paul53 Gargano 2 Replies Last reply Reply Quote 0
                      • paul53
                        paul53 @JB_Sullivan last edited by

                        @JB_Sullivan sagte:

                        was machen die Codezeilen?

                        Sie ermitteln die Vorhersage der gesamten Einstrahlung (in Wh) für heute.

                        1 Reply Last reply Reply Quote 0
                        • Gargano
                          Gargano @JB_Sullivan last edited by Gargano

                          @JB_Sullivan
                          Ich hab noch mal einen Datenpunkt dazu genommen
                          "javascript.0.SolarForecast.Today"
                          der wird jeden Tag um 0:30 upgedatet.

                          Dein-Lon und Dein-Lat musst Du noch eintragen
                          Der Syntax der url ist
                          https://api.forecast.solar/estimate/lat/lon/dec/az/kwp

                          lat - latitude of location, -90 (south) … 90 (north)
                          lon - longitude of location, -180 (west) … 180 (east)
                          dec - plane declination, 0 (horizontal) … 90 (vertical)
                          az - plane azimuth, -180 … 180 (-180 = north, -90 = east, 0 = south, 90 = west, 180 = north)
                          kwp - installed modules power in kilo watt

                          
                          const SolarToday = "javascript.0.SolarForecast.Today";
                          
                          const creatStateList = [
                              {name :SolarToday, type:"number", role : "value"}
                          ]
                          
                          creatStateList.forEach (function(item) {
                              createState(item.name, { 
                                  type: item.type,
                                  min: 0,
                                  def: 0,
                                  role: item.role
                              });
                          });
                          
                          var request = require('request');
                          var options = {url: 'https://api.forecast.solar/estimate/Dein-Lat/Dein-Lon/45/45/1', method: 'GET', headers: { 'User-Agent': 'request' }};
                          
                          schedule({hour: 00, minute: 30}, GetSolar );
                          
                          function GetSolar() {
                              request(options, function(error, response, body) {
                              if (!error && response.statusCode == 200) {
                                  let res = JSON.parse(body);  // info ist ein Objekt
                                  let today = formatDate(new Date(), 'YYYY-MM-DD');
                                  setState(SolarToday,res.result.watt_hours_day[today]);
                             }
                          });
                          }
                          
                          
                          
                          
                          
                          JB_Sullivan 1 Reply Last reply Reply Quote 0
                          • JB_Sullivan
                            JB_Sullivan @Gargano last edited by

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

                            az - plane azimuth, -180 … 180 (-180 = north, -90 = east, 0 = south, 90 = west, 180 = north)

                            Hmmmmmm - wie bekommt man denn hier eine OST / WEST Ausrichtung dargestellt? Also ich habe Solarplatten sowohl auf der Ost-, als auch auf der Westseite

                            paul53 1 Reply Last reply Reply Quote 0
                            • paul53
                              paul53 @JB_Sullivan last edited by

                              @JB_Sullivan sagte:

                              Solarplatten sowohl auf der Ost-, als auch auf der Westseite

                              Das ganze zweimal und beide Werte addieren.

                              JB_Sullivan 1 Reply Last reply Reply Quote 0
                              • JB_Sullivan
                                JB_Sullivan @paul53 last edited by

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

                                Das ganze zweimal und beide Werte addieren.

                                OK, dann bin ich wieder raus - Javaskript ist halt nicht meins.......aber ist es korrekt, das bei dem Ergebnis nur ein Zahlenwert bei dem Objekt drin steht und keine jsaon Tabelle mit mehreren Werten?

                                Also bei mir steht 6843 - ich nehme mal an Wh drin. In Wirklichkeit hatte ich heute aber nur 2396 Wh Erzeugung. Wobei lt. Formel das nur der Wert vom Westdach wäre. die 2369 sind aber schon der Tagesertrag von beiden Dachflächen.

                                Also entweder ich habe irgendwo einen Bock drin, oder so toll ist die Vorhersage dann doch nicht.

                                paul53 Gargano 3 Replies Last reply Reply Quote 0
                                • paul53
                                  paul53 @JB_Sullivan last edited by paul53

                                  @JB_Sullivan sagte:

                                  Bock drin, oder so toll ist die Vorhersage dann doch nicht.

                                  Hast Du eine zu große Modulleistung übergeben ?
                                  Da Vorhersagen die Zukunft betreffen, sind sie selten genau.

                                  1 Reply Last reply Reply Quote 0
                                  • paul53
                                    paul53 @JB_Sullivan last edited by

                                    @JB_Sullivan sagte:

                                    wann es ggf. sinnvoller ist den Geschirrspüler, die Waschmaschine, oder Wäschetrockner einzuschalten.

                                    Dann interessieren Dich nicht die "watt_hours_day", sondern die "watts".

                                    Gargano 1 Reply Last reply Reply Quote 0
                                    • Gargano
                                      Gargano @JB_Sullivan last edited by Gargano

                                      @JB_Sullivan Also ich hab mal auch die Watts in dem Objekt JSON hinterlegt.
                                      Zum Test wird die Funktion auch gleich nach dem Start des Scripts einmal aufgerufen , ansonsten um 00:30
                                      Mal sehen, evtl. bekomme ich es morgen hin mit 2 Panel-Flächen.
                                      Nur weis ich nicht wie man die Watts aufdröseln soll. (Objekte Watts jede Stunde ?)

                                      
                                      const SolarJSON = "javascript.0.SolarForecast.JSON";
                                      const SolarToday = "javascript.0.SolarForecast.Today";
                                      
                                      const creatStateList = [
                                          {name :SolarJSON, type:"string", role : "value"},
                                          {name :SolarToday, type:"number", role : "value"}
                                      ]
                                      
                                      creatStateList.forEach (function(item) {
                                          createState(item.name, { 
                                              type: item.type,
                                              min: 0,
                                              def: 0,
                                              role: item.role
                                          });
                                      });
                                      
                                      var request = require('request');
                                      var options = {url: 'https://api.forecast.solar/estimate/xxx/yyy/45/45/1', method: 'GET', headers: { 'User-Agent': 'request' }};
                                      
                                      schedule('6 6-18 * * *', getSolar);
                                      getSolar();
                                      
                                      function getSolar() {
                                          request(options, function(error, response, body) {
                                              if (!error && response.statusCode == 200) {
                                                  let res = JSON.parse(body);  // res ist ein Objekt
                                                  log (res.result.watt_hours_day);
                                                  let today = formatDate(new Date(), 'YYYY-MM-DD');
                                                  log(res.result.watt_hours_day[today]);
                                                  setState(SolarJSON,JSON.stringify(res.result.watts));
                                                  setState(SolarToday,res.result.watt_hours_day[today]);
                                              }
                                          });
                                      }
                                      
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • Gargano
                                        Gargano @paul53 last edited by

                                        @paul53 Also relativ einfach machbar wäre es die watts_hours in festen Schritten zu errechnen:

                                        Mitternacht bis 9:00
                                        9:00 bis 12:00
                                        12:00 bis 15:00
                                        15:00 bis 18:00
                                        18:00 bis 21:00
                                        21:00 bis Mitternacht

                                        paul53 1 Reply Last reply Reply Quote 0
                                        • paul53
                                          paul53 @Gargano last edited by

                                          @Gargano sagte:

                                          relativ einfach machbar wäre es die watts_hours in festen Schritten zu errechnen:

                                          Das sind die über den Tag kumulierten Werte. Wozu braucht man die ?

                                          So einfach ist es auch nicht, denn das die Zeiten und Werte ab 15:00 Uhr:

                                          '2020-12-15 15:00:00':8720,'2020-12-15 15:41:00':8780,'2020-12-15 16:22:00':8780,
                                          
                                          Gargano 1 Reply Last reply Reply Quote 0
                                          • paul53
                                            paul53 @JB_Sullivan last edited by paul53

                                            @JB_Sullivan sagte:

                                            Tabelle mit mehreren Werten?

                                            Du möchtest eine JSON-Tabelle. Dafür habe ich mal die Funktion von @Gargano abgewandelt.

                                            function GetSolar() {
                                                request(options, function(error, response, body) {
                                                    if (!error && response.statusCode == 200) {
                                                        let watts = JSON.parse(body).result.watts;  
                                                        let today = formatDate(new Date(), 'YYYY-MM-DD');
                                                        let table = [];
                                                        for(let time in watts) {
                                                            let pos = time.indexOf(':00:00');
                                                            if(time.includes(today) && pos != -1) {
                                                                let entry = {};
                                                                entry.Uhrzeit = time.substr(pos - 2, 5);
                                                                entry.Leistung = watts[time];
                                                                table.push(entry);
                                                            }
                                                        }  
                                                        setState(SolarJSON, JSON.stringify(table), true);
                                                    }
                                                });
                                            }
                                            
                                            Gargano 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

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

                                            492
                                            Online

                                            31.8k
                                            Users

                                            80.0k
                                            Topics

                                            1.3m
                                            Posts

                                            json solar systeminfo
                                            15
                                            188
                                            19086
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo