Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Node-Red
    5. Tages/Nachtlänge berechnen

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Tages/Nachtlänge berechnen

    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hpgo last edited by

      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

      mickym 1 Reply Last reply Reply Quote 0
      • mickym
        mickym Most Active @hpgo last edited by 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 1 Reply Last reply Reply Quote 0
        • H
          hpgo @mickym last edited by

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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Support us

          ioBroker
          Community Adapters
          Donate

          650
          Online

          31.7k
          Users

          79.8k
          Topics

          1.3m
          Posts

          2
          3
          232
          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