Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. (gelöst) Sonnenauf/untergang mit Log warn ?

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    (gelöst) Sonnenauf/untergang mit Log warn ?

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

      Hallo 👍

      Ich möchte die Zeiten in ein Objekt schreiben um es allgemein verwenden zu können.
      Dazu schreibe ich SA und SU in ein Objekt und aus dem Objekt extrahiere ich dann die Zeit.
      Die Objekte sind Zeichenketten (also String?)
      Unterschied in der extrahierten Zeit (GMT+1? MEZ?), diese stimmt, der komplette Zeitstempel ist 1h falsch.

      Funktioniert soweit, nur gibt es Einträge im Log

      javascript.0	2021-03-13 07:16:00.021	warn	(15581) at processTimers (internal/timers.js:497:7)
      javascript.0	2021-03-13 07:16:00.020	warn	(15581) at listOnTimeout (internal/timers.js:554:17)
      javascript.0	2021-03-13 07:16:00.020	warn	(15581) at Timeout._onTimeout (/opt/iobroker/node_modules/iobroker.javascript/node_modules/node-schedule/lib/schedule.js:510:7)
      javascript.0	2021-03-13 07:16:00.019	warn	(15581) at /opt/iobroker/node_modules/iobroker.javascript/node_modules/node-schedule/lib/schedule.js:552:11
      javascript.0	2021-03-13 07:16:00.019	warn	(15581) at Job.invoke (/opt/iobroker/node_modules/iobroker.javascript/node_modules/node-schedule/lib/schedule.js:173:10)
      javascript.0	2021-03-13 07:16:00.019	warn	(15581) at Job.job (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1296:34)
      javascript.0	2021-03-13 07:16:00.018	warn	(15581) at Object.<anonymous> (script.js.common.Sonne:3:3)
      javascript.0	2021-03-13 07:16:00.018	warn	(15581) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1422:20)
      javascript.0	2021-03-13 07:16:00.015	warn	(15581) You are assigning a object to the state "javascript.0.Sonne.Sonnenuntergang" which expects a string. Please fix your code to use a string or change the state type to object. This warning migh
      javascript.0	2021-03-13 07:16:00.014	warn	(15581) at processTimers (internal/timers.js:497:7)
      javascript.0	2021-03-13 07:16:00.014	warn	(15581) at listOnTimeout (internal/timers.js:554:17)
      javascript.0	2021-03-13 07:16:00.014	warn	(15581) at Timeout._onTimeout (/opt/iobroker/node_modules/iobroker.javascript/node_modules/node-schedule/lib/schedule.js:510:7)
      javascript.0	2021-03-13 07:16:00.013	warn	(15581) at /opt/iobroker/node_modules/iobroker.javascript/node_modules/node-schedule/lib/schedule.js:552:11
      javascript.0	2021-03-13 07:16:00.013	warn	(15581) at Job.invoke (/opt/iobroker/node_modules/iobroker.javascript/node_modules/node-schedule/lib/schedule.js:173:10)
      javascript.0	2021-03-13 07:16:00.012	warn	(15581) at Job.job (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1296:34)
      javascript.0	2021-03-13 07:16:00.012	warn	(15581) at Object.<anonymous> (script.js.common.Sonne:2:3)
      javascript.0	2021-03-13 07:16:00.011	warn	(15581) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1422:20)
      javascript.0	2021-03-13 07:16:00.007	warn	(15581) You are assigning a object to the state "javascript.0.Sonne.Sonnenaufgang" which expects a string. Please fix your code to use a string or change the state type to object. This warning might
      
      
      <xml xmlns="https://developers.google.com/blockly/xml">
        <block type="schedule" id="axKIE:]CZ2er~HzyK#sH" x="-63" y="-63">
          <field name="SCHEDULE">{"time":{"exactTime":true,"start":"03:00"},"period":{"days":1}}</field>
          <statement name="STATEMENT">
            <block type="update" id="#12sgD682S#Z/@;#5^xi">
              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
              <field name="OID">javascript.0.Sonne.Sonnenaufgang</field>
              <field name="WITH_DELAY">FALSE</field>
              <value name="VALUE">
                <block type="time_astro" id="i`eJycW41~Rt)4S[f5)!">
                  <field name="TYPE">sunrise</field>
                  <field name="OFFSET">0</field>
                </block>
              </value>
              <next>
                <block type="update" id="p2/LYZU=kea]~]/SF^O[">
                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                  <field name="OID">javascript.0.Sonne.Sonnenuntergang</field>
                  <field name="WITH_DELAY">FALSE</field>
                  <value name="VALUE">
                    <block type="time_astro" id="VB,-F0PIdPo8ZpHx6Y$i">
                      <field name="TYPE">sunset</field>
                      <field name="OFFSET">0</field>
                    </block>
                  </value>
                  <next>
                    <block type="update" id="3}M6T`4#PA=yi$YO)`HA">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                      <field name="OID">javascript.0.Sonne.ZeitSA</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="convert_from_date" id="!@+]1|_W^Sz*KG^4k/r!">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                          <field name="OPTION">hh:mm</field>
                          <value name="VALUE">
                            <block type="time_astro" id="yAFE)h}/^R38Ndj_$O6!">
                              <field name="TYPE">sunrise</field>
                              <field name="OFFSET">0</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <next>
                        <block type="update" id="iK=d{4w$SS@v(D%=vTmF">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">javascript.0.Sonne.ZeitSU</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="convert_from_date" id=".3.LI3mG.TadnNzpGn(E">
                              <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                              <field name="OPTION">hh:mm</field>
                              <value name="VALUE">
                                <block type="time_astro" id="Zrx*YxV8f/M2:o#/T7JU">
                                  <field name="TYPE">sunset</field>
                                  <field name="OFFSET">0</field>
                                </block>
                              </value>
                            </block>
                          </value>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
      </xml>
      

      Bildschirmfoto 2021-03-13 um 07.21.46.png
      Bildschirmfoto 2021-03-13 um 07.23.16.png
      Bildschirmfoto 2021-03-13 um 07.24.07.png
      Bildschirmfoto 2021-03-13 um 07.29.09.png

      Asgothian 1 Reply Last reply Reply Quote 0
      • Asgothian
        Asgothian Developer @Humidor last edited by

        @humidor Du solltest das "Objekt" Zeit in einen Text umwandeln. Dein Datenpunkt erwartet eine Zeichenkette, aber bekommt ein Objekt geliefert.

        Wenn du diesen Baustein vor deine Werte setzt sollte es passen.
        Screen Shot 2021-03-13 at 07.37.02 .png

        Humidor 2 Replies Last reply Reply Quote 1
        • Humidor
          Humidor @Asgothian last edited by

          @asgothian super, danke, hat damit funktioniert und alle Werte stimmen jetzt.

          1 Reply Last reply Reply Quote 0
          • Humidor
            Humidor @Asgothian last edited by Humidor

            @asgothian
            eine Abfrage, passt das so oder muss da auch noch umgewandelt werden?
            Bildschirmfoto 2021-03-13 um 08.33.29.png

            ..schaut OK aus, wird abgearbeitet, mal sehen wenn es außerhalb der Zeit ist

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

            Support us

            ioBroker
            Community Adapters
            Donate

            592
            Online

            32.0k
            Users

            80.5k
            Topics

            1.3m
            Posts

            2
            4
            137
            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