Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. OpenDTU - falls DTU "falsch", dann Fritz Dect Steckdose aus!

    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

    OpenDTU - falls DTU "falsch", dann Fritz Dect Steckdose aus!

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

      @knopers1 sagte: Falls Ping auf die DTU länger als 30min "falsch" ist, und die Fritz Deckt 200 (wahr) ist, steuere Fritz Deckt auf "falsch". sonst, falls Ping auf die DTU "wahr" ist, steuere Fritz Deck 200 auf "wahr)

      Blockly_temp.JPG

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

        Danke @paul53 ,
        leider komme ich noch nicht zum Ziel, da ich das Script nicht ganz verstehe!
        Was genau kommt beim "Wert"? Der Ping Adapter liefert true oder false.....

        dtu.png

        <xml xmlns="https://developers.google.com/blockly/xml">
          <variables>
            <variable type="timeout" id="timeout2">timeout2</variable>
          </variables>
          <block type="on_ext" id="13k~%BXuW:dn^bzTXH?t" x="-87" y="-462">
            <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="D%+u;:[j;Ls5e|sffdom">
                <field name="oid">ping.0.raspberrypi.192_168_1_155</field>
              </shadow>
            </value>
            <statement name="STATEMENT">
              <block type="timeouts_cleartimeout" id="phJQ_1$Tx1t|~O@|IdMI">
                <field name="NAME">timeout</field>
                <next>
                  <block type="controls_if" id="Cv|YRH`Ln_h)X$$,+C^p">
                    <mutation elseif="1"></mutation>
                    <value name="IF0">
                      <block type="logic_negate" id="b/xvU,[jSe?PlbIJ.Hg8">
                        <value name="BOOL">
                          <block type="on_source" id="eI4nb`bgI/y6:[^d%ANF">
                            <field name="ATTR">state.val</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <statement name="DO0">
                      <block type="timeouts_settimeout" id="u9Zdd7N0rtv9+/:wI]++">
                        <field name="NAME">timeout2</field>
                        <field name="DELAY">30</field>
                        <field name="UNIT">min</field>
                        <statement name="STATEMENT">
                          <block type="control" id="Z!^ByDqmlh]b`?B(dved">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">fritzdect.0.DECT_116570570860.state</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="logic_boolean" id="mTwv!d5NuFJbke$wy$Rd">
                                <field name="BOOL">FALSE</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                      </block>
                    </statement>
                    <value name="IF1">
                      <block type="logic_negate" id="-.T5a%R-(wNX+|xaH7CG">
                        <value name="BOOL">
                          <block type="get_value" id="s*{{?xWUr3q}]sxG0vqq">
                            <field name="ATTR">val</field>
                            <field name="OID">ping.0.raspberrypi.192_168_1_155</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <statement name="DO1">
                      <block type="control" id="QF2_R8$?nn313/.]nPj6">
                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                        <field name="OID">fritzdect.0.DECT_116570570860.state</field>
                        <field name="WITH_DELAY">FALSE</field>
                        <value name="VALUE">
                          <block type="logic_boolean" id="|tvtV_^FI_kfm|TdD.K)">
                            <field name="BOOL">TRUE</field>
                          </block>
                        </value>
                      </block>
                    </statement>
                  </block>
                </next>
              </block>
            </statement>
          </block>
        </xml>
        
        Homoran paul53 2 Replies Last reply Reply Quote 0
        • Homoran
          Homoran Global Moderator Administrators @knopers1 last edited by

          @knopers1 sagte in OpenDTU - falls DTU "falsch", dann Fritz Dect Steckdose aus!:

          Was genau kommt beim "Wert"?

          der Wert des Triggerdatenpunkts

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

            @knopers1 sagte: Was genau kommt beim "Wert"?

            Wert enthält den Wert des Trigger-Datenpunktes "ping.0.raspberrypi.192_168_1_155".
            Es muss der richtige timeout2 gestoppt werden. Bei "sonst falls" muss die Steckdose geprüft werden.

            Blockly_temp.JPG

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

              @paul53

              okay, demnach sollte das Blockly doch laufen! Habe ich es richtig verstanden?

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

                @knopers1 sagte: demnach sollte das Blockly doch laufen! Habe ich es richtig verstanden?

                Ja, nachdem die beiden Korrekturen erfolgt sind.

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

                  @paul53

                  puhh ,

                  Bei "sonst falls" muss die Steckdose geprüft werden - habe verstanden und abgeändert!

                  dtu.png

                  Jetzt noch mal zum Wert! Schaust Du nach? Die zwei " nicht" Bausteine machen für mich keinen Sinn! Kann es so funktionieren? Sorry Paul, habe mich damit zu wenig befasst 😞

                  <xml xmlns="https://developers.google.com/blockly/xml">
                    <variables>
                      <variable type="timeout" id="timeout2">timeout2</variable>
                    </variables>
                    <block type="on_ext" id="13k~%BXuW:dn^bzTXH?t" x="-87" y="-462">
                      <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="D%+u;:[j;Ls5e|sffdom">
                          <field name="oid">ping.0.raspberrypi.192_168_1_155</field>
                        </shadow>
                      </value>
                      <statement name="STATEMENT">
                        <block type="timeouts_cleartimeout" id="phJQ_1$Tx1t|~O@|IdMI">
                          <field name="NAME">timeout2</field>
                          <next>
                            <block type="controls_if" id="Cv|YRH`Ln_h)X$$,+C^p">
                              <mutation elseif="1"></mutation>
                              <value name="IF0">
                                <block type="logic_compare" id="[6cMqYlc3#7E)Aqo@v})">
                                  <field name="OP">EQ</field>
                                  <value name="A">
                                    <block type="get_value" id="?vm|uWEZ/|M_%JctG[9!">
                                      <field name="ATTR">val</field>
                                      <field name="OID">ping.0.raspberrypi.192_168_1_155</field>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <block type="logic_boolean" id="!TBMhH{RAeGShuQPH4.?">
                                      <field name="BOOL">FALSE</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <statement name="DO0">
                                <block type="timeouts_settimeout" id="u9Zdd7N0rtv9+/:wI]++">
                                  <field name="NAME">timeout2</field>
                                  <field name="DELAY">30</field>
                                  <field name="UNIT">min</field>
                                  <statement name="STATEMENT">
                                    <block type="control" id="Z!^ByDqmlh]b`?B(dved">
                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                      <field name="OID">fritzdect.0.DECT_116570570860.state</field>
                                      <field name="WITH_DELAY">FALSE</field>
                                      <value name="VALUE">
                                        <block type="logic_boolean" id="mTwv!d5NuFJbke$wy$Rd">
                                          <field name="BOOL">FALSE</field>
                                        </block>
                                      </value>
                                    </block>
                                  </statement>
                                </block>
                              </statement>
                              <value name="IF1">
                                <block type="logic_compare" id="FyjQ4z/2$!p;s^zeEXl~">
                                  <field name="OP">EQ</field>
                                  <value name="A">
                                    <block type="get_value" id="F88jE*;R.|KIds;n[v_L">
                                      <field name="ATTR">val</field>
                                      <field name="OID">fritzdect.0.DECT_116570570860.state</field>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <block type="logic_boolean" id="M+8{#_W$41=p!),Fc]3%">
                                      <field name="BOOL">FALSE</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <statement name="DO1">
                                <block type="control" id="QF2_R8$?nn313/.]nPj6">
                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                  <field name="OID">fritzdect.0.DECT_116570570860.state</field>
                                  <field name="WITH_DELAY">FALSE</field>
                                  <value name="VALUE">
                                    <block type="logic_boolean" id="|tvtV_^FI_kfm|TdD.K)">
                                      <field name="BOOL">TRUE</field>
                                    </block>
                                  </value>
                                </block>
                              </statement>
                            </block>
                          </next>
                        </block>
                      </statement>
                    </block>
                    <block type="logic_negate" id="b/xvU,[jSe?PlbIJ.Hg8" x="588" y="-462"></block>
                    <block type="logic_negate" id="-.T5a%R-(wNX+|xaH7CG" x="638" y="-387"></block>
                  </xml>
                  
                  paul53 1 Reply Last reply Reply Quote 0
                  • paul53
                    paul53 @knopers1 last edited by paul53

                    @knopers1 sagte: Kann es so funktionieren?

                    Ja.

                    @knopers1 sagte in OpenDTU - falls DTU "falsch", dann Fritz Dect Steckdose aus!:

                    Die zwei " nicht" Bausteine machen für mich keinen Sinn!

                    "nicht x" entspricht "x = falsch" bei Logikwerten (true / false).

                    Wenn der Wert schon als Variable vorliegt, vermeidet man das Einlesen des Datenpunktes:

                    Blockly_temp.JPG

                    K 1 Reply Last reply Reply Quote 1
                    • K
                      knopers1 @paul53 last edited by

                      @paul53
                      okay, wieder etwas dazu gelernt. Danke vielmals für deine Zeit! Auf Dich ist immer Verlass...
                      Dann lasse ich jetzt die letzte Scriptversion stehen, die ich da mit deiner Hilfe umgebaut habe!
                      Ich hoffe, sie läuft......

                      K 1 Reply Last reply Reply Quote 0
                      • K
                        knopers1 @knopers1 last edited by knopers1

                        @paul53
                        jetzt leuchtet es mir ein.... Ich habe die Variable nicht wahr genommen !
                        Dein Hinweis mit der Variablen und dem erneuten Einlesen des Datenpunktes hat bei mir klick gemacht 🙂 Somit passe ich nochmal das Script nach deiner Version an!

                        dtu.png

                        <xml xmlns="https://developers.google.com/blockly/xml">
                          <variables>
                            <variable type="timeout" id="timeout2">timeout2</variable>
                          </variables>
                          <block type="on_ext" id="13k~%BXuW:dn^bzTXH?t" x="-87" y="-462">
                            <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="D%+u;:[j;Ls5e|sffdom">
                                <field name="oid">ping.0.raspberrypi.192_168_1_155</field>
                              </shadow>
                            </value>
                            <statement name="STATEMENT">
                              <block type="timeouts_cleartimeout" id="phJQ_1$Tx1t|~O@|IdMI">
                                <field name="NAME">timeout2</field>
                                <next>
                                  <block type="controls_if" id="Cv|YRH`Ln_h)X$$,+C^p">
                                    <mutation elseif="1"></mutation>
                                    <value name="IF0">
                                      <block type="logic_negate" id="kCrhu_a0f%ly@+J[o9UI">
                                        <value name="BOOL">
                                          <block type="on_source" id="PfW^]VSV37G+NvLcZH{s">
                                            <field name="ATTR">state.val</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <statement name="DO0">
                                      <block type="timeouts_settimeout" id="u9Zdd7N0rtv9+/:wI]++">
                                        <field name="NAME">timeout2</field>
                                        <field name="DELAY">30</field>
                                        <field name="UNIT">min</field>
                                        <statement name="STATEMENT">
                                          <block type="control" id="Z!^ByDqmlh]b`?B(dved">
                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                            <field name="OID">fritzdect.0.DECT_116570570860.state</field>
                                            <field name="WITH_DELAY">FALSE</field>
                                            <value name="VALUE">
                                              <block type="logic_boolean" id="mTwv!d5NuFJbke$wy$Rd">
                                                <field name="BOOL">FALSE</field>
                                              </block>
                                            </value>
                                          </block>
                                        </statement>
                                      </block>
                                    </statement>
                                    <value name="IF1">
                                      <block type="logic_negate" id="rXLteYmHZ8gBR95GQ2xv">
                                        <value name="BOOL">
                                          <block type="get_value" id="F88jE*;R.|KIds;n[v_L">
                                            <field name="ATTR">val</field>
                                            <field name="OID">fritzdect.0.DECT_116570570860.state</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <statement name="DO1">
                                      <block type="control" id="QF2_R8$?nn313/.]nPj6">
                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                        <field name="OID">fritzdect.0.DECT_116570570860.state</field>
                                        <field name="WITH_DELAY">FALSE</field>
                                        <value name="VALUE">
                                          <block type="logic_boolean" id="|tvtV_^FI_kfm|TdD.K)">
                                            <field name="BOOL">TRUE</field>
                                          </block>
                                        </value>
                                      </block>
                                    </statement>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                        </xml>
                        
                        <xml xmlns="https://developers.google.com/blockly/xml">
                          <variables>
                            <variable type="timeout" id="timeout2">timeout2</variable>
                          </variables>
                          <block type="on_ext" id="13k~%BXuW:dn^bzTXH?t" x="-87" y="-462">
                            <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="D%+u;:[j;Ls5e|sffdom">
                                <field name="oid">ping.0.raspberrypi.192_168_1_155</field>
                              </shadow>
                            </value>
                            <statement name="STATEMENT">
                              <block type="timeouts_cleartimeout" id="phJQ_1$Tx1t|~O@|IdMI">
                                <field name="NAME">timeout2</field>
                                <next>
                                  <block type="controls_if" id="Cv|YRH`Ln_h)X$$,+C^p">
                                    <mutation elseif="1"></mutation>
                                    <value name="IF0">
                                      <block type="logic_negate" id="kCrhu_a0f%ly@+J[o9UI">
                                        <value name="BOOL">
                                          <block type="on_source" id="PfW^]VSV37G+NvLcZH{s">
                                            <field name="ATTR">state.val</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <statement name="DO0">
                                      <block type="timeouts_settimeout" id="u9Zdd7N0rtv9+/:wI]++">
                                        <field name="NAME">timeout2</field>
                                        <field name="DELAY">30</field>
                                        <field name="UNIT">min</field>
                                        <statement name="STATEMENT">
                                          <block type="control" id="Z!^ByDqmlh]b`?B(dved">
                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                            <field name="OID">fritzdect.0.DECT_116570570860.state</field>
                                            <field name="WITH_DELAY">FALSE</field>
                                            <value name="VALUE">
                                              <block type="logic_boolean" id="mTwv!d5NuFJbke$wy$Rd">
                                                <field name="BOOL">FALSE</field>
                                              </block>
                                            </value>
                                          </block>
                                        </statement>
                                      </block>
                                    </statement>
                                    <value name="IF1">
                                      <block type="logic_negate" id="rXLteYmHZ8gBR95GQ2xv">
                                        <value name="BOOL">
                                          <block type="get_value" id="F88jE*;R.|KIds;n[v_L">
                                            <field name="ATTR">val</field>
                                            <field name="OID">fritzdect.0.DECT_116570570860.state</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <statement name="DO1">
                                      <block type="control" id="QF2_R8$?nn313/.]nPj6">
                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                        <field name="OID">fritzdect.0.DECT_116570570860.state</field>
                                        <field name="WITH_DELAY">FALSE</field>
                                        <value name="VALUE">
                                          <block type="logic_boolean" id="|tvtV_^FI_kfm|TdD.K)">
                                            <field name="BOOL">TRUE</field>
                                          </block>
                                        </value>
                                      </block>
                                    </statement>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                        </xml>
                        
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        822
                        Online

                        31.8k
                        Users

                        80.0k
                        Topics

                        1.3m
                        Posts

                        3
                        11
                        363
                        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