I have recently found a problem when using the trigger node.
If used normally things work as expected.
But if using it to have multiple timers running with different topics sending a reset signal does nothing.
Though I can understand some reasons why it shouldn't clear all active timers, another part of me sees this as a problem.
Flow - for the sake of it.
[{"id":"f590dc16c5aa0177","type":"trigger","z":"26262ba1.62dcbc","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"250","extend":false,"overrideDelay":true,"units":"ms","reset":"","bytopic":"topic","topic":"topic","outputs":1,"x":3900,"y":6320,"wires":[[]]},{"id":"3abdb00e854c6371","type":"inject","z":"26262ba1.62dcbc","name":"Can NOT reset","props":[{"p":"payload"},{"p":"delay","v":"20000","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topic","payload":"foo","payloadType":"str","x":3720,"y":6320,"wires":[["f590dc16c5aa0177"]]},{"id":"56480dde8153495e","type":"inject","z":"26262ba1.62dcbc","name":"reset","props":[{"p":"reset","v":"reset","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":3710,"y":6270,"wires":[["f590dc16c5aa0177"]]},{"id":"9ae784ad56707ebd","type":"inject","z":"26262ba1.62dcbc","name":"reset","props":[{"p":"reset","v":"reset","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":3710,"y":6370,"wires":[["7ae631ad1aa4f971"]]},{"id":"7ae631ad1aa4f971","type":"trigger","z":"26262ba1.62dcbc","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"250","extend":false,"overrideDelay":true,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":3900,"y":6420,"wires":[[]]},{"id":"dd6953b24c6d4da0","type":"inject","z":"26262ba1.62dcbc","name":"CAN reset","props":[{"p":"payload"},{"p":"delay","v":"20000","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topic","payload":"foo","payloadType":"str","x":3700,"y":6420,"wires":[["7ae631ad1aa4f971"]]},{"id":"aa5bbbebebbfa787","type":"comment","z":"26262ba1.62dcbc","name":"Start","info":"","x":3550,"y":6320,"wires":[]},{"id":"2dac4b8b7e447eeb","type":"comment","z":"26262ba1.62dcbc","name":"Start","info":"","x":3550,"y":6420,"wires":[]}]
Suggestion/s:
reset is ambiguous as documented.
reset
If a message is received with this property, any timeout or repeat currently in progress will be cleared and no message triggered.
ANY is the problem word here.
Though different to ALL, it is confusing.
if msg.reset is set, then ALL timers will be stopped.
the if msg.payload == part needs more explaining and should also explain that the topic needs to be set for the desird timer to be stopped/dropped also.
Another thing I noticed:
the if msg.paylad equals
I don't think it works.
Reason:
I had this code:
let msg1 = {}
msg1.topic = msg.payload.name
msg1.payload = "reset"
return msg1
being sent to the trigger node set as shown:
Didn't work.
I had to change it to:
let msg1 = {}
msg1.topic = msg.payload.name
msg1.reset = "reset"
return msg1
and then it worked.
![]()
