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. Node-Red
  5. Tages/Nachtlänge berechnen

NEWS

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

  • 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

Tages/Nachtlänge berechnen

Scheduled Pinned Locked Moved Node-Red
3 Posts 2 Posters 368 Views 3 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.
  • H Offline
    H Offline
    hpgo
    wrote on last edited by
    #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 Reply Last reply
    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 Offline
      mickymM Offline
      mickym
      Most Active
      wrote on last edited by 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 Reply Last reply
      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
        wrote on last edited by
        #3

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

        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

        294

        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