- Home
- Deutsch
- Skripten / Logik
- Blockly
- (gelöst) - Blockly Funktion
(gelöst) - Blockly Funktion
-
Ich bin gerade dabei Deine erstellte Funktion für ein Blockly "Fenster-Skript" zu probieren. Vielleicht kannst Du nochmal helfen ?
Ich bekomme alle geöffneten Fenster wie gewünscht. (die deaktivierten Bausteine kannst Du ignorieren)
Ich hätte die Telegram oder auch Pushover Meldungen mit geöffneten Fenstern gern in einer Liste und nicht als Einzelmeldung. Ich habe schon mit Listen Bausteinen eine ganze Weile probiert, bekomme es aber nicht hin. Wie stelle ich das an ?
im Moment sieht das so aus:
-
@dslraser
Vorschlag (innerhalb des Triggers):Leider kennt Blockly kein array.push(element).
-
@paul53
Danke, funktioniert schon fast.
Nun noch mit Zeilenumbrüchen und ohne Klammern und die "".
Bekomme ich auch nicht hin...Sieht jetzt so aus
-
Nur noch Zeilenumbrüche und ohne Klammern.
Ja, JSON.stringify() ist nicht das wahre, aber ich vermisse array.join() in Blockly.
-
@paul53
ich habe mal mehrere Fenster geöffnet, funktioniert ja, eben nur das Format -
@dslraser Bau selbst die Funktion join(array, trenner)
und verwende sie für das Telegarmm.
-
Den kann ich dann auch probieren. die anderen Sachen habe ich hiermit weg bekommen.
-
-
@paul53
damit habe ich die Klammern und die " weg bekommen.
Neue Zeile ging damit auch.
So läuft es nun. Danke für Deine Hilfe.
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="" id="3Eu!3bSQeipPK#4r!G0o">id</variable>
<variable type="" id="bf/Z2r!m9,e}g4A3bA6)">originalText</variable>
<variable type="" id="/OzH}sD#.7aud9WY{/=G">suchText</variable>
<variable type="" id="A8F%D/JIH$+LvGduNG5H">tauschText</variable>
<variable type="" id="MGbjhMo,|OE]bTX6R79;">offeneFenster</variable>
<variable type="" id="o-Y1!mS4.o.6+Mj[sQ#">Text</variable> <variable type="" id="nr)=!dz]y4urXFQ{8{y-">fensterstatus</variable> <variable type="" id="P^PxOlMA9Ro5zuSC]*pE">AnzZeichenSuchtext</variable> <variable type="" id="Y!At7!o;7@}I~(6oA$pR">Stelle</variable> <variable type="" id="o-Pjbq{O^xX1Vmts,wer">MeinText</variable> <variable type="" id="(.
4WMsEzFZ9|E$[f4e/">neuerText</variable>
<variable type="" id="^o17}cPhG@#N0x?4hY|">Teil_1</variable>
<variable type="" id="IR;9iiSXRYYF47pi:,{=">Teil_2</variable>
</variables>
<block type="procedures_defcustomreturn" id="!N6;}kSECsPgA~=}mQv" x="-5913" y="-2388">
<mutation statements="false">
<arg name="id" varid="3Eu!3bSQeipPK#4r!G0o"></arg>
</mutation>
<field name="NAME">getParentName</field>
<field name="SCRIPT">aWYoZ2V0T2JqZWN0KGlkLnN1YnN0cmluZygwLCBpZC5sYXN0SW5kZXhPZignLicpKSkpIHJldHVybiBnZXRPYmplY3QoaWQuc3Vic3RyaW5nKDAsIGlkLmxhc3RJbmRleE9mKCcuJykpKS5jb21tb24ubmFtZTsNCmVsc2UgcmV0dXJuIG51bGw7</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
</block>
<block type="on_ext" id="q8A38W=#;PI{7f/}3pqI" x="-4963" y="-2387">
<mutation items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="5Y$(^lu{[^5]ux3oE+("> <field name="oid">default</field> </shadow> <block type="selector" id="v{K?$pjlM,cd:S]7)}@t"> <field name="TEXT">channel[state.id=*.STATE](functions="Fenster")</field> </block> </value> <statement name="STATEMENT"> <block type="variables_set" id="_%Y+gCOLsC1}FrPCVNk:"> <field name="VAR" id="MGbjhMo,|OE]bTX6R79;" variabletype="">offeneFenster</field> <value name="VALUE"> <block type="lists_create_with" id="V16(qSW0SL.n@Id{SQ[u"> <mutation items="0"></mutation> </block> </value> <next> <block type="controls_forEach" id="Eb!ly!|dTn,Zqy9edjG$"> <field name="VAR" id="nr)=!dz]y4urXFQ{8{y-" variabletype="">fensterstatus</field> <value name="LIST"> <block type="selector" id="%nDh2dr]@.=mVH4-
B-#">
<field name="TEXT">channelstate.id=*.STATE</field>
</block>
</value>
<statement name="DO">
<block type="controls_if" id="tq_Th[d(pZtxt2T-LrO">
<value name="IF0">
<block type="logic_compare" id="FYP=~;)uQu!a5|]KMNd/">
<field name="OP">NEQ</field>
<value name="A">
<block type="get_value_var" id="j,y|JnaJz:sb,i(9oe^C">
<field name="ATTR">val</field>
<value name="OID">
<shadow type="text" id="pmOdHJq595YI/$n-u^$"> <field name="TEXT"></field> </shadow> <block type="variables_get" id=";=A)49}3Eqx{}^5C
S[z">
<field name="VAR" id="nr)=!dz]y4urXFQ{8{y-" variabletype="">fensterstatus</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="math_number" id="HQSbp;V,L:xNvI$lI=t!">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="lists_setIndex" id="F!KR3Rxr/RH5YL}J~$T" inline="false">
<mutation at="true"></mutation>
<field name="MODE">SET</field>
<field name="WHERE">FROM_START</field>
<value name="LIST">
<block type="variables_get" id="H2NstO2,gntow{QM%=|x">
<field name="VAR" id="MGbjhMo,|OE]bTX6R79;" variabletype="">offeneFenster</field>
</block>
</value>
<value name="AT">
<block type="math_arithmetic" id="TMNFe_GH3BtOrEKv0F">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id=")43ylUFXJ=jhc.9$m7Oo">
<field name="NUM">1</field>
</shadow>
<block type="lists_length" id="z-3zZ!%o$CO(mZ|w%1">
<value name="VALUE">
<block type="variables_get" id="S+LKJSv_LdS?FEs=^M.]">
<field name="VAR" id="MGbjhMo,|OE]bTX6R79;" variabletype="">offeneFenster</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="Z8e6TaXp%{0QY4q4f!Ys">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="TO">
<block type="procedures_callcustomreturn" id="ToXniOfG/14/-A[2WP[s">
<mutation name="getParentName">
<arg name="id"></arg>
</mutation>
<value name="ARG0">
<block type="variables_get" id=":c,lS[6P:[gP#El9/bp+">
<field name="VAR" id="nr)=!dz]y4urXFQ{8{y-" variabletype="">fensterstatus</field>
</block>
</value>
</block>
</value>
</block>
</statement>
</block>
</statement>
<next>
<block type="comment" id="?t^|J^}%io+OnqAwVT4A">
<field name="COMMENT">Beliebige Zeichen tauschen</field>
<next>
<block type="variables_set" id="-P{[1=caHEAoB9cP4Qx">
<field name="VAR" id="o-Pjbq{O^xX1Vmts,wer" variabletype="">MeinText</field>
<value name="VALUE">
<block type="convert_object2json" id="fpS?9TkyXMH2Q[?}NB{"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="viMaAiR.=_#mHodV,W+9"> <field name="VAR" id="MGbjhMo,|OE]bTX6R79;" variabletype="">offeneFenster</field> </block> </value> </block> </value> <next> <block type="controls_if" id="eO-Yu;zv=:r~yJNHR:iS"> <value name="IF0"> <block type="logic_negate" id="u@28{:]xG=4a9HU}|/v)"> <value name="BOOL"> <block type="text_isEmpty" id="W-_T.2)lUsLG/Z(5zIQN"> <value name="VALUE"> <shadow type="text" id="9LrDM?0xYv?MX-(}2OrI"> <field name="TEXT"></field> </shadow> <block type="variables_get" id="B?L(8|(8?-Z7Ao*[F/VM"> <field name="VAR" id="o-Pjbq{O^xX1Vmts,wer" variabletype="">MeinText</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="variables_set" id="ziw)~y|7*7le5/J*8HC#"> <field name="VAR" id="(.
4WMsEzFZ9|E$[f4e/" variabletype="">neuerText</field>
<value name="VALUE">
<block type="procedures_callreturn" id="ECH/%?YEFylSUOK.8/K">
<mutation name="changeText">
<arg name="originalText"></arg>
<arg name="suchText"></arg>
<arg name="tauschText"></arg>
</mutation>
<value name="ARG0">
<block type="variables_get" id="Y(bM=~D[D5v)7a#1{}
">
<field name="VAR" id="o-Pjbq{O^xX1Vmts,wer" variabletype="">MeinText</field>
</block>
</value>
<value name="ARG1">
<block type="text" id="(iqf|@QE;6:tP0}rbaEj">
<field name="TEXT">"</field>
</block>
</value>
<value name="ARG2">
<block type="text" id="{HiLh|2|F3|a#[4lCvX">
<field name="TEXT"></field>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="vGUP!R!*|3sjY~dZXxZ"> <field name="VAR" id="(.
4WMsEzFZ9|E$[f4e/" variabletype="">neuerText</field>
<value name="VALUE">
<block type="procedures_callreturn" id="rvKR.cz9FhImw~YT8:YY">
<mutation name="changeText">
<arg name="originalText"></arg>
<arg name="suchText"></arg>
<arg name="tauschText"></arg>
</mutation>
<value name="ARG0">
<block type="variables_get" id="4r-=T6yu%Y[}Zn!QhpR/">
<field name="VAR" id="(.4WMsEzFZ9|E$[f4e/" variabletype="">neuerText</field> </block> </value> <value name="ARG1"> <block type="text" id="mbk@+N
6F_eG)N%Jw|2J">
<field name="TEXT">[</field>
</block>
</value>
<value name="ARG2">
<block type="text" id="OtGH;LSHf;t,59fJ)5i">
<field name="TEXT"></field>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="3+|QU5[xS;U@Qijfuu@7">
<field name="VAR" id="(.4WMsEzFZ9|E$[f4e/" variabletype="">neuerText</field> <value name="VALUE"> <block type="procedures_callreturn" id="~C~TrH*=xX3Xl-l@tg#V"> <mutation name="changeText"> <arg name="originalText"></arg> <arg name="suchText"></arg> <arg name="tauschText"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id=",eH?bND1?H}TimRX_wnz"> <field name="VAR" id="(.
4WMsEzFZ9|E$[f4e/" variabletype="">neuerText</field>
</block>
</value>
<value name="ARG1">
<block type="text" id="6AWuk;A#5~8;jXas31)I">
<field name="TEXT">]</field>
</block>
</value>
<value name="ARG2">
<block type="text" id="[M[ZL8Y,u8fNWw|eR|g)">
<field name="TEXT"> </field>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="=W]8VAgdxy#^@A_9Rf-~">
<field name="VAR" id="(.4WMsEzFZ9|E$[f4e/" variabletype="">neuerText</field> <value name="VALUE"> <block type="procedures_callreturn" id="rE[|PemF=#35?@B.!kZc"> <mutation name="changeText"> <arg name="originalText"></arg> <arg name="suchText"></arg> <arg name="tauschText"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="Ut
cglzihG8@?=2?Vl/Z">
<field name="VAR" id="(.4WMsEzFZ9|E$[f4e/" variabletype="">neuerText</field> </block> </value> <value name="ARG1"> <block type="text" id="uGSd
v~AZL/rlYN|rkzc">
<field name="TEXT">,</field>
</block>
</value>
<value name="ARG2">
<block type="text_newline" id="J^+7X7AL6D2WGky6sZ="> <field name="Type">\n</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="controls_if" id="k=c@dd%t(al[|eGKV2lq"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="$Lr~g!sPrDD]U#xE5e8c"> <field name="OP">GT</field> <value name="A"> <block type="lists_length" id="bKDrS3vksWj,gJD_M_Kf"> <value name="VALUE"> <block type="variables_get" id=".6*oPn_hEeUJB?16^9a{"> <field name="VAR" id="MGbjhMo,|OE]bTX6R79;" variabletype="">offeneFenster</field> </block> </value> </block> </value> <value name="B"> <block type="math_number" id="9VJhYUb/ECM?6Havyv$Q"> <field name="NUM">0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="telegram" id="D8xCB2b:9I#Q!|WofLFh"> <field name="INSTANCE"></field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">default</field> <value name="MESSAGE"> <shadow type="text" id="#Woh%x_kVf$RDE3.50nO"> <field name="TEXT">text</field> </shadow> <block type="variables_get" id="8d%]gdHO
?oGOoEgK5_k">
<field name="VAR" id="(.4WMsEzFZ9|E$[f4e/" variabletype="">neuerText</field> </block> </value> </block> </statement> <statement name="ELSE"> <block type="telegram" id="MRPV=Xqhfy)x]0x)vkxc"> <field name="INSTANCE"></field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">default</field> <value name="MESSAGE"> <shadow type="text" id="#Woh%x_kVf$RDE3.50nO"> <field name="TEXT">text</field> </shadow> <block type="text" id=":#rPqk#wb+Si.uPfI+xg"> <field name="TEXT"> 🔒 alle Fenster im Haus sind geschlossen 🔒</field> </block> </value> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> <block type="procedures_defreturn" id="*?%n[KG5e1!^tNun#Hj5" x="-5912" y="-2313"> <mutation> <arg name="originalText" varid="bf/Z2r!m9,e}g4A3bA6)"></arg> <arg name="suchText" varid="/OzH}sD#.7aud9WY{/=G"></arg> <arg name="tauschText" varid="A8F%D/JIH$+LvGduNG5H"></arg> </mutation> <field name="NAME">changeText</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="variables_set" id="LyZ2%lYW+kfm,4)yV8UN"> <field name="VAR" id="o-Y1!mS4.o.6+M
j[sQ#" variabletype="">Text</field>
<value name="VALUE">
<block type="variables_get" id="da5p]}sO:{{|ZE!nhDe">
<field name="VAR" id="bf/Z2r!m9,e}g4A3bA6)" variabletype="">originalText</field>
</block>
</value>
<next>
<block type="variables_set" id="yx;qp1@1fC(oiG4c5gZt">
<field name="VAR" id="P^PxOlMA9Ro5zuSC]*pE" variabletype="">AnzZeichenSuchtext</field>
<value name="VALUE">
<block type="text_length" id="Jwz33ARDLc!=8:eDagDD">
<value name="VALUE">
<shadow type="text" id="RZWm!~Yo4w5)66Gu|Gs">
<field name="TEXT">abc</field>
</shadow>
<block type="variables_get" id="G2I+np)5qee]q{4)BlN2">
<field name="VAR" id="/OzH}sD#.7aud9WY{/=G" variabletype="">suchText</field>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="eAGK[85W)DRaIaN!oMiH">
<field name="VAR" id="Y!At7!o;7@}I~(6oA$pR" variabletype="">Stelle</field>
<value name="VALUE">
<block type="text_indexOf" id="/@rj}{;VUCJ8O|28^(Hf">
<field name="END">FIRST</field>
<value name="VALUE">
<block type="variables_get" id="}de%ffOrIt%j6)99pf3">
<field name="VAR" id="o-Y1!mS4.o.6+Mj[sQ#" variabletype="">Text</field> </block> </value> <value name="FIND"> <shadow type="text" id="7MprEQxoWq}#3~Xz:32k"> <field name="TEXT">%0D%0A</field> </shadow> <block type="variables_get" id="7)r.X1a~Tee1!dAwZy
!">
<field name="VAR" id="/OzH}sD#.7aud9WY{/=G" variabletype="">suchText</field>
</block>
</value>
</block>
</value>
<next>
<block type="controls_whileUntil" id="4lR}{f])DWKyjt}.(6cc">
<field name="MODE">WHILE</field>
<value name="BOOL">
<block type="logic_compare" id="eeUWK6kyOU=[/x]M({
">
<field name="OP">GT</field>
<value name="A">
<block type="variables_get" id="}7HLWRwI(SDg1^@=czoV">
<field name="VAR" id="Y!At7!o;7@}I~(6oA$pR" variabletype="">Stelle</field>
</block>
</value>
<value name="B">
<block type="math_number" id="#y,za{r#@s7Ri.U!9v)A">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<statement name="DO">
<block type="controls_if" id="PM@Su)b1YOhTZo2qPxB]">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="l,u?h{)Z-u/OozI,.79G">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="B/K~z.ANK2);I3(uk4Bh">
<field name="VAR" id="Y!At7!o;7@}I~(6oA$pR" variabletype="">Stelle</field>
</block>
</value>
<value name="B">
<block type="math_number" id="|3~K:6jrHq7oxz=fL:Yz">
<field name="NUM">1</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="comment" id="uN{|N4-0EabDJqYE0]@#">
<field name="COMMENT">steht am Textanfang</field>
<next>
<block type="variables_set" id="9?Gy,w.t#1pdl^AOxc#Y">
<field name="VAR" id="^o17}cPhG@#N0x?4hY|" variabletype="">Teil_1</field>
<value name="VALUE">
<block type="variables_get" id="h(#=bJDU%y/Jd9%HR9I"> <field name="VAR" id="A8F%D/JIH$+LvGduNG5H" variabletype="">tauschText</field> </block> </value> </block> </next> </block> </statement> <statement name="ELSE"> <block type="variables_set" id="{R*X,7K)DA^dq/.~KK7{"> <field name="VAR" id="^o17}cPh*G@#N0x?4hY|" variabletype="">Teil_1</field> <value name="VALUE"> <block type="text_getSubstring" id="Img0opt.EB#)RM-bp~hw"> <mutation at1="false" at2="true"></mutation> <field name="WHERE1">FIRST</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="variables_get" id="A9h*F{tgJR0y[Q0uv7,="> <field name="VAR" id="o-Y1!mS4.o.6+M
j[sQ#" variabletype="">Text</field>
</block>
</value>
<value name="AT2">
<block type="math_arithmetic" id="([5R[:8Ywn-thKN@r:~}">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="u@:!j5WimCjV%fG9hPGs">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="U0qw,~,2KoaAc37UO{l#">
<field name="VAR" id="Y!At7!o;7@}I~(6oA$pR" variabletype="">Stelle</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="DT#zRSRu1.y^|5Z#G37W">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
</block>
</statement>
<next>
<block type="variables_set" id="Else^,?QE9TTS.Y%K]W=">
<field name="VAR" id="IR;9iiSXRYYF47pi:,{=" variabletype="">Teil_2</field>
<value name="VALUE">
<block type="text_getSubstring" id="e8A7NqY7O!@K(aFlMpV#" inline="false">
<mutation at1="true" at2="false"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">LAST</field>
<value name="STRING">
<block type="variables_get" id="|jU0g8+eIgwn_|IB56)@">
<field name="VAR" id="o-Y1!mS4.o.6+Mj[sQ#" variabletype="">Text</field> </block> </value> <value name="AT1"> <block type="math_arithmetic" id="F#*%;R9ugmwaaas?WBwG"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="8/I%=/~YReHV]Iwo{}(J"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="R0|a}kx2M~SYjPKS5Cc{"> <field name="VAR" id="Y!At7!o;7@}I~(6oA$pR" variabletype="">Stelle</field> </block> </value> <value name="B"> <shadow type="math_number" id=";Q(aJ::90?0?H;-45cgS"> <field name="NUM">0</field> </shadow> <block type="variables_get" id="dY33=1IVxkrSH1k1#X6A"> <field name="VAR" id="P^PxOlMA9Ro5zuSC]*pE" variabletype="">AnzZeichenSuchtext</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="OcJS!-Ku1vQY4)I+r,gc"> <field name="VAR" id="o-Y1!mS4.o.6+M
j[sQ#" variabletype="">Text</field>
<value name="VALUE">
<block type="text_join" id="%%D@nUqB1tt^?qrUahx"> <mutation items="3"></mutation> <value name="ADD0"> <block type="variables_get" id="q]l%0Dpb89BZy1-m[TjM"> <field name="VAR" id="^o17}cPh*G@#N0x?4hY|" variabletype="">Teil_1</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="f~POFU0}K4-w]xVc1?,
">
<field name="VAR" id="A8F%D/JIH$+LvGduNG5H" variabletype="">tauschText</field>
</block>
</value>
<value name="ADD2">
<block type="variables_get" id="U77~u,Qfmb2g[O19eHoh">
<field name="VAR" id="IR;9iiSXRYYF47pi:,{=" variabletype="">Teil_2</field>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="lao?KUxF77Si~Xc2j%^{">
<field name="VAR" id="Y!At7!o;7@}I~(6oA$pR" variabletype="">Stelle</field>
<value name="VALUE">
<block type="text_indexOf" id="[),PN,ZrAW,C/~:K[x[:">
<field name="END">FIRST</field>
<value name="VALUE">
<block type="variables_get" id="6{t:BeVh6=bsQF(zUhYG">
<field name="VAR" id="o-Y1!mS4.o.6+Mj[sQ#" variabletype="">Text</field> </block> </value> <value name="FIND"> <shadow type="text" id="{Vd/Su8uk@lo|:3KMi1L"> <field name="TEXT">%0D%0A</field> </shadow> <block type="variables_get" id="r|~fKkGR#@1@G6_GX
-g">
<field name="VAR" id="/OzH}sD#.7aud9WY{/=G" variabletype="">suchText</field>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
<value name="RETURN">
<block type="variables_get" id=".*DA-:q/GzURSEPH2ZiQ">
<field name="VAR" id="o-Y1!mS4.o.6+M`j[sQ#" variabletype="">Text</field>
</block>
</value>
</block>
</xml>
Variante 2 nach @paul53 Variante-Vorschlag
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="" id="3Eu!3bSQeipPK#4r!G0o">id</variable>
<variable type="" id=",CKGwqC*VMH?=oFfDM}">arry</variable> <variable type="" id="9,LX9*Q_^1Zm.XL]5L%Y">trenner</variable> <variable type="" id="MGbjhMo,|OE]bTX6R79;">offeneFenster</variable> <variable type="" id="nr)=!dz]y4urXFQ{8{y-">fensterstatus</variable> </variables> <block type="procedures_defcustomreturn" id="!N6;}kSECsPgA~=}mQv" x="-5887" y="-2387"> <mutation statements="false"> <arg name="id" varid="3Eu!3bSQeipPK#4r!G0o"></arg> </mutation> <field name="NAME">getParentName</field> <field name="SCRIPT">aWYoZ2V0T2JqZWN0KGlkLnN1YnN0cmluZygwLCBpZC5sYXN0SW5kZXhPZignLicpKSkpIHJldHVybiBnZXRPYmplY3QoaWQuc3Vic3RyaW5nKDAsIGlkLmxhc3RJbmRleE9mKCcuJykpKS5jb21tb24ubmFtZTsNCmVsc2UgcmV0dXJuIG51bGw7</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="procedures_defcustomreturn" id="_(a~5[lFS^_b-QSlk(!i" x="-5887" y="-2337"> <mutation statements="false"> <arg name="arry" varid=",CKGwqC*
VMH?=oFfDM}"></arg>
<arg name="trenner" varid="9,LX9Q_^1Zm.XL]5L%Y"></arg>
</mutation>
<field name="NAME">arry, trenner</field>
<field name="SCRIPT">cmV0dXJuIGFycnkuam9pbih0cmVubmVyKTs=</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
</block>
<block type="on_ext" id="q8A38W=#;PI{7f/}3pqI" x="-5888" y="-2288">
<mutation items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="5Y$(^lu{[^5]ux3oE+(">
<field name="oid">default</field>
</shadow>
<block type="selector" id="lhBGb7A6n[vUm1?Q#tC+">
<field name="TEXT">channelstate.id=*.STATE</field>
</block>
</value>
<statement name="STATEMENT">
<block type="variables_set" id="_%Y+gCOLsC1}FrPCVNk:">
<field name="VAR" id="MGbjhMo,|OE]bTX6R79;" variabletype="">offeneFenster</field>
<value name="VALUE">
<block type="lists_create_with" id="V16(qSW0SL.n@Id{SQ[u">
<mutation items="0"></mutation>
</block>
</value>
<next>
<block type="controls_forEach" id="Eb!ly!|dTn,Zqy9edjG$">
<field name="VAR" id="nr)=!dz]y4urXFQ{8{y-" variabletype="">fensterstatus</field>
<value name="LIST">
<block type="selector" id="W^U2V|c!N.-9APmp;}zj">
<field name="TEXT">channelstate.id=*.STATE</field>
</block>
</value>
<statement name="DO">
<block type="controls_if" id="tq_Th[d(pZtxt2T-LrO">
<value name="IF0">
<block type="logic_compare" id="FYP=~;)uQu!a5|]KMNd/">
<field name="OP">NEQ</field>
<value name="A">
<block type="get_value_var" id="j,y|JnaJz:sb,i(9oe^C">
<field name="ATTR">val</field>
<value name="OID">
<shadow type="text" id="pmOdHJq595YI/$n-u^$">
<field name="TEXT"></field>
</shadow>
<block type="variables_get" id=";=A)49}3Eqx{}^5CS[z">
<field name="VAR" id="nr)=!dz]y4urXFQ{8{y-" variabletype="">fensterstatus</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="math_number" id="HQSbp;V,L:xNvI$lI=t!">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="lists_setIndex" id="F!KR3Rxr/RH5YL}J~$T" inline="false">
<mutation at="true"></mutation>
<field name="MODE">SET</field>
<field name="WHERE">FROM_START</field>
<value name="LIST">
<block type="variables_get" id="H2NstO2,gntow{QM%=|x">
<field name="VAR" id="MGbjhMo,|OE]bTX6R79;" variabletype="">offeneFenster</field>
</block>
</value>
<value name="AT">
<block type="math_arithmetic" id="TMNFe_GH3BtOrEKv0F">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id=")43ylUFXJ=jhc.9$m7Oo">
<field name="NUM">1</field>
</shadow>
<block type="lists_length" id="z-3zZ!%o$CO(mZ|w%1">
<value name="VALUE">
<block type="variables_get" id="S+LKJSv_LdS?FEs=^M.]">
<field name="VAR" id="MGbjhMo,|OE]bTX6R79;" variabletype="">offeneFenster</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="Z8e6TaXp%{0QY4q4f!Ys">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="TO">
<block type="procedures_callcustomreturn" id="ToXniOfG/14/-A[2WP[s">
<mutation name="getParentName">
<arg name="id"></arg>
</mutation>
<value name="ARG0">
<block type="variables_get" id=":c,lS[6P:[gP#El9/bp+">
<field name="VAR" id="nr)=!dz]y4urXFQ{8{y-" variabletype="">fensterstatus</field>
</block>
</value>
</block>
</value>
</block>
</statement>
</block>
</statement>
<next>
<block type="controls_if" id="k=c@dd%t(al[|eGKV2lq">
<mutation elseif="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="$Lr~g!sPrDD]U#xE5e8c">
<field name="OP">GT</field>
<value name="A">
<block type="lists_length" id="bKDrS3vksWj,gJD_M_Kf">
<value name="VALUE">
<block type="variables_get" id=".6oPn_hEeUJB?16^9a{">
<field name="VAR" id="MGbjhMo,|OE]bTX6R79;" variabletype="">offeneFenster</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="math_number" id="9VJhYUb/ECM?6Havyv$Q">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="telegram" id="D8xCB2b:9I#Q!|WofLFh">
<field name="INSTANCE"></field>
<field name="LOG"></field>
<field name="SILENT">FALSE</field>
<field name="PARSEMODE">default</field>
<value name="MESSAGE">
<shadow type="text" id="#Woh%x_kVf$RDE3.50nO">
<field name="TEXT">text</field>
</shadow>
<block type="procedures_callcustomreturn" id="-sZVA9Z2QD=LjYtAE^QY">
<mutation name="arry, trenner">
<arg name="arry"></arg>
<arg name="trenner"></arg>
</mutation>
<value name="ARG0">
<block type="variables_get" id="~JA:S%RDqagjIPoV$@ss">
<field name="VAR" id="MGbjhMo,|OE]bTX6R79;" variabletype="">offeneFenster</field>
</block>
</value>
<value name="ARG1">
<block type="text_newline" id="}W*pJP{Z)M$;yV{Ke@c;">
<field name="Type">\n</field>
</block>
</value>
</block>
</value>
</block>
</statement>
<value name="IF1">
<block type="logic_compare" id="xV,7Iiu2SeB,7Z`@ubuC">
<field name="OP">EQ</field>
<value name="A">
<block type="lists_length" id="BTD)uUCWQ;$poZ?oECc]">
<value name="VALUE">
<block type="variables_get" id="L3x/b?ZyRWYI^bjl:nlj">
<field name="VAR" id="MGbjhMo,|OE]bTX6R79;" variabletype="">offeneFenster</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="math_number" id="%6}|t(IYG+i,3yhzZyoz">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="telegram" id="MRPV=Xqhfy)x]0x)vkxc">
<field name="INSTANCE"></field>
<field name="LOG"></field>
<field name="SILENT">FALSE</field>
<field name="PARSEMODE">default</field>
<value name="MESSAGE">
<shadow type="text" id="#Woh%x_kVf$RDE3.50nO">
<field name="TEXT">text</field>
</shadow>
<block type="text" id=":#rPqk#wb+Si.uPfI+xg">
<field name="TEXT"> alle Fenster im Haus sind geschlossen </field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</xml>
-
@dslraser
Morgen,
Script kann man nicht importieren zeigt sofort einen Fehler.
Grüße -
@Homer-J
Moin, ja da sind Blockly Bausteine drinn die es noch nicht offiziell gibt. Dafür brauchst Du diese JS-Adapter Version.Hier kannst Du auch rein sehen.
-
@dslraser Hab die Version 4.1.12 installiert sollte doch damit funktionieren oder. ?
-
@Homer-J sagte in (gelöst) - Blockly Funktion:
@dslraser Hab die Version 4.1.12 installiert sollte doch damit funktionieren oder. ?
NEIN.
Du benötigst eine extra angepasste Version.
-
Gut weiß ich Bescheid danke euch.