@speedy hier mein Blockly
Wenn es klingelt wird die VIS auf die View "main/021_Videoueberwachung" umgeschaltet,
nach 5 Minuten wieder auf die Ansicht zuvor.
War vorher schon die Videoüberwachung zu sehen nimmt er die Startseite
[image: 1632245662762-1cc26b8e-97c2-441d-aa75-505ee9ae7c97-image.png]
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="T=B:k/ua%|aL[Gj5VwWo">SaveCurrentView</variable>
<variable type="timeout" id="timeout">timeout</variable>
</variables>
<block type="on" id="JPyGu[EqAzDSLXD?t!6r" x="-462" y="-712">
<field name="OID">mqtt.0.stat.ESP8266_Klingel.POWER</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="variables_set" id="Ma`^6kwMNQ/waWJAbP(p">
<field name="VAR" id="T=B:k/ua%|aL[Gj5VwWo">SaveCurrentView</field>
<value name="VALUE">
<block type="get_value" id="lbiJWK|@j5H^vH!%Ou8%">
<field name="ATTR">val</field>
<field name="OID">vis.0.control.data</field>
</block>
</value>
<next>
<block type="control" id=",N2/C9Ef;xe;lB{9JmbO">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">vis.0.control.instance</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="Jt)vih1pKfYbE2,J}Ine">
<field name="TEXT">*</field>
</block>
</value>
<next>
<block type="control" id="1)`k-W-kHZ#oETs0kb94">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">vis.0.control.data</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="#:_w#*[$t#|5IhC5j;ZX">
<field name="TEXT">main/021_Videoueberwachung</field>
</block>
</value>
<next>
<block type="control" id=".-mU^~lFw/:Zr^U4vc-N">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">vis.0.control.command</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="k-i.-*ofLW1=)|.K!f^o">
<field name="TEXT">changeView</field>
</block>
</value>
<next>
<block type="timeouts_settimeout" id="uFqDTo[Yk`M~%5kwuCB9">
<field name="NAME">timeout</field>
<field name="DELAY">5</field>
<field name="UNIT">min</field>
<statement name="STATEMENT">
<block type="controls_if" id="pH-(cf0#ig-%K7_{m}RL">
<value name="IF0">
<block type="logic_compare" id="5+0g-}Rkd]`Vt_=oUD,y">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="%6(a%1RNmB$|a)AHS9]g">
<field name="VAR" id="T=B:k/ua%|aL[Gj5VwWo">SaveCurrentView</field>
</block>
</value>
<value name="B">
<block type="text" id="r9%?Y]bDB1~48SWAUQuA">
<field name="TEXT">main/021_Videoueberwachung</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id="(59vJ{[R16YhX]VG/ny=">
<field name="VAR" id="T=B:k/ua%|aL[Gj5VwWo">SaveCurrentView</field>
<value name="VALUE">
<block type="text" id="^x}Z~jA9|Qzm;kDbzFg%">
<field name="TEXT">main/000_Start</field>
</block>
</value>
</block>
</statement>
<next>
<block type="controls_if" id="ayw*9R)Z~PPkhCcxv?Qz">
<value name="IF0">
<block type="logic_compare" id=".BL^aB#W3$BGs~c[;N7~">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="6XC8D?ql6ZU2W{Jx^`Ja">
<field name="ATTR">val</field>
<field name="OID">vis.0.control.data</field>
</block>
</value>
<value name="B">
<block type="text" id="AtxTvveEV4Pn4N|x1f19">
<field name="TEXT">main/021_Videoueberwachung</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="y.|U:ZLI32.4OsZA|H]i">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">vis.0.control.instance</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="i$$xHG^9,]rY9F2g51-m">
<field name="TEXT">*</field>
</block>
</value>
<next>
<block type="control" id="|=qvPdB4TyPXB`+YeTo^">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">vis.0.control.data</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="variables_get" id="y_0-Xvuf/y-++)F`QL}J">
<field name="VAR" id="T=B:k/ua%|aL[Gj5VwWo">SaveCurrentView</field>
</block>
</value>
<next>
<block type="control" id="6!Sevz17dEK5_e+gR%(.">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">vis.0.control.command</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="/2gdPxJ@5-$CiSv}oqaA">
<field name="TEXT">changeView</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</xml>
Die Lück im System ist, das wenn jemand 2x innerhalb der 5 Minuten klingelt, dann ist die letzte View die Videoüberwachung, deshalb dann die Startseite. Den Timeout-Teil habe ich aber sowieso deaktiviert da ein anderes Skript im Hintergrund läuft was sowieso nach 5 Minuten wieder auf die Startseite wechseln lässt