Trigger node - how to delay and repeat message?

Hi!
I want to set a trigger node to do the following:

  • On message do nothing
  • Send the received message every 10 seconds, until the reset criteria is fulfilled.

So I set "Send" to "nothing" and "then" to "resend it every".
But when "Send" is set to "nothing", then the message is not sent at all.

Is there an issue with the trigger node?

Node Red V3.0.2

well it's doing what its says... sending nothing then resending it (nothing) every 10 seconds...

But that makes not really sense... :wink:
Wouldn't it be better to have the same possibilities on the "repeat" option than on the "delay" option?

they are exactly the same options... you picked the nothing option ???
the first boxes selects what to send - the second modifies how often.
(I understand that it isn't really useful - but is what it is currently)
I guss you could add a delay node afterwards set to 10 secs - and then set this to send existing message . And wire a msg.reset to both to stop them both at the same time.

No, there are not.If I select "then" -> "delay", I can determine what to be sent after the delay.
With "then" -> "repeat" I can't do this.

This is exactly what I've done as a workaround. But as I wrote: This is a workaround...

In my opinion it should not be possible to set any option combinations that does not make any sense.

So either, when "Send" is set to "nothing", the "Then" option "repeat" should not be able to be selected,
or the node should provide the same possibilities for "repeat" than for "delay".

Instead of "repeat" use send nothing then send the original object, and feed the output back in to the trigger.

[{"id":"ef0c1e44b782a74a","type":"inject","z":"8964ba134d837e40","name":"reset","props":[{"p":"reset","v":"","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":300,"wires":[["4d9ef966df4f2c83"]]},{"id":"4d9ef966df4f2c83","type":"trigger","z":"8964ba134d837e40","name":"","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"2","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":380,"y":340,"wires":[["59fec3c4ee08c090","09aab31e6cc795f9"]]},{"id":"59fec3c4ee08c090","type":"debug","z":"8964ba134d837e40","name":"debug 242","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":340,"wires":[]},{"id":"b4d8ad15b1b6e7c8","type":"inject","z":"8964ba134d837e40","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":340,"wires":[["4d9ef966df4f2c83"]]},{"id":"09aab31e6cc795f9","type":"junction","z":"8964ba134d837e40","x":380,"y":400,"wires":[["4d9ef966df4f2c83"]]}]

I don't like making a loop. Make sure you don't inject multiple messages without resetting.

This is safer

[{"id":"4d9ef966df4f2c83","type":"trigger","z":"8964ba134d837e40","name":"","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"2","extend":false,"overrideDelay":false,"units":"s","reset":"reset","bytopic":"all","topic":"topic","outputs":1,"x":480,"y":420,"wires":[["59fec3c4ee08c090","09aab31e6cc795f9"]]},{"id":"59fec3c4ee08c090","type":"debug","z":"8964ba134d837e40","name":"debug 242","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":650,"y":420,"wires":[]},{"id":"b4d8ad15b1b6e7c8","type":"inject","z":"8964ba134d837e40","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Repeat Me","payloadType":"str","x":140,"y":420,"wires":[["6f60abcff3602b66"]]},{"id":"6f60abcff3602b66","type":"trigger","z":"8964ba134d837e40","name":"reset first","op1":"reset","op2":"","op1type":"str","op2type":"pay","duration":"250","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":300,"y":420,"wires":[["4d9ef966df4f2c83"]]},{"id":"1fe88636074727ed","type":"inject","z":"8964ba134d837e40","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"And Me","payloadType":"str","x":150,"y":460,"wires":[["6f60abcff3602b66"]]},{"id":"09aab31e6cc795f9","type":"junction","z":"8964ba134d837e40","x":480,"y":460,"wires":[["4d9ef966df4f2c83"]]}]

Thank you.
But that doesn't change the fact that, in my opinion, the current configuration doesn't meet the standards I expect from a good UX.

Fair enough.
It seems obvious that the trigger node setup like this will send "congratulations" every 10 seconds.

I wouldn't expect any different behaviour if the first message sent was 'nothing' rather than a string.
I have never actually had a need for the "resend" option.

Your opinion is as good as mine though.

I never knew it even existed :slight_smile:

PR raised to remove the repeat option when "nothing" is selected.

Are you sure this is what @OliverWieland was proposing?

I suspect that @OliverWieland was hoping to have a second message (equal to the first) sent at specified intervals after a wait time. This is not currently possible, but it seems like a reasonable use case and consistent with the intended use of the node.

If the repeat option were to increment msg.repeatcount, he could use a switch node to ignore the first iteration.

1 Like

It would make it more clear I guess. If you set it to 'nothing' it would repeat 'nothing'

Instead I would use something like:

Or add an option to the trigger node with some logic attached, if nothing selected then add option: resend last msg every... ?

Thank you all for your suggestions. I know there are a lot of possibilities to solve my problem.

However, the main reason for my post was the fact that the trigger node can currently be parameterized to do nothing, and that makes absolutely no sense from a user perspective.
If that's the intention, then it should at least be clearly mentioned in the documentation. However, it would be better to either remove these settings or change the behavior so that the setting makes sense.
Personally, I would lean towards the second option.

... however - I have chosen to implement the first. The PR removes the option to repeat sending nothing (which we all agree makes no sense).

Thank you. This makes the functionality more clear for the user, and that is exactly what I intended :slight_smile:

1 Like