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. Skripten / Logik
  4. [gelöst] Optimale Neigung Solarmodule errechnen

NEWS

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

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

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

[gelöst] Optimale Neigung Solarmodule errechnen

Scheduled Pinned Locked Moved Skripten / Logik
3 Posts 2 Posters 480 Views 2 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.
  • C Offline
    C Offline
    christian_ffm
    wrote on last edited by christian_ffm
    #1

    Hallo,

    ich möchte ein PV-Tracking (nur Neigung) bauen für mein Wohnmobil. Dafür möchte ich die optimale Neigung der Module in Abhängigkeit der Uhrzeit, aktuellen Koordinaten und Ausrichtung berechnen. Koordinaten und Ausrichtung liegen vor. Ich scheitere aber kläglich an der Berechnung. Ich habe zwei Varianten gebaut auf Grundlage von unten genannten Threads, aber beide bringen nicht das erhoffte Ergebnis. Ich bin mit der Mathematik leider überfordert und benötige hier eure Hilfe. Die Herausforderung ist nicht, den besten Winkel zu berechnen, sondern die konkrete, theoretische Leistung in Abhängigkeit von Uhrzeit, aktuellen Koordinaten, Neigung und Ausrichtung zu berechnen. Den Rest bekomme ich dann hin.

    Variante 1: https://forum.iobroker.net/topic/4953/script-sonnenstand-und-einstrahlung

    8826bc00-4309-4615-b4dd-2ebfc6c1a745-grafik.png

    Ausgabe:
    0:00 Uhr: 0 | 1:00 Uhr: 0 | 2:00 Uhr: 0 | 3:00 Uhr: 0 | 4:00 Uhr: 0 | 5:00 Uhr: 0 | 6:00 Uhr: 0 | 7:00 Uhr: 0 | 8:00 Uhr: 0 | 9:00 Uhr: 183.35 | 10:00 Uhr: 401.56 | 11:00 Uhr: 551.24 | 12:00 Uhr: 632.75 | 13:00 Uhr: 641.67 | 14:00 Uhr: 577.46 | 15:00 Uhr: 443.85 | 16:00 Uhr: 244.08 | 17:00 Uhr: 0 | 18:00 Uhr: 0 | 19:00 Uhr: 0 | 20:00 Uhr: 0 | 21:00 Uhr: 0 | 22:00 Uhr: 0 | 23:00 Uhr: 0
    
    var suncalc = require('suncalc');
    
    //var lat =  getState("0_userdata.0.Router.gpslat").val;
    
    // var long = getState("0_userdata.0.Router.gpslat").val;
    
     
    
    // var modtilt =       38;     //Dachneigung in Grad (Solar panel's tilt angle)
    
    // var modazi =        200;    //Ausrichtung des Hauses in Grad zB SSW (Solar panel's azimut)
    
    var modsufrace =    1;   //Paneloberfläche in m2 (Solar panel's surface in sq. meters)
    
    var modeff =        0.183;  //Annäherung an Panel-Wirkungsgrad zB 18 Prozent (modules efficiency correction)
    
                                // Hier kann an einem klaren Tag etwas geschraubt werden ;-)
    
     
    
    var altitude;       // Calculated Elevation
    
    var azimuth;        // Calculated Azimuth
    
     
    
    
    // ganz am Ende die setStates anpassen nicht vergessen!
    
     
    
    // Do not change below, until You know what You are doing!
    
    // ********************************************************
    
     
    
    Math.degrees = function(radians) {return radians * 180 / Math.PI;};
    
    Math.radians = function(degrees) {return degrees * Math.PI / 180;};
    
        var now = stunde;
    
        var sunpos = suncalc.getPosition(now, lat, long);
    
     //   log("Script Sonnenstand; latitude : " + result.native.latitude + " / longitude: " + result.native.longitude,'debug');
    
     //   log("Script Sonnenstand; sunpos: " + JSON.stringify(sunpos),'debug');
    
    
    
        altitude = Math.degrees(sunpos.altitude);
    
        azimuth =  Math.degrees(sunpos.azimuth) + 180;
    
     
    
        // The intensity of the direct component of sunlight throughout each day can be determined as 
    
        // a function of air mass. based on: http://pveducation.org/pvcdrom/properties-of-sunlight/air-mass#formula
    
        var airmass = 1/Math.cos((90-altitude)*4*Math.asin(1)/360); 
    
     
    
        // Sincident is the intensity on a plane perpendicular to the sun's rays in units of kW/m2 and AM is the air mass.
    
        // The value of 1.353 kW/m2 is the solar constant and the number 0.7 arises from the fact that about 70% of the radiation incident on the atmosphere is transmitted
    
        // to the Earth. The extra power term of 0.678 is an empirical fit to the observed data and takes into account the non-uniformities in the atmospheric layers.
    
        // ykuendig: use different values because of pv instead thermal panels
    
        var Sincident = (1.367*Math.pow(0.78,Math.pow(airmass,0.6)));
    
        var fraction = Math.cos(altitude*4*Math.asin(1)/360)*Math.sin(modtilt*4*Math.asin(1)/360)*Math.cos(azimuth*4*Math.asin(1)/360-modazi*4*Math.asin(1)/360)+Math.sin(altitude*4*Math.asin(1)/360)*Math.cos(modtilt*4*Math.asin(1)/360);
    
        // W/m² light intensity on the module * module's surface
    
        var SmoduleInt = Sincident * fraction * modsufrace * 1000;
    
        if(SmoduleInt<0) {
    
            SmoduleInt =    0;
    
        }
    
        // Module Effective in relation of the efficiency of the used panel
    
        var SmoduleEff = SmoduleInt * modeff;
    
     
    
        if( altitude < 0 ) {
    
            SmoduleInt =    0;
    
            SmoduleEff =    0;
    
            altitude =      0;
    
        }
    
     
    
    return SmoduleInt;
    
    

    Ich rechne mit dem Skript die Leistung für jede Stunde heute aus. Leider passen die Werte null mit denen vom Adapter PV-Forecast überein, auch nicht verhältnismäßig. Für mich ist der reale Ertrag zwar irrelevant, da ich ja nur die beste Ausrichtung berechnen möchte, trotzdem habe ich große Zweifel, dass das stimmt

    Werte PVForecast von 9-16h zum vergleich
    30d9a1ae-9f07-4938-8d40-a0742d2c9416-grafik.png

    Variante 2: https://forum.iobroker.net/topic/42892/mathe-genie-gesucht-kurvenberechnung/87?_=1674170079397&lang=de

    4a53ff7b-9bc1-4961-8c89-7497c7048091-grafik.png

     Ausgabe: 30.658461704697068
    
    var suncalc = require('suncalc');
    
    var lat =  getState("0_userdata.0.Router.gpslat").val;
    
    var long = getState("0_userdata.0.Router.gpslat").val;
    
     
    Math.degrees = function(radians) {return radians * 180 / Math.PI;};
    
    var sunpos = suncalc.getPosition(stunde, lat, long);
    
    return Math.degrees(sunpos.altitude);
    
    var suncalc = require('suncalc');
    
    var lat =  getState("0_userdata.0.Router.gpslat").val;
    
    var long = getState("0_userdata.0.Router.gpslat").val;
    
     
    Math.degrees = function(radians) {return radians * 180 / Math.PI;};
    
    var sunpos = suncalc.getPosition(stunde, lat, long);
    
    return Math.degrees(sunpos.azimuth) +180;
    

    Diese Ausgabe macht für mich auch keinen Sinn, weil um 6 Uhr ist die Sonne noch garnicht aufgegangen, da kann es noch keine Leistung geben...

    Welche Variante ich am Ende nutze ist mir wurscht, hauptsache ich kann die Nachführung realisieren. Kann mir jemand weiterhelfen?

    Vielen Dank für eure Hilfe!

    paul53P 1 Reply Last reply
    0
    • C christian_ffm

      Hallo,

      ich möchte ein PV-Tracking (nur Neigung) bauen für mein Wohnmobil. Dafür möchte ich die optimale Neigung der Module in Abhängigkeit der Uhrzeit, aktuellen Koordinaten und Ausrichtung berechnen. Koordinaten und Ausrichtung liegen vor. Ich scheitere aber kläglich an der Berechnung. Ich habe zwei Varianten gebaut auf Grundlage von unten genannten Threads, aber beide bringen nicht das erhoffte Ergebnis. Ich bin mit der Mathematik leider überfordert und benötige hier eure Hilfe. Die Herausforderung ist nicht, den besten Winkel zu berechnen, sondern die konkrete, theoretische Leistung in Abhängigkeit von Uhrzeit, aktuellen Koordinaten, Neigung und Ausrichtung zu berechnen. Den Rest bekomme ich dann hin.

      Variante 1: https://forum.iobroker.net/topic/4953/script-sonnenstand-und-einstrahlung

      8826bc00-4309-4615-b4dd-2ebfc6c1a745-grafik.png

      Ausgabe:
      0:00 Uhr: 0 | 1:00 Uhr: 0 | 2:00 Uhr: 0 | 3:00 Uhr: 0 | 4:00 Uhr: 0 | 5:00 Uhr: 0 | 6:00 Uhr: 0 | 7:00 Uhr: 0 | 8:00 Uhr: 0 | 9:00 Uhr: 183.35 | 10:00 Uhr: 401.56 | 11:00 Uhr: 551.24 | 12:00 Uhr: 632.75 | 13:00 Uhr: 641.67 | 14:00 Uhr: 577.46 | 15:00 Uhr: 443.85 | 16:00 Uhr: 244.08 | 17:00 Uhr: 0 | 18:00 Uhr: 0 | 19:00 Uhr: 0 | 20:00 Uhr: 0 | 21:00 Uhr: 0 | 22:00 Uhr: 0 | 23:00 Uhr: 0
      
      var suncalc = require('suncalc');
      
      //var lat =  getState("0_userdata.0.Router.gpslat").val;
      
      // var long = getState("0_userdata.0.Router.gpslat").val;
      
       
      
      // var modtilt =       38;     //Dachneigung in Grad (Solar panel's tilt angle)
      
      // var modazi =        200;    //Ausrichtung des Hauses in Grad zB SSW (Solar panel's azimut)
      
      var modsufrace =    1;   //Paneloberfläche in m2 (Solar panel's surface in sq. meters)
      
      var modeff =        0.183;  //Annäherung an Panel-Wirkungsgrad zB 18 Prozent (modules efficiency correction)
      
                                  // Hier kann an einem klaren Tag etwas geschraubt werden ;-)
      
       
      
      var altitude;       // Calculated Elevation
      
      var azimuth;        // Calculated Azimuth
      
       
      
      
      // ganz am Ende die setStates anpassen nicht vergessen!
      
       
      
      // Do not change below, until You know what You are doing!
      
      // ********************************************************
      
       
      
      Math.degrees = function(radians) {return radians * 180 / Math.PI;};
      
      Math.radians = function(degrees) {return degrees * Math.PI / 180;};
      
          var now = stunde;
      
          var sunpos = suncalc.getPosition(now, lat, long);
      
       //   log("Script Sonnenstand; latitude : " + result.native.latitude + " / longitude: " + result.native.longitude,'debug');
      
       //   log("Script Sonnenstand; sunpos: " + JSON.stringify(sunpos),'debug');
      
      
      
          altitude = Math.degrees(sunpos.altitude);
      
          azimuth =  Math.degrees(sunpos.azimuth) + 180;
      
       
      
          // The intensity of the direct component of sunlight throughout each day can be determined as 
      
          // a function of air mass. based on: http://pveducation.org/pvcdrom/properties-of-sunlight/air-mass#formula
      
          var airmass = 1/Math.cos((90-altitude)*4*Math.asin(1)/360); 
      
       
      
          // Sincident is the intensity on a plane perpendicular to the sun's rays in units of kW/m2 and AM is the air mass.
      
          // The value of 1.353 kW/m2 is the solar constant and the number 0.7 arises from the fact that about 70% of the radiation incident on the atmosphere is transmitted
      
          // to the Earth. The extra power term of 0.678 is an empirical fit to the observed data and takes into account the non-uniformities in the atmospheric layers.
      
          // ykuendig: use different values because of pv instead thermal panels
      
          var Sincident = (1.367*Math.pow(0.78,Math.pow(airmass,0.6)));
      
          var fraction = Math.cos(altitude*4*Math.asin(1)/360)*Math.sin(modtilt*4*Math.asin(1)/360)*Math.cos(azimuth*4*Math.asin(1)/360-modazi*4*Math.asin(1)/360)+Math.sin(altitude*4*Math.asin(1)/360)*Math.cos(modtilt*4*Math.asin(1)/360);
      
          // W/m² light intensity on the module * module's surface
      
          var SmoduleInt = Sincident * fraction * modsufrace * 1000;
      
          if(SmoduleInt<0) {
      
              SmoduleInt =    0;
      
          }
      
          // Module Effective in relation of the efficiency of the used panel
      
          var SmoduleEff = SmoduleInt * modeff;
      
       
      
          if( altitude < 0 ) {
      
              SmoduleInt =    0;
      
              SmoduleEff =    0;
      
              altitude =      0;
      
          }
      
       
      
      return SmoduleInt;
      
      

      Ich rechne mit dem Skript die Leistung für jede Stunde heute aus. Leider passen die Werte null mit denen vom Adapter PV-Forecast überein, auch nicht verhältnismäßig. Für mich ist der reale Ertrag zwar irrelevant, da ich ja nur die beste Ausrichtung berechnen möchte, trotzdem habe ich große Zweifel, dass das stimmt

      Werte PVForecast von 9-16h zum vergleich
      30d9a1ae-9f07-4938-8d40-a0742d2c9416-grafik.png

      Variante 2: https://forum.iobroker.net/topic/42892/mathe-genie-gesucht-kurvenberechnung/87?_=1674170079397&lang=de

      4a53ff7b-9bc1-4961-8c89-7497c7048091-grafik.png

       Ausgabe: 30.658461704697068
      
      var suncalc = require('suncalc');
      
      var lat =  getState("0_userdata.0.Router.gpslat").val;
      
      var long = getState("0_userdata.0.Router.gpslat").val;
      
       
      Math.degrees = function(radians) {return radians * 180 / Math.PI;};
      
      var sunpos = suncalc.getPosition(stunde, lat, long);
      
      return Math.degrees(sunpos.altitude);
      
      var suncalc = require('suncalc');
      
      var lat =  getState("0_userdata.0.Router.gpslat").val;
      
      var long = getState("0_userdata.0.Router.gpslat").val;
      
       
      Math.degrees = function(radians) {return radians * 180 / Math.PI;};
      
      var sunpos = suncalc.getPosition(stunde, lat, long);
      
      return Math.degrees(sunpos.azimuth) +180;
      

      Diese Ausgabe macht für mich auch keinen Sinn, weil um 6 Uhr ist die Sonne noch garnicht aufgegangen, da kann es noch keine Leistung geben...

      Welche Variante ich am Ende nutze ist mir wurscht, hauptsache ich kann die Nachführung realisieren. Kann mir jemand weiterhelfen?

      Vielen Dank für eure Hilfe!

      paul53P Offline
      paul53P Offline
      paul53
      wrote on last edited by paul53
      #2

      @christian_ffm sagte: Dafür möchte ich die optimale Neigung der Module in Abhängigkeit der Uhrzeit

      Wie man aus den Formeln sieht, ist die optimale Neigung = 90° - Elevation.

      @christian_ffm sagte in Optimale Neigung Solarmodule errechnen:

      var lat =  getState("0_userdata.0.Router.gpslat").val;
      var long = getState("0_userdata.0.Router.gpslat").val;
      

      lat und long können nicht aus dem gleichen Datenpunkt kommen, wenn sie dort als Zahl vorliegen.

      EDIT: Die passende Formel für die PV-Leistung bei klarem Himmel unter Berücksichtigung der Globalstrahlung findet man hier.

      Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
      Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

      C 1 Reply Last reply
      0
      • paul53P paul53

        @christian_ffm sagte: Dafür möchte ich die optimale Neigung der Module in Abhängigkeit der Uhrzeit

        Wie man aus den Formeln sieht, ist die optimale Neigung = 90° - Elevation.

        @christian_ffm sagte in Optimale Neigung Solarmodule errechnen:

        var lat =  getState("0_userdata.0.Router.gpslat").val;
        var long = getState("0_userdata.0.Router.gpslat").val;
        

        lat und long können nicht aus dem gleichen Datenpunkt kommen, wenn sie dort als Zahl vorliegen.

        EDIT: Die passende Formel für die PV-Leistung bei klarem Himmel unter Berücksichtigung der Globalstrahlung findet man hier.

        C Offline
        C Offline
        christian_ffm
        wrote on last edited by
        #3

        @paul53 oh je, was ein blöder Fehler. Copy paste ist was für fortgeschrittene. Danke Paul! Funktioniert jetzt beides einwandfrei mit plausiblen Ergebnissen.

        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

        295

        Online

        32.8k

        Users

        82.7k

        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