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

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

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Node-Red
  5. Tages/Nachtlänge berechnen

NEWS

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

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

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    25
    1
    2.2k

Tages/Nachtlänge berechnen

Geplant Angeheftet Gesperrt Verschoben Node-Red
3 Beiträge 2 Kommentatoren 338 Aufrufe 3 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • H Offline
    H Offline
    hpgo
    schrieb am zuletzt editiert von
    #1

    Hallo, ich würde mir gern berechnen, wie lange ist es tagsüber hell und wie lange es dunkel ist. Dazu hab ich die Sun positions Node die gewünschten Zeiten herausgesucht.
    Jetzt müsst das ganze noch berechnet werden - leider fehlt mir dazu der Ansatz.
    Vlt gibts auch schon fertige Lösungen?

    [
        {
            "id": "1d8c27aff840b27c",
            "type": "tab",
            "label": "TEST",
            "disabled": false,
            "info": "",
            "env": []
        },
        {
            "id": "858b441eaddacfd7",
            "type": "sun-position",
            "z": "1d8c27aff840b27c",
            "name": "",
            "positionConfig": "d836509a.67bc4",
            "rules": [],
            "onlyOnChange": "true",
            "topic": "",
            "outputs": 1,
            "start": "",
            "startType": "none",
            "startOffset": 0,
            "startOffsetType": "none",
            "startOffsetMultiplier": 60000,
            "end": "",
            "endType": "none",
            "endOffset": 0,
            "endOffsetType": "none",
            "endOffsetMultiplier": 60000,
            "x": 430,
            "y": 240,
            "wires": [
                [
                    "69184b9a38db4f0b",
                    "e6e2c94479444efe",
                    "a76942cd4a4957a5"
                ]
            ]
        },
        {
            "id": "da350f3e507cd358",
            "type": "inject",
            "z": "1d8c27aff840b27c",
            "name": "Inject",
            "props": [
                {
                    "p": "payload"
                },
                {
                    "p": "topic",
                    "vt": "str"
                }
            ],
            "repeat": "",
            "crontab": "",
            "once": false,
            "onceDelay": 0.1,
            "topic": "",
            "payload": "",
            "payloadType": "date",
            "x": 270,
            "y": 240,
            "wires": [
                [
                    "858b441eaddacfd7"
                ]
            ]
        },
        {
            "id": "69184b9a38db4f0b",
            "type": "change",
            "z": "1d8c27aff840b27c",
            "name": "Sonnenuntergang",
            "rules": [
                {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "payload.times.sunsetStart.value",
                    "tot": "msg"
                }
            ],
            "action": "",
            "property": "",
            "from": "",
            "to": "",
            "reg": false,
            "x": 690,
            "y": 260,
            "wires": [
                [
                    "ee5148fbf0ef5947"
                ]
            ]
        },
        {
            "id": "e6e2c94479444efe",
            "type": "change",
            "z": "1d8c27aff840b27c",
            "name": "Sonneaunaufgang",
            "rules": [
                {
                    "t": "set",
                    "p": "payload",
                    "pt": "msg",
                    "to": "payload.times.sunriseStart.value",
                    "tot": "msg"
                }
            ],
            "action": "",
            "property": "",
            "from": "",
            "to": "",
            "reg": false,
            "x": 690,
            "y": 220,
            "wires": [
                [
                    "ee5148fbf0ef5947"
                ]
            ]
        },
        {
            "id": "a76942cd4a4957a5",
            "type": "debug",
            "z": "1d8c27aff840b27c",
            "name": "",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": false,
            "complete": "true",
            "targetType": "full",
            "statusVal": "",
            "statusType": "auto",
            "x": 630,
            "y": 160,
            "wires": []
        },
        {
            "id": "ee5148fbf0ef5947",
            "type": "join",
            "z": "1d8c27aff840b27c",
            "name": "",
            "mode": "custom",
            "build": "array",
            "property": "payload",
            "propertyType": "msg",
            "key": "topic",
            "joiner": "\\n",
            "joinerType": "str",
            "accumulate": false,
            "timeout": "",
            "count": "2",
            "reduceRight": false,
            "reduceExp": "",
            "reduceInit": "",
            "reduceInitType": "",
            "reduceFixup": "",
            "x": 890,
            "y": 240,
            "wires": [
                [
                    "4d86b7feb800bad5"
                ]
            ]
        },
        {
            "id": "4d86b7feb800bad5",
            "type": "debug",
            "z": "1d8c27aff840b27c",
            "name": "",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": false,
            "complete": "false",
            "statusVal": "",
            "statusType": "auto",
            "x": 1050,
            "y": 240,
            "wires": []
        },
        {
            "id": "d836509a.67bc4",
            "type": "position-config",
            "name": "Johnsdorf/Brunn",
            "isValide": "true",
            "longitude": "0",
            "latitude": "0",
            "angleType": "deg",
            "timeZoneOffset": 99,
            "timeZoneDST": 0,
            "stateTimeFormat": "3",
            "stateDateFormat": "3",
            "contextStore": ""
        }
    ]
    

    Lg

    mickymM 1 Antwort Letzte Antwort
    0
    • H hpgo

      Hallo, ich würde mir gern berechnen, wie lange ist es tagsüber hell und wie lange es dunkel ist. Dazu hab ich die Sun positions Node die gewünschten Zeiten herausgesucht.
      Jetzt müsst das ganze noch berechnet werden - leider fehlt mir dazu der Ansatz.
      Vlt gibts auch schon fertige Lösungen?

      [
          {
              "id": "1d8c27aff840b27c",
              "type": "tab",
              "label": "TEST",
              "disabled": false,
              "info": "",
              "env": []
          },
          {
              "id": "858b441eaddacfd7",
              "type": "sun-position",
              "z": "1d8c27aff840b27c",
              "name": "",
              "positionConfig": "d836509a.67bc4",
              "rules": [],
              "onlyOnChange": "true",
              "topic": "",
              "outputs": 1,
              "start": "",
              "startType": "none",
              "startOffset": 0,
              "startOffsetType": "none",
              "startOffsetMultiplier": 60000,
              "end": "",
              "endType": "none",
              "endOffset": 0,
              "endOffsetType": "none",
              "endOffsetMultiplier": 60000,
              "x": 430,
              "y": 240,
              "wires": [
                  [
                      "69184b9a38db4f0b",
                      "e6e2c94479444efe",
                      "a76942cd4a4957a5"
                  ]
              ]
          },
          {
              "id": "da350f3e507cd358",
              "type": "inject",
              "z": "1d8c27aff840b27c",
              "name": "Inject",
              "props": [
                  {
                      "p": "payload"
                  },
                  {
                      "p": "topic",
                      "vt": "str"
                  }
              ],
              "repeat": "",
              "crontab": "",
              "once": false,
              "onceDelay": 0.1,
              "topic": "",
              "payload": "",
              "payloadType": "date",
              "x": 270,
              "y": 240,
              "wires": [
                  [
                      "858b441eaddacfd7"
                  ]
              ]
          },
          {
              "id": "69184b9a38db4f0b",
              "type": "change",
              "z": "1d8c27aff840b27c",
              "name": "Sonnenuntergang",
              "rules": [
                  {
                      "t": "set",
                      "p": "payload",
                      "pt": "msg",
                      "to": "payload.times.sunsetStart.value",
                      "tot": "msg"
                  }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 690,
              "y": 260,
              "wires": [
                  [
                      "ee5148fbf0ef5947"
                  ]
              ]
          },
          {
              "id": "e6e2c94479444efe",
              "type": "change",
              "z": "1d8c27aff840b27c",
              "name": "Sonneaunaufgang",
              "rules": [
                  {
                      "t": "set",
                      "p": "payload",
                      "pt": "msg",
                      "to": "payload.times.sunriseStart.value",
                      "tot": "msg"
                  }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 690,
              "y": 220,
              "wires": [
                  [
                      "ee5148fbf0ef5947"
                  ]
              ]
          },
          {
              "id": "a76942cd4a4957a5",
              "type": "debug",
              "z": "1d8c27aff840b27c",
              "name": "",
              "active": true,
              "tosidebar": true,
              "console": false,
              "tostatus": false,
              "complete": "true",
              "targetType": "full",
              "statusVal": "",
              "statusType": "auto",
              "x": 630,
              "y": 160,
              "wires": []
          },
          {
              "id": "ee5148fbf0ef5947",
              "type": "join",
              "z": "1d8c27aff840b27c",
              "name": "",
              "mode": "custom",
              "build": "array",
              "property": "payload",
              "propertyType": "msg",
              "key": "topic",
              "joiner": "\\n",
              "joinerType": "str",
              "accumulate": false,
              "timeout": "",
              "count": "2",
              "reduceRight": false,
              "reduceExp": "",
              "reduceInit": "",
              "reduceInitType": "",
              "reduceFixup": "",
              "x": 890,
              "y": 240,
              "wires": [
                  [
                      "4d86b7feb800bad5"
                  ]
              ]
          },
          {
              "id": "4d86b7feb800bad5",
              "type": "debug",
              "z": "1d8c27aff840b27c",
              "name": "",
              "active": true,
              "tosidebar": true,
              "console": false,
              "tostatus": false,
              "complete": "false",
              "statusVal": "",
              "statusType": "auto",
              "x": 1050,
              "y": 240,
              "wires": []
          },
          {
              "id": "d836509a.67bc4",
              "type": "position-config",
              "name": "Johnsdorf/Brunn",
              "isValide": "true",
              "longitude": "0",
              "latitude": "0",
              "angleType": "deg",
              "timeZoneOffset": 99,
              "timeZoneDST": 0,
              "stateTimeFormat": "3",
              "stateDateFormat": "3",
              "contextStore": ""
          }
      ]
      

      Lg

      mickymM Online
      mickymM Online
      mickym
      Most Active
      schrieb am zuletzt editiert von mickym
      #2

      @hpgo Wenn Du schon diese Nodes installiert hast, warum nutzt die dann nicht ?

      6b1cc37b-a882-40d4-867f-670f4ab8792c-image.png

      Diese Node ist doch super komfortabel - um solche Aufgaben - out of the box zu lösen:

      366f2133-9039-4594-84b4-8e66e03b72fc-image.png

      In der Hilfe zu der Node gibt es auch ein WIKI um Dir alles erklären zu lassen:

      d1abfc39-19d9-4adf-8bf8-6ba615c9d88c-image.png

      [
         {
             "id": "4d86b7feb800bad5",
             "type": "debug",
             "z": "e07ec81bf2817d9a",
             "name": "",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "false",
             "statusVal": "",
             "statusType": "auto",
             "x": 1050,
             "y": 340,
             "wires": []
         },
         {
             "id": "f70ba7449572c8a9",
             "type": "time-span",
             "z": "e07ec81bf2817d9a",
             "outputs": 1,
             "name": "",
             "positionConfig": "",
             "operand1": "sunriseEnd",
             "operand1Type": "pdsTime",
             "operand1Format": "0",
             "operand1Offset": 0,
             "operand1OffsetType": "none",
             "operand1OffsetMultiplier": 60000,
             "operand2": "sunsetEnd",
             "operand2Type": "pdsTime",
             "operand2Format": "0",
             "operand2Offset": 0,
             "operand2OffsetType": "none",
             "operand2OffsetMultiplier": 60000,
             "rules": [],
             "checkall": "true",
             "results": [
                 {
                     "p": "",
                     "pt": "msgPayload",
                     "v": "",
                     "vt": "timespan",
                     "o": "",
                     "oT": "none",
                     "oM": "60000",
                     "fTs": 3,
                     "fTsS": 3,
                     "fTsT": "Stunden",
                     "fTsI": "3",
                     "f": 0,
                     "fS": 0,
                     "fT": "Millisekunden UNIX-Zeit",
                     "fI": "0",
                     "next": false,
                     "days": "*",
                     "months": "*",
                     "onlyEvenDays": false,
                     "onlyOddDays": false,
                     "onlyEvenWeeks": false,
                     "onlyOddWeeks": false
                 }
             ],
             "x": 540,
             "y": 280,
             "wires": [
                 [
                     "1daf54e19d778ac5"
                 ]
             ]
         },
         {
             "id": "fbd738101ef48d85",
             "type": "inject",
             "z": "e07ec81bf2817d9a",
             "name": "",
             "props": [
                 {
                     "p": "payload"
                 }
             ],
             "repeat": "",
             "crontab": "",
             "once": false,
             "onceDelay": 0.1,
             "topic": "",
             "payload": "true",
             "payloadType": "bool",
             "x": 230,
             "y": 300,
             "wires": [
                 [
                     "f70ba7449572c8a9",
                     "25fb26316449d50a"
                 ]
             ]
         },
         {
             "id": "1daf54e19d778ac5",
             "type": "debug",
             "z": "e07ec81bf2817d9a",
             "name": "",
             "active": false,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "false",
             "statusVal": "",
             "statusType": "auto",
             "x": 830,
             "y": 280,
             "wires": []
         },
         {
             "id": "25fb26316449d50a",
             "type": "time-span",
             "z": "e07ec81bf2817d9a",
             "outputs": 1,
             "name": "",
             "positionConfig": "",
             "operand1": "sunriseEnd",
             "operand1Type": "pdsTime",
             "operand1Format": "0",
             "operand1Offset": 0,
             "operand1OffsetType": "none",
             "operand1OffsetMultiplier": 60000,
             "operand2": "sunsetEnd",
             "operand2Type": "pdsTime",
             "operand2Format": "0",
             "operand2Offset": 0,
             "operand2OffsetType": "none",
             "operand2OffsetMultiplier": 60000,
             "rules": [],
             "checkall": "true",
             "results": [
                 {
                     "p": "",
                     "pt": "msgPayload",
                     "v": "",
                     "vt": "timespan",
                     "o": "",
                     "oT": "none",
                     "oM": "60000",
                     "fTs": 2,
                     "fTsS": 2,
                     "fTsT": "Minuten",
                     "fTsI": "2",
                     "f": 0,
                     "fS": 0,
                     "fT": "Millisekunden UNIX-Zeit",
                     "fI": "0",
                     "next": false,
                     "days": "*",
                     "months": "*",
                     "onlyEvenDays": false,
                     "onlyOddDays": false,
                     "onlyEvenWeeks": false,
                     "onlyOddWeeks": false
                 }
             ],
             "x": 540,
             "y": 340,
             "wires": [
                 [
                     "bf62f0ad31fc54e9"
                 ]
             ]
         },
         {
             "id": "bf62f0ad31fc54e9",
             "type": "change",
             "z": "e07ec81bf2817d9a",
             "name": "",
             "rules": [
                 {
                     "t": "set",
                     "p": "payload",
                     "pt": "msg",
                     "to": "{ \"tag\": $floor((payload *-1) / 60) & \" Stunden - \" & $round((payload *-1) % 60,0) & \" Minuten\",\t\"nacht\": $floor((1440- payload *-1) / 60) & \" Stunden - \" & $round((1440- payload *-1) % 60,0) & \" Minuten\"}",
                     "tot": "jsonata"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 850,
             "y": 340,
             "wires": [
                 [
                     "4d86b7feb800bad5"
                 ]
             ]
         }
      ]
      

      Ich habe zumindest mit dieser Bibliothek alle diese Nodes installiert bekommen:

      825314ea-59a4-4268-a9f1-6de9edbd2568-image.png

      Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

      H 1 Antwort Letzte Antwort
      0
      • mickymM mickym

        @hpgo Wenn Du schon diese Nodes installiert hast, warum nutzt die dann nicht ?

        6b1cc37b-a882-40d4-867f-670f4ab8792c-image.png

        Diese Node ist doch super komfortabel - um solche Aufgaben - out of the box zu lösen:

        366f2133-9039-4594-84b4-8e66e03b72fc-image.png

        In der Hilfe zu der Node gibt es auch ein WIKI um Dir alles erklären zu lassen:

        d1abfc39-19d9-4adf-8bf8-6ba615c9d88c-image.png

        [
           {
               "id": "4d86b7feb800bad5",
               "type": "debug",
               "z": "e07ec81bf2817d9a",
               "name": "",
               "active": true,
               "tosidebar": true,
               "console": false,
               "tostatus": false,
               "complete": "false",
               "statusVal": "",
               "statusType": "auto",
               "x": 1050,
               "y": 340,
               "wires": []
           },
           {
               "id": "f70ba7449572c8a9",
               "type": "time-span",
               "z": "e07ec81bf2817d9a",
               "outputs": 1,
               "name": "",
               "positionConfig": "",
               "operand1": "sunriseEnd",
               "operand1Type": "pdsTime",
               "operand1Format": "0",
               "operand1Offset": 0,
               "operand1OffsetType": "none",
               "operand1OffsetMultiplier": 60000,
               "operand2": "sunsetEnd",
               "operand2Type": "pdsTime",
               "operand2Format": "0",
               "operand2Offset": 0,
               "operand2OffsetType": "none",
               "operand2OffsetMultiplier": 60000,
               "rules": [],
               "checkall": "true",
               "results": [
                   {
                       "p": "",
                       "pt": "msgPayload",
                       "v": "",
                       "vt": "timespan",
                       "o": "",
                       "oT": "none",
                       "oM": "60000",
                       "fTs": 3,
                       "fTsS": 3,
                       "fTsT": "Stunden",
                       "fTsI": "3",
                       "f": 0,
                       "fS": 0,
                       "fT": "Millisekunden UNIX-Zeit",
                       "fI": "0",
                       "next": false,
                       "days": "*",
                       "months": "*",
                       "onlyEvenDays": false,
                       "onlyOddDays": false,
                       "onlyEvenWeeks": false,
                       "onlyOddWeeks": false
                   }
               ],
               "x": 540,
               "y": 280,
               "wires": [
                   [
                       "1daf54e19d778ac5"
                   ]
               ]
           },
           {
               "id": "fbd738101ef48d85",
               "type": "inject",
               "z": "e07ec81bf2817d9a",
               "name": "",
               "props": [
                   {
                       "p": "payload"
                   }
               ],
               "repeat": "",
               "crontab": "",
               "once": false,
               "onceDelay": 0.1,
               "topic": "",
               "payload": "true",
               "payloadType": "bool",
               "x": 230,
               "y": 300,
               "wires": [
                   [
                       "f70ba7449572c8a9",
                       "25fb26316449d50a"
                   ]
               ]
           },
           {
               "id": "1daf54e19d778ac5",
               "type": "debug",
               "z": "e07ec81bf2817d9a",
               "name": "",
               "active": false,
               "tosidebar": true,
               "console": false,
               "tostatus": false,
               "complete": "false",
               "statusVal": "",
               "statusType": "auto",
               "x": 830,
               "y": 280,
               "wires": []
           },
           {
               "id": "25fb26316449d50a",
               "type": "time-span",
               "z": "e07ec81bf2817d9a",
               "outputs": 1,
               "name": "",
               "positionConfig": "",
               "operand1": "sunriseEnd",
               "operand1Type": "pdsTime",
               "operand1Format": "0",
               "operand1Offset": 0,
               "operand1OffsetType": "none",
               "operand1OffsetMultiplier": 60000,
               "operand2": "sunsetEnd",
               "operand2Type": "pdsTime",
               "operand2Format": "0",
               "operand2Offset": 0,
               "operand2OffsetType": "none",
               "operand2OffsetMultiplier": 60000,
               "rules": [],
               "checkall": "true",
               "results": [
                   {
                       "p": "",
                       "pt": "msgPayload",
                       "v": "",
                       "vt": "timespan",
                       "o": "",
                       "oT": "none",
                       "oM": "60000",
                       "fTs": 2,
                       "fTsS": 2,
                       "fTsT": "Minuten",
                       "fTsI": "2",
                       "f": 0,
                       "fS": 0,
                       "fT": "Millisekunden UNIX-Zeit",
                       "fI": "0",
                       "next": false,
                       "days": "*",
                       "months": "*",
                       "onlyEvenDays": false,
                       "onlyOddDays": false,
                       "onlyEvenWeeks": false,
                       "onlyOddWeeks": false
                   }
               ],
               "x": 540,
               "y": 340,
               "wires": [
                   [
                       "bf62f0ad31fc54e9"
                   ]
               ]
           },
           {
               "id": "bf62f0ad31fc54e9",
               "type": "change",
               "z": "e07ec81bf2817d9a",
               "name": "",
               "rules": [
                   {
                       "t": "set",
                       "p": "payload",
                       "pt": "msg",
                       "to": "{ \"tag\": $floor((payload *-1) / 60) & \" Stunden - \" & $round((payload *-1) % 60,0) & \" Minuten\",\t\"nacht\": $floor((1440- payload *-1) / 60) & \" Stunden - \" & $round((1440- payload *-1) % 60,0) & \" Minuten\"}",
                       "tot": "jsonata"
                   }
               ],
               "action": "",
               "property": "",
               "from": "",
               "to": "",
               "reg": false,
               "x": 850,
               "y": 340,
               "wires": [
                   [
                       "4d86b7feb800bad5"
                   ]
               ]
           }
        ]
        

        Ich habe zumindest mit dieser Bibliothek alle diese Nodes installiert bekommen:

        825314ea-59a4-4268-a9f1-6de9edbd2568-image.png

        H Offline
        H Offline
        hpgo
        schrieb am zuletzt editiert von
        #3

        @mickym
        Vielen herzlichen Dank, ich hatte mir nur die Blind Control Node angeschaut.
        Lg

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


        Support us

        ioBroker
        Community Adapters
        Donate

        710

        Online

        32.6k

        Benutzer

        82.2k

        Themen

        1.3m

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

        • Du hast noch kein Konto? Registrieren

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