Once a STOPTIMER is stopped, it wont run again without a direct injection

Steps to re-create

  1. Press Inject1
  2. First 5 second timer shows running, then expires
  3. Second 5 second timer shows running, then expires.
  4. This is good
  5. Press stop
  6. Second 5 second timer shows ‘stopped’
  7. Press inject1
  8. First 5 second timer shows running, then expires
  9. Second 5 second timer clears the ‘stopped’ message but does not run.

The second 5 second timer will not run again without a direction injection using Inject2.

How do I get the second 5 sec timer to be able to run again after stopping it once?

[{"id":"95f65e76f41ed604","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"560c929059c2f147","type":"inject","z":"95f65e76f41ed604","name":"Inject1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":122,"y":81,"wires":[["7231abd0a50e42d5"]]},{"id":"6c3cb3140f1ae775","type":"inject","z":"95f65e76f41ed604","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"stop","payloadType":"str","x":392,"y":171,"wires":[["7cde4641cfeb63b8"]]},{"id":"7231abd0a50e42d5","type":"stoptimer","z":"95f65e76f41ed604","duration":"5","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":324,"y":81,"wires":[["7cde4641cfeb63b8"],[]]},{"id":"7cde4641cfeb63b8","type":"stoptimer","z":"95f65e76f41ed604","duration":"5","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":567,"y":81,"wires":[[],[]]},{"id":"38caef8c03d27b70","type":"inject","z":"95f65e76f41ed604","name":"Inject2","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":383,"y":225,"wires":[["7cde4641cfeb63b8"]]}]

image

There is an additional message that comes out that stops the timers down the line. Add this after the first stop timer.

[{"id":"335c204b.84fa1","type":"change","z":"7d105d71.cc18e4","g":"e001ec80.03598","name":"","rules":[{"t":"delete","p":"_timerpass","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":1220,"wires":[["24e06059.d8b4e8"]]}]
1 Like

You could also try replacing “StopTimer” with Stoptimer Varidelay. You can read about the _timerpass property at that link, and how Stoptimer-varidelay allows you to handle it within the node itself.

1 Like

@mikefila @putch

Both great solutions that both worked. Thanks!