Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Zeitliches Blockly

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Zeitliches Blockly

    This topic has been deleted. Only users with topic management privileges can see it.
    • Codierknecht
      Codierknecht Developer Most Active @Yoda last edited by

      @yoda
      Im linken Teil muss die Prüfung auf "TotalActivePower < 100" nach meinem Verständnis raus.

      Yoda 1 Reply Last reply Reply Quote 0
      • Yoda
        Yoda @Codierknecht last edited by

        @codierknecht ja habs draußen, ich teste mal ein wenig rum...

        zeit 4.png

        Codierknecht 1 Reply Last reply Reply Quote 0
        • Codierknecht
          Codierknecht Developer Most Active @Yoda last edited by

          @yoda
          Nein - so:
          9acf6f79-b584-4183-aff7-189f838e2fa1-image.png

          Yoda 1 Reply Last reply Reply Quote 0
          • Yoda
            Yoda @Codierknecht last edited by

            @codierknecht stimmt das habe ich gesehen als ich es Postete, habs nun Aktiv kommen aber nur Fehlermeldungen

            zeit 5.png

            Codierknecht 1 Reply Last reply Reply Quote 0
            • Codierknecht
              Codierknecht Developer Most Active @Yoda last edited by

              @yoda
              Schau in den JS-Quellcode. In den Fehlermeldungen sind Zeilennummern (35) angegeben.
              Da ist wohl ein State gar nicht bool.

              Yoda 1 Reply Last reply Reply Quote 0
              • Yoda
                Yoda @Codierknecht last edited by Yoda

                @codierknecht
                ich habe mal einen neuen Datenpunkt angelegt der entsprechend geschaltet werden soll.
                Das macht er soweit ich sehe auch.
                Nur kommt immer eine Warnung:

                zeit 6.png

                <block xmlns="https://developers.google.com/blockly/xml" type="on_ext" id="$MTczKq5M[)q~5ums$P1" x="-438" y="-1587">
                  <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                  <field name="CONDITION">ne</field>
                  <field name="ACK_CONDITION"></field>
                  <value name="OID0">
                    <shadow type="field_oid" id="dcv3.1sshW|CuMJl$$sW">
                      <field name="oid">shelly.0.shellypro3em#08f9e0e88fc4#1.EM0.TotalActivePower</field>
                    </shadow>
                  </value>
                  <statement name="STATEMENT">
                    <block type="controls_if" id="1i$gNV20J$nzQGH=pZAl">
                      <mutation elseif="1"></mutation>
                      <value name="IF0">
                        <block type="logic_compare" id="bg35k3A:0k0Zmuc8WAfG">
                          <field name="OP">LTE</field>
                          <value name="A">
                            <block type="on_source" id="Z|ueY`Pf~m.C9]-S$oy;">
                              <field name="ATTR">state.val</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="math_number" id="fOB#07r~#k5onO#bK}E,">
                              <field name="NUM">100</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <statement name="DO0">
                        <block type="timeouts_cleartimeout" id="WUC*cW,hX39=H^+yf~Ay">
                          <field name="NAME">timeout2</field>
                          <next>
                            <block type="control" id="0}u[]$oUiUyIi742-%J[">
                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                              <field name="OID">0_userdata.0.DatenpunktAktivPowerZeit</field>
                              <field name="WITH_DELAY">FALSE</field>
                              <value name="VALUE">
                                <block type="logic_boolean" id=",q5NBv#]~80biB1$Dp3=">
                                  <field name="BOOL">FALSE</field>
                                </block>
                              </value>
                            </block>
                          </next>
                        </block>
                      </statement>
                      <value name="IF1">
                        <block type="logic_compare" id="TNN;|i{obr-ufa@Ci=]i">
                          <field name="OP">LTE</field>
                          <value name="A">
                            <block type="on_source" id="zg{c|U7(A1ciP.Xrweos">
                              <field name="ATTR">oldState.val</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="math_number" id="7+q7Z#XtTlDdB0goRGY]">
                              <field name="NUM">100</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <statement name="DO1">
                        <block type="timeouts_settimeout" id="9,{:SCW9{Aq$@@.%bC_d">
                          <field name="NAME">timeout2</field>
                          <field name="DELAY">10</field>
                          <field name="UNIT">sec</field>
                          <statement name="STATEMENT">
                            <block type="control" id="(8vdZEBPf=R^4mrhGF(`">
                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                              <field name="OID">0_userdata.0.DatenpunktAktivPowerZeit</field>
                              <field name="WITH_DELAY">FALSE</field>
                              <value name="VALUE">
                                <block type="logic_boolean" id="%{R2^o9Bl1VqB:9wBkK_">
                                  <field name="BOOL">TRUE</field>
                                </block>
                              </value>
                            </block>
                          </statement>
                        </block>
                      </statement>
                    </block>
                  </statement>
                </block>
                

                Das steht in Zeile 51:

                ![d962188c-caaf-486a-9548-79df818694ef-image.png](/assets/uploads/files/1724242654751-d962188c-caaf-486a-9548-79df818694ef-image.png) code_text
                

                on({ id: [].concat(['shelly.0.shellypro3em#08f9e0e88fc4#1.EM0.TotalActivePower']), change: 'ne' }, async (obj) => {
                let value = obj.state.val;
                let oldValue = obj.oldState.val;
                if ((obj.state ? obj.state.val : '') <= 100) {
                (() => { if (timeout2) { clearTimeout(timeout2); timeout2 = null; }})();
                setState('0_userdata.0.DatenpunktAktivPowerZeit' /* DatenpunktAktivPowerZeit /, false);
                } else if ((obj.oldState ? obj.oldState.val : '') <= 100) {
                timeout2 = setTimeout(async () => {
                timeout2 = null;
                setState('0_userdata.0.DatenpunktAktivPowerZeit' /
                DatenpunktAktivPowerZeit */, true);
                }, 10000);
                }
                });

                
                web.0
                2024-08-21 14:21:06.606	info	<== Disconnect system.user.admin from ::ffff:192.168.178.166 flot
                
                web.0
                2024-08-21 14:21:06.601	info	<== Disconnect system.user.admin from ::ffff:192.168.178.166 flot
                
                web.0
                2024-08-21 14:21:06.543	info	<== Disconnect system.user.admin from ::ffff:192.168.178.166 flot
                
                javascript.0
                2024-08-21 14:21:04.339	info	State value to set for "0_userdata.0.DatenpunktAktivPowerZeit" has to be type "string" but received type "boolean"
                
                javascript.0
                2024-08-21 14:21:04.323	warn	at processImmediate (node:internal/timers:483:21)
                
                javascript.0
                2024-08-21 14:21:04.323	warn	at Immediate._onImmediate (/opt/iobroker/node_modules/@iobroker/js-controller-adapter/src/lib/adapter/adapter.ts:11053:62)
                
                javascript.0
                2024-08-21 14:21:04.323	warn	at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:645:29)
                
                javascript.0
                2024-08-21 14:21:04.322	warn	at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1452:38)
                
                javascript.0
                2024-08-21 14:21:04.322	warn	at Object.<anonymous> (script.js.Manni_Schalter.Aussen.Teichfilter-Sommer1:51:5)
                
                javascript.0
                2024-08-21 14:21:04.322	warn	at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:2090:20)
                
                javascript.0
                2024-08-21 14:21:04.319	warn	You are assigning a boolean to the state "0_userdata.0.DatenpunktAktivPowerZeit" which expects a string. Please fix your code to use a string or change the state type to boolean. This warning might become an error in future versions.
                
                javascript.0
                2024-08-21 14:21:00.285	info	State value to set for "0_userdata.0.DatenpunktAktivPowerZeit" has to be type "string" but received type "boolean"
                
                javascript.0
                2024-08-21 14:21:00.272	warn	at processImmediate (node:internal/timers:483:21)
                
                Codierknecht 1 Reply Last reply Reply Quote 0
                • Codierknecht
                  Codierknecht Developer Most Active @Yoda last edited by

                  @yoda sagte in Zeitliches Blockly:

                  Das steht in Zeile 51:

                  Das XML ist nur der rechte Teil.

                  You are assigning a boolean to the state "0_userdata.0.DatenpunktAktivPowerZeit" which expects a string
                  

                  Hast Du den Datenpunkt als "Zeichenfolge" angelegt?

                  Yoda 1 Reply Last reply Reply Quote 0
                  • Yoda
                    Yoda @Codierknecht last edited by

                    @codierknecht

                    {
                      "common": {
                        "name": "DatenpunktAktivPowerZeit",
                        "desc": "Manuell erzeugt",
                        "role": "state",
                        "type": "string",
                        "read": true,
                        "write": true,
                        "def": ""
                      },
                      "type": "state",
                      "native": {},
                      "_id": "0_userdata.0.DatenpunktAktivPowerZeit",
                      "acl": {
                        "object": 1636,
                        "state": 1636,
                        "owner": "system.user.admin",
                        "ownerGroup": "system.group.administrator"
                      },
                      "from": "system.adapter.admin.0",
                      "user": "system.user.admin",
                      "ts": 1724243075612
                    }
                    
                    Codierknecht 1 Reply Last reply Reply Quote 0
                    • Codierknecht
                      Codierknecht Developer Most Active @Yoda last edited by

                      @yoda sagte in Zeitliches Blockly:

                      "type": "string",                                                                                                                                                                            
                      

                      Das muss bool sein (Logikwert)

                      Yoda 1 Reply Last reply Reply Quote 1
                      • Yoda
                        Yoda @Codierknecht last edited by

                        @codierknecht perfekt vielen Dank, sieht soweit nun sauber aus, in der Praxis muss ich noch etwas schauen wie es sich verhält.

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        791
                        Online

                        32.0k
                        Users

                        80.3k
                        Topics

                        1.3m
                        Posts

                        blockly
                        4
                        18
                        621
                        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