NEWS
(gelöst) Fenster Offen Liste
-
Hallo Zusammen,
Ich habe mal wieder eine Frage
Ich habe mir dieses Blockly genommen um mir in der VIS anzeigen zu lassen welche Fenster noch offen sind
https://www.machs-smart.de/offene-und-geschlossene-fenster-mit-blockly-als-liste-ausgeben/Jetzt habe ich 2 Fragen dazu
- Leider werden nicht alle Räume ausgegeben (um genau zu sein nur die Küche) bei den anderen steht immer "undefined" da
- Wie muss ich das Blockly umbauen damit mir nur die geöffneten Fenster angezeigt werden und wenn alle zu sind einfach da steht "es sind alle Fenster geschlossen"
Ich danke euch im Voraus
Gruß
Marcel -
poste mal bitte dein eigenes gebautes Skript, nicht ne Anleitung
-
@cinimod
OK mache ich heute Nachmittag wenn ich zuhause bin
Ich denke gegen 16Uhr -
Das Script kannte ich noch nicht.
Wenn du nur reine Infos haben willst wann etwas offen ist als Text. Kannst du dir mal meinen Adapter anschauen. Ist zwar nicht angedacht den noch zu erweitern aber in der jetzigen Version funktioniert der gut und kann das auch.
https://forum.iobroker.net/topic/37173/test-adapter-meldungsliste-v0-0-x-github/43?_=1633507383955Musst allerdings von github direkt installieren.
Alternativ kann ich dir auch noch mein Script anbieten ist etwas flexibler als der Adapter
-
@thebam
Auch das werde ich mir heute nachmittag ansehen
Läuft dein Adapter auch unter der neuen Adminoberfläche? -
Hier der Code von mir
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="Fwt*3`3ScyT(qDt?gf(T">ObjectID</variable> <variable id="./q,SFeGV,;)[@g=ERgm">Liste</variable> <variable id="K@h0-NY5VaI|@t!5/iJh">Wert</variable> <variable id="cTIvd#0frb]}?DN^7oUd">Liste-komplett</variable> <variable id="MLrrG!H:mqglsc.Y_Ljh">Liste-offen</variable> <variable id="}K$K4dup~Vnv!`[}vnQy">Liste-geschlossen</variable> <variable id="9sl@{VQ/amrd~ZTB}e/O">i</variable> <variable id="}7$%uuGc-M*ZU6ZQ%SJ[">j</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">bGV0IG5hbWUgPSBnZXRPYmplY3QoT2JqZWN0SUQpLmNvbW1vbi5uYW1lOwovL2lmKHR5cGVvZiByb29tID09ICdvYmplY3QnKSByZXR1cm4gcm9vbS5kZTsKcmV0dXJuICI8Yj4iK25hbWUrIjwvYj4iOw==</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="procedures_defcustomreturn" id="v;YxDy}cJ+i39]iq7oim" x="-112" y="-862"> <mutation statements="false"> <arg name="ObjectID" varid="Fwt*3`3ScyT(qDt?gf(T"></arg> </mutation> <field name="NAME">Raum</field> <field name="SCRIPT">bGV0IHJvb20gPSBnZXRPYmplY3QoT2JqZWN0SUQsICdyb29tcycpLmVudW1OYW1lc1swXTsKcmV0dXJuICI8YnI+PHNwYW4gY2xhc3M9Jyc+PHNtYWxsPiIrcm9vbS5kZSsiPC9zbWFsbD48L3NwYW4+Ijs=</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="procedures_defcustomreturn" id="!t;U0AgoNU@W*^{W;)1~" x="-112" y="-837"> <mutation statements="false"> <arg name="Liste" varid="./q,SFeGV,;)[@g=ERgm"></arg> <arg name="Wert" varid="K@h0-NY5VaI|@t!5/iJh"></arg> </mutation> <field name="NAME">Multisort</field> <field name="SCRIPT">dmFyIFdlcnQgPSBXZXJ0IC0gMTsgCkxpc3RlLnNvcnQoZnVuY3Rpb24oYSwgYil7CiAgICByZXR1cm4gYltXZXJ0XSAtIGFbV2VydF07Cn0pOwpyZXR1cm4gTGlzdGU7</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="-762"> <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=fenster_status)</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-offen</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-geschlossen</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=fenster_status)</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"> <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-offen</field> </block> </value> <value name="TO"> <block type="lists_create_with" id="6a@[p]s)BEL%k0#L3dY#"> <mutation items="3"></mutation> <value name="ADD0"> <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> <value name="ADD1"> <block type="procedures_callcustomreturn" id="}$wVs/^YVcjh{n/kS,q!"> <mutation name="Raum"> <arg name="ObjectID"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="E+iVny-H8b?jxnc3eZ/_"> <field name="VAR" id="9sl@{VQ/amrd~ZTB}e/O">i</field> </block> </value> </block> </value> <value name="ADD2"> <block type="get_value_var" id="ZH.h{PJzN,EeXI-)JVDH"> <field name="ATTR">lc</field> <value name="OID"> <shadow type="text"> <field name="TEXT"></field> </shadow> <block type="variables_get" id="!@Z.|vd8M+75I$7U.crR"> <field name="VAR" id="9sl@{VQ/amrd~ZTB}e/O">i</field> </block> </value> </block> </value> </block> </value> </block> </statement> <statement name="ELSE"> <block type="lists_setIndex" id="-jTzj32XiFWfi?n1Y/LN"> <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-geschlossen</field> </block> </value> <value name="TO"> <block type="lists_create_with" id="2h-G=W]Wb-8[:@[C~H,Y"> <mutation items="3"></mutation> <value name="ADD0"> <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> <value name="ADD1"> <block type="procedures_callcustomreturn" id="U=T2KtRYql2nS!LoW{0d"> <mutation name="Raum"> <arg name="ObjectID"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="gkj|GlgH+B$28{6w8,WN"> <field name="VAR" id="9sl@{VQ/amrd~ZTB}e/O">i</field> </block> </value> </block> </value> <value name="ADD2"> <block type="get_value_var" id="mc2z(j0*wy9u3b.3zwJ["> <field name="ATTR">lc</field> <value name="OID"> <shadow type="text"> <field name="TEXT"></field> </shadow> <block type="variables_get" id="Voni%mnoR.KzD5a!J:7a"> <field name="VAR" id="9sl@{VQ/amrd~ZTB}e/O">i</field> </block> </value> </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-offen</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="text_append" id="+f`#OFcL{@YyO@sI#uCn"> <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="_u=h#j1gG^*i^j^JZqD6"> <field name="TEXT"><div class="headline"><b>Geöffnet</b></div><table class="table-status"><tbody></field> </block> </value> <next> <block type="controls_forEach" id="eWuU?Rt40RRVcn@?$@eq"> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> <value name="LIST"> <block type="procedures_callcustomreturn" id="(AShS`,jO5uhez@2%ZNO"> <mutation name="Multisort"> <arg name="Liste"></arg> <arg name="Wert"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="a;$8#B,;I75h-Hy}~}q3"> <field name="VAR" id="MLrrG!H:mqglsc.Y_Ljh">Liste-offen</field> </block> </value> <value name="ARG1"> <block type="math_number" id="y28xQ%[n;@7Wa:a77wl!"> <field name="NUM">3</field> </block> </value> </block> </value> <statement name="DO"> <block type="text_append" id="gf^b8UA.=3P(K5[$j)Bj"> <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_join" id=";7`[nwtLmM9SXh2[VePK"> <mutation items="8"></mutation> <value name="ADD0"> <block type="text" id="j?`NI/7Gacv}dFN.+$PE"> <field name="TEXT"><tr><td><img src="/vis.0/main/icons/noun_open.png"></td><td></field> </block> </value> <value name="ADD1"> <block type="lists_getIndex" id="@5OV65,;$.kv#!TecfHZ"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="EWa-I_dccB@]^nQe/W^d"> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> </block> </value> <value name="AT"> <block type="math_number" id="g}BE:?b{VIm/+ZX2V0__"> <field name="NUM">1</field> </block> </value> </block> </value> <value name="ADD2"> <block type="lists_getIndex" id="q)iY@.m/$og@3$~)uH,K"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="g@zqTh)Ok*(KS$Z@eyc2"> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> </block> </value> <value name="AT"> <block type="math_number" id="xcqlR!$Dwpu}DNdHJgy5"> <field name="NUM">2</field> </block> </value> </block> </value> <value name="ADD3"> <block type="text" id=",FstDM5*y1X5@,$t;^[k"> <field name="TEXT"></td><td><span class=""><i>Letzte Änderung:</i><br></field> </block> </value> <value name="ADD4"> <block type="convert_from_date" id="jhQmJJ_|F9dP%V#G7f2("> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">DD.MM.</field> <value name="VALUE"> <block type="lists_getIndex" id="P3nC5W6:Y!7hvvwb[W4("> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="J]=7|JP6XXE0=iPV#!cV"> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> </block> </value> <value name="AT"> <block type="math_number" id=",;WKYc]epU}2fK^CNY~Q"> <field name="NUM">3</field> </block> </value> </block> </value> </block> </value> <value name="ADD5"> <block type="text" id="@n3wTEG3`D{hPv(e[Wr)"> <field name="TEXT">, </field> </block> </value> <value name="ADD6"> <block type="convert_from_date" id="XCt-c7RmMEAIAg:,hF]Y"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">hh:mm</field> <value name="VALUE"> <block type="lists_getIndex" id="[aoz%*sr^}=m)|rI2a(t"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="{#={{3Gtp:2fb/o-ure("> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> </block> </value> <value name="AT"> <block type="math_number" id="2k8J6XGU%Y%uqN%8q5H|"> <field name="NUM">3</field> </block> </value> </block> </value> </block> </value> <value name="ADD7"> <block type="text" id="w]zt{}A*8rLlwGa7H=Ty"> <field name="TEXT"> Uhr</span></td></tr></field> </block> </value> </block> </value> </block> </statement> <next> <block type="text_append" id="yrfmMVllibE1D[1,T-8c"> <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="^^w-UuG$rGsR==gG(FoC"> <field name="TEXT"></tbody></table></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-geschlossen</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"><div class="headline"><b>Geschlossen</b></div><table class="table-status inactive"><tbody></field> </block> </value> <next> <block type="controls_forEach" id=",E%-hd9aNijDQS~xb6IG"> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> <value name="LIST"> <block type="procedures_callcustomreturn" id="zJBJ-|TKh/:ffe,W~G//"> <mutation name="Multisort"> <arg name="Liste"></arg> <arg name="Wert"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="u4US1gL%m8Myl{MI]BFp"> <field name="VAR" id="}K$K4dup~Vnv!`[}vnQy">Liste-geschlossen</field> </block> </value> <value name="ARG1"> <block type="math_number" id="sRy6vLJv{L4*zM1h$Vw."> <field name="NUM">3</field> </block> </value> </block> </value> <statement name="DO"> <block type="text_append" id="IM7}q13Z,USrjHB5d^`n"> <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_join" id="5rJbRkW+.9IHmSei:Rem"> <mutation items="8"></mutation> <value name="ADD0"> <block type="text" id="Lx-~aJu?UNp)TMQLkg}`"> <field name="TEXT"><tr><td><img src="/vis.0/main/icons/noun_open.png"></td><td></field> </block> </value> <value name="ADD1"> <block type="lists_getIndex" id="AoaEUJWKFdo)%+D*Yk3`"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="HP7dg7+GTepvUBFM3uVT"> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> </block> </value> <value name="AT"> <block type="math_number" id="bpTIbgw@cw;ar+uBuXbB"> <field name="NUM">1</field> </block> </value> </block> </value> <value name="ADD2"> <block type="lists_getIndex" id="9?X`MaNlZ1NZS6C-SYS|"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="k%z{z]Lw~_bKfP=YRX^;"> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> </block> </value> <value name="AT"> <block type="math_number" id="MFyongfno_TN#AtpmSJm"> <field name="NUM">2</field> </block> </value> </block> </value> <value name="ADD3"> <block type="text" id="$$]eY9QbaR[AgXw{/~~j"> <field name="TEXT"></td><td><span class=""><i>Letzte Änderung:</i><br></field> </block> </value> <value name="ADD4"> <block type="convert_from_date" id="aBK1xf.=O3@4B{}t+hse"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">DD.MM.</field> <value name="VALUE"> <block type="lists_getIndex" id="v4J?rf;_y|w){2wYgI}^"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="9UQY?lUs2WHo1:QMD*,."> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> </block> </value> <value name="AT"> <block type="math_number" id="k:!a*P$0iS!w(w=%ZI#~"> <field name="NUM">3</field> </block> </value> </block> </value> </block> </value> <value name="ADD5"> <block type="text" id="s.!yxzz@DmF9$ljS.E[4"> <field name="TEXT">, </field> </block> </value> <value name="ADD6"> <block type="convert_from_date" id="BdIPI^$}|(8fhQ`Lg-@]"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">hh:mm</field> <value name="VALUE"> <block type="lists_getIndex" id="~A$+{3Nnp%6Sw6m$nef$"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="S_D%98-`g28xsoQgC@*a"> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> </block> </value> <value name="AT"> <block type="math_number" id="=gOAYbL~nFne0k:Eo/^|"> <field name="NUM">3</field> </block> </value> </block> </value> </block> </value> <value name="ADD7"> <block type="text" id="F7-vgXOBbexh|4M^!v5G"> <field name="TEXT"> Uhr</span></td></tr></field> </block> </value> </block> </value> </block> </statement> <next> <block type="text_append" id="WRGYm57Dr)oU(kB+1fT?"> <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="`r/el3B4b=](jn!@`y,1"> <field name="TEXT"></tbody></table></field> </block> </value> </block> </next> </block> </next> </block> </statement> <next> <block type="control" id="dI4yke%zrI0vqI$=7|!P"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.002_nurVIS.01_Infos.Fenster-Status</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="1Q0Efv^4i*zZNN~`bBg,"> <field name="VAR" id="cTIvd#0frb]}?DN^7oUd">Liste-komplett</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </xml>
Screenshot ist leider nicht wirklich möglich
-
-
@homoran
Hier mal in 3 Teilen
-
@wszene sagte: Leider werden nicht alle Räume ausgegeben (um genau zu sein nur die Küche) bei den anderen steht immer "undefined" da
Ändere mal die Funktion Raum(ObjectID):
let room = getObject(ObjectID, 'rooms').enumNames[0]; if(typeof room == 'object') room = room.de; return "<br><span class=''><small>"+room+"</small></span>";
-
@wszene sagte: Wie muss ich das Blockly umbauen damit mir nur die geöffneten Fenster angezeigt werden und wenn alle zu sind einfach da steht "es sind alle Fenster geschlossen"
Alles weglassen, was mit "Fenster geschlossen" zu tun hat. Etwa so:
Mit HTML kenne ich mich nicht aus.
-
@paul53 sagte in Fenster Offen Liste:
@wszene sagte: Leider werden nicht alle Räume ausgegeben (um genau zu sein nur die Küche) bei den anderen steht immer "undefined" da
Ändere mal die Funktion Raum(ObjectID):
let room = getObject(ObjectID, 'rooms').enumNames[0]; if(typeof room == 'object') room = room.de; return "<br><span class=''><small>"+room+"</small></span>";
Danke das funktioniert
Kannst du mir bitte eine kurze Erklärung zu deiner Änderung geben? -
@wszene sagte: Kannst du mir bitte eine kurze Erklärung zu deiner Änderung geben?
Wenn ein vorgefertigter Raum (Küche) zugeordnet wird, enthält der Name ein mehrsprachiges Objekt.
{ "_id": "enum.rooms.kitchen", "common": { "icon": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgNDgwIDQ4MCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDgwIDQ4MDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGc+DQoJPHBhdGggZD0iTTAsMjA4djQ4aDE2djIyNGg0NDhWMjU2aDE2di00OEgweiBNMjA4LDQ2NEgzMlYyNTZoMTc2VjQ2NHogTTI4OCw0NjRoLTY0VjMyMGg2NFY0NjR6IE0zNjgsNDY0aC02NFYzMjBoNjRWNDY0eg0KCQkgTTQ0OCw0NjRoLTY0VjMyMGg2NFY0NjR6IE00NDgsMzA0SDIyNHYtNDhoMjI0VjMwNHogTTQ2NCwyNDBIMTZ2LTE2aDQ0OFYyNDB6Ii8+DQo8L2c+DQo8Zz4NCgk8cGF0aCBkPSJNNDgsMzM2djExMmgxNDRWMzM2SDQ4eiBNMTc2LDQzMkg2NHYtODBoMTEyVjQzMnoiLz4NCjwvZz4NCjxnPg0KCTxwYXRoIGQ9Ik03MiwyNzJjLTEzLjI1NSwwLTI0LDEwLjc0NS0yNCwyNHMxMC43NDUsMjQsMjQsMjRzMjQtMTAuNzQ1LDI0LTI0Uzg1LjI1NSwyNzIsNzIsMjcyeiBNNzIsMzA0Yy00LjQxOCwwLTgtMy41ODItOC04DQoJCQlzMy41ODItOCw4LThzOCwzLjU4Miw4LDhTNzYuNDE4LDMwNCw3MiwzMDR6Ii8+DQo8L2c+DQo8Zz4NCgk8cGF0aCBkPSJNMTY4LDI3MmMtMTMuMjU1LDAtMjQsMTAuNzQ1LTI0LDI0czEwLjc0NSwyNCwyNCwyNHMyNC0xMC43NDUsMjQtMjRTMTgxLjI1NSwyNzIsMTY4LDI3MnogTTE2OCwzMDRjLTQuNDE4LDAtOC0zLjU4Mi04LTgNCgkJczMuNTgyLTgsOC04czgsMy41ODIsOCw4UzE3Mi40MTgsMzA0LDE2OCwzMDR6Ii8+DQo8L2c+DQo8Zz4NCgk8cmVjdCB4PSIzMDQiIHk9IjI3MiIgd2lkdGg9IjY0IiBoZWlnaHQ9IjE2Ii8+DQo8L2c+DQo8Zz4NCgk8cmVjdCB4PSIyNTYiIHk9IjMzNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ii8+DQo8L2c+DQo8Zz4NCgk8cmVjdCB4PSIzMzYiIHk9IjM2OCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjMyIi8+DQo8L2c+DQo8Zz4NCgk8cmVjdCB4PSI0MDAiIHk9IjM2OCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjMyIi8+DQo8L2c+DQo8Zz4NCgk8cGF0aCBkPSJNMjA4LDB2ODYuMDhsLTI0LTQ4VjBINDB2MzguMDhMMC44OCwxMTYuNGMtMS45ODgsMy45NDYtMC40MDEsOC43NTYsMy41NDQsMTAuNzQ0QzUuNTM0LDEyNy43MDMsNi43NTgsMTI3Ljk5Niw4LDEyOGg0NzINCgkJVjBIMjA4eiBNNTYsMTZoMTEydjE2SDU2VjE2eiBNMjAuOTYsMTEybDMyLTY0aDExOC4wOGwzMiw2NEgyMC45NnogTTMzNiwxMTJIMjI0VjE2aDExMlYxMTJ6IE00NjQsMTEySDM1MlYxNmgxMTJWMTEyeiIvPg0KPC9nPg0KPGc+DQoJPHJlY3QgeD0iMzA0IiB5PSI4MCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ii8+DQo8L2c+DQo8Zz4NCgk8cmVjdCB4PSIzNjgiIHk9IjgwIiB3aWR0aD0iMTYiIGhlaWdodD0iMTYiLz4NCjwvZz4NCjxnPg0KCTxyZWN0IHg9Ijk2IiB5PSIzNjgiIHdpZHRoPSI0OCIgaGVpZ2h0PSIxNiIvPg0KPC9nPg0KPC9zdmc+DQo=", "name": { "en": "Kitchen", "de": "Küche", "ru": "Кухня", "pt": "Cozinha", "nl": "Keuken", "fr": "Cuisine", "it": "Cucina", "es": "Cocina", "pl": "Kuchnia", "zh-cn": "厨房" }, "members": [
Bei selbst erstellten Räumen ist es i.d.R. ein String (deutsch).
-
Ja sollte laufen aber teste das heute Abend selbst mal
-
@paul53 sagte in Fenster Offen Liste:
So jetzt habe ich es so das es mir bei geöffneten Fenster eine Liste anzeigt
Aber ich stehe auf dem Schlauch wie ich es jetzt machen kann das wenn alle geschlossen sind das da steht "es sind alle Fenster geschlossen" -
@wszene sagte: das da steht "es sind alle Fenster geschlossen"
Habe ich vom Prinzip her gezeigt: Anstelle von
falls nicht Liste-offen ist leer mache Tabelle erstellen
ändern in
falls Liste-offen ist leer mache HTML-Text "es sind alle Fenster geschlossen" sonst Tabelle erstellen
-
OK Ich habe es jetzt
Für alle diejenigen die es auch gern so haben wollen hier das Blockly<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="Fwt*3`3ScyT(qDt?gf(T">ObjectID</variable> <variable id="./q,SFeGV,;)[@g=ERgm">Liste</variable> <variable id="K@h0-NY5VaI|@t!5/iJh">Wert</variable> <variable id="cTIvd#0frb]}?DN^7oUd">Liste-komplett</variable> <variable id="MLrrG!H:mqglsc.Y_Ljh">Liste-offen</variable> <variable id="9sl@{VQ/amrd~ZTB}e/O">i</variable> <variable id="}7$%uuGc-M*ZU6ZQ%SJ[">j</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">bGV0IG5hbWUgPSBnZXRPYmplY3QoT2JqZWN0SUQpLmNvbW1vbi5uYW1lOwovL2lmKHR5cGVvZiByb29tID09ICdvYmplY3QnKSByZXR1cm4gcm9vbS5kZTsKcmV0dXJuICI8Yj4iK25hbWUrIjwvYj4iOw==</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="procedures_defcustomreturn" id="v;YxDy}cJ+i39]iq7oim" x="-112" y="-862"> <mutation statements="false"> <arg name="ObjectID" varid="Fwt*3`3ScyT(qDt?gf(T"></arg> </mutation> <field name="NAME">Raum</field> <field name="SCRIPT">bGV0IHJvb20gPSBnZXRPYmplY3QoT2JqZWN0SUQsICdyb29tcycpLmVudW1OYW1lc1swXTsKaWYodHlwZW9mIHJvb20gPT0gJ29iamVjdCcpIHJvb20gPSByb29tLmRlOwpyZXR1cm4gIjxicj48c3BhbiBjbGFzcz0nJz48c21hbGw+Iityb29tKyI8L3NtYWxsPjwvc3Bhbj4iOwo=</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="procedures_defcustomreturn" id="!t;U0AgoNU@W*^{W;)1~" x="-112" y="-837"> <mutation statements="false"> <arg name="Liste" varid="./q,SFeGV,;)[@g=ERgm"></arg> <arg name="Wert" varid="K@h0-NY5VaI|@t!5/iJh"></arg> </mutation> <field name="NAME">Multisort</field> <field name="SCRIPT">dmFyIFdlcnQgPSBXZXJ0IC0gMTsgCkxpc3RlLnNvcnQoZnVuY3Rpb24oYSwgYil7CiAgICByZXR1cm4gYltXZXJ0XSAtIGFbV2VydF07Cn0pOwpyZXR1cm4gTGlzdGU7</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="on_ext" id="RT3@Kxqxg#w3f=(kzwCu" x="-113" y="-788"> <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=fenster_status)</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-offen</field> <value name="VALUE"> <block type="lists_create_with" id="$AFtq:sq?.LYHWTSs$x|"> <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=fenster_status)</field> </block> </value> <statement name="DO"> <block type="controls_if" id="-3J;6~}7Ac!D}IR`/Dr1"> <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"> <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-offen</field> </block> </value> <value name="TO"> <block type="lists_create_with" id="6a@[p]s)BEL%k0#L3dY#"> <mutation items="3"></mutation> <value name="ADD0"> <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> <value name="ADD1"> <block type="procedures_callcustomreturn" id="}$wVs/^YVcjh{n/kS,q!"> <mutation name="Raum"> <arg name="ObjectID"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="E+iVny-H8b?jxnc3eZ/_"> <field name="VAR" id="9sl@{VQ/amrd~ZTB}e/O">i</field> </block> </value> </block> </value> <value name="ADD2"> <block type="get_value_var" id="ZH.h{PJzN,EeXI-)JVDH"> <field name="ATTR">lc</field> <value name="OID"> <shadow type="text"> <field name="TEXT"></field> </shadow> <block type="variables_get" id="!@Z.|vd8M+75I$7U.crR"> <field name="VAR" id="9sl@{VQ/amrd~ZTB}e/O">i</field> </block> </value> </block> </value> </block> </value> </block> </statement> </block> </statement> <next> <block type="controls_if" id="%xroGCihVu8$~$xQ{]ke"> <mutation else="1"></mutation> <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-offen</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="text_append" id="+f`#OFcL{@YyO@sI#uCn"> <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="_u=h#j1gG^*i^j^JZqD6"> <field name="TEXT"><div class="headline"><b>Geöffnet</b></div><table class="table-status"><tbody></field> </block> </value> <next> <block type="controls_forEach" id="eWuU?Rt40RRVcn@?$@eq"> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> <value name="LIST"> <block type="procedures_callcustomreturn" id="(AShS`,jO5uhez@2%ZNO"> <mutation name="Multisort"> <arg name="Liste"></arg> <arg name="Wert"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="a;$8#B,;I75h-Hy}~}q3"> <field name="VAR" id="MLrrG!H:mqglsc.Y_Ljh">Liste-offen</field> </block> </value> <value name="ARG1"> <block type="math_number" id="y28xQ%[n;@7Wa:a77wl!"> <field name="NUM">3</field> </block> </value> </block> </value> <statement name="DO"> <block type="text_append" id="gf^b8UA.=3P(K5[$j)Bj"> <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_join" id=";7`[nwtLmM9SXh2[VePK"> <mutation items="8"></mutation> <value name="ADD0"> <block type="text" id="j?`NI/7Gacv}dFN.+$PE"> <field name="TEXT"><tr><td><img src="/vis.0/main/icons/noun_open.png"></td><td></field> </block> </value> <value name="ADD1"> <block type="lists_getIndex" id="@5OV65,;$.kv#!TecfHZ"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="EWa-I_dccB@]^nQe/W^d"> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> </block> </value> <value name="AT"> <block type="math_number" id="g}BE:?b{VIm/+ZX2V0__"> <field name="NUM">1</field> </block> </value> </block> </value> <value name="ADD2"> <block type="lists_getIndex" id="q)iY@.m/$og@3$~)uH,K"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="g@zqTh)Ok*(KS$Z@eyc2"> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> </block> </value> <value name="AT"> <block type="math_number" id="xcqlR!$Dwpu}DNdHJgy5"> <field name="NUM">2</field> </block> </value> </block> </value> <value name="ADD3"> <block type="text" id=",FstDM5*y1X5@,$t;^[k"> <field name="TEXT"></td><td><span class=""><i>Letzte Änderung:</i><br></field> </block> </value> <value name="ADD4"> <block type="convert_from_date" id="jhQmJJ_|F9dP%V#G7f2("> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">DD.MM.</field> <value name="VALUE"> <block type="lists_getIndex" id="P3nC5W6:Y!7hvvwb[W4("> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="J]=7|JP6XXE0=iPV#!cV"> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> </block> </value> <value name="AT"> <block type="math_number" id=",;WKYc]epU}2fK^CNY~Q"> <field name="NUM">3</field> </block> </value> </block> </value> </block> </value> <value name="ADD5"> <block type="text" id="@n3wTEG3`D{hPv(e[Wr)"> <field name="TEXT">, </field> </block> </value> <value name="ADD6"> <block type="convert_from_date" id="XCt-c7RmMEAIAg:,hF]Y"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">hh:mm</field> <value name="VALUE"> <block type="lists_getIndex" id="[aoz%*sr^}=m)|rI2a(t"> <mutation statement="false" at="true"></mutation> <field name="MODE">GET</field> <field name="WHERE">FROM_START</field> <value name="VALUE"> <block type="variables_get" id="{#={{3Gtp:2fb/o-ure("> <field name="VAR" id="}7$%uuGc-M*ZU6ZQ%SJ[">j</field> </block> </value> <value name="AT"> <block type="math_number" id="2k8J6XGU%Y%uqN%8q5H|"> <field name="NUM">3</field> </block> </value> </block> </value> </block> </value> <value name="ADD7"> <block type="text" id="w]zt{}A*8rLlwGa7H=Ty"> <field name="TEXT"> Uhr</span></td></tr></field> </block> </value> </block> </value> </block> </statement> <next> <block type="text_append" id="yrfmMVllibE1D[1,T-8c"> <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="^^w-UuG$rGsR==gG(FoC"> <field name="TEXT"></tbody></table></field> </block> </value> </block> </next> </block> </next> </block> </statement> <statement name="ELSE"> <block type="text_append" id="b8j0,y*t!!Yit@B8ZDu3"> <field name="VAR" id="cTIvd#0frb]}?DN^7oUd">Liste-komplett</field> <value name="TEXT"> <shadow type="text" id="nm)]Xdp_nV?LQWuQ:ElF"> <field name="TEXT"></field> </shadow> <block type="text" id="Ce$MOG)(RZ9G-P`-x)P)"> <field name="TEXT"><table class="table-status"> <tbody> <td class="alles_zu"><span class="">Alle Fenster geschlossen</span></td> </tbody> </table></field> </block> </value> </block> </statement> <next> <block type="control" id="dI4yke%zrI0vqI$=7|!P"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.002_nurVIS.01_Infos.Fenster-Status</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="1Q0Efv^4i*zZNN~`bBg,"> <field name="VAR" id="cTIvd#0frb]}?DN^7oUd">Liste-komplett</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </xml>
Hier das CSS
/* ===== Fenster-Status ===== */ .table-status { width: 100%; margin: 0px 0px 40px; } .table-status tr { background: none!important; border-bottom: 1px dotted #ccc; height: 48px; } .table-status tr:last-child { background: none!important; border-bottom: 0px solid #ccc; } .table-status th:nth-child(1), .table-status td:nth-child(1) { padding: 5px 0px 0px!important; text-align: left!important; width: 10%!important; vertical-align: top; } .table-status th:nth-child(1) img, .table-status td:nth-child(1) img { width: 40px; height: auto; margin-left: -6px; } .table-status.inactive img { opacity: 0.6; } .table-status th:nth-child(2), .table-status td:nth-child(2) { padding: 0px 0px 0px 10px!important; text-align: left; width: *; -moz-hyphens: none; -o-hyphens: none; -webkit-hyphens: none; -ms-hyphens: none; hyphens: none; white-space: nowrap; font-size: large; line-height: 1; } .table-status th:nth-child(3), .table-status td:nth-child(3) { padding: 9px 0px 0px!important; vertical-align: top; text-align: right; } .alles_zu { text-align: center; font-size: 25px: color: #329c1a; }
Großen Dank nochmal an @paul53
-
@wszene Danke, habs mal übernommen, coole idee