mal ein ganz andrer Ansatz:
Bei Level schaue ich ob ein Javascript Kommando rein kommt und setze eine Variable "fromJS".
Dann warte ich bis Direction auf 0 zurück fällt und werte über die Variable "fomJS" aus.
Dort dann die Automatik komplett zurück setzen bis zur nächsten Bewegung.
fca97669-2cb5-49bb-a41f-8084f44f227d-image.png
Somit entfällt der Timer komplett und es wird ausgewertet sobald der Rolladen wieder steht.
Debug muss natürlich raus, aber ansonsten hats eben ganz gut funktioniert.
Findet ihr nen Fehler?
Hier das Skript:
Spoiler
<xml xmlns="
http://www.w3.org/1999/xhtml">
<variables>
<variable type="undefined" id="timeout2">timeout2</variable>
<variable type="" id="lY7^WQ2@/#Q80+BzHyx">blind_moving</variable> <variable type="" id="o=kS9?GhG|!3U6s/P!Q!">fromJS</variable> </variables> <block type="on" id="nT7C=4NMT[KJ*mm~XQod" x="-163" y="-413"> <field name="OID">javascript.0.sun_protection_active</field> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="control" id="#pfd6}j{ge@E%!(j}[l#"> <mutation delay_input="false"></mutation> <field name="OID">javascript.0.scriptEnabled.Rolladen.auto_active_Rollo_WZ</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="Zjg@-Ffn|FUP7+KEm%)">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</statement>
</block>
<block type="timeouts_settimeout" id="W,!iXT,2WEDRs5JM-%i(" disabled="true" x="-163" y="-163">
<field name="NAME">timeout2</field>
<field name="DELAY">2</field>
<field name="UNIT">sec</field>
<statement name="STATEMENT">
<block type="control" id="62lw2h9$1+!]FFC-EmE"> <mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.MEQ0735994.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="l3In5$CIy$uL^T{*kV!D"> <field name="NUM">80</field> </block> </value> </block> </statement> </block> <block type="variables_set" id="@:.{J)S.86[LRkTFUjAm" x="-88" y="38"> <field name="VAR" id="lY7^WQ2@/#Q80+BzHyx" variabletype="">blind_moving</field>
<value name="VALUE">
<block type="logic_boolean" id="nrZ}F^h)59a7{UutP:Xo">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="variables_set" id="SQzGexCD+-mtFkDD%|Xm">
<field name="VAR" id="o=kS9?GhG|!3U6s/P!Q!" variabletype="">fromJS</field>
<value name="VALUE">
<block type="logic_boolean" id="m.g9RWer/2zE#HP(=E4h">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="on_ext" id="0#X(g}On.E,4.oiB;owO">
<mutation items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="(Ly^wv*{wh:C/dmuHoMc">
<field name="oid">hm-rpc.0.MEQ0735994.1.LEVEL</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="debug" id="#GUL)N(T0h|w~:l2!Rv">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="pqF)/_kGlvEeTEZ3E9zX">
<field name="TEXT">from funktioniert</field>
</shadow>
<block type="text_join" id="O=1]UAu|L%qu,JvTs]Hg">
<mutation items="4"></mutation>
<value name="ADD0">
<block type="text" id="cUjfbsY3XUZc|24XTTZ7">
<field name="TEXT">Ursprung Rollo Links Aktion = </field>
</block>
</value>
<value name="ADD1">
<block type="on_source" id="PS_Xn(@3TGY|WEeZG{bP">
<field name="ATTR">state.from</field>
</block>
</value>
<value name="ADD2">
<block type="text" id="k?Ei(?=mb,ta]QHa0yy"> <field name="TEXT"> , mit Wert</field> </block> </value> <value name="ADD3"> <block type="on_source" id="f._eITYe58wX-0o$=H/">
<field name="ATTR">state.val</field>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="^xNxZa#MAqkZj(MmkPh">
<field name="VAR" id="lY7^WQ2@/#Q80+BzHyx" variabletype="">blind_moving</field> <value name="VALUE"> <block type="logic_boolean" id="8G7vLNZ^S=2Ot.Fntztn"> <field name="BOOL">TRUE</field> </block> </value> <next> <block type="controls_if" id="npU+h406jggC_pJ=E(X">
<value name="IF0">
<block type="logic_compare" id="+9GZrRTu[4@z2d1btjo"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="E^z6J-Y3SW2*7I5_+.g~"> <field name="ATTR">state.from</field> </block> </value> <value name="B"> <block type="text" id="fTZx9r8ej6=)g^SJTi?,"> <field name="TEXT">system.adapter.javascript.0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="variables_set" id="5MyRXFSkqb]tLg[GutL">
<field name="VAR" id="o=kS9?GhG|!3U6s/P!Q!" variabletype="">fromJS</field>
<value name="VALUE">
<block type="logic_boolean" id="|EcxeQVLUsy1?]w[Fk9I">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="on_ext" id="g2v{4jv,CZ:=cTXQ;m}$">
<mutation items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="62#Ox;ukN9xi9S;2zhsI">
<field name="oid">hm-rpc.0.MEQ0735994.1.DIRECTION</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="debug" id="uq;(k^tNDrnLR4aD@kQ">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="pqF)/_kGlvEeTEZ3E9zX">
<field name="TEXT">from funktioniert</field>
</shadow>
<block type="text_join" id="8t_v,43^EU~J#A2?3ba">
<mutation items="4"></mutation>
<value name="ADD0">
<block type="text" id="q8cUTf6B;hf]8wyJ-G">
<field name="TEXT">Ursprung Direction Rollo Links Aktion = </field>
</block>
</value>
<value name="ADD1">
<block type="on_source" id="$X|(:Gy!wiaH~L%tYaDL">
<field name="ATTR">state.from</field>
</block>
</value>
<value name="ADD2">
<block type="text" id="GuJ,L$:~}=3}LBL-kkT">
<field name="TEXT">, Wert = </field>
</block>
</value>
<value name="ADD3">
<block type="on_source" id="H39j(RFDwn?G}~uj8-WG">
<field name="ATTR">state.val</field>
</block>
</value>
</block>
</value>
<next>
<block type="controls_if" id="}(%|KxulU933=rFKcVK{">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_operation" id="!pfy8bQv9[?r5zV0Wql8" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="=bI7j6UcxWFqmVN5m-kl">
<field name="OP">EQ</field>
<value name="A">
<block type="on_source" id=":2~hN%ByW,kbCjK0TnSm">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="math_number" id="Zpbb8jjQ63V|ajb4$(K">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="variables_get" id="}s55P;/vo6E|%?s]9c#">
<field name="VAR" id="lY7^WQ2@/#Q80+BzHyx" variabletype="">blind_moving</field> </block> </value> </block> </value> <statement name="DO0"> <block type="controls_if" id="bqAYMk^%4Egeb!_p]jnc"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_negate" id="iaGYRaC@FAncu!2q:Rtq"> <value name="BOOL"> <block type="variables_get" id="EJ){DJ:|6,Ye,fhCogj">
<field name="VAR" id="o=kS9?GhG|!3U6s/P!Q!" variabletype="">fromJS</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="debug" id="X7zt^nhoFPv%iSn|0RIF">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="[QW1~y=-?)w*nc#.#yu"> <field name="TEXT">Direction Methode: Manuell</field> </shadow> </value> <next> <block type="control" id="xcp[t$/M0%:yKCW]E=g5" disabled="true"> <mutation delay_input="false"></mutation> <field name="OID">javascript.0.scriptEnabled.Rolladen.auto_active_Rollo_WZ</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="-AD/I;/W_yl-=LAj%Be8"> <field name="BOOL">FALSE</field> </block> </value> </block> </next> </block> </statement> <statement name="ELSE"> <block type="debug" id="Tb]inMLQLwv{6=Y+n,9("> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id=":yunpic7Z8f3IJsBY?w">
<field name="TEXT">Directton Methode: Automatik</field>
</shadow>
</value>
</block>
</statement>
<next>
<block type="variables_set" id="FlUDV8^L;A:,trj}J8D=">
<field name="VAR" id="lY7^WQ2@/#Q80+BzHyx" variabletype="">blind_moving</field> <value name="VALUE"> <block type="logic_boolean" id="d4#D%i%My}XFD5jV/eT~"> <field name="BOOL">FALSE</field> </block> </value> <next> <block type="variables_set" id="NCJ$0-+3-VSV#[:8CUZE"> <field name="VAR" id="o=kS9?GhG|!3U6s/P!Q!" variabletype="">fromJS</field> <value name="VALUE"> <block type="logic_boolean" id="0IgUHFz?SX~%X38CG7B">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
<statement name="ELSE">
<block type="variables_set" id="3^-OG_A=[@O8P$#dnGyu">
<field name="VAR" id="lY7^WQ2@/#Q80+Bz`Hyx" variabletype="">blind_moving</field>
<value name="VALUE">
<block type="logic_boolean" id="fCNRFdkui}$MrvR_gCu">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</xml>