Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Skript Fenster auf nicht optimal

    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

    Skript Fenster auf nicht optimal

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

      Hallo Zusammen,

      ich hatte letztes Jahr schon mal ein Skript gebaut und in Aktion genommen, welches den Fensterstatus und Temperatur Abfall überwachsen soll. Irgendwie läuft dieses aber nicht optimal. So werden die Meldungen zu schnell nacheinander ausgegeben (logisch die Temperatur ist < der Mindesttemperatur und fällt weiter).

      Hat jemand eine Idee zur Optimierung z.B. Zwischen erster Meldung und erneuter Prüfung einen Timer
      oder hat jemand ein schlaueres, irgendwie erscheint es mir selber aktuell fragwürdig warum ich als Trigger die Temperatur nehme und nicht den Fensterstatus?

      <block xmlns="https://developers.google.com/blockly/xml" type="on_ext" id="i_%w!B3XTB]C}MLrhG$o" x="-98" y="-2514">
        <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
        <field name="CONDITION">any</field>
        <field name="ACK_CONDITION"></field>
        <value name="OID0">
          <shadow type="field_oid" id="]t}%]B=dQr?16;,zON4^">
            <field name="oid">default</field>
          </shadow>
          <block type="field_oid" id="%cFwTqh=|kt4rf!Yg^B[">
            <field name="oid">hm-rpc.1.000393C99BEECA.1.ACTUAL_TEMPERATURE_STATUS</field>
          </block>
        </value>
        <value name="OID1">
          <shadow type="field_oid" id="ZlD1I[do%M*s?2gOY;v~">
            <field name="oid">default</field>
          </shadow>
          <block type="field_oid" id="TX`?E5*UO!:A0*Rlh?[P">
            <field name="oid">zigbee.0.00158d000273c35f.temperature</field>
          </block>
        </value>
        <statement name="STATEMENT">
          <block type="comment" id="x2Y2YCf:9:{xsbYi[VKz">
            <field name="COMMENT">Trigger Fenster und Trigger Temperaturabfall</field>
            <next>
              <block type="controls_if" id="z^$A*=PqAa*B|y[{c#|;">
                <mutation elseif="1"></mutation>
                <value name="IF0">
                  <block type="logic_operation" id="zAZ/n`RHg/G1Jv4.zd^a" inline="false">
                    <field name="OP">AND</field>
                    <value name="A">
                      <block type="logic_compare" id="cgfXS,33]RMwN?]ZEvV+">
                        <field name="OP">EQ</field>
                        <value name="A">
                          <block type="get_value" id="*G3+;]6O@qf=qV_B4Eu)">
                            <field name="ATTR">val</field>
                            <field name="OID">hm-rpc.1.0000D3C99985C1.1.STATE</field>
                          </block>
                        </value>
                        <value name="B">
                          <block type="math_number" id="n6xzyypLNRbG])A//o{3">
                            <field name="NUM">1</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <value name="B">
                      <block type="logic_operation" id="Sv7n+M;)smd$(:4mA32s" inline="false">
                        <field name="OP">OR</field>
                        <value name="A">
                          <block type="logic_compare" id="n!cS6py@n;}9B1S@|km@">
                            <field name="OP">LTE</field>
                            <value name="A">
                              <block type="get_value" id="jvNauVYNP_${:-F5CKS~">
                                <field name="ATTR">val</field>
                                <field name="OID">hm-rpc.1.000393C99BEECA.1.ACTUAL_TEMPERATURE</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id=";*a,GKd.[paXySdwG[?R">
                                <field name="NUM">19.5</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <value name="B">
                          <block type="logic_compare" id="rpS2I*#//:6cyM%A!Kb1">
                            <field name="OP">LTE</field>
                            <value name="A">
                              <block type="get_value" id="zhzfyFX#H(Taqcm^(k34">
                                <field name="ATTR">val</field>
                                <field name="OID">zigbee.0.00158d000273c35f.temperature</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="7^t9xO918h^ddUO9do2d">
                                <field name="NUM">19.5</field>
                              </block>
                            </value>
                          </block>
                        </value>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO0">
                  <block type="comment" id="VNX`R(-z1hdjl841LK`|">
                    <field name="COMMENT">Alexa und Pushover mit variablen Text ansprechen</field>
                    <next>
                      <block type="timeouts_settimeout" id="=Vju)wrYVCw7+c~SA{$C">
                        <field name="NAME">timeout</field>
                        <field name="DELAY">10</field>
                        <field name="UNIT">sec</field>
                        <statement name="STATEMENT">
                          <block type="control" id="]Ul{`mu/{j/e~,F(=;_~">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">alexa2.0.Echo-Devices.429c7541422f43bfbf236d2d3d7af066.Commands.speak</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="text_join" id="WM%@-:YC-I$4prv6.[bN">
                                <mutation items="3"></mutation>
                                <value name="ADD0">
                                  <block type="text" id="_hdpH;8fAM(0XPHWkA|z">
                                    <field name="TEXT">Fenster Schlafzimmer schließen, Temperatur nur noch bei </field>
                                  </block>
                                </value>
                                <value name="ADD1">
                                  <block type="math_round" id="Vd~0{~)02BzqT_IM3.6s">
                                    <field name="OP">ROUND</field>
                                    <value name="NUM">
                                      <shadow type="math_number" id="./rUWv8ZCTD)ET.1|UU)">
                                        <field name="NUM">3.1</field>
                                      </shadow>
                                      <block type="get_value" id="*9*G{n9-AfW5@#~`F%7j">
                                        <field name="ATTR">val</field>
                                        <field name="OID">zigbee.0.00158d000273c35f.temperature</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <value name="ADD2">
                                  <block type="text" id="7lt;[m|Uvcb?c#^aZk#v">
                                    <field name="TEXT"> Grad</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <next>
                              <block type="pushover" id=".KQO5,XYBdF:^RPG}E(W">
                                <field name="INSTANCE"></field>
                                <field name="SOUND"></field>
                                <field name="PRIORITY">0</field>
                                <field name="LOG"></field>
                                <value name="MESSAGE">
                                  <shadow type="text" id="B`,lTv/-Df5Szb/R!9HE">
                                    <field name="TEXT">Fenster im Schlafzimmer schließen</field>
                                  </shadow>
                                  <block type="text_join" id="YPbYht64Knl#9GqfF`c{">
                                    <mutation items="3"></mutation>
                                    <value name="ADD0">
                                      <block type="text" id="N,+@|n:a]DD#;76u0gLV">
                                        <field name="TEXT">Fenster Schlafzimmer schließen, Temperatur nur noch bei </field>
                                      </block>
                                    </value>
                                    <value name="ADD1">
                                      <block type="math_round" id="c(XKF)o+9%~qj{IS1,ge">
                                        <field name="OP">ROUND</field>
                                        <value name="NUM">
                                          <shadow type="math_number" id="?).In!1~E0dP`GHgu`Vm">
                                            <field name="NUM">3.1</field>
                                          </shadow>
                                          <block type="get_value" id="$sAi:/nnYTqn$Cf?GB`9">
                                            <field name="ATTR">val</field>
                                            <field name="OID">zigbee.0.00158d000273c35f.temperature</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="ADD2">
                                      <block type="text" id=",I#bp.R^7%sAI1kNdq8D">
                                        <field name="TEXT"> Grad</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                              </block>
                            </next>
                          </block>
                        </statement>
                      </block>
                    </next>
                  </block>
                </statement>
                <value name="IF1">
                  <block type="logic_compare" id="^KR1;Kn#i@}E8vS)zLDo">
                    <field name="OP">EQ</field>
                    <value name="A">
                      <block type="get_value" id="NjyS~uHb^ds/vq/Kq|}@">
                        <field name="ATTR">val</field>
                        <field name="OID">hm-rpc.1.0000D3C99985C1.1.STATE</field>
                      </block>
                    </value>
                    <value name="B">
                      <block type="math_number" id="d_W`|$_*D:Sju0r_*_ew">
                        <field name="NUM">0</field>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO1">
                  <block type="timeouts_cleartimeout" id="8uAQ}vs;OW{TXx$U:m}@">
                    <field name="NAME">timeout</field>
                  </block>
                </statement>
              </block>
            </next>
          </block>
        </statement>
      </block>
      
      paul53 1 Reply Last reply Reply Quote 0
      • paul53
        paul53 @robbsen last edited by

        @robbsen sagte: So werden die Meldungen zu schnell nacheinander ausgegeben

        Da der Timer mehrfach gestartet wurde.

        @robbsen sagte in Skript Fenster auf nicht optimal:

        als Trigger die Temperatur nehme und nicht den Fensterstatus?

        Ja, besser den Fensterstatus als Trigger verwenden und mittels eines Intervalls erinnern.

        Bild_2021-12-09_150107.png

        <xml xmlns="https://developers.google.com/blockly/xml">
         <variables>
           <variable type="interval" id="Intervall">Intervall</variable>
           <variable id="K:4ffo2%}M])0@CbS}}0">text</variable>
         </variables>
         <block type="on_ext" id="i_%w!B3XTB]C}MLrhG$o" x="-28" y="-2586">
           <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="]t}%]B=dQr?16;,zON4^">
               <field name="oid">default</field>
             </shadow>
             <block type="text" id="t=8OS#|gWV4hE{-25DTh">
               <field name="TEXT">hm-rpc.1.0000D3C99985C1.1.STATE</field>
             </block>
           </value>
           <statement name="STATEMENT">
             <block type="comment" id="x2Y2YCf:9:{xsbYi[VKz">
               <field name="COMMENT">Trigger Fenster</field>
               <next>
                 <block type="controls_if" id="z^$A*=PqAa*B|y[{c#|;">
                   <mutation else="1"></mutation>
                   <value name="IF0">
                     <block type="on_source" id="U]!]34g3[`b=+I0}GU!H">
                       <field name="ATTR">state.val</field>
                     </block>
                   </value>
                   <statement name="DO0">
                     <block type="timeouts_setinterval" id="}^RJ*Nk~hSMGEG,@i/3~">
                       <field name="NAME">Intervall</field>
                       <field name="INTERVAL">2</field>
                       <field name="UNIT">min</field>
                       <statement name="STATEMENT">
                         <block type="controls_if" id="a,CmzDDM386t=qI,(LYA">
                           <value name="IF0">
                             <block type="logic_operation" id="Sv7n+M;)smd$(:4mA32s" inline="false">
                               <field name="OP">OR</field>
                               <value name="A">
                                 <block type="logic_compare" id="n!cS6py@n;}9B1S@|km@">
                                   <field name="OP">LTE</field>
                                   <value name="A">
                                     <block type="get_value" id="jvNauVYNP_${:-F5CKS~">
                                       <field name="ATTR">val</field>
                                       <field name="OID">hm-rpc.1.000393C99BEECA.1.ACTUAL_TEMPERATURE</field>
                                     </block>
                                   </value>
                                   <value name="B">
                                     <block type="math_number" id=";*a,GKd.[paXySdwG[?R">
                                       <field name="NUM">19.5</field>
                                     </block>
                                   </value>
                                 </block>
                               </value>
                               <value name="B">
                                 <block type="logic_compare" id="rpS2I*#//:6cyM%A!Kb1">
                                   <field name="OP">LTE</field>
                                   <value name="A">
                                     <block type="get_value" id="zhzfyFX#H(Taqcm^(k34">
                                       <field name="ATTR">val</field>
                                       <field name="OID">zigbee.0.00158d000273c35f.temperature</field>
                                     </block>
                                   </value>
                                   <value name="B">
                                     <block type="math_number" id="7^t9xO918h^ddUO9do2d">
                                       <field name="NUM">19.5</field>
                                     </block>
                                   </value>
                                 </block>
                               </value>
                             </block>
                           </value>
                           <statement name="DO0">
                             <block type="comment" id="VNX`R(-z1hdjl841LK`|">
                               <field name="COMMENT">Alexa und Pushover mit variablen Text ansprechen</field>
                               <next>
                                 <block type="variables_set" id="Le{@fyq3k+ExTKo^~F+P">
                                   <field name="VAR" id="K:4ffo2%}M])0@CbS}}0">text</field>
                                   <value name="VALUE">
                                     <block type="text_join" id="YPbYht64Knl#9GqfF`c{">
                                       <mutation items="3"></mutation>
                                       <value name="ADD0">
                                         <block type="text" id="N,+@|n:a]DD#;76u0gLV">
                                           <field name="TEXT">Fenster Schlafzimmer schließen, Temperatur nur noch bei </field>
                                         </block>
                                       </value>
                                       <value name="ADD1">
                                         <block type="math_round" id="c(XKF)o+9%~qj{IS1,ge">
                                           <field name="OP">ROUND</field>
                                           <value name="NUM">
                                             <shadow type="math_number" id="?).In!1~E0dP`GHgu`Vm">
                                               <field name="NUM">3.1</field>
                                             </shadow>
                                             <block type="get_value" id="$sAi:/nnYTqn$Cf?GB`9">
                                               <field name="ATTR">val</field>
                                               <field name="OID">zigbee.0.00158d000273c35f.temperature</field>
                                             </block>
                                           </value>
                                         </block>
                                       </value>
                                       <value name="ADD2">
                                         <block type="text" id=",I#bp.R^7%sAI1kNdq8D">
                                           <field name="TEXT"> Grad</field>
                                         </block>
                                       </value>
                                     </block>
                                   </value>
                                   <next>
                                     <block type="control" id="]Ul{`mu/{j/e~,F(=;_~">
                                       <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                       <field name="OID">alexa2.0.Echo-Devices.429c7541422f43bfbf236d2d3d7af066.Commands.speak</field>
                                       <field name="WITH_DELAY">FALSE</field>
                                       <value name="VALUE">
                                         <block type="variables_get" id="-;3UmOOGKwi=TWe(laxt">
                                           <field name="VAR" id="K:4ffo2%}M])0@CbS}}0">text</field>
                                         </block>
                                       </value>
                                       <next>
                                         <block type="pushover" id=".KQO5,XYBdF:^RPG}E(W">
                                           <field name="INSTANCE"></field>
                                           <field name="SOUND"></field>
                                           <field name="PRIORITY">0</field>
                                           <field name="LOG"></field>
                                           <value name="MESSAGE">
                                             <shadow type="text" id="B`,lTv/-Df5Szb/R!9HE">
                                               <field name="TEXT">Fenster im Schlafzimmer schließen</field>
                                             </shadow>
                                             <block type="variables_get" id="FEOi5eEC:LG_4IhOe^`H">
                                               <field name="VAR" id="K:4ffo2%}M])0@CbS}}0">text</field>
                                             </block>
                                           </value>
                                         </block>
                                       </next>
                                     </block>
                                   </next>
                                 </block>
                               </next>
                             </block>
                           </statement>
                         </block>
                       </statement>
                     </block>
                   </statement>
                   <statement name="ELSE">
                     <block type="timeouts_clearinterval" id="LpfAz#h(3EFgX/[])Y-2">
                       <field name="NAME">Intervall</field>
                     </block>
                   </statement>
                 </block>
               </next>
             </block>
           </statement>
         </block>
        </xml>
        

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

          @paul53 merci :), dann baue ich mal um.

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

          Support us

          ioBroker
          Community Adapters
          Donate

          858
          Online

          31.8k
          Users

          80.0k
          Topics

          1.3m
          Posts

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