Hier das fertige Skript:
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 > 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&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>