Something weird is happening with `msg.delay` and `trigger` node

I have an inject node spitting out messages every 40 seconds.

I originally added a msg.delay to it, but a node into which the message went didn't pass on that, so I had to stick a change node after that to set msg.delay.
(And I also ticked the extend of message arrives option)

Downstream, I have some trigger nodes.
They were originally set to 120 seconds as the time.
But I decided to cheat having to edit all these nodes I set the override with msg.delay so all I have to do is adjust that property.

So, I (stupidly) set the msg.delay to 120 (Yeah, I know - now)

Suddenly I was getting a lot of alerts as the trigger nodes not getting a signal.

So I changed the value from 120 to 12000.

Still getting them.

Thoughts?

Post an example flow that exhibits the problem, that we can test.

Code:

[{"id":"a9d28571.a909d8","type":"inject","z":"c56bddee.ca0a18","name":"WAP scan *","props":[{"p":"payload"}],"repeat":"40","crontab":"","once":true,"onceDelay":"2","topic":"","payload":"1","payloadType":"num","x":180,"y":330,"wires":[["31e5b191.b8f056","f8a0810e.2d9378"]],"info":"Make sure `msg.delay` (set on second line) is a lot greater than the scan time."},{"id":"f8a0810e.2d9378","type":"pythonshell in","z":"c56bddee.ca0a18","name":"wifiscan","pyfile":"/home/pi/python_stuff/wifiscan.py","virtualenv":"","continuous":false,"stdInData":false,"x":550,"y":310,"wires":[["b1f4ee0993eb1635"]]},{"id":"b1f4ee0993eb1635","type":"change","z":"c56bddee.ca0a18","name":"delay (ms)","rules":[{"t":"set","p":"delay","pt":"msg","to":"120000","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":655,"y":310,"wires":[["7d11f7e2.8ab188","bed0b75b24a7d023","f63974b5bff323ba","89c86f65.2dd438"]],"l":false},{"id":"89c86f65.2dd438","type":"split","z":"c56bddee.ca0a18","name":"Spliter","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":170,"y":510,"wires":[["ec424f64.9e3fb","80326bb7.b1ebd"]]},{"id":"ec424f64.9e3fb","type":"switch","z":"c56bddee.ca0a18","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"Marys_Farm_2.4","vt":"str"},{"t":"cont","v":"PiNet","vt":"str"},{"t":"cont","v":"MusicPi","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":370,"y":510,"wires":[["a2ddf193.eb9b2","cbc7451e.882c48","6f85dabf.e8e8ec"],["b6d0e5a5.8c246","c4c40434.f4ab6"],["cf9bae6b.340e68","efb14f6c.1c6ba8"]]},{"id":"6f85dabf.e8e8ec","type":"change","z":"c56bddee.ca0a18","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":505,"y":420,"wires":[["e4d2eb6a.510b3","1bf0835ecc376fa6"]],"l":false},{"id":"1bf0835ecc376fa6","type":"trigger","z":"c56bddee.ca0a18","name":"Trigger (v)","op1":"true","op2":"false","op1type":"bool","op2type":"bool","duration":"60","extend":true,"overrideDelay":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":710,"y":390,"wires":[["72f00882.b6efc8","375a3741.743c4","babc12dd.24df7"]]}]

I have a python script running to get WAP names.
(You can bypass that)

There is a change node after that which sets the msg.delay. It is now set to 120000.
It fails if it is set to 12000.
The message is then sent down and split so each WAP name is a different line.
That is then sent through a switch node and another change node to set the payload.
Then it gets to the trigger node.

It keeps failing from what I can see.

The other trigger node (on the right) is also timing out.

Sorry it is a mess. I bypassed a couple of foreign nodes.
You will also have to edit the switch node (or actually probably remove it)
and the wifiscan node won't work as it runs a python script.

Add a debug node showing what is going to the trigger node. Set the debug node so output Complete Message. Post it here.

From the MAIN debug node shown in the scree shot.

Luckily shortly after posting things timed out.
(I dropped the value from 120000 to 12000 - the latter should be 120 seconds, yes?

{"delay":12000,"settings":{"input":"2022-03-02T10:18:12.624Z","input_format":"","input_tz":"Australia/Sydney","output_format":"YYYY-MM-DD HH:mm:ss","output_locale":"en_AU","output_tz":"Australia/Sydney"},"time":"2022-03-02 21:18:12","payload":"[\"Marys_Farm_2.4\"","parts":{"id":"991ad92bb887a62a","type":"string","ch":",","index":0,"count":15},"_msgid":"bc6b209b383a30f3"}

This is another example on a different machine doing the same thing.

[{"id":"77795cac0d658efe","type":"change","z":"0918ee609bf69fc7","name":"","rules":[{"t":"set","p":"delay","pt":"msg","to":"12000","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":3470,"y":140,"wires":[["a407ab20bbb005f3","d8b5834f552a5ea8"]]},{"id":"871d194d2d8dc437","type":"inject","z":"0918ee609bf69fc7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"40","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":3320,"y":190,"wires":[["d595285338d487f5","77795cac0d658efe"]]},{"id":"a407ab20bbb005f3","type":"trigger","z":"0918ee609bf69fc7","name":"","op1":"","op2":"FAIL","op1type":"nul","op2type":"str","duration":"250","extend":true,"overrideDelay":true,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":3670,"y":190,"wires":[["c4b2b9ae77efc369"]]},{"id":"d8b5834f552a5ea8","type":"debug","z":"0918ee609bf69fc7","name":"into trigger","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":3650,"y":90,"wires":[]},{"id":"d595285338d487f5","type":"trigger","z":"0918ee609bf69fc7","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"3","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":3310,"y":240,"wires":[[]]},{"id":"c4b2b9ae77efc369","type":"debug","z":"0918ee609bf69fc7","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":3660,"y":240,"wires":[]}]

You have set the delay to 12000 milliseconds . There are 1000 milliseconds in a second, so 12 seconds after the inject the trigger times out. What do you expect to happen?

1 Like

Yeah, I'm stupid.

Alas somehow I thought it was x100.... That's not milli, but more centi.

Sorry.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.