Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Blockly: Schwierigkeiten mit ids vom Selektor. Hilfe

    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

    Blockly: Schwierigkeiten mit ids vom Selektor. Hilfe

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

      @paul53
      Hab das jetzt mal so umgesetzt, aber leider funktioniert es nicht.
      abfa7bc0-c831-4455-aaa5-7feb0323e9b6-grafik.png

      Hab nur einen Baustein hinzugefügt, damit die Nachricht verschickt wird.
      Woran könnte es liegen?
      Vielen Dank schonmal für deine Bemühungen!👍

      DJMarc75 paul53 2 Replies Last reply Reply Quote 0
      • DJMarc75
        DJMarc75 @Timur last edited by

        @timur sagte in Blockly: Schwierigkeiten mit ids vom Selektor. Hilfe:

        Hab das jetzt mal so umgesetzt

        Nein, Du hast wieder Trigger in Trigger gesetzt. Da kann das nur schiefgehen.
        Warum nicht einfach die Vorlage von @paul53 verwenden?

        T 2 Replies Last reply Reply Quote 0
        • T
          Timur @DJMarc75 last edited by

          @djmarc75
          Achso....also dafür einen separaten blockly....ich dachte ich kann das so in mein Telegram Menü einbinden, aber stimmt...ist wieder trigger in trigger.
          Aber wie kann ich die 2 sachen miteinander verbinden? Damit ich im Telegram Menü abfragen kann welche Lichter eingschaltet sind?

          DJMarc75 paul53 2 Replies Last reply Reply Quote 0
          • T
            Timur @DJMarc75 last edited by

            @djmarc75

            Möchte später auch gerne damit von verschiedenen Geräten die Batteriestände abrufen.

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

              @timur sagte in Blockly: Schwierigkeiten mit ids vom Selektor. Hilfe:

              Aber wie kann ich die 2 sachen miteinander verbinden? Damit ich im Telegram Menü abfragen kann welche Lichter eingschaltet sind?

              Das weiss ich nicht aber ich glaub dass ein Menu in Telegram wenig mit Blockly zu tun hat. Wird das nicht über den Adapter Text2Command erstellt?

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

                @djmarc75

                Ja so hatte ich es zuvor. Man kann es aber auch nur mit Blockly machen und mehrere Menü`s für verschiedene Personen erstellen. Damit bin ich bisher super zufrieden! Finde es auch angenehmer, wenn man nur mit einem Adapter alles realisieren kann. Jetzt muss nur das noch funktionieren und ich bin happy 🙂

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

                  @timur sagte in Blockly: Schwierigkeiten mit ids vom Selektor. Hilfe:

                  Man kann es aber auch nur mit Blockly machen und mehrere Menü`s für verschiedene Personen erstellen.

                  Da bin ich dann leider raus, sorry 😬

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

                    @timur sagte: Hab das jetzt mal so umgesetzt

                    Du warst zu schnell: Ich habe die Sache mit dem Namen noch geändert: Funktion getName(id), weil sonst nur der Name des Trigger-Datenpunktes verwendet wird (siehe oben).

                    Bild_2022-06-27_200306971.png

                    Inhalt der Funktion:

                    return getObject(id).common.name;
                    

                    Ja, und keinen weiteren Trigger drum herum!

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

                      @timur sagte: im Telegram Menü abfragen kann welche Lichter eingschaltet sind?

                      Davon habe ich keine Ahnung! In meinem Vorschlag wird getriggert, wenn ein Licht geschaltet wird. Vielleicht kann dieser Trigger durch einen anderen Trigger (Telegram Menü) ersetzt werden? Das Programm innerhalb des Triggers würde gleich bleiben.

                      Bild_2022-06-27_202432861.png

                      EDIT: Wie werden die Variablen Letzter_Text und Letzter_Absender gesetzt?

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

                        @paul53

                        Ich habs nun geschafft. Hat etwas Zeit und Nerven gekostet. 🙂
                        Hab ein script von folgender seite übernommen und etwas verändert.
                        https://www.machs-smart.de/iobroker-offene-fenster-zaehlen-blockly/

                        Nochmal vielen Dank für eure Hilfe!!!👍 👏

                        Hier nun mein script, falls es jemand benötigt.

                        <xml xmlns="https://developers.google.com/blockly/xml">
                          <variables>
                            <variable id="Fwt*3`3ScyT(qDt?gf(T">ObjectID</variable>
                            <variable id="cTIvd#0frb]}?DN^7oUd">Liste-komplett</variable>
                            <variable id="MLrrG!H:mqglsc.Y_Ljh">Liste-Licht-An</variable>
                            <variable id="}K$K4dup~Vnv!`[}vnQy">Liste-Licht-Aus</variable>
                            <variable id="9sl@{VQ/amrd~ZTB}e/O">i</variable>
                          </variables>
                          <block type="procedures_defcustomreturn" id="]lQM=r`L^2M}s^@n(USH" x="-112" y="-887">
                            <mutation statements="false">
                              <arg name="ObjectID" varid="Fwt*3`3ScyT(qDt?gf(T"></arg>
                            </mutation>
                            <field name="NAME">Name</field>
                            <field name="SCRIPT">bGV0IG5hbWUgPSBnZXRPYmplY3QoT2JqZWN0SUQpLmNvbW1vbi5uYW1lOwovL2lmKHR5cGVvZiByb29tID09ICdvYmplY3QnKSByZXR1cm4gcm9vbS5kZTsKcmV0dXJuIG5hbWU7</field>
                            <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                          </block>
                          <block type="on_ext" id="RT3@Kxqxg#w3f=(kzwCu" x="-112" y="-862">
                            <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="0)0sp$I1ccfm%4Sde-mT">
                                <field name="oid">default</field>
                              </shadow>
                              <block type="selector" id=",lvP%A]1J?Mf^@0s2D%[">
                                <field name="TEXT">state[id=*](functions=Licht)</field>
                              </block>
                            </value>
                            <statement name="STATEMENT">
                              <block type="variables_set" id="EaZb.Nmx4%jg9Z;%%B!-">
                                <field name="VAR" id="cTIvd#0frb]}?DN^7oUd">Liste-komplett</field>
                                <value name="VALUE">
                                  <block type="text" id="Wh^sL0z$W-HIc=.KAWpS">
                                    <field name="TEXT"></field>
                                  </block>
                                </value>
                                <next>
                                  <block type="variables_set" id="SS-}=kJy|nP`aiAV1-xb">
                                    <field name="VAR" id="MLrrG!H:mqglsc.Y_Ljh">Liste-Licht-An</field>
                                    <value name="VALUE">
                                      <block type="lists_create_with" id="$AFtq:sq?.LYHWTSs$x|">
                                        <mutation items="0"></mutation>
                                      </block>
                                    </value>
                                    <next>
                                      <block type="variables_set" id="o_#fa#./grwL0VYZXhV1">
                                        <field name="VAR" id="}K$K4dup~Vnv!`[}vnQy">Liste-Licht-Aus</field>
                                        <value name="VALUE">
                                          <block type="lists_create_with" id="P~^2(u_E4rR`PYMfolf}">
                                            <mutation items="0"></mutation>
                                          </block>
                                        </value>
                                        <next>
                                          <block type="controls_forEach" id="~PaFX`X@5n{TM9K^{Jw6">
                                            <field name="VAR" id="9sl@{VQ/amrd~ZTB}e/O">i</field>
                                            <value name="LIST">
                                              <block type="selector" id="xQ^Q5{h5V@5PLI+YO@i.">
                                                <field name="TEXT">state[id=*](functions=Licht)</field>
                                              </block>
                                            </value>
                                            <statement name="DO">
                                              <block type="controls_if" id="-3J;6~}7Ac!D}IR`/Dr1">
                                                <mutation else="1"></mutation>
                                                <value name="IF0">
                                                  <block type="get_value_var" id=")kSAuROX6lA-U2N,FJ1Q">
                                                    <field name="ATTR">val</field>
                                                    <value name="OID">
                                                      <shadow type="text" id="e+?Z+-m0_DLYGl{zT3ix">
                                                        <field name="TEXT"></field>
                                                      </shadow>
                                                      <block type="variables_get" id="!fALmmY3PSF+?rGHUXQ,">
                                                        <field name="VAR" id="9sl@{VQ/amrd~ZTB}e/O">i</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <statement name="DO0">
                                                  <block type="lists_setIndex" id="-zUiNM(}BsoQ].Hu.|mx" inline="false">
                                                    <mutation at="false"></mutation>
                                                    <field name="MODE">INSERT</field>
                                                    <field name="WHERE">FIRST</field>
                                                    <value name="LIST">
                                                      <block type="variables_get" id="Q0Hct8=ken4m!!W]js)U">
                                                        <field name="VAR" id="MLrrG!H:mqglsc.Y_Ljh">Liste-Licht-An</field>
                                                      </block>
                                                    </value>
                                                    <value name="TO">
                                                      <block type="procedures_callcustomreturn" id="2fUjFt9g8rVF/XheoN.x">
                                                        <mutation name="Name">
                                                          <arg name="ObjectID"></arg>
                                                        </mutation>
                                                        <value name="ARG0">
                                                          <block type="variables_get" id="k:Is?gkGPl/=r1X^,k3K">
                                                            <field name="VAR" id="9sl@{VQ/amrd~ZTB}e/O">i</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </statement>
                                                <statement name="ELSE">
                                                  <block type="lists_setIndex" id="-jTzj32XiFWfi?n1Y/LN" inline="false">
                                                    <mutation at="false"></mutation>
                                                    <field name="MODE">INSERT</field>
                                                    <field name="WHERE">FIRST</field>
                                                    <value name="LIST">
                                                      <block type="variables_get" id="2~tv/YW~42Q$E*%G;Pqi">
                                                        <field name="VAR" id="}K$K4dup~Vnv!`[}vnQy">Liste-Licht-Aus</field>
                                                      </block>
                                                    </value>
                                                    <value name="TO">
                                                      <block type="procedures_callcustomreturn" id="`Zdw5Kh*[(IY72pyr_o(">
                                                        <mutation name="Name">
                                                          <arg name="ObjectID"></arg>
                                                        </mutation>
                                                        <value name="ARG0">
                                                          <block type="variables_get" id="dTq}?1$ruG%K+237sR}z">
                                                            <field name="VAR" id="9sl@{VQ/amrd~ZTB}e/O">i</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </statement>
                                              </block>
                                            </statement>
                                            <next>
                                              <block type="controls_if" id="%xroGCihVu8$~$xQ{]ke">
                                                <value name="IF0">
                                                  <block type="logic_negate" id="u(+LUZ2=D}K8JRKt()tg">
                                                    <value name="BOOL">
                                                      <block type="lists_isEmpty" id="zS,AjUzHt0uWh$(li$,h">
                                                        <value name="VALUE">
                                                          <block type="variables_get" id="b),0*5k:oMF~4H^Xx.Hw">
                                                            <field name="VAR" id="MLrrG!H:mqglsc.Y_Ljh">Liste-Licht-An</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <statement name="DO0">
                                                  <block type="text_append" id="xgCK}K@KSx){tg%A(xl5">
                                                    <field name="VAR" id="cTIvd#0frb]}?DN^7oUd">Liste-komplett</field>
                                                    <value name="TEXT">
                                                      <shadow type="text">
                                                        <field name="TEXT"></field>
                                                      </shadow>
                                                      <block type="text" id="-HV%tM;_jbL/K_)=V78_">
                                                        <field name="TEXT">Licht An: </field>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="text_append" id="mQWs]oKZy!!UBi#)2pN:">
                                                        <field name="VAR" id="cTIvd#0frb]}?DN^7oUd">Liste-komplett</field>
                                                        <value name="TEXT">
                                                          <shadow type="text">
                                                            <field name="TEXT"></field>
                                                          </shadow>
                                                          <block type="lists_split" id="vo;Gre#7RVr3M6$mk7E:">
                                                            <mutation mode="JOIN"></mutation>
                                                            <field name="MODE">JOIN</field>
                                                            <value name="INPUT">
                                                              <block type="variables_get" id="o(LRYzD:?:_v5aTHyYuJ">
                                                                <field name="VAR" id="MLrrG!H:mqglsc.Y_Ljh">Liste-Licht-An</field>
                                                              </block>
                                                            </value>
                                                            <value name="DELIM">
                                                              <shadow type="text" id="lIp}_n+[0|`={eJh]aEe">
                                                                <field name="TEXT">, </field>
                                                              </shadow>
                                                              <block type="text_newline" id="3VGu|;nAg9JYe;6n*G8Q">
                                                                <field name="Type">\n</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="text_append" id=":+)c7I}{1/nyEBI7mJJ{">
                                                            <field name="VAR" id="cTIvd#0frb]}?DN^7oUd">Liste-komplett</field>
                                                            <value name="TEXT">
                                                              <shadow type="text" id="33ABK`PY}NDK3PSrP/}e">
                                                                <field name="TEXT"></field>
                                                              </shadow>
                                                              <block type="text_newline" id="o(@3V35-R{~llLN+.p?K">
                                                                <field name="Type">\n</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </statement>
                                                <next>
                                                  <block type="controls_if" id="L!}N25QKJ[D61;a?bf%?">
                                                    <value name="IF0">
                                                      <block type="logic_negate" id="P#;v$=eLxCHvoTF^|O)k">
                                                        <value name="BOOL">
                                                          <block type="lists_isEmpty" id="7GdP`ErgKtT#V1*MU9gK">
                                                            <value name="VALUE">
                                                              <block type="variables_get" id="T`YMrp]-^RFDhRULk,7z">
                                                                <field name="VAR" id="}K$K4dup~Vnv!`[}vnQy">Liste-Licht-Aus</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <statement name="DO0">
                                                      <block type="text_append" id="rr-Lu!{,+|n3Pz}r,/|q">
                                                        <field name="VAR" id="cTIvd#0frb]}?DN^7oUd">Liste-komplett</field>
                                                        <value name="TEXT">
                                                          <shadow type="text" id="u#~AR/M~-4pVtl1Oc_:7">
                                                            <field name="TEXT"></field>
                                                          </shadow>
                                                          <block type="text" id="rHg4[Q1;k=YZ/r;j3e$B">
                                                            <field name="TEXT">Licht Aus: </field>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="text_append" id="(`NHR}HYpw]:P`ZNgy6X">
                                                            <field name="VAR" id="cTIvd#0frb]}?DN^7oUd">Liste-komplett</field>
                                                            <value name="TEXT">
                                                              <shadow type="text" id="LHw-8A|w9lQp3_kLp8XM">
                                                                <field name="TEXT"></field>
                                                              </shadow>
                                                              <block type="lists_split" id="s{W^YIjtci(NGf{R![Df">
                                                                <mutation mode="JOIN"></mutation>
                                                                <field name="MODE">JOIN</field>
                                                                <value name="INPUT">
                                                                  <block type="variables_get" id="u4US1gL%m8Myl{MI]BFp">
                                                                    <field name="VAR" id="}K$K4dup~Vnv!`[}vnQy">Liste-Licht-Aus</field>
                                                                  </block>
                                                                </value>
                                                                <value name="DELIM">
                                                                  <shadow type="text" id="),t^.5%yN_V(;k~5h}?^">
                                                                    <field name="TEXT">, </field>
                                                                  </shadow>
                                                                  <block type="text_newline" id="gTATzQaSaQpWZDg1}MY(">
                                                                    <field name="Type">\n</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </statement>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                          <block type="on_ext" id="Q:@R}~bt`:M4%+)V6`zJ" x="538" y="-837">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                            <field name="CONDITION">any</field>
                            <field name="ACK_CONDITION"></field>
                            <value name="OID0">
                              <shadow type="field_oid" id="z%tb_ZB,HVK@M.K^TYt=">
                                <field name="oid">telegram.0.communicate.request</field>
                              </shadow>
                            </value>
                            <statement name="STATEMENT">
                              <block type="controls_if" id="H~Dx_I9YlQNeP;w^aiZ~">
                                <value name="IF0">
                                  <block type="logic_compare" id="3PgRt8mZnR2mBU:S1I+t">
                                    <field name="OP">EQ</field>
                                    <value name="A">
                                      <block type="get_value" id="n0f(7]0?,_9%b8tB9.P*">
                                        <field name="ATTR">val</field>
                                        <field name="OID">telegram.0.communicate.request</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="text" id="8Ar66k/.ZtW0`)*%umv]">
                                        <field name="TEXT">[Timur]Status Licht</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO0">
                                  <block type="telegram" id="ys1J1;eU^O3UbQr1SxTa">
                                    <field name="INSTANCE">.0</field>
                                    <field name="LOG"></field>
                                    <field name="SILENT">FALSE</field>
                                    <field name="PARSEMODE">default</field>
                                    <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field>
                                    <value name="MESSAGE">
                                      <shadow type="text">
                                        <field name="TEXT">text</field>
                                      </shadow>
                                      <block type="variables_get" id="(2UX:[,PkWn9*/xyCX:G">
                                        <field name="VAR" id="cTIvd#0frb]}?DN^7oUd">Liste-komplett</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                              </block>
                            </statement>
                          </block>
                        </xml>
                        
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        831
                        Online

                        31.9k
                        Users

                        80.1k
                        Topics

                        1.3m
                        Posts

                        4
                        17
                        1005
                        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