Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Anwesenheit counter

    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

    Anwesenheit counter

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

      Moin,

      Ich bin gerade am Basteln und möchte einen einfachen counter erstelen der die Gerät im Haus Zählt, leider bin ich gerade am verzweifeln, warum mein script nicht funktioniert. Kann jemand über mein cript rüberschauen und mal gucken ob er den Fehler findet?

      Bildschirmfoto 2021-01-02 um 19.39.15.png

      Und Hier ist der Code :
      <block xmlns="https://developers.google.com/blockly/xml" type="on_ext" id="TS9S$-Y=ho/.|h5Nqd(f" x="-462.0319999999999" y="-462.68">
      <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="761/wD-L^WuOwouS4g."> <field name="oid">0_userdata.0.Anwesenheit_Ping.Mika_Anwesend_Ping</field> </shadow> <block type="logic_operation" id="i([v!fL83~c,YT#=VI}5"> <field name="OP">OR</field> <value name="A"> <block type="logic_operation" id="%U6#?MNz.;]hL*T.}Z@~"> <field name="OP">OR</field> <value name="A"> <block type="get_value" id="I{M*e4/[oZGK%(UH2LaE"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Anwesenheit_Ping.Mika_Anwesend_Ping</field> </block> </value> <value name="B"> <block type="get_value" id="#11+Hzcs*iFk{ptF@Qm;"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Anwesenheit_Ping.Kim_Anwesend_Ping</field> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="a#We.0nKDs8QfCuRAblH"> <field name="OP">OR</field> <value name="A"> <block type="get_value" id="f0GF;hC0ks-M)-p86bSt"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Anwesenheit_Ping.Jens_Anwesend_Ping</field> </block> </value> <value name="B"> <block type="get_value" id="HdWEuJ~@~mYWNZk7DVhQ"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Anwesenheit_Ping.Simona_Anwesend_Ping</field> </block> </value> </block> </value> </block> </value> <statement name="STATEMENT"> <block type="controls_if" id="5t@]Vz9MFXtfexYp+L**"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_compare" id="du4~giXAnF8[8PyrJiR]"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="FK$h5GZC#{xh@P42:)x="> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Anwesenheit_Ping.Mika_Anwesend_Ping</field> </block> </value> <value name="B"> <block type="logic_boolean" id="(mczDYdlzwEV:AiDdGqi"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="EN6av4eO^x0v6BgeH]r">
      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field>
      <field name="WITH_DELAY">FALSE</field>
      <value name="VALUE">
      <block type="math_arithmetic" id="aO//5]9k=iG3o$^qpl$H">
      <field name="OP">ADD</field>
      <value name="A">
      <shadow type="math_number" id="#f}~tD_s7$=elpyxO_jN">
      <field name="NUM">1</field>
      </shadow>
      <block type="get_value" id="pCe/g-Z-jYH!h3D@[.!%">
      <field name="ATTR">val</field>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field>
      </block>
      </value>
      <value name="B">
      <shadow type="math_number" id="(g_|,oZ$4U!qnTTdW]0X">
      <field name="NUM">1</field>
      </shadow>
      </value>
      </block>
      </value>
      </block>
      </statement>
      <value name="IF1">
      <block type="logic_compare" id="oVMP!]~;YPRzF6?WH1M9">
      <field name="OP">EQ</field>
      <value name="A">
      <block type="get_value" id="xyQm?R8(buxFhm[L1v-o">
      <field name="ATTR">val</field>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Mika_Anwesend_Ping</field>
      </block>
      </value>
      <value name="B">
      <block type="logic_boolean" id="YE#~0paP6UrB2|Mp.t6I">
      <field name="BOOL">FALSE</field>
      </block>
      </value>
      </block>
      </value>
      <statement name="DO1">
      <block type="control" id="%/41lb91v!^gnTTUx/7x">
      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field>
      <field name="WITH_DELAY">FALSE</field>
      <value name="VALUE">
      <block type="math_arithmetic" id="%Pj_$Z{=Mkl|g;:QD^xx">
      <field name="OP">ADD</field>
      <value name="A">
      <shadow type="math_number">
      <field name="NUM">1</field>
      </shadow>
      <block type="get_value" id="Y^L(+b0+Rmn~Ir05d7=">
      <field name="ATTR">val</field>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field>
      </block>
      </value>
      <value name="B">
      <shadow type="math_number" id="QNu?[$Ezd+jM=MkMc}g">
      <field name="NUM">-1</field>
      </shadow>
      </value>
      </block>
      </value>
      </block>
      </statement>
      <next>
      <block type="controls_if" id="w8l/o;K3,=gC%fioH$V"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_compare" id="co|rqq?[?VyFcYNR.t6Y"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="Fi9LiK3L%VuELP=E?V0f"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Anwesenheit_Ping.Kim_Anwesend_Ping</field> </block> </value> <value name="B"> <block type="logic_boolean" id="DmEsBd{TGo^#KBq%W?VB"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="m7Ef::3HEQ,Wk]A1Zu[n"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_arithmetic" id="vWtS~DJNOMJ])|3[1UgQ"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="bD3m=W!~L(dhqN/Y1_J">
      <field name="NUM">1</field>
      </shadow>
      <block type="get_value" id="z_APGgC[nqYb5f!+1|0">
      <field name="ATTR">val</field>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field>
      </block>
      </value>
      <value name="B">
      <shadow type="math_number" id="qn:Y%YzBI?Og^mj^gr+u">
      <field name="NUM">1</field>
      </shadow>
      </value>
      </block>
      </value>
      </block>
      </statement>
      <value name="IF1">
      <block type="logic_compare" id="wML=fShc4+v}$3n:QIr=">
      <field name="OP">EQ</field>
      <value name="A">
      <block type="get_value" id="^5bsO-13{{:sH
      uE$43~">
      <field name="ATTR">val</field>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Kim_Anwesend_Ping</field>
      </block>
      </value>
      <value name="B">
      <block type="logic_boolean" id="xVHQ;9BZA8|uUD_B=6N;">
      <field name="BOOL">FALSE</field>
      </block>
      </value>
      </block>
      </value>
      <statement name="DO1">
      <block type="control" id="rhe$1eyGI-,|A10IToi3">
      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field>
      <field name="WITH_DELAY">FALSE</field>
      <value name="VALUE">
      <block type="math_arithmetic" id="$nc}!MmHiO4t%iUibXY"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="get_value" id="i2S9oI{5f1DuxtkN9,dx"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field> </block> </value> <value name="B"> <shadow type="math_number" id="xMK,p9bBo7.9Sb/eRBp">
      <field name="NUM">-1</field>
      </shadow>
      </value>
      </block>
      </value>
      </block>
      </statement>
      <next>
      <block type="controls_if" id="@j~7y{tiJLDVZiV;U
      P~">
      <mutation elseif="1"></mutation>
      <value name="IF0">
      <block type="logic_compare" id="2ly)bP^Dp;sKWc1Lb:sV">
      <field name="OP">EQ</field>
      <value name="A">
      <block type="get_value" id="9xVKSzZGOfZCRj6j0Vb|">
      <field name="ATTR">val</field>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Jens_Anwesend_Ping</field>
      </block>
      </value>
      <value name="B">
      <block type="logic_boolean" id="nOuBK:0$inpd|r8{n0Hs">
      <field name="BOOL">TRUE</field>
      </block>
      </value>
      </block>
      </value>
      <statement name="DO0">
      <block type="control" id="DUsqWdzQWrfKtR(@A4?u">
      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field>
      <field name="WITH_DELAY">FALSE</field>
      <value name="VALUE">
      <block type="math_arithmetic" id="Lmu7xdf
      C}urKp(ZQ-Yb">
      <field name="OP">ADD</field>
      <value name="A">
      <shadow type="math_number">
      <field name="NUM">1</field>
      </shadow>
      <block type="get_value" id="96[WYsrp%ZAM,#tIG?n">
      <field name="ATTR">val</field>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field>
      </block>
      </value>
      <value name="B">
      <shadow type="math_number" id="3!rxYwzMVaNY~Kz[f4:5">
      <field name="NUM">1</field>
      </shadow>
      </value>
      </block>
      </value>
      </block>
      </statement>
      <value name="IF1">
      <block type="logic_compare" id="GiZC]L
      :l!$S+g0XHyGX">
      <field name="OP">EQ</field>
      <value name="A">
      <block type="get_value" id="W.4wtFd@_-b7PE{4GE"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Anwesenheit_Ping.Jens_Anwesend_Ping</field> </block> </value> <value name="B"> <block type="logic_boolean" id="i0MXUe3=5sNf:Y0CN-">
      <field name="BOOL">FALSE</field>
      </block>
      </value>
      </block>
      </value>
      <statement name="DO1">
      <block type="control" id="6Kz1{he!6%Cw8P3sCaBW">
      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field>
      <field name="WITH_DELAY">FALSE</field>
      <value name="VALUE">
      <block type="math_arithmetic" id="S4veKf48}fST@+zZEV}"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="get_value" id="WUmAM%Q]4:znvC,XGUd">
      <field name="ATTR">val</field>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field>
      </block>
      </value>
      <value name="B">
      <shadow type="math_number" id="+Ih4h6z6ZR30eg(GbUW">
      <field name="NUM">-1</field>
      </shadow>
      </value>
      </block>
      </value>
      </block>
      </statement>
      <next>
      <block type="controls_if" id="s0$F+0[(LTmczd[c9xq=">
      <mutation elseif="1"></mutation>
      <value name="IF0">
      <block type="logic_compare" id="Af1=^#HqSj0te9Y920fk">
      <field name="OP">EQ</field>
      <value name="A">
      <block type="get_value" id="xIP2G,L:W?EGBJ3IJG0G">
      <field name="ATTR">val</field>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Simona_Anwesend_Ping</field>
      </block>
      </value>
      <value name="B">
      <block type="logic_boolean" id="Y
      Ygg)BhHB!Q#_zw]=Vb">
      <field name="BOOL">TRUE</field>
      </block>
      </value>
      </block>
      </value>
      <statement name="DO0">
      <block type="control" id="fIw.frp)yP$n9{K)f_"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_arithmetic" id="dOalq-*eY?O=N(V-LX$="> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="get_value" id="1t8*pZ=~V42+uH:+[%"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field> </block> </value> <value name="B"> <shadow type="math_number" id="A=8i~hy!eP:tlbK(xe@3"> <field name="NUM">1</field> </shadow> </value> </block> </value> </block> </statement> <value name="IF1"> <block type="logic_compare" id="=zsF)+tWce#NkD{*a:Id"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="I;^8w]5e$lRjergRzn/">
      <field name="ATTR">val</field>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Simona_Anwesend_Ping</field>
      </block>
      </value>
      <value name="B">
      <block type="logic_boolean" id="Nd79CtfrHg=FLcuE.Qi3">
      <field name="BOOL">FALSE</field>
      </block>
      </value>
      </block>
      </value>
      <statement name="DO1">
      <block type="control" id="^}t,asBfw]B}n(y/}.oA">
      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field>
      <field name="WITH_DELAY">FALSE</field>
      <value name="VALUE">
      <block type="math_arithmetic" id=";E|
      /L^X]pNzX%ZF7Q)y">
      <field name="OP">ADD</field>
      <value name="A">
      <shadow type="math_number">
      <field name="NUM">1</field>
      </shadow>
      <block type="get_value" id="-/3HS^/Cz+w]T:1_vZXF">
      <field name="ATTR">val</field>
      <field name="OID">0_userdata.0.Anwesenheit_Ping.Personen_Anwesend_Ping</field>
      </block>
      </value>
      <value name="B">
      <shadow type="math_number" id="Jhw0Gb_Y`B0x$rwAy(">
      <field name="NUM">-1</field>
      </shadow>
      </value>
      </block>
      </value>
      </block>
      </statement>
      </block>
      </next>
      </block>
      </next>
      </block>
      </next>
      </block>
      </statement>
      </block>

      sigi234 paul53 2 Replies Last reply Reply Quote 0
      • sigi234
        sigi234 Forum Testing Most Active @Pirates last edited by

        @Pirates

        Bitte benutzt die Code Tags Funktion -> </>
        Hier gehts zur Hilfe.

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

          @Pirates
          Man kann keine Werte zum Triggern verwenden, sondern nur Datenpunkt-IDs, etwa so:

          Blockly_temp.JPG

          "default" durch die Datenpunkt-IDs ersetzen.

          P 1 Reply Last reply Reply Quote 1
          • P
            Pirates @paul53 last edited by

            @paul53
            Danke schonmal, leider funktioniert es immer noch nicht, hast du noch eine andere idee woren es liegen könnte?

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

              @Pirates sagte:

              hast du noch eine andere idee woren es liegen könnte?

              Man kann keinen Datenpunktwert einlesen, den man gerade geändert hat (asynchrone Abarbeitung von "steuere"). Lese zu Anfang den Wert in eine Variable ein und verwende zwischendurch die Variable, die erst zum Ende in den Datenpunkt geschrieben wird.

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

              Support us

              ioBroker
              Community Adapters
              Donate

              927
              Online

              31.9k
              Users

              80.2k
              Topics

              1.3m
              Posts

              blockly javascript security
              3
              5
              214
              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