Skip to content

Blockly

6.6k Topics 79.7k Posts

Hilfe für Skripterstellung mit Blockly

NEWS

  • Ermitteln des Ordners eines Datenpunktes

    14
    2
    0 Votes
    14 Posts
    2k Views
    Martin SchlenderM
    Hier das fertige Skript: [image: 1598730689790-62c02772-da4a-4c1a-b07d-eaee75f61e97-image.png] <xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="7mRfUtsH)|%hw[[a`rh*">id</variable> <variable id="H!z2t8D]-}?Y#]N.Mi:z">eingeschaltete_Lampen</variable> <variable id="8DbC;yB}KwDVwI`GCcjq">strLevel</variable> <variable id="xk:V8ZG:/eys*CC0I%u(">Rolle</variable> </variables> <block type="on" id="gp{(6ggat}i[$IGeUI{v" x="287" y="-437"> <field name="OID">tr-064.0.states.Anwesenheit</field> <field name="CONDITION">false</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="comment" id="/44{J!zbaUO44Dd@$/,_"> <field name="COMMENT">Alle Datenpunkte mit level in einer Schleife </field> <next> <block type="comment" id="NGO9r@s8Qk+.d8f@=y@]"> <field name="COMMENT">durchgehen</field> <next> <block type="variables_set" id="r4y+K/j5BmDzFL_Hq@Ca"> <field name="VAR" id="H!z2t8D]-}?Y#]N.Mi:z">eingeschaltete_Lampen</field> <value name="VALUE"> <block type="text" id="9)sUy8Ak?75xMvq*M@d!"> <field name="TEXT"></field> </block> </value> <next> <block type="controls_forEach" id="+Rn2T^|`oekO53H5maRm"> <field name="VAR" id="8DbC;yB}KwDVwI`GCcjq">strLevel</field> <value name="LIST"> <block type="lists_split" id="0eaY/yd`!Lo5MxDO|/_d"> <mutation mode="SPLIT"></mutation> <field name="MODE">SPLIT</field> <value name="INPUT"> <block type="convert_tostring" id="OwjN=kwv1)b3d::5X~D+"> <value name="VALUE"> <block type="selector" id="nCshdbQY/.XTedh13T9^"> <field name="TEXT">state[id=level]</field> </block> </value> </block> </value> <value name="DELIM"> <shadow type="text" id="gDfmiN!Uo^^K4F@2g(_e"> <field name="TEXT">,</field> </shadow> </value> </block> </value> <statement name="DO"> <block type="comment" id="JI?HkJO7C*{RC?pPhPrA"> <field name="COMMENT">nur die aus der Instanz hue.0</field> <next> <block type="controls_if" id=",^:@q}@w`,84DD)iE1Ve"> <value name="IF0"> <block type="logic_compare" id="xS|FXnW~rue{*`r-W[8j"> <field name="OP">GT</field> <value name="A"> <block type="text_indexOf" id="Z6$Mpiwl[$cqvmIx97;f"> <field name="END">FIRST</field> <value name="VALUE"> <block type="variables_get" id="(L=M!QA}{;W%+k`;q_[k"> <field name="VAR" id="8DbC;yB}KwDVwI`GCcjq">strLevel</field> </block> </value> <value name="FIND"> <shadow type="text" id="!UNHx^O+7lCS=A{Rq!o!"> <field name="TEXT">hue.0</field> </shadow> </value> </block> </value> <value name="B"> <block type="math_number" id="$_G3n*=J?0!Y9QkBl9[G"> <field name="NUM">0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="comment" id="?JIjsM!.)GQ@RD)(ywXs"> <field name="COMMENT">Level &gt; 0 suchen (nicht erreichbare Lampen sind 0)</field> <next> <block type="controls_if" id="~O69iZpyGCSc3DRbANic"> <value name="IF0"> <block type="logic_compare" id="/+l]%bC$tF9U]p+RC^4,"> <field name="OP">GT</field> <value name="A"> <block type="get_value_var" id="F`p1_}*5ps#fvrg2inTs"> <field name="ATTR">val</field> <value name="OID"> <shadow type="text" id="e+REH.op!3CLeT-S8BYD"> <field name="TEXT"></field> </shadow> <block type="variables_get" id="L*wqbxfPVx8{MJ+b[N{D"> <field name="VAR" id="8DbC;yB}KwDVwI`GCcjq">strLevel</field> </block> </value> </block> </value> <value name="B"> <block type="math_number" id="nu2kjUT?wZbm7f.fn|0A"> <field name="NUM">0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="comment" id=";4bhNgz$8Bi)U$,`EAp7"> <field name="COMMENT">übergeordneten Ordner und dessen Rolle ermitteln</field> <next> <block type="comment" id=")3;bXU=MlLb$kc7lGIQ{"> <field name="COMMENT">und Räume, Schalter etc. rausfiltern</field> <next> <block type="variables_set" id="xnsJV0]GY(P6%_fA;uzg"> <field name="VAR" id="xk:V8ZG:/eys*CC0I%u(">Rolle</field> <value name="VALUE"> <block type="get_attr" id="Us`m44~5*Syq6~4Ma8)R"> <value name="PATH"> <shadow type="text" id="$ZF+Sp4fp+8.:cTh9HC["> <field name="TEXT">common.role</field> </shadow> </value> <value name="OBJECT"> <block type="procedures_callcustomreturn" id="#SxKRHN=]l,1mL^V-|oE"> <mutation name="Objekt"> <arg name="id"></arg> </mutation> <value name="ARG0"> <block type="text_getSubstring" id="%+vvC~LcN5+4HL:Eu)lj"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="variables_get" id="$eHOT?3=bv$-cZN:S{p@"> <field name="VAR" id="8DbC;yB}KwDVwI`GCcjq">strLevel</field> </block> </value> <value name="AT1"> <block type="math_number" id="FBpt]rF*{-m[Q36]ty-v"> <field name="NUM">1</field> </block> </value> <value name="AT2"> <block type="math_arithmetic" id="VMvZh4%I-bMm?N)Xu7@s"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="text_indexOf" id="~AXv!q2ypZ+wQzsfK4{2"> <field name="END">LAST</field> <value name="VALUE"> <block type="variables_get" id="o;b2VcY#/9?FNU/M=99l"> <field name="VAR" id="8DbC;yB}KwDVwI`GCcjq">strLevel</field> </block> </value> <value name="FIND"> <shadow type="text" id="vBoikVq(16w5cj|7X+._"> <field name="TEXT">.</field> </shadow> </value> </block> </value> <value name="B"> <shadow type="math_number" id="i_XwGX`#0C`iG:Hb{`p5"> <field name="NUM">1</field> </shadow> </value> </block> </value> </block> </value> </block> </value> </block> </value> <next> <block type="controls_if" id="Iln[?j,#}@K]{6NeLYH-"> <value name="IF0"> <block type="logic_compare" id="YjzSt/|B8|2:p5ZrJ0-r"> <field name="OP">GT</field> <value name="A"> <block type="text_indexOf" id="y;f,h2hSA^IczOH(i%g="> <field name="END">FIRST</field> <value name="VALUE"> <block type="variables_get" id="l[#=5R=8mzzKWe}fEn0/"> <field name="VAR" id="xk:V8ZG:/eys*CC0I%u(">Rolle</field> </block> </value> <value name="FIND"> <shadow type="text" id="[%c1esfur{@D7xKy{I!+"> <field name="TEXT">light</field> </shadow> </value> </block> </value> <value name="B"> <block type="math_number" id="!Z$/{|nSeGqjsLT`DbH;"> <field name="NUM">0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="text_append" id=";L+nt@`/3~/c)pAqVg4,"> <field name="VAR" id="H!z2t8D]-}?Y#]N.Mi:z">eingeschaltete_Lampen</field> <value name="TEXT"> <shadow type="text" id="yy_].i[.p0@9moZp7=.:"> <field name="TEXT"></field> </shadow> <block type="text_join" id="!5-T(rL~VVt/[p$!AQt|"> <mutation items="2"></mutation> <value name="ADD0"> <block type="get_attr" id="3%pg%Om?79LDI!A:H~vG"> <value name="PATH"> <shadow type="text" id="wvNpxgXJ4MLs/uqtr6;X"> <field name="TEXT">common.name</field> </shadow> </value> <value name="OBJECT"> <block type="procedures_callcustomreturn" id="H[SBrDb/JS~YhOlDJduf"> <mutation name="Objekt"> <arg name="id"></arg> </mutation> <value name="ARG0"> <block type="text_getSubstring" id="-}#tsvSa=^`7=`}S@yT$"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="variables_get" id=";;jDOvi)H$@,9P}yocTA"> <field name="VAR" id="8DbC;yB}KwDVwI`GCcjq">strLevel</field> </block> </value> <value name="AT1"> <block type="math_number" id="`*8R[bg9yG/t~bA*-+b/"> <field name="NUM">1</field> </block> </value> <value name="AT2"> <block type="math_arithmetic" id="U``iB)tKR[64Td3!E^f:"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="text_indexOf" id="5Osm|nVKkI=uzN-Z=!6m"> <field name="END">LAST</field> <value name="VALUE"> <block type="variables_get" id="?=)/rId~e6v?@=S4/QZn"> <field name="VAR" id="8DbC;yB}KwDVwI`GCcjq">strLevel</field> </block> </value> <value name="FIND"> <shadow type="text" id="]W?`1bz!GX/o5sCHR4FA"> <field name="TEXT">.</field> </shadow> </value> </block> </value> <value name="B"> <shadow type="math_number" id="|=oZom.5v(aQgJa.qk0F"> <field name="NUM">1</field> </shadow> </value> </block> </value> </block> </value> </block> </value> </block> </value> <value name="ADD1"> <block type="text_newline" id="R}nz[R2DyuQ-W^2fi{X="> <field name="Type">\n</field> </block> </value> </block> </value> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </statement> </block> </next> </block> </statement> <next> <block type="debug" id="%M)#2]g;K)l/^DuYchq."> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="KE11]EJPs$oa1(z}0bs{"> <field name="TEXT">Los</field> </shadow> <block type="variables_get" id="GpZD$)VBU.FA)X;A~VTH"> <field name="VAR" id="H!z2t8D]-}?Y#]N.Mi:z">eingeschaltete_Lampen</field> </block> </value> <next> <block type="request" id="hDk|bg6yN6BE?:A*RF//"> <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="false"></mutation> <field name="WITH_STATEMENT">FALSE</field> <field name="LOG">log</field> <value name="URL"> <shadow type="text" id="@4;JzOhtxW;6:^Bq(j,)"> <field name="TEXT">https://autoremotejoaomgcd.appspot.com/sendmessage?key=APA91bFlHVBNl9otue41du3jVy9JA_xWiXdBuCpyDiAoprSHSnH3qIz7B2dFb8BJNotQhKQjfZDxxc8h4YCIyy6uFrDXjbM2ioJloyEfcJFzDCfEgdlXgsaI0lWRSy3BfvzECn68Ft9A&amp;message=ioBroker Alarm: Gefrierfach zu warm</field> </shadow> <block type="text_join" id="NG-K54.;H!!KNH%heU0$"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="@mhJoX-~`72(Cazodi9s"> <field name="TEXT">https://Dein Push-Link mit Hinweis</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="MBL%W;%Gx8-y.buMUZjp"> <field name="VAR" id="H!z2t8D]-}?Y#]N.Mi:z">eingeschaltete_Lampen</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> <block type="procedures_defcustomreturn" id="LU_V=dEh4#j!Q=8E;_8." x="637" y="-362"> <mutation statements="false"> <arg name="id" varid="7mRfUtsH)|%hw[[a`rh*"></arg> </mutation> <field name="NAME">Objekt</field> <field name="SCRIPT">cmV0dXJuIGdldE9iamVjdChpZCk7</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> </xml>
  • Timeout für Waschmaschine

    16
    2
    0 Votes
    16 Posts
    1k Views
    C
    @paul53 So hat es jetzt funktioniert Danke für deine Unterstützung
  • Probleme mit Zeitlicher und Present schaltung

    blockly
    15
    1
    0 Votes
    15 Posts
    1k Views
    W
    Bitte zahlen in matheblöcke und true/false in logikblöcke ändern Okay geändert. dass du auf aktualisieren triggerst hat seinen Grund? nicht auf Änderung? Habe ich ausprobiert ob es dann eine änderung gibt. Und sich dann nicht immer abgeschaltet hat. Und es hat was mit der Anlage zu tun. Habe die ja oben nicht im Trigger drin. das könnte ich aber noch nachfügen.
  • Problem mit skript Licht an so lange Bewegung

    9
    1
    0 Votes
    9 Posts
    573 Views
    F
    Danke für die Hilfe ich werde das mal Testen und berichte :) [image: 1598692014494-2020-08-29-10_10_30-javascript-iobroker.png] So scheint es zu laufen. Vielen Dank
  • Kamera mit Anwesenheit und Zeit Scharf schalten aber wie?

    2
    3
    0 Votes
    2 Posts
    259 Views
    paul53P
    @xxsirosxx Prinzip: [image: 1598606377509-blockly_temp.jpg]
  • Zeitschleife, was ist falsch?

    50
    2
    0 Votes
    50 Posts
    4k Views
    E
    @Dutchman Da sag ich mal Respekt.
  • Gerät welches erkennt, dass die Waschmaschine fertig ist

    19
    0 Votes
    19 Posts
    2k Views
    mcBirneM
    @Dutchman mit einer noch älteren Version hat es geklappt
  • Text an Text an Text ... ich habe einen Knopf im Kopf

    blockly
    4
    3
    0 Votes
    4 Posts
    216 Views
    DutchmanD
    @metaxa sagte in Text an Text an Text ... ich habe einen Knopf im Kopf: "asynchron" Das gleiche in einem echten JS geschrieben würde "man" wohl auch mit variablen lösen, oder ginge das anders Würde man mit Variable oder „await“ lösen, das macht eine Promise, wartet auf Resultat und macht erst dan weiter. So ist js halt, der Code Rent weiter 😉
  • IP Adresse pingen

    5
    0 Votes
    5 Posts
    242 Views
    mcBirneM
    @Hartmut-Tomcin [image: 1598456066267-unbenannt.png] Super, es funktioniert perfekt. Danke!
  • Bewegungsmelder zu bestimmter Uhrzeit abschalten

    blockly
    3
    1
    0 Votes
    3 Posts
    349 Views
    Sebastian 0S
    @paul53 ok, ich hab anscheinend zu kompliziert gedacht :D vielen Dank!!
  • ab Ereignis Timer laufen lassen?

    blockly
    8
    0 Votes
    8 Posts
    326 Views
    HumidorH
    @Dutchman Danke @paul53 Danke
  • Wie muss das Blockly bei Alexa Sprachausgabe aussehen?

    blockly
    23
    0 Votes
    23 Posts
    6k Views
    KusselinK
    Hallo Zusammen, muss mich nochmal melden...und zwar kann ich jetzt zb auch den Aquara Cube gleichzeitig für andere Sxcripte verwenden? Denke schon...darf halt nicht die Aktion jetzt von hier sein oder? Über ne Info herzlichen Dank. P.S. Und letzte Frage...kann ich den Script auch so ändern das ich noch mehr Radiosender aufnehmen kann mit Aktionen des Cube??
  • Poolpumpe einschalten bei Sonne

    2
    0 Votes
    2 Posts
    318 Views
    HomoranH
    @steve-schulze sagte in Poolpumpe einschalten bei Sonne: habt ihr da ein paar tips für mich triggern auf solarüberschuss oder was immer du hast Dann ein falls Wert >250 mache Pumpe ein, So sonstfalls Wet < 150 mache pumpe aus Aber Vorsicht. Bei wolkigem Wetter springt die Pumpe dauernd wieder an
  • Samsung Fernseher per Bewegungsmelder ein- und ausschalten

    1
    0 Votes
    1 Posts
    657 Views
    No one has replied
  • sonos member channel

    1
    2
    0 Votes
    1 Posts
    155 Views
    No one has replied
  • Aqara Vibrationssensor für Postbenachrichtigung Briefkasten

    9
    1
    0 Votes
    9 Posts
    1k Views
    L
    Hey, danke für eure Beispiele! Genau so ein Skripzt wie @johannes1702 hatte ich anfangs auch, aber es wollte nicht auslösen (wie oben geschrieben). Ich hatte es dann einfach deaktiviert und ein neues über vibration.strength gebaut. Ich habe es jetzt einfach mal aktiviert und - siehe da: Es geht, es löst nur einmal aus. Keine Ahnung was da los war. Danke aber trotzdem!
  • Alexa Ende einer Sprachausgabe erkennen

    Moved
    3
    0 Votes
    3 Posts
    377 Views
    Danny 0D
    @CrunkFX Hi, das hatte ich auch schon im Sinn, müsste dann nur mit der Stoppuhr stoppen wie lange mehrere Sätze dauern. Ich habe gedacht das es noch etwas anderes gibt :-)
  • Poolheizung steuern

    12
    0 Votes
    12 Posts
    1k Views
    L
    @Homoran Ja super. Habe das auch gerade gefunden. Danke!
  • [Gelöst] HUE Motion Sensor Lampe an/aus -> Problem Haustier

    31
    1
    0 Votes
    31 Posts
    5k Views
    SanwebS
    @padrino Habe Deines auch noch einmal ausprobiert, wie Paul schon schrieb, funktioniert Deines ebenfalls mit dem nun richtigen Datenpunkt.
  • [gelöst] Script läuft bei virtuellem Tastend nicht bei real

    46
    0 Votes
    46 Posts
    3k Views
    D
    @bahnuhr Eigentlich ja, aber hier war es ja eben nicht so die Zeit wurde immer aktualisiert aber die Aktion nicht ausgeführt.

585

Online

32.8k

Users

82.7k

Topics

1.3m

Posts