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] Aufzählung Fensterstatus - Anzeige in VIS

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelöst] Aufzählung Fensterstatus - Anzeige in VIS

    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      IceD112 @Schmakus last edited by

      @schmakus
      Richtig, das funktioniert leider nicht.

      1 Reply Last reply Reply Quote 0
      • amg_666
        amg_666 @IceD112 last edited by

        @iced112 im Blockly hast du id "window" aber deine Aufzählung heißt Fenster, ich glaube nicht, dass das passt

        I 1 Reply Last reply Reply Quote 0
        • I
          IceD112 @amg_666 last edited by

          @amg_666
          Das ist, bzw sollte korrekt sein. window ist ja die ID und Fenster der Name
          Screenshot 2022-03-15 at 16-21-12 enums - ioBroker.png

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

            @iced112 sagte: Dazu habe ich zunächst einen Datenpunkt "Fenster_Status" erstellt

            Der muss vom Typ "Logikwert" sein.

            common_Fenster.JPG

            @iced112 sagte in Aufzählung Fensterstatus - Anzeige in VIS:

            folgendes Script erstellt

            Man benötigt eine ODER-Verknüpfung aller Datenpunktwerte, um festzustellen, ob mindestens ein Fenster offen ist. Das kann man mit einer Schleife erledigen.

            Bild_2022-03-15_191153.png

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

              @paul53
              Ich habe bisher noch nie mit Variablen gearbeitet. Ich gehe mal davon aus, dass das Erstellen der Variablen "id", "ids" und "offen" alleine nicht aussreicht?

              Hab nämlich mal versucht dein Blockly nach zu bauen aber so funktioniert es noch nicht

              B paul53 2 Replies Last reply Reply Quote 0
              • B
                badsnoopy667 @IceD112 last edited by

                @iced112
                Nimm doch einfach meinen Export von oben, der sollte funktionieren. Da musst du dann ggf. nur noch ein: Wenn Anzahl Fenster = 0 Dann Fenster Status = geschlossen einfügen am Ende. Fertig

                amg_666 I 2 Replies Last reply Reply Quote 0
                • paul53
                  paul53 @IceD112 last edited by

                  @iced112 sagte: versucht dein Blockly nach zu bauen aber so funktioniert es noch nicht

                  Datenpunkt "Fenster Status" austauschen!

                  <xml xmlns="https://developers.google.com/blockly/xml">
                   <variables>
                     <variable id="sa{l1~ORe0j$HLuZ5N%!">ids</variable>
                     <variable id="kT%nX!]Jo^`}k%/`k?Gq">offen</variable>
                     <variable id=":nd$CvGxF5#~Ll%,n#b2">id</variable>
                   </variables>
                   <block type="variables_set" id="i(tPYLv;RbKHg~i@a0{/" x="38" y="38">
                     <field name="VAR" id="sa{l1~ORe0j$HLuZ5N%!">ids</field>
                     <value name="VALUE">
                       <block type="selector" id="}ukVNv/ei7Qs4LavaT+0">
                         <field name="TEXT">*(functions=window)</field>
                       </block>
                     </value>
                     <next>
                       <block type="on_ext" id="Yr}xw(F4N,5fxKcZ:vaA">
                         <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="H6rjU$rO8@g6Lgk:jv9f">
                             <field name="oid">default</field>
                           </shadow>
                           <block type="variables_get" id="WDNWJnP.L:dRO2.H3gFM">
                             <field name="VAR" id="sa{l1~ORe0j$HLuZ5N%!">ids</field>
                           </block>
                         </value>
                         <statement name="STATEMENT">
                           <block type="variables_set" id="fiT;40M9XwH-IB;dai$*">
                             <field name="VAR" id="kT%nX!]Jo^`}k%/`k?Gq">offen</field>
                             <value name="VALUE">
                               <block type="logic_boolean" id="D}!bGj=1]X5!.KmIss,#">
                                 <field name="BOOL">FALSE</field>
                               </block>
                             </value>
                             <next>
                               <block type="controls_forEach" id="hZm%QED(q{qqF9Qt_4zV">
                                 <field name="VAR" id=":nd$CvGxF5#~Ll%,n#b2">id</field>
                                 <value name="LIST">
                                   <block type="variables_get" id="W?h4_#I[DjCw!DD`F47g">
                                     <field name="VAR" id="sa{l1~ORe0j$HLuZ5N%!">ids</field>
                                   </block>
                                 </value>
                                 <statement name="DO">
                                   <block type="controls_if" id="z})86Cf$,3q!)/4/%c_V">
                                     <value name="IF0">
                                       <block type="get_value_var" id="A4]d*E-i6@qDI3SUpZqx">
                                         <field name="ATTR">val</field>
                                         <value name="OID">
                                           <shadow type="text" id="iJar`blbRA6G?|%Gx#Po">
                                             <field name="TEXT"></field>
                                           </shadow>
                                           <block type="variables_get" id="*JdI$y).=mPIbq)_%f@?">
                                             <field name="VAR" id=":nd$CvGxF5#~Ll%,n#b2">id</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <statement name="DO0">
                                       <block type="variables_set" id="Fq.`IT_ELmfwRP@:9=fo">
                                         <field name="VAR" id="kT%nX!]Jo^`}k%/`k?Gq">offen</field>
                                         <value name="VALUE">
                                           <block type="logic_boolean" id="XAR!D%*in|Fp8/pJ/8x?">
                                             <field name="BOOL">TRUE</field>
                                           </block>
                                         </value>
                                         <next>
                                           <block type="controls_flow_statements" id=":b34uz=#:?=ZHl=pLEUL">
                                             <field name="FLOW">BREAK</field>
                                           </block>
                                         </next>
                                       </block>
                                     </statement>
                                   </block>
                                 </statement>
                                 <next>
                                   <block type="update" id="QKP7Y`XWPrhAR@*2qMM`">
                                     <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                     <field name="OID">0_userdata.0.Blockly.Fenster</field>
                                     <field name="WITH_DELAY">FALSE</field>
                                     <value name="VALUE">
                                       <block type="variables_get" id="nxH}!Z]j_(5pFwh+`utV">
                                         <field name="VAR" id="kT%nX!]Jo^`}k%/`k?Gq">offen</field>
                                       </block>
                                     </value>
                                   </block>
                                 </next>
                               </block>
                             </next>
                           </block>
                         </statement>
                       </block>
                     </next>
                   </block>
                  </xml>
                  

                  1 Reply Last reply Reply Quote 0
                  • amg_666
                    amg_666 @badsnoopy667 last edited by

                    @badsnoopy667 sagte in Aufzählung Fensterstatus - Anzeige in VIS:

                    @iced112
                    Nimm doch einfach meinen Export von oben

                    Den hab ich eben auch mal zum Testen genommen, läuft ohne Probleme 🙂 👍 Und Anzahl offene Fenster finde ich auch besser, man kann das nutzen aber eben auch bei ungleich Null mit "Logikwerten" arbeiten.

                    1 Reply Last reply Reply Quote 1
                    • I
                      IceD112 @badsnoopy667 last edited by

                      @badsnoopy667 said in Aufzählung Fensterstatus - Anzeige in VIS:

                      @iced112
                      Da musst du dann ggf. nur noch ein: Wenn Anzahl Fenster = 0 Dann Fenster Status = geschlossen einfügen am Ende. Fertig

                      Ok, dein Export alleine funktioniert noch nicht. Helf mir mal bitte auf die Sprünge was du mit dem letzten Satz meintest? Das raff ich grade nicht😲

                      paul53 amg_666 2 Replies Last reply Reply Quote 0
                      • paul53
                        paul53 @IceD112 last edited by paul53

                        @iced112 sagte: was du mit dem letzten Satz meintest?

                        Wandlung der Anzahl offener Fenster in Logikwert "mind. ein Fenster offen".

                        Bild_2022-03-16_114045.png

                        B 1 Reply Last reply Reply Quote 1
                        • B
                          badsnoopy667 @paul53 last edited by

                          @paul53 Danke, so schnell war ich nicht 😉

                          1 Reply Last reply Reply Quote 0
                          • amg_666
                            amg_666 @IceD112 last edited by

                            @iced112 sagte in Aufzählung Fensterstatus - Anzeige in VIS:

                            ein Export alleine funktioniert noch nicht

                            Also bei mir läuft das einwandfrei mit dem Blockly von @badsnoopy667
                            Kann es sein, dass du in deiner Aufzählung die Objekte (also z.B. einen Sensor mit Bezeichnung Wohnzimmer1) gezogen hast? Ich hab bei mir in der Aufzählung nur den Datenpunkt des jeweiligen Sensors aufgenommen, z.B. "state" (bei Homematic) bzw "is_open" (bei zigbee).
                            Bei dem Blockly muss die Variable vom Typ Zahl sein. Oder du passt das wie von @paul53 beschrieben ein, dann muss es eine Logik-Variable sein

                            I 1 Reply Last reply Reply Quote 0
                            • I
                              IceD112 @amg_666 last edited by

                              @amg_666
                              Meine Aufzählung schaut so aus
                              Screenshot 2022-03-16 at 11-57-06 enums - ioBroker.png

                              Hab ich da ggf ein Fehler? Also der Name in der Aufzählung kommt vom State door

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

                                @iced112 sagte: Hab ich da ggf ein Fehler? Also der Name in der Aufzählung kommt vom State door

                                Nein, das ist so in Ordnung. Es sind 12 Datenpunkte "door" zu functions=window zugeordnet.

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

                                  @paul53 ok, Datenpunkt "door" sagte mir nix. Bei mir sieht das so aus und läuft wie gesagt:
                                  7beb8432-7eb8-42c5-b4c6-520a04c12b82-grafik.png

                                  und in der Aufzählung dann nur DP "State"
                                  7faa3f37-53a6-4072-b696-8237663db49e-grafik.png

                                  I 1 Reply Last reply Reply Quote 0
                                  • I
                                    IceD112 @amg_666 last edited by

                                    @amg_666
                                    Das sind Sensoren von Shelly. Der Datenpunkt door gibt true oder flase aus wenn offen oder geschlossen.

                                    Ja, was mach ich denn falsch?

                                    amg_666 paul53 2 Replies Last reply Reply Quote 0
                                    • amg_666
                                      amg_666 @IceD112 last edited by

                                      @iced112 dann poste doch mal bitte dein blockly, hast du da irgendwas modifiziert?

                                      I 1 Reply Last reply Reply Quote 0
                                      • I
                                        IceD112 @amg_666 last edited by IceD112

                                        @amg_666
                                        Screenshot 2022-03-16 at 13-19-40 javascript - ioBroker.png

                                        <xml xmlns="https://developers.google.com/blockly/xml">
                                          <variables>
                                            <variable id="sa{l1~ORe0j$HLuZ5N%!">ids</variable>
                                            <variable id="kT%nX!]Jo^`}k%/`k?Gq">offen</variable>
                                            <variable id=":nd$CvGxF5#~Ll%,n#b2">id</variable>
                                            <variable id="xu-:vrDF`H;M_fGe2]b4">x</variable>
                                          </variables>
                                          <block type="variables_set" id="i(tPYLv;RbKHg~i@a0{/" x="-412" y="-237">
                                            <field name="VAR" id="sa{l1~ORe0j$HLuZ5N%!">ids</field>
                                            <value name="VALUE">
                                              <block type="selector" id="}ukVNv/ei7Qs4LavaT+0">
                                                <field name="TEXT">*(functions=window)</field>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="on_ext" id="Yr}xw(F4N,5fxKcZ:vaA">
                                                <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="H6rjU$rO8@g6Lgk:jv9f">
                                                    <field name="oid">default</field>
                                                  </shadow>
                                                  <block type="variables_get" id="WDNWJnP.L:dRO2.H3gFM">
                                                    <field name="VAR" id="sa{l1~ORe0j$HLuZ5N%!">ids</field>
                                                  </block>
                                                </value>
                                                <statement name="STATEMENT">
                                                  <block type="variables_set" id="fiT;40M9XwH-IB;dai$*">
                                                    <field name="VAR" id="kT%nX!]Jo^`}k%/`k?Gq">offen</field>
                                                    <value name="VALUE">
                                                      <block type="logic_boolean" id="D}!bGj=1]X5!.KmIss,#">
                                                        <field name="BOOL">FALSE</field>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="controls_forEach" id="hZm%QED(q{qqF9Qt_4zV">
                                                        <field name="VAR" id=":nd$CvGxF5#~Ll%,n#b2">id</field>
                                                        <value name="LIST">
                                                          <block type="variables_get" id="W?h4_#I[DjCw!DD`F47g">
                                                            <field name="VAR" id="sa{l1~ORe0j$HLuZ5N%!">ids</field>
                                                          </block>
                                                        </value>
                                                        <statement name="DO">
                                                          <block type="controls_if" id="z})86Cf$,3q!)/4/%c_V">
                                                            <value name="IF0">
                                                              <block type="get_value_var" id="A4]d*E-i6@qDI3SUpZqx">
                                                                <field name="ATTR">val</field>
                                                                <value name="OID">
                                                                  <shadow type="text" id="iJar`blbRA6G?|%Gx#Po">
                                                                    <field name="TEXT"></field>
                                                                  </shadow>
                                                                  <block type="variables_get" id="*JdI$y).=mPIbq)_%f@?">
                                                                    <field name="VAR" id=":nd$CvGxF5#~Ll%,n#b2">id</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <statement name="DO0">
                                                              <block type="variables_set" id="Fq.`IT_ELmfwRP@:9=fo">
                                                                <field name="VAR" id="kT%nX!]Jo^`}k%/`k?Gq">offen</field>
                                                                <value name="VALUE">
                                                                  <block type="logic_boolean" id="XAR!D%*in|Fp8/pJ/8x?">
                                                                    <field name="BOOL">TRUE</field>
                                                                  </block>
                                                                </value>
                                                                <next>
                                                                  <block type="controls_flow_statements" id=":b34uz=#:?=ZHl=pLEUL">
                                                                    <field name="FLOW">BREAK</field>
                                                                  </block>
                                                                </next>
                                                              </block>
                                                            </statement>
                                                          </block>
                                                        </statement>
                                                        <next>
                                                          <block type="update" id="QKP7Y`XWPrhAR@*2qMM`">
                                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                            <field name="OID">0_userdata.0.Routinen.Fenster_Status</field>
                                                            <field name="WITH_DELAY">FALSE</field>
                                                            <value name="VALUE">
                                                              <block type="logic_compare" id="pK*Xb]J~V:d47jSa)5$b">
                                                                <field name="OP">GT</field>
                                                                <value name="A">
                                                                  <block type="variables_get" id="OIv|$ewMBS:u!+T72:D)">
                                                                    <field name="VAR" id="xu-:vrDF`H;M_fGe2]b4">x</field>
                                                                  </block>
                                                                </value>
                                                                <value name="B">
                                                                  <block type="math_number" id="Avy%3uPr5m{lU:pjUzqZ">
                                                                    <field name="NUM">0</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </statement>
                                              </block>
                                            </next>
                                          </block>
                                        </xml>
                                        
                                        amg_666 1 Reply Last reply Reply Quote 0
                                        • amg_666
                                          amg_666 @IceD112 last edited by

                                          @iced112 Du verwendest das Blockly von @badsnoopy667 und hast die "Logikzeile" von @paul53 drangehängt.
                                          Das kann nix werden, weil du in den Schleifen die Variable x überhaupt nicht verwendest, die du dann abprüfst...
                                          Mach mal unten aktualisiere "Fenster Status" mit "offen". Oder du sparst dir die letzte Zeile und ersetzt im Blockly "offen" mit "Fenster Status"

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

                                            @iced112 sagte: was mach ich denn falsch?

                                            Bild_2022-03-16_133025.png

                                            Überprüfe, ob der Selektor funktioniert:

                                            Bild_2022-03-16_133235.png

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            480
                                            Online

                                            32.0k
                                            Users

                                            80.4k
                                            Topics

                                            1.3m
                                            Posts

                                            7
                                            31
                                            2091
                                            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