NEWS
Blockly - mehrere falls-mache Bedingungen hintereinander
-
Hallo Gemeinde,
da mein Blockly "Alarm-Anlage lite" nicht so will wie ich obwohl ich schon Stunden investiert habe, muss ich jetzt leider doch fragen. Kann das Blockly von mir so funktionieren??? Ich habe mehrere "Falls - Mache"-Bausteine in meinem Triggerblock untereinander stehen (siehe Bild).
Einzige Idee, die ich jetzt habe, is, für jedes Objekt ein separates Blockly zu bauen mit "Trigger-block" auf ein Objekt und dann "Falls-Mache" - und das ganze dann 5 mal hintereinander…fänd ich aber irgendwie unschön. Müsste doch so klappen wie ich das schon gemacht habe??
Na super...kann wieder mal nur 1 Bild hochladen...das ist zu wenig...daher einmal als Blockly-Export und einmal als Java-Skript:
zumindest der erste Teil meines Blockly als Bild:

Blockly-Export:
! ````
<xml xmlns="http://www.w3.org/1999/xhtml"><block type="on_ext" id="*5J%`oFTp.S(wIsK0JQv" x="56" y="12"><mutation items="5"></mutation>
<field name="CONDITION">true</field><value name="OID0"><shadow type="field_oid" id=",0#?*?#=Bz9gkwa5t?U-"><field name="oid">hm-rpc.0.0000D709925D62.1.STATE</field></shadow></value> <value name="OID1"><shadow type="field_oid" id="yegMXWA2v1B)84(g)z5V"><field name="oid">mihome.0.devices.magnet_158d00019db26a.state</field></shadow></value> <value name="OID2"><shadow type="field_oid" id="sdM`B)!R7Xs7h^xH{B0I"><field name="oid">mihome.0.devices.magnet_158d00019f4fbf.state</field></shadow></value> <value name="OID3"><shadow type="field_oid" id=";Wgr2;%`4Q%m*.n%wLFm"><field name="oid">mihome.0.devices.magnet_158d0001ab5af4.state</field></shadow></value> <value name="OID4"><shadow type="field_oid" id="yoza)86CA0J)Y]%oMXNb"><field name="oid">hm-rpc.0.0000D7099A2F33.1.STATE</field></shadow></value> <statement name="STATEMENT"><block type="debug" id="Ash0cL^O~5~hzmS_=q0T"><field name="Severity">log</field> <value name="TEXT"><shadow type="text" id="yROW:9=p3.Mp@:Iv`H6l"><field name="TEXT">Alarm_getriggert</field></shadow></value> <next><block type="timeouts_cleartimeout" id="A:m!/=Aj0ScPWm.=M]7f"><field name="NAME">timeout</field> <next><block type="timeouts_cleartimeout" id="x0ZL6NLC6a.z.!GtKN%?"><field name="NAME">timeout2</field> <next><block type="timeouts_cleartimeout" id="izmI=tPFMtRU6B=4/i(4"><field name="NAME">timeout3</field> <next><block type="timeouts_cleartimeout" id="SUrs|xGgO|Qkc5M*pU+~"><field name="NAME">timeout4</field> <next><block type="comment" id="%^8od9Fvh|M@`pFsEEN%"><field name="COMMENT">Kellertür</field> <next><block type="controls_if" id=";6|PRSu9pQ%q5jyNkT(q"><value name="IF0"><block type="logic_operation" id="qY[epr8@q+c~vK+MV[r2"><field name="OP">AND</field> <value name="A"><block type="logic_compare" id="ZFDd/PvJtW_dP;vbk[cL"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="b=.+m5Gb!cBn1m.i*f/7"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.0000D709925D62.1.STATE</field></block></value> <value name="B"><block type="logic_boolean" id="RMB1lLq*fd(|~(nhz}A."><field name="BOOL">TRUE</field></block></value></block></value> <value name="B"><block type="logic_compare" id="A5JwbMUh[c,--Nn16f7C"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="}iWzq.*/Rs=%TcPVA@V,"><field name="ATTR">val</field> <field name="OID">javascript.0.scriptEnabled.common.Alarm.Alarm_ON_OFF</field></block></value> <value name="B"><block type="logic_boolean" id="(iN8)=2_7;M?.qG*o@)8"><field name="BOOL">TRUE</field></block></value></block></value></block></value> <statement name="DO0"><block type="debug" id="RwpPAA9{,Tm(Wj^p29f~"><field name="Severity">log</field> <value name="TEXT"><shadow type="text" id="RqzTJ1JNl}p`QoMwUNbZ"><field name="TEXT">Keller_getriggert</field></shadow></value> <next><block type="control" id="2zsqkePEgzTn?:YCeL7r"><mutation delay_input="false"></mutation> <field name="OID">paw.0.SonyXperiaX2Tablet.command.volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="WKmsY5qE6hWLzT5OpE%4"><field name="NUM">100</field></block></value> <next><block type="timeouts_settimeout" id="/pXxlQ=~~gP[l51BE.rc"><field name="NAME">timeout2</field> <field name="DELAY">1</field> <field name="UNIT">sec</field> <statement name="STATEMENT"><block type="sendto_custom" id="R-sSu%YWDL3/Dp**Rd2z"><mutation items="send:'say'" with_statement="false"></mutation> <field name="INSTANCE">paw.0</field> <field name="COMMAND">SonyXperiaX2Tablet</field> <field name="WITH_STATEMENT">FALSE</field> <value name="ARG0"><shadow type="text" id="xsumyo}j|i}1g71:KLyX"><field name="TEXT">"Alarm, Kellertüre wurde geöffnet."</field></shadow></value></block></statement> <next><block type="timeouts_settimeout" id="RBI;zYKcfd}Mo[S:hLXa"><field name="NAME">timeout3</field> <field name="DELAY">7</field> <field name="UNIT">sec</field> <statement name="STATEMENT"><block type="sendto_custom" id="eEptIu[;ipB/Aed+mM0,"><mutation items="send:'say'" with_statement="false"></mutation> <field name="INSTANCE">paw.0</field> <field name="COMMAND">SonyXperiaX2Tablet</field> <field name="WITH_STATEMENT">FALSE</field> <value name="ARG0"><shadow type="text" id="*lBdz.ez:LUMRkt0Qds;"><field name="TEXT">"Alarm, Kellertüre wurde geöffnet."</field></shadow></value></block></statement> <next><block type="timeouts_settimeout" id="y`mHtBT74`.!(uUEz*8Q"><field name="NAME">timeout4</field> <field name="DELAY">13</field> <field name="UNIT">sec</field> <statement name="STATEMENT"><block type="sendto_custom" id="^7422(e4_s0@03dlR^7s"><mutation items="send:'say'" with_statement="false"></mutation> <field name="INSTANCE">paw.0</field> <field name="COMMAND">SonyXperiaX2Tablet</field> <field name="WITH_STATEMENT">FALSE</field> <value name="ARG0"><shadow type="text" id="+/7H7d+Kcxh50PSBZF*y"><field name="TEXT">"Alarm, Kellertüre wurde geöffnet."</field></shadow></value></block></statement> <next><block type="timeouts_settimeout" id="S4XnLXR3=nsX,!g?G7Bl"><field name="NAME">timeout</field> <field name="DELAY">20</field> <field name="UNIT">sec</field> <statement name="STATEMENT"><block type="controls_if" id="1J1TO2.CE+;(1[)%8B,n"><value name="IF0"><block type="logic_compare" id="A)6CEE;9MEJfSij08qT["><field name="OP">EQ</field> <value name="A"><block type="get_value" id="u+-A;jeho;HN3i4eTFjF"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.0000D709925D62.1.STATE</field></block></value> <value name="B"><block type="logic_boolean" id="DX_QqFz.Mp:Fo{09p`H`"><field name="BOOL">FALSE</field></block></value></block></value> <statement name="DO0"><block type="control" id="Hm;BZ:0z@i(5FjnNakj-"><mutation delay_input="false"></mutation> <field name="OID">paw.0.SonyXperiaX2Tablet.command.volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="-HVMINXrsdmdRXPv}44:"><field name="NUM">0</field></block></value></block></statement></block></statement></block></next></block></next></block></next></block></next></block></next></block></statement> <next><block type="comment" id="k9Z`j8193kLpjQPfpf7C"><field name="COMMENT">Küchenfenster</field> <next><block type="controls_if" id="v5(n~V2J^YD(JSs}4b:y"><value name="IF0"><block type="logic_operation" id="(T~jz8i-FXFSsH_[NTz3"><field name="OP">AND</field> <value name="A"><block type="logic_compare" id="yG30BEKcEo4tx~^}a@WK"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="CN/:F|4d=XlTC=vYNX)9"><field name="ATTR">val</field> <field name="OID">mihome.0.devices.magnet_158d00019db26a.state</field></block></value> <value name="B"><block type="logic_boolean" id="pia:6_a.JZS#sJN7zjCs"><field name="BOOL">TRUE</field></block></value></block></value> <value name="B"><block type="logic_compare" id="479IK(4^;buK_=mY@u}~"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="eg!lhQbKY[!:Vl%pMn_#"><field name="ATTR">val</field> <field name="OID">javascript.0.scriptEnabled.common.Alarm.Alarm_ON_OFF</field></block></value> <value name="B"><block type="logic_boolean" id="yn}k_V%ty5Lzn~`L[Y(O"><field name="BOOL">TRUE</field></block></value></block></value></block></value> <statement name="DO0"><block type="debug" id="4sNEf2|(3=)+CXwG+c*X"><field name="Severity">log</field> <value name="TEXT"><shadow type="text" id="a~9G8W/m[V@/`NuouZh3"><field name="TEXT">Küchenfenster_getriggert</field></shadow></value> <next><block type="control" id="K.tIKH,]gXbt`:jAZyYw"><mutation delay_input="false"></mutation> <field name="OID">paw.0.SonyXperiaX2Tablet.command.volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="o2e^)l6Nd(cqs6[x;v)L"><field name="NUM">100</field></block></value> <next><block type="timeouts_setinterval" id="A#nCuqg:E9IVF_P0E/,U"><field name="NAME">Intervall</field> <field name="INTERVAL">5</field> <field name="UNIT">sec</field> <statement name="STATEMENT"><block type="sendto_custom" id=".C3C;|pZrD4g)A)Rl4b)"><mutation items="send:'say'" with_statement="false"></mutation> <field name="INSTANCE">paw.0</field> <field name="COMMAND">SonyXperiaX2Tablet</field> <field name="WITH_STATEMENT">FALSE</field> <value name="ARG0"><shadow type="text" id="jVz^fML{w@#d4Zm3CCU*"><field name="TEXT">"Alarm, Küchenfenster wurde geöffnet."</field></shadow></value> <next><block type="controls_if" id=")nWM]5(5sB[.A+_cFFQX"><value name="IF0"><block type="logic_compare" id="}p(L(r[YycghU`-*RQNX"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="u+/VTFAzYJ{Qga62nBuS"><field name="ATTR">val</field> <field name="OID">mihome.0.devices.magnet_158d00019db26a.state</field></block></value> <value name="B"><block type="logic_boolean" id="h:21O-?.18@ssz7rc-]]"><field name="BOOL">FALSE</field></block></value></block></value> <statement name="DO0"><block type="timeouts_clearinterval" id="LF_|2+UAd2n*w*?BhG2r"><field name="NAME">Intervall</field> <next><block type="control" id="42sqPi{#r)^kYGuQq2WI"><mutation delay_input="false"></mutation> <field name="OID">paw.0.SonyXperiaX2Tablet.command.volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="(Ig]Xa5C(KXVMAF*`)[k"><field name="NUM">0</field></block></value></block></next></block></statement></block></next></block></statement></block></next></block></next></block></statement> <next><block type="comment" id="I]pDCQ;PY0!T#ik.QnbU"><field name="COMMENT">Eingangstür</field> <next><block type="controls_if" id="j;%9vjTP._6?BB!Ei]1T"><value name="IF0"><block type="logic_operation" id="i^7_Oo_;xnG(!WWAV:~!"><field name="OP">AND</field> <value name="A"><block type="logic_compare" id="IrpEoea/kK%-021a3ZM{"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="(g6uFcg[4n,vT%57%.u)"><field name="ATTR">val</field> <field name="OID">mihome.0.devices.magnet_158d00019f4fbf.state</field></block></value> <value name="B"><block type="logic_boolean" id="5zBp{4#3`QyKMxXYxQ@U"><field name="BOOL">TRUE</field></block></value></block></value> <value name="B"><block type="logic_compare" id="rtv_zsd?N@|wl61~eOU5"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="elE~@bdWpn)@`F6=~|8H"><field name="ATTR">val</field> <field name="OID">javascript.0.scriptEnabled.common.Alarm.Alarm_ON_OFF</field></block></value> <value name="B"><block type="logic_boolean" id="JvK(iH#*hVXbl}Y6x@i8"><field name="BOOL">TRUE</field></block></value></block></value></block></value> <statement name="DO0"><block type="debug" id="CvKdx/=sdo3Fnp%IhGyj"><field name="Severity">log</field> <value name="TEXT"><shadow type="text" id="-[HXUrHb=02`1/#tUrA/"><field name="TEXT">Eingangstür_getriggert</field></shadow></value> <next><block type="control" id="]#BqVu(o?|bz)v#HV#@^"><mutation delay_input="false"></mutation> <field name="OID">paw.0.SonyXperiaX2Tablet.command.volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="A.~RTx:]Y%tfsoM6)km8"><field name="NUM">100</field></block></value> <next><block type="timeouts_setinterval" id="9C;Diqxuh2cEKlvKN}I8"><field name="NAME">Intervall2</field> <field name="INTERVAL">5</field> <field name="UNIT">sec</field> <statement name="STATEMENT"><block type="sendto_custom" id="`z+c09S^{(._@/ET~*`("><mutation items="send:'say'" with_statement="false"></mutation> <field name="INSTANCE">paw.0</field> <field name="COMMAND">SonyXperiaX2Tablet</field> <field name="WITH_STATEMENT">FALSE</field> <value name="ARG0"><shadow type="text" id=".5TPXe=kFloKC/,V}^yb"><field name="TEXT">"Alarm, Eingangstür wurde geöffnet."</field></shadow></value> <next><block type="controls_if" id=",rTM:mJx|echQl6nh51s"><value name="IF0"><block type="logic_compare" id="3hxV#DD7_|:XyzILc@#1"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="i7~GM/*@vg,yWCkX0/jn"><field name="ATTR">val</field> <field name="OID">mihome.0.devices.magnet_158d00019f4fbf.state</field></block></value> <value name="B"><block type="logic_boolean" id=";+Nx{O;66`ebg.@A{}z@"><field name="BOOL">FALSE</field></block></value></block></value> <statement name="DO0"><block type="timeouts_clearinterval" id="9jNeX,+Q.m5h0+NvO6DX"><field name="NAME">Intervall2</field> <next><block type="control" id="q1y%k3]/@al~bIO!k8uI"><mutation delay_input="false"></mutation> <field name="OID">paw.0.SonyXperiaX2Tablet.command.volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="[_^NHbPYISKQmR3TbH;="><field name="NUM">0</field></block></value></block></next></block></statement></block></next></block></statement></block></next></block></next></block></statement> <next><block type="comment" id="{/}){l-*Y-Q~:g!WW5}4"><field name="COMMENT">Balkontür klein</field> <next><block type="controls_if" id="k!/Hi}bh?N?M;e.tXpKW"><value name="IF0"><block type="logic_operation" id="x;vf6UGc9=F;G1w5id/i"><field name="OP">AND</field> <value name="A"><block type="logic_compare" id="LxMj:X:~w3VHBDp9K022"><field name="OP">EQ</field> <value name="A"><block type="get_value" id=".ow/LDF8a;VRa*OUQ!5p"><field name="ATTR">val</field> <field name="OID">mihome.0.devices.magnet_158d0001ab5af4.state</field></block></value> <value name="B"><block type="logic_boolean" id=")*gR#`cGwz*SD4(hj,62"><field name="BOOL">TRUE</field></block></value></block></value> <value name="B"><block type="logic_compare" id="(%X?Q)EF2y=8ZTCj5UMN"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="2H~T[OcPqm~?5*7{%96x"><field name="ATTR">val</field> <field name="OID">javascript.0.scriptEnabled.common.Alarm.Alarm_ON_OFF</field></block></value> <value name="B"><block type="logic_boolean" id="Q1[FWc0Zg0!}apedN7xA"><field name="BOOL">TRUE</field></block></value></block></value></block></value> <statement name="DO0"><block type="debug" id="oA(mw|B4rdyjaZe2yYoi"><field name="Severity">log</field> <value name="TEXT"><shadow type="text" id="{{s3;nX#[:VUw(A%}P.4"><field name="TEXT">Balkontür klein_getriggert</field></shadow></value> <next><block type="control" id="^tZ2|Lr][Tru1Rfha!];"><mutation delay_input="false"></mutation> <field name="OID">paw.0.SonyXperiaX2Tablet.command.volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="Qs+C`l*s0SdGP7hXGbxN"><field name="NUM">100</field></block></value> <next><block type="timeouts_setinterval" id="ayv4JIKl*SQEr;T*:@Z}"><field name="NAME">Intervall3</field> <field name="INTERVAL">5</field> <field name="UNIT">sec</field> <statement name="STATEMENT"><block type="sendto_custom" id="A7Lz_bs97;WOzZ?80SYG"><mutation items="send:'say'" with_statement="false"></mutation> <field name="INSTANCE">paw.0</field> <field name="COMMAND">SonyXperiaX2Tablet</field> <field name="WITH_STATEMENT">FALSE</field> <value name="ARG0"><shadow type="text" id="Y4R=k^`1O,BnabeC78s`"><field name="TEXT">"Alarm, Balkontür klein wurde geöffnet."</field></shadow></value> <next><block type="controls_if" id="BI3rx|D5z7h{X2Zix*ED"><value name="IF0"><block type="logic_compare" id="{:n=(fSx{Q2d38iL}P6t"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="[@t?8+Rg+]U-9aN%@9yK"><field name="ATTR">val</field> <field name="OID">mihome.0.devices.magnet_158d0001ab5af4.state</field></block></value> <value name="B"><block type="logic_boolean" id="Y[]**-mG0UNG1hzSm2ul"><field name="BOOL">FALSE</field></block></value></block></value> <statement name="DO0"><block type="timeouts_clearinterval" id="P_Kh2|aTW%nHPsab3k1="><field name="NAME">Intervall3</field> <next><block type="control" id="tMSrik1%!2:5R3e@_LHY"><mutation delay_input="false"></mutation> <field name="OID">paw.0.SonyXperiaX2Tablet.command.volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="[SkPQ|rbk2|b!MoT)l,L"><field name="NUM">0</field></block></value></block></next></block></statement></block></next></block></statement></block></next></block></next></block></statement> <next><block type="comment" id="}B;o{Vr?Eie#Erw}`Ih{"><field name="COMMENT">Balkontür gross</field> <next><block type="controls_if" id=")R5AsS5fL?TD;d=HTst5"><value name="IF0"><block type="logic_operation" id="6gDN:Llu#w=#Bg}#sI@l"><field name="OP">AND</field> <value name="A"><block type="logic_compare" id="%;J(8SUt3DfMc3X*q(+i"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="e[?=p6p[v)}x{)Us]cH#"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.0000D7099A2F33.1.STATE</field></block></value> <value name="B"><block type="logic_boolean" id="bnY`+]I3g@Jmr/txcPvt"><field name="BOOL">TRUE</field></block></value></block></value> <value name="B"><block type="logic_compare" id="d?OMMcf=eAb2D/EgiF?%"><field name="OP">EQ</field> <value name="A"><block type="get_value" id=":bNE?]f~^#nODT1pPCD]"><field name="ATTR">val</field> <field name="OID">javascript.0.scriptEnabled.common.Alarm.Alarm_ON_OFF</field></block></value> <value name="B"><block type="logic_boolean" id="ci`5AJI_?j0O%1I=(rmJ"><field name="BOOL">TRUE</field></block></value></block></value></block></value> <statement name="DO0"><block type="debug" id="Uas`RUS7Lo/C/@4[h(UC"><field name="Severity">log</field> <value name="TEXT"><shadow type="text" id="p(A@Q1GWaF3qH*SCGQ[*"><field name="TEXT">Balkontür gross_getriggert</field></shadow></value> <next><block type="control" id="~GYq])ye,nY[R23l3bcv"><mutation delay_input="false"></mutation> <field name="OID">paw.0.SonyXperiaX2Tablet.command.volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="*0/^7i5niCR`=0:O^a8^"><field name="NUM">100</field></block></value> <next><block type="timeouts_setinterval" id="}jgBLi)3A.0-~I+(+k,y"><field name="NAME">Intervall4</field> <field name="INTERVAL">5</field> <field name="UNIT">sec</field> <statement name="STATEMENT"><block type="sendto_custom" id="pJkd:5:b*i6Y9d.yU2^X"><mutation items="send:'say'" with_statement="false"></mutation> <field name="INSTANCE">paw.0</field> <field name="COMMAND">SonyXperiaX2Tablet</field> <field name="WITH_STATEMENT">FALSE</field> <value name="ARG0"><shadow type="text" id="R.RPp+VmBK+i_A?zNdE)"><field name="TEXT">"Alarm, Balkontür gross wurde geöffnet."</field></shadow></value> <next><block type="controls_if" id="-IU]:J`iB`t{R@GNwl|L"><value name="IF0"><block type="logic_compare" id="tOlK,+cQVSy`Q=;rassi"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="txeCWiYIpf)=;K;QJDcM"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.0000D7099A2F33.1.STATE</field></block></value> <value name="B"><block type="logic_boolean" id="B!7N+jKZb@2dXmA~U5g]"><field name="BOOL">FALSE</field></block></value></block></value> <statement name="DO0"><block type="timeouts_clearinterval" id="M3*T(ns@+;jVX1AzU[+W"><field name="NAME">Intervall4</field> <next><block type="control" id="pOJ~e0)-x%`926;Ca8eR"><mutation delay_input="false"></mutation> <field name="OID">paw.0.SonyXperiaX2Tablet.command.volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="!bXOzu?u=3f0v`tGjgSq"><field name="NUM">0</field></block></value></block></next></block></statement></block></next></block></statement></block></next></block></next></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></xml>Und Java-Skript: >! ```` var timeout2, timeout3, timeout4, Intervall, timeout, Intervall2, Intervall3, Intervall4; >! on({id: new RegExp('hm-rpc\\.0\\.0000D709925D62\\.1\\.STATE' + "|" + 'mihome\\.0\\.devices\\.magnet_158d00019db26a\\.state' + "|" + 'mihome\\.0\\.devices\\.magnet_158d00019f4fbf\\.state' + "|" + 'mihome\\.0\\.devices\\.magnet_158d0001ab5af4\\.state' + "|" + 'hm-rpc\\.0\\.0000D7099A2F33\\.1\\.STATE'), val: true}, function (obj) { console.log('Alarm_getriggert'); (function () {if (timeout) {clearTimeout(timeout); timeout = null;}})(); (function () {if (timeout2) {clearTimeout(timeout2); timeout2 = null;}})(); (function () {if (timeout3) {clearTimeout(timeout3); timeout3 = null;}})(); (function () {if (timeout4) {clearTimeout(timeout4); timeout4 = null;}})(); // Kellertür if (getState("hm-rpc.0.0000D709925D62.1.STATE").val == true && getState("javascript.0.scriptEnabled.common.Alarm.Alarm_ON_OFF").val == true) { console.log('Keller_getriggert'); setState("paw.0.SonyXperiaX2Tablet.command.volume"/*volume*/, 100); timeout2 = setTimeout(function () { sendTo("paw.0", "SonyXperiaX2Tablet", { "send:'say'": '"Alarm, Kellertüre wurde geöffnet."' }); }, 1000); timeout3 = setTimeout(function () { sendTo("paw.0", "SonyXperiaX2Tablet", { "send:'say'": '"Alarm, Kellertüre wurde geöffnet."' }); }, 7000); timeout4 = setTimeout(function () { sendTo("paw.0", "SonyXperiaX2Tablet", { "send:'say'": '"Alarm, Kellertüre wurde geöffnet."' }); }, 13000); timeout = setTimeout(function () { if (getState("hm-rpc.0.0000D709925D62.1.STATE").val == false) { setState("paw.0.SonyXperiaX2Tablet.command.volume"/*volume*/, 0); } }, 20000); } // Küchenfenster if (getState("mihome.0.devices.magnet_158d00019db26a.state").val == true && getState("javascript.0.scriptEnabled.common.Alarm.Alarm_ON_OFF").val == true) { console.log('Küchenfenster_getriggert'); setState("paw.0.SonyXperiaX2Tablet.command.volume"/*volume*/, 100); Intervall = setInterval(function () { sendTo("paw.0", "SonyXperiaX2Tablet", { "send:'say'": '"Alarm, Küchenfenster wurde geöffnet."' }); if (getState("mihome.0.devices.magnet_158d00019db26a.state").val == false) { (function () {if (Intervall) {clearInterval(Intervall); Intervall = null;}})(); setState("paw.0.SonyXperiaX2Tablet.command.volume"/*volume*/, 0); } }, 5000); } // Eingangstür if (getState("mihome.0.devices.magnet_158d00019f4fbf.state").val == true && getState("javascript.0.scriptEnabled.common.Alarm.Alarm_ON_OFF").val == true) { console.log('Eingangstür_getriggert'); setState("paw.0.SonyXperiaX2Tablet.command.volume"/*volume*/, 100); Intervall2 = setInterval(function () { sendTo("paw.0", "SonyXperiaX2Tablet", { "send:'say'": '"Alarm, Eingangstür wurde geöffnet."' }); if (getState("mihome.0.devices.magnet_158d00019f4fbf.state").val == false) { (function () {if (Intervall2) {clearInterval(Intervall2); Intervall2 = null;}})(); setState("paw.0.SonyXperiaX2Tablet.command.volume"/*volume*/, 0); } }, 5000); } // Balkontür klein if (getState("mihome.0.devices.magnet_158d0001ab5af4.state").val == true && getState("javascript.0.scriptEnabled.common.Alarm.Alarm_ON_OFF").val == true) { console.log('Balkontür klein_getriggert'); setState("paw.0.SonyXperiaX2Tablet.command.volume"/*volume*/, 100); Intervall3 = setInterval(function () { sendTo("paw.0", "SonyXperiaX2Tablet", { "send:'say'": '"Alarm, Balkontür klein wurde geöffnet."' }); if (getState("mihome.0.devices.magnet_158d0001ab5af4.state").val == false) { (function () {if (Intervall3) {clearInterval(Intervall3); Intervall3 = null;}})(); setState("paw.0.SonyXperiaX2Tablet.command.volume"/*volume*/, 0); } }, 5000); } // Balkontür gross if (getState("hm-rpc.0.0000D7099A2F33.1.STATE").val == true && getState("javascript.0.scriptEnabled.common.Alarm.Alarm_ON_OFF").val == true) { console.log('Balkontür gross_getriggert'); setState("paw.0.SonyXperiaX2Tablet.command.volume"/*volume*/, 100); Intervall4 = setInterval(function () { sendTo("paw.0", "SonyXperiaX2Tablet", { "send:'say'": '"Alarm, Balkontür gross wurde geöffnet."' }); if (getState("hm-rpc.0.0000D7099A2F33.1.STATE").val == false) { (function () {if (Intervall4) {clearInterval(Intervall4); Intervall4 = null;}})(); setState("paw.0.SonyXperiaX2Tablet.command.volume"/*volume*/, 0); } }, 5000); } });Ich habe das Gefühl, es wird nicht mal auf eine Statusänderung meiner Sensoren reagiert???!!! Ich habe aber unter Objekte im Admin 3.4.2 geschaut und da ändert sich der State des jeweiligen Objekts (Magnet-Sensor am Fenster zB).
Danke euch und viel Grüße, Thorsten
-
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren Anmelden
