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] Script anpassen

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelöst] Script anpassen

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

      Hallo zusammen,

      habe mal eine Frage und komme irgendwie nicht weiter. Habe ein Blockly Script das auch gut funktioniert. Gerne würde ich dieses erweitern. Das Script schaltet, sobald ich das Handy auf dem Induktionsladegerät lege, über den Android Tasker das Handy stumm, meine Klingel aus und die Rollos im Schlafzimmer senken sich auf 35%. Sobald ich das Handy dann vom Ladegerät abhebe, geht nach 90 sek. die Klingel wieder an und die Rollos öffnen sich auf 100 %. Jetzt möchte ich jedoch die Rollos nur öffnen, wenn diese zuvor über 8 Prozent geöffnet waren (8% deshalb, weil die sich bei geöffnetem Fester bezüglich Belüftung auf 8 % öffnen)
      Kann mir jemand einen Lösungsansatz aufzeigen bitte?
      Screenshot 2023-11-28 154952.png


      <xml xmlns="https://developers.google.com/blockly/xml">
      <variables>
      <variable type="timeout" id="timeout">timeout</variable>
      </variables>
      <block type="on_ext" id="o;~P(Mc{1xm;%q1!jT]|" x="-963" y="-663">
      <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="c2#hp3$VP3]a].Edo(b">
      <field name="oid">0_userdata.0.Tasker</field>
      </shadow>
      </value>
      <statement name="STATEMENT">
      <block type="controls_if" id="d4aN~8/1RE|VkW$:]ccj">
      <mutation else="1"></mutation>
      <value name="IF0">
      <block type="logic_operation" id="/]CbO+|(.G7ao^N,R4=" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_operation" id="^vVqVk/fvju)jr;vzb-" inline="false">
      <field name="OP">AND</field>
      <value name="A">
      <block type="logic_compare" id="h!^?}b)COaC4h.tpq?Ch">
      <field name="OP">EQ</field>
      <value name="A">
      <block type="get_value" id="B^6@Njyb[Fi#R6#xo%5V">
      <field name="ATTR">val</field>
      <field name="OID">0_userdata.0.Tasker</field>
      </block>
      </value>
      <value name="B">
      <block type="logic_boolean" id="Yokibw:2n(Vj0k3G}A|8">
      <field name="BOOL">TRUE</field>
      </block>
      </value>
      </block>
      </value>
      <value name="B">
      <block type="logic_compare" id="HAkB_6p0nvlJjUu_~H1j">
      <field name="OP">EQ</field>
      <value name="A">
      <block type="get_value" id="Y|HywtU%jkY[8VWb[H"> <field name="ATTR">val</field> <field name="OID">hm-rpc.0.CUX2801006.13.STATE</field> </block> </value> <value name="B"> <block type="logic_boolean" id="71veZIMI|@]HU[{Dl^k">
      <field name="BOOL">TRUE</field>
      </block>
      </value>
      </block>
      </value>
      </block>
      </value>
      <value name="B">
      <block type="logic_operation" id="S~6UdEj/MOY@hjaR2P/G" inline="false">
      <field name="OP">OR</field>
      <value name="A">
      <block type="logic_operation" id="
      %-rKd[(oO@xLNJ}rK2S">
      <field name="OP">AND</field>
      <value name="A">
      <block type="logic_compare" id="
      x/)JH2u_]/m}cvQX25"> <field name="OP">LTE</field> <value name="A"> <block type="time_get" id="hi}]q0wKwTGHtxfF5e/S"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">wd</field> </block> </value> <value name="B"> <block type="math_number" id="!7w$h?4,ReYI8^-?-gJ@"> <field name="NUM">4</field> </block> </value> </block> </value> <value name="B"> <block type="time_compare" id=".jcJK[Rjc%/Q))fqFGO{"> <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true"></mutation> <field name="OPTION">between</field> <field name="START_TIME">09:00</field> <field name="END_TIME">17:00</field> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="])iNdWKQt%A54x[Qqv?^"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="W$(4*QJbR-J#L{,PuOSj"> <field name="OP">GT</field> <value name="A"> <block type="time_get" id="a?8c48*|vksMele07xL">
      <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
      <field name="OPTION">wd</field>
      </block>
      </value>
      <value name="B">
      <block type="math_number" id="mzO;cS!)T={7nM?gOPC%">
      <field name="NUM">4</field>
      </block>
      </value>
      </block>
      </value>
      <value name="B">
      <block type="time_compare" id="=oa4E-1v_pLdr1%DfLF"> <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true"></mutation> <field name="OPTION">between</field> <field name="START_TIME">09:00</field> <field name="END_TIME">18:00</field> </block> </value> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="d{jmP0L,d.7+;FEslQsx"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hm-rpc.1.BidCoS-RF.6.PRESS_SHORT</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="r.EmO{Rz+^,bU#*#Z.X{"> <field name="BOOL">TRUE</field> </block> </value> <next> <block type="control" id="4$Kdr-Z0o8_8TOFm7opC"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hm-rpc.2.001158A995FF7E.4.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="|Lywakptd/hYEiE[l}4K"> <field name="NUM">35</field> </block> </value> <next> <block type="timeouts_cleartimeout" id="3E7ve+!Jd@kW5Q~#7)28"> <field name="NAME">timeout</field> </block> </next> </block> </next> </block> </statement> <statement name="ELSE"> <block type="timeouts_cleartimeout" id="ZI2C!!d~ctb$.nyqftKu"> <field name="NAME">timeout</field> <next> <block type="timeouts_settimeout" id="F?(7@XE.EXrDNAzBl}i="> <field name="NAME">timeout</field> <field name="DELAY">90</field> <field name="UNIT">sec</field> <statement name="STATEMENT"> <block type="controls_if" id="$KJ9u8{v$HRIx{(BXnH?"> <value name="IF0"> <block type="logic_operation" id="M{w9^|HHns4epAqWr*G~" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_operation" id="sPHmx!H[[}u_O}[To1KX" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id=".ZKCtE.HSDN];i,z#0%,"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="|4?5i~)=3Kwu@%KLm:bU"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Tasker</field> </block> </value> <value name="B"> <block type="logic_boolean" id="H!6PHbB5X^zHIaQAg^4x"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="?((!$Y8GmFQB8x^tz#E1"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="g$1,?;p7C#^zaK:2_v_u"> <field name="ATTR">val</field> <field name="OID">hm-rpc.0.CUX2801006.13.STATE</field> </block> </value> <value name="B"> <block type="logic_boolean" id="%JB*7~vZnP#GMzVS_w{Z"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="]|z_I4etKgH#D3[@[UC(" inline="false"> <field name="OP">OR</field> <value name="A"> <block type="logic_operation" id="cj$n)Kb!~_W,:G2%IVf="> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="#YRJAb4c~4#]sQZ$^2(u"> <field name="OP">LTE</field> <value name="A"> <block type="time_get" id="|.J+HvjD)[7!=y+s.~{("> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">wd</field> </block> </value> <value name="B"> <block type="math_number" id="gNAPLQEJEErX0*V++sx5"> <field name="NUM">4</field> </block> </value> </block> </value> <value name="B"> <block type="time_compare" id="|J[@?D=GR?JSn;Iy.y(r"> <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true"></mutation> <field name="OPTION">between</field> <field name="START_TIME">09:00</field> <field name="END_TIME">17:00</field> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="]Ri}dF+/?Z70a{M_2;++"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="7{h-w)PW^0EqUi269I">
      <field name="OP">GT</field>
      <value name="A">
      <block type="time_get" id="K:,=7Mks29lGWxQDi[P_">
      <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
      <field name="OPTION">wd</field>
      </block>
      </value>
      <value name="B">
      <block type="math_number" id="Trs^HL%Vj-|e_O?#R?x|">
      <field name="NUM">4</field>
      </block>
      </value>
      </block>
      </value>
      <value name="B">
      <block type="time_compare" id="pS%m._(dJastg?1bJ;fe">
      <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true"></mutation>
      <field name="OPTION">between</field>
      <field name="START_TIME">09:00</field>
      <field name="END_TIME">18:00</field>
      </block>
      </value>
      </block>
      </value>
      </block>
      </value>
      </block>
      </value>
      <statement name="DO0">
      <block type="control" id="4mj_r,EW0qbMp:dzV1Hs">
      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
      <field name="OID">hm-rpc.1.BidCoS-RF.6.PRESS_LONG</field>
      <field name="WITH_DELAY">TRUE</field>
      <field name="DELAY_MS">1</field>
      <field name="UNIT">sec</field>
      <field name="CLEAR_RUNNING">TRUE</field>
      <value name="VALUE">
      <block type="logic_boolean" id=")RReS97tG6A2$0JN
      9j!">
      <field name="BOOL">TRUE</field>
      </block>
      </value>
      <next>
      <block type="control" id="Gr$]y+lv_|5Y[rjAE_]?">
      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
      <field name="OID">hm-rpc.2.001158A995FF7E.4.LEVEL</field>
      <field name="WITH_DELAY">TRUE</field>
      <field name="DELAY_MS">1</field>
      <field name="UNIT">sec</field>
      <field name="CLEAR_RUNNING">TRUE</field>
      <value name="VALUE">
      <block type="math_number" id="8VYwGIqHdj{-J{Z^gm3s">
      <field name="NUM">100</field>
      </block>
      </value>
      </block>
      </next>
      </block>
      </statement>
      </block>
      </statement>
      </block>
      </next>
      </block>
      </statement>
      </block>
      </statement>
      </block>
      </xml>

      Codierknecht Homoran 2 Replies Last reply Reply Quote 0
      • Codierknecht
        Codierknecht Developer Most Active @dirkheider last edited by

        @dirkheider
        Du musst halt im timeout zusätzlich zu den bereits vorhandenen Bedingungen noch "Schlafzimmer.3.LEVEL" abprüfen.

        ef75d3af-1b19-4ef8-bbcf-880747e99edc-image.png

        D DJMarc75 2 Replies Last reply Reply Quote 0
        • D
          dirkheider @Codierknecht last edited by

          @codierknecht
          Ja......das hatte ich auch, aber dann schaltet sich die Klingel auch nur dann wieder ein, wenn das Rollo über 8 % ist:-(. Die Klingel soll sich aber immer wieder einschalten. Nur das Rollo soll nur auf 100% öffnen, wenn es zuvor auf 8 % stand.

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

            @dirkheider bitte Threadtitel sinnvoll anpassen

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

              @codierknecht sagte in Blockly Script:

              zusätzlich zu den bereits vorhandenen Bedingungen noch "Schlafzimmer.3.LEVEL" abprüfen.

              dann wird die Klingel nicht geschaltet wenn der Wert <= 8 ist.

              Besser einen zweiten Falls Block in den Timeout einbauen

              Screenshot 2023-11-28 161558.png

              Den rot markierten raus und dafür

              Screenshot 2023-11-28 161726.png

              an dieser Stelle einsetzen - müsste klappen 😉

              D 1 Reply Last reply Reply Quote 0
              • D
                dirkheider @DJMarc75 last edited by

                @djmarc75
                ohhhh man......ich bin ja sooo blind gewesen. Ich hatte deine Lösung schon selbst probiert. Nur habe ich nicht den Wert des Rollos richtig abgelesen. Somit hatte es nicht funktioniert.
                Danke allen für die Hilfe..........manchmal ist man halt einfach nur blind

                Gruß Dirk

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

                Support us

                ioBroker
                Community Adapters
                Donate

                489
                Online

                32.0k
                Users

                80.4k
                Topics

                1.3m
                Posts

                4
                6
                180
                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