Page 1 of 1
script start with delay
Posted: Tuesday 06 October 2020 22:34
by stack
hello, how can I get a blockly to start a script after 2 seconds. when motion sensor is on.
Re: script start with delay
Posted: Wednesday 07 October 2020 0:09
by waaren
stack wrote: ↑Tuesday 06 October 2020 22:34
hello, how can I get a blockly to start a script after 2 seconds. when motion sensor is on.
What kind of script do you want a Blockly to start? Itself or another Blockly / Lua/ dzVents or OS script?
Assuming you mean itself, it could look like below.
Copy /paste below XML in the import window of the Blockly event editor, change the device numbers to your device names and save as device triggered event.
- Spoiler: show
-
Code: Select all
<xml xmlns="http://www.w3.org/1999/xhtml"><block type="domoticzcontrols_ifelseif" id="[h@[r-x=imJMT;lxXhkj" x="11" y="8"><mutation elseif="1"></mutation><value name="IF0"><block type="logic_compare" id="YLRyJl+knMNi{)I*zuEx"><field name="OP">EQ</field><value name="A"><block type="switchvariablesMR" id="^RP%y+t1:jy8QK)cOz9i"><field name="Switch">658</field></block></value><value name="B"><block type="logic_states" id="%{Q-E|/k0Cx~37ZnPL=Q"><field name="State">On</field></block></value></block></value><statement name="DO0"><block type="logic_setafter" id="8+3^2J|ih-d*bxk{*la."><value name="A"><block type="switchvariablesMR" id="M5|14ShJI*E(-@`6Kh!x"><field name="Switch">659</field></block></value><value name="B"><block type="logic_states" id="%YpEJB7%fM}^R^qAI8VB"><field name="State">On</field></block></value><value name="C"><block type="math_number" id="p|pwZ^w{iYub^WR5zl|F"><field name="NUM">2</field></block></value></block></statement><value name="IF1"><block type="logic_compare" id="U*NQ{3H7HP~iq:VX=z8b"><field name="OP">EQ</field><value name="A"><block type="switchvariablesMR" id="[v6PZ~!=Xg/MorVYTpc="><field name="Switch">659</field></block></value><value name="B"><block type="logic_states" id="H$nf,ryK|[h0!3%7VI^H"><field name="State">On</field></block></value></block></value><statement name="DO1"><block type="logic_set" id="13GS_%HGkuYkEvye@HuV"><value name="A"><block type="switchvariablesMR" id="A*0si.RBK9i`.N:mDcjs"><field name="Switch">659</field></block></value><value name="B"><block type="logic_states" id="9ec^C)OWMxJ5r@D](rt8"><field name="State">Off</field></block></value><next><block type="writetolog" id="/_co#Xa2Ch.w=+E`x=S:"><value name="writeToLog"><block type="text" id="dv.|3/`gaJ`m#^)Ec^vg"><field name="TEXT">What should I do now??</field></block></value></block></next></block></statement></block></xml>

- Blockly.png (124.66 KiB) Viewed 716 times
Re: script start with delay
Posted: Wednesday 07 October 2020 21:46
by stack
Thanks working perfect