NEWS
Liste durchsuchen und vergleichen
-
Hi,
für meine Rolladensteuerung möchte ich für den Sonnenschutz zusätzlich prüfen, ob es ein Wintermonat ist oder nicht. Je nachdem soll ein Bool gesetzt werden. Nun habe ich schon einiges gesucht, bin aber über die Suchfunktion/ google nicht schlauer geworden.
Zuerst habe ich den Ansatz mit einer for-Schleife verfolgt, habe aber dann gesehen, dass man auf "in der Liste...suche erstes Auftreten..." gibt. Offensichtlich findet er aber kein Element in der Liste. Hat jemand einen Tipp, was ich falsch mache?
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="9)y]#-:0A7;xz,f.Syk`">Heizperiode</variable> </variables> <block type="comment" id="JG51J}GVw@.=e+97*~Ut" x="788" y="37"> <field name="COMMENT">Check Heizperiode</field> <next> <block type="schedule" id="MxI|#rqB}eq{Y+J[^wu4"> <field name="SCHEDULE">{"time":{"exactTime":true,"start":"15:05"},"period":{"days":1}}</field> <statement name="STATEMENT"> <block type="comment" id="?R]Ed4i8]Q68{{SAq/|Q"> <field name="COMMENT">Liste mit Wintermonaten</field> <next> <block type="variables_set" id="!Xx%KFT))fe9ZvxC{CyU"> <field name="VAR" id="9)y]#-:0A7;xz,f.Syk`">Heizperiode</field> <value name="VALUE"> <block type="convert_tonumber" id="x4~e*HjpJkRco}241LH@"> <value name="VALUE"> <block type="lists_create_with" id="34e4HXLl$XIJ.f9gF|vN"> <mutation items="7"></mutation> <value name="ADD0"> <block type="math_number" id="rz7uw^wAbS.13ZfGM-u+"> <field name="NUM">1</field> </block> </value> <value name="ADD1"> <block type="math_number" id="7$tv!T/{WOoa_kUuN)KF"> <field name="NUM">2</field> </block> </value> <value name="ADD2"> <block type="math_number" id="9!eZpXQ{VF8s^q_z%pR0"> <field name="NUM">3</field> </block> </value> <value name="ADD3"> <block type="math_number" id="A-z69LnNkw2}Hbdms#E4"> <field name="NUM">4</field> </block> </value> <value name="ADD4"> <block type="math_number" id="OIE$s|aaO#M=5gDUq~s,"> <field name="NUM">10</field> </block> </value> <value name="ADD5"> <block type="math_number" id="kcflKKg6!HLo=IZXxiL$"> <field name="NUM">11</field> </block> </value> <value name="ADD6"> <block type="math_number" id="@p(}su15V77j~fHBis-["> <field name="NUM">12</field> </block> </value> </block> </value> </block> </value> <next> <block type="comment" id="MhW{[e$6mdL$qW-F}[b;"> <field name="COMMENT">Check: ist aktueller Monat einer der Monate in der Liste?</field> <next> <block type="controls_if" id="=i;^CQJdkdxW;AC_pW~3"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="%FSLLOo/kVj_+`qwJBdW"> <field name="OP">EQ</field> <value name="A"> <block type="lists_indexOf" id="?h^o+GPN|!LJ+AHXx9c?"> <field name="END">FIRST</field> <value name="VALUE"> <block type="variables_get" id="U@3u(2*QWA/hsqz6Btg4"> <field name="VAR" id="9)y]#-:0A7;xz,f.Syk`">Heizperiode</field> </block> </value> <value name="FIND"> <block type="time_get" id="Y@9F;Ll}.6M*oorM`tqU"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">M</field> </block> </value> </block> </value> <value name="B"> <block type="time_get" id="kbw3WF{Q#l{~;RiRV/*S"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">M</field> </block> </value> </block> </value> <statement name="DO0"> <block type="update" id="zMgEF48mIgRY,b^1lW9H"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.EigeneDatenpunkte.Heizung.Heizperiode</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="+K0SJ~K{w0;0IDX@!m!f"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> <statement name="ELSE"> <block type="update" id="IcW^Gt_AtKSWo94S#Yso"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.EigeneDatenpunkte.Heizung.Heizperiode</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="JaIsV?|6Wy%0N?%YC)dT"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </next> </block> <block type="schedule" id="^jDm(Xx%~#S)qKU-Qpi`" disabled="true" x="-424" y="1038"> <field name="SCHEDULE">{"time":{"exactTime":true,"start":"02:00"},"period":{"days":1}}</field> <statement name="STATEMENT"> <block type="debug" id="/jWb^WLzBhomW$Gyi!Y6"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text"> <field name="TEXT">test</field> </shadow> <block type="text" id="Q~OM#_:f/DPVc[*v6Q#E"> <field name="TEXT">-HausInfos- Viessmann Optolink neu gestartet.</field> </block> </value> </block> </statement> </block> </xml>
-
@mading
Weshalb so kompliziert über eine Liste? -
@paul53 danke, stimmt eigentlich!