Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Frage wegen Warnings in Blockly Prg

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    Frage wegen Warnings in Blockly Prg

    This topic has been deleted. Only users with topic management privileges can see it.
    • dslraser
      dslraser Forum Testing Most Active @hg6806 last edited by dslraser

      @hg6806
      Im unteren Blockly hast Du Wert von Objekt ID….als Trigger, das geht schon mal nicht. (nur Objekt ID nehmen)

      1 Reply Last reply Reply Quote 0
      • hg6806
        hg6806 Most Active last edited by

        Stimmt!
        Ist gefixt.

        Ich bekomme allerdings noch immer ein Warning:

        c74bf71a-58f4-49fe-8e92-ccb687c34b93-image.png

        Ist Zeile 17?

        9035f9f5-2dfa-480f-814b-bb509acb159c-image.png

        Homoran 1 Reply Last reply Reply Quote 0
        • Homoran
          Homoran Global Moderator Administrators @hg6806 last edited by

          @hg6806 Kein Screenshot!
          ich kann da nichts zitieren!

          1 Reply Last reply Reply Quote 0
          • hg6806
            hg6806 Most Active last edited by

            OK, hier das Javascript:

            var Boost_Soll_T_Raum, timeout, timeout;
            
            
            on({id: 'smartmeter.0.1-0:16_7_0__255.value', change: "ne"}, async function (obj) {
              var value = obj.state.val;
              var oldValue = obj.oldState.val;
              if (getState("javascript.0.PV.Heizung-Boost").val && !timeout) {
                if ((obj.state ? obj.state.val : "") < -500) {
                  if (Boost_Soll_T_Raum < 30) {
                    Boost_Soll_T_Raum = (typeof Boost_Soll_T_Raum == 'number' ? Boost_Soll_T_Raum : 0) + 0.5;
                  }
                }
              } else if ((obj.state ? obj.state.val : "") < -50 && Boost_Soll_T_Raum > getState("javascript.0.PV.Raumtemp-Soll_alt").val) {
                Boost_Soll_T_Raum = (typeof Boost_Soll_T_Raum == 'number' ? Boost_Soll_T_Raum : 0) + -0.5;
              }
              if (getState("smartmeter.0.1-0:16_7_0__255.value").val != Boost_Soll_T_Raum) {
                setState("fhem.0.myHPSU.HPSU~Soll_T_Raum_1"/*myHPSU HPSU.Soll_T_Raum_1*/, Boost_Soll_T_Raum);
                timeout = setTimeout(async function () {
                  timeout = null;
                }, 60000);
              }
            });
            
            setState("javascript.0.PV.Heizung-Boost"/*Heizung-Boost*/, false);
            on({id: 'javascript.0.PV.Heizung-Boost', change: "ne"}, async function (obj) {
              var value = obj.state.val;
              var oldValue = obj.oldState.val;
              if ((obj.state ? obj.state.val : "")) {
                Boost_Soll_T_Raum = getState("fhem.0.myHPSU.HPSU~Soll_T_Raum_1").val;
                setState("javascript.0.PV.Raumtemp-Soll_alt"/*Raumtemp-Soll_alt*/, Boost_Soll_T_Raum, true);
              } else {
                setState("fhem.0.myHPSU.HPSU~Soll_T_Raum_1"/*myHPSU HPSU.Soll_T_Raum_1*/, getState("javascript.0.PV.Raumtemp-Soll_alt").val);
              }
            });
            
            Homoran 1 Reply Last reply Reply Quote 0
            • Homoran
              Homoran Global Moderator Administrators @hg6806 last edited by Homoran

              @hg6806 sagte in Frage wegen Warnings in Blockly Prg:

              setState("fhem.0.myHPSU.HPSU~Soll_T_Raum_1"/myHPSU HPSU.Soll_T_Raum_1/, Boost_Soll_T_Raum)

              was macht die Tilde da?
              Heisst deine ID wirklich so?

              1 Reply Last reply Reply Quote 0
              • hg6806
                hg6806 Most Active last edited by

                Ja, die wilde Tilde ist leider Bestandteil des Datenpunktes.
                Der kommt von FHEM.

                dslraser 1 Reply Last reply Reply Quote 0
                • dslraser
                  dslraser Forum Testing Most Active @hg6806 last edited by

                  @hg6806
                  hast Du mal probiert dafür einen Alias zu erstellen und dann den im Blockly zu verwenden ?
                  Da kannst Du dann wenigstens „vernünftige“ Namen und ID vergeben (ohne wilde Tilde)

                  1 Reply Last reply Reply Quote 0
                  • hg6806
                    hg6806 Most Active last edited by

                    Habe ein Alias für den Wert erstellt.
                    Alias-Namen ohne Tilde. Steht auch so im Alias-Manager drin.

                    Wenn ich den Alias dann auswähle steht wieder eine Tilde drin?????

                    Nach dem Fix von Wert des Objekt ID in nur Objekt ID geht es, zählt jedoch alle 5-10 Sek hoch und nicht jede Minute.

                    Ich schätze da stimmt was mit Timeout nicht.
                    Ist auch komisch dass es in der Variablendeklaration 2x auftaucht.

                    Wie schon geschrieben hatte ich "timeout" als Variable neu angelegt, da ich es sonst im Blockly nicht hätte auswählen können

                    paul53 1 Reply Last reply Reply Quote 0
                    • paul53
                      paul53 @hg6806 last edited by paul53

                      @hg6806 sagte: Wie schon geschrieben hatte ich "timeout" als Variable neu angelegt, da ich es sonst im Blockly nicht hätte auswählen können

                      Dann wähle die andere (echte) Variable timeout aus und kontrolliere in der Javascript-Ansicht, dass nur noch eine Variable timeout existiert.

                      @hg6806 sagte in Frage wegen Warnings in Blockly Prg:

                      hier das Javascript:

                      Falsch nachgebaut. Hier ein Export, bei dem nur noch sämtliche Datenpunkt-IDs zugewiesen werden müssen:

                      <xml xmlns="https://developers.google.com/blockly/xml">
                       <variables>
                         <variable id="Z$dQ(fbDb]yEVd;|nC}-">sollwert</variable>
                         <variable type="timeout" id="timeout">timeout</variable>
                       </variables>
                       <block type="on_ext" id="WS2pki!+Wa]B9pOoH1EE" x="37" y="212">
                         <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="Y^gX`@%S7?]9pdzDbqEn">
                             <field name="oid">0_userdata.0.Blockly.Power</field>
                           </shadow>
                         </value>
                         <statement name="STATEMENT">
                           <block type="controls_if" id="-o8O7GRQ_+OWlJ(^s1h%">
                             <value name="IF0">
                               <block type="logic_operation" id="eT!,1v1_jt8)-5XX@;?2" inline="false">
                                 <field name="OP">AND</field>
                                 <value name="A">
                                   <block type="get_value" id="v/tyE{%;^.:%%orWc8:=">
                                     <field name="ATTR">val</field>
                                     <field name="OID">0_userdata.0.Blockly.Freigabe_Ventil</field>
                                   </block>
                                 </value>
                                 <value name="B">
                                   <block type="logic_negate" id="MXXJdcO#s]zQ-JxKx[Bh">
                                     <value name="BOOL">
                                       <block type="variables_get" id="x9+r_-8A*dc4*7wR}1KX">
                                         <field name="VAR" id="timeout" variabletype="timeout">timeout</field>
                                       </block>
                                     </value>
                                   </block>
                                 </value>
                               </block>
                             </value>
                             <statement name="DO0">
                               <block type="controls_if" id="$+Tz0_$:o%:gB#ZPeD:C">
                                 <mutation elseif="1"></mutation>
                                 <value name="IF0">
                                   <block type="logic_compare" id="pZ-=;Pw4Q#KOu7F|A6r%">
                                     <field name="OP">LT</field>
                                     <value name="A">
                                       <block type="on_source" id="7r5wceo=h`FgR(eUAPjg">
                                         <field name="ATTR">state.val</field>
                                       </block>
                                     </value>
                                     <value name="B">
                                       <block type="math_number" id="n|s4N_SYXa:14gT]--M8">
                                         <field name="NUM">-500</field>
                                       </block>
                                     </value>
                                   </block>
                                 </value>
                                 <statement name="DO0">
                                   <block type="controls_if" id="-vmvsiA04M-QQ{q+;2=S">
                                     <value name="IF0">
                                       <block type="logic_compare" id="r!}hW3Jx;};jGqVq7(,*">
                                         <field name="OP">LT</field>
                                         <value name="A">
                                           <block type="variables_get" id=";)|KKMwc}q?9GgFXDRJB">
                                             <field name="VAR" id="Z$dQ(fbDb]yEVd;|nC}-">sollwert</field>
                                           </block>
                                         </value>
                                         <value name="B">
                                           <block type="math_number" id="cF!GbW/0|^ptc@N7QwxT">
                                             <field name="NUM">30</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <statement name="DO0">
                                       <block type="math_change" id=",tB,NxYBtB.os9gwcwKF">
                                         <field name="VAR" id="Z$dQ(fbDb]yEVd;|nC}-">sollwert</field>
                                         <value name="DELTA">
                                           <shadow type="math_number" id="6.SMWS.JZ7n.%iWwSIYY">
                                             <field name="NUM">0.5</field>
                                           </shadow>
                                         </value>
                                       </block>
                                     </statement>
                                   </block>
                                 </statement>
                                 <value name="IF1">
                                   <block type="logic_operation" id="?S~%I*Xg2:{~A+]VD?P`" inline="false">
                                     <field name="OP">AND</field>
                                     <value name="A">
                                       <block type="logic_compare" id="!|lzv#rfsRB[uRR-?8$y">
                                         <field name="OP">GT</field>
                                         <value name="A">
                                           <block type="on_source" id="k1M{WSL7Jhz.(NG+OzPq">
                                             <field name="ATTR">state.val</field>
                                           </block>
                                         </value>
                                         <value name="B">
                                           <block type="math_number" id="-d#_*f;t]C(]]/Ai.1%f">
                                             <field name="NUM">-50</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <value name="B">
                                       <block type="logic_compare" id="cz6_7CvYs=$+Sm6EE:gb">
                                         <field name="OP">GT</field>
                                         <value name="A">
                                           <block type="variables_get" id="9`#BZ6DDn/2xOix%G}4D">
                                             <field name="VAR" id="Z$dQ(fbDb]yEVd;|nC}-">sollwert</field>
                                           </block>
                                         </value>
                                         <value name="B">
                                           <block type="get_value" id=";)%YZm}v`Zgyl_5nzjoc">
                                             <field name="ATTR">val</field>
                                             <field name="OID">ID auswählen</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                   </block>
                                 </value>
                                 <statement name="DO1">
                                   <block type="math_change" id="cD[rF.$wvhyc9A~lPgHD">
                                     <field name="VAR" id="Z$dQ(fbDb]yEVd;|nC}-">sollwert</field>
                                     <value name="DELTA">
                                       <shadow type="math_number" id="tgK{*FKsZ*.aVs|?/9kR">
                                         <field name="NUM">-0.5</field>
                                       </shadow>
                                     </value>
                                   </block>
                                 </statement>
                                 <next>
                                   <block type="controls_if" id="(L0@;g9L{HUsVe)wksD9">
                                     <value name="IF0">
                                       <block type="logic_compare" id="qp1YjeoR-#T`*b)T-s/2">
                                         <field name="OP">NEQ</field>
                                         <value name="A">
                                           <block type="variables_get" id="Y`5.KpcfrW`AxI:SDz#(">
                                             <field name="VAR" id="Z$dQ(fbDb]yEVd;|nC}-">sollwert</field>
                                           </block>
                                         </value>
                                         <value name="B">
                                           <block type="get_value" id="ZX_bR1a[SnhgVmw|Q*9n">
                                             <field name="ATTR">val</field>
                                             <field name="OID">0_userdata.0.Blockly.Soll_Temperatur</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <statement name="DO0">
                                       <block type="control" id="X]wVtN]L1~B?Hf+3=o5V">
                                         <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                         <field name="OID">0_userdata.0.Blockly.Soll_Temperatur</field>
                                         <field name="WITH_DELAY">FALSE</field>
                                         <value name="VALUE">
                                           <block type="variables_get" id="E=D1Jm-$N-SVHnI7!YsQ">
                                             <field name="VAR" id="Z$dQ(fbDb]yEVd;|nC}-">sollwert</field>
                                           </block>
                                         </value>
                                       </block>
                                     </statement>
                                     <next>
                                       <block type="timeouts_settimeout" id="!Mx#av5+R*@g#]jARsK.">
                                         <field name="NAME">timeout</field>
                                         <field name="DELAY">1</field>
                                         <field name="UNIT">min</field>
                                         <statement name="STATEMENT">
                                           <block type="variables_set" id="4ym+oZsroTg8TRrd$*lv">
                                             <field name="VAR" id="timeout" variabletype="timeout">timeout</field>
                                             <value name="VALUE">
                                               <block type="logic_null" id="M6m?`rO-O1Ip)vX*cLw5"></block>
                                             </value>
                                           </block>
                                         </statement>
                                       </block>
                                     </next>
                                   </block>
                                 </next>
                               </block>
                             </statement>
                           </block>
                         </statement>
                       </block>
                       <block type="on_ext" id="V!I|JBF1eXs(=1C?2MrO" x="512" y="213">
                         <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="=f[=Yy}F]CQ@$O/r1k{V">
                             <field name="oid">0_userdata.0.Blockly.Freigabe_Ventil</field>
                           </shadow>
                         </value>
                         <statement name="STATEMENT">
                           <block type="controls_if" id="S_.jdk|=zJG7scL4a!C@">
                             <mutation else="1"></mutation>
                             <value name="IF0">
                               <block type="on_source" id=")mc%Hr$aEpk.r2gF#`Zw">
                                 <field name="ATTR">state.val</field>
                               </block>
                             </value>
                             <statement name="DO0">
                               <block type="variables_set" id="j!fW@36IZ4+v~%`cE}.?">
                                 <field name="VAR" id="Z$dQ(fbDb]yEVd;|nC}-">sollwert</field>
                                 <value name="VALUE">
                                   <block type="get_value" id="6L4QjxCw`a/4,tc%*MYr">
                                     <field name="ATTR">val</field>
                                     <field name="OID">0_userdata.0.Blockly.Soll_Temperatur</field>
                                   </block>
                                 </value>
                                 <next>
                                   <block type="update" id="M=0-F6W4M+$c3p(9Br11">
                                     <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                     <field name="OID">Object ID</field>
                                     <field name="WITH_DELAY">FALSE</field>
                                     <value name="VALUE">
                                       <block type="variables_get" id="M*ss*L*Amq{|pG|K0_^F">
                                         <field name="VAR" id="Z$dQ(fbDb]yEVd;|nC}-">sollwert</field>
                                       </block>
                                     </value>
                                   </block>
                                 </next>
                               </block>
                             </statement>
                             <statement name="ELSE">
                               <block type="control" id="11t{niAfqS9bH9?UXEf{">
                                 <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                 <field name="OID">0_userdata.0.Blockly.Soll_Temperatur</field>
                                 <field name="WITH_DELAY">FALSE</field>
                                 <value name="VALUE">
                                   <block type="get_value" id="-6|)NTE*4+N[YhQF;%;,">
                                     <field name="ATTR">val</field>
                                     <field name="OID">ID auswählen</field>
                                   </block>
                                 </value>
                               </block>
                             </statement>
                           </block>
                         </statement>
                       </block>
                      </xml>
                      

                      hg6806 1 Reply Last reply Reply Quote 0
                      • hg6806
                        hg6806 Most Active @paul53 last edited by

                        @paul53
                        Danke, aber Ziel ist es, dass ich es alleine auf die Beine stelle.
                        Das Blockly hatte ich nur zur Hälfte verstanden, bei deinem Javascript verstehe ich gar nichts. Das bringt mir nichts.

                        Ich muss erst einmal schauen, warum mir Alias wieder eine Tilde ausspuckt, obwohl ich ohne Tilde erstelle.

                        paul53 1 Reply Last reply Reply Quote 0
                        • paul53
                          paul53 @hg6806 last edited by

                          @hg6806 sagte: Ziel ist es, dass ich es alleine auf die Beine stelle.

                          Gut so. Vergleiche die Anordnung von "Ausführen timeout".

                          Bild_2021-11-09_143546.png

                          1 Reply Last reply Reply Quote 0
                          • hg6806
                            hg6806 Most Active last edited by

                            @paul53
                            Stimmt!

                            So sollte es hoffentlich passen. Kann es erst morgen testen:

                            0c3b2bda-f0ec-4847-9c96-e4728c854cde-image.png

                            paul53 1 Reply Last reply Reply Quote 0
                            • paul53
                              paul53 @hg6806 last edited by

                              @hg6806 sagte: So sollte es hoffentlich passen.

                              Weshalb wird "Heizung-Boost" bei Skriptstart auf falsch gesetzt?

                              1 Reply Last reply Reply Quote 0
                              • hg6806
                                hg6806 Most Active last edited by

                                Weil ich es generell eben auf aus gestellt haben möchte, wenn der Pi mal gebootet wird Javascript neu gestartet, etc.

                                1 Reply Last reply Reply Quote 0
                                • hg6806
                                  hg6806 Most Active last edited by

                                  So, nachdem ich es richtig umgesetzt wurde läuft es endlich 🙂

                                  Noch eine kurze Off Topic Frage.

                                  a5856ad1-ef73-41fb-b3d0-93416540277f-image.png

                                  Das Objekt myHPSU HPSU.Betriebsart..... gibt mir ab und zu ein "Abtauen" aus.
                                  Jedoch funktioniert die Falls-Abfrage nicht.

                                  Homoran paul53 2 Replies Last reply Reply Quote 0
                                  • Homoran
                                    Homoran Global Moderator Administrators @hg6806 last edited by

                                    @hg6806 sagte in Frage wegen Warnings in Blockly Prg:

                                    Jedoch funktioniert die Falls-Abfrage nicht.

                                    wie sieht denn das RAW des Datenpunktes aus?
                                    kann das eine Werteliste sein?

                                    1 Reply Last reply Reply Quote 0
                                    • hg6806
                                      hg6806 Most Active last edited by

                                      Hier ist das Raw. Werteliste kann ich nicht beantworten.

                                      {
                                        "_id": "fhem.0.myHPSU.HPSU~Aktive_Betriebsart",
                                        "type": "state",
                                        "common": {
                                          "name": "myHPSU HPSU.Aktive_Betriebsart",
                                          "type": "string",
                                          "role": "text",
                                          "read": true,
                                          "write": false,
                                          "custom": {
                                            "history.0": {
                                              "enabled": true,
                                              "aliasId": "",
                                              "changesOnly": true,
                                              "debounce": 0,
                                              "changesRelogInterval": "0",
                                              "changesMinDelta": 0,
                                              "maxLength": 10,
                                              "retention": "31536000"
                                            }
                                          }
                                        },
                                        "native": {
                                          "Name": "myHPSU",
                                          "Attribute": "HPSU.Aktive_Betriebsart",
                                          "Readings": true,
                                          "type": "string",
                                          "role": "text"
                                        },
                                        "value": {
                                          "val": "Standby"
                                        },
                                        "acl": {
                                          "object": 1636,
                                          "state": 1636,
                                          "owner": "system.user.admin",
                                          "ownerGroup": "system.group.administrator"
                                        },
                                        "from": "system.adapter.admin.0",
                                        "user": "system.user.admin",
                                        "ts": 1622098457713
                                      }
                                      
                                      Homoran 1 Reply Last reply Reply Quote 0
                                      • paul53
                                        paul53 @hg6806 last edited by paul53

                                        @hg6806
                                        Du triggerst auf "...Aktive_Betriebsart", vergleichst dann aber "...Betriebsart". Besser so für Beginn:

                                        Bild_2021-11-11_184938.png

                                        und so für Ende Abtauen:

                                        Bild_2021-11-11_185150.png

                                        1 Reply Last reply Reply Quote 0
                                        • Homoran
                                          Homoran Global Moderator Administrators @hg6806 last edited by

                                          @hg6806 sagte in Frage wegen Warnings in Blockly Prg:

                                          "type": "string",

                                          nein, ist wirklich ein String

                                          dann schreib mal zusätzliche einen debug Baustein rein, der die den WERT ausgibt, damit man sieht was da wirklich ankommt, wenn da Abtauen steht,
                                          Wert ist ein Menüpunkt des Pulldownmenüs in dem Baustein aus der Gruppe Trigger

                                          hg6806 1 Reply Last reply Reply Quote 0
                                          • hg6806
                                            hg6806 Most Active @Homoran last edited by

                                            @homoran
                                            Welcher Baustein ist das?

                                            paul53 Homoran 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            744
                                            Online

                                            31.8k
                                            Users

                                            79.9k
                                            Topics

                                            1.3m
                                            Posts

                                            8
                                            63
                                            2033
                                            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