Bug Report - Random Delay Does Not Respond to "Seconds"

Hello, I am using Node-Red in Home Assistant and I have serval uses of the Random Delay node. The ones I have set to between limits in minutes work fine. But if I set the limit to occur between seconds, it still defaults to minutes.

NR Bug 1
NR Bug 2

Are you sure you have not got between 10 and 600 seconds (or something similar)? Unfortunately if you manually enter 600 and will show as 60 or 00. Click in the box and arrow left and right to check what you have.
If it isn't that then what version of node-red are you running (you can check by looking at the bottom of the dropdown menu)?.

Those inputs do look a little small. We've made them a bit bigger for the 1.3.4 release.

But not been able to reproduce any issues around the different units.

Hello @Colin @knolleary ... I am very sorry for my delay in responding, but work has been hell.
@Colin Thank you for the replay, Nope, fortunately I have learned that little trick on a previous adventure. I can definitely confirm that ii is not a matter of hidden characters, but thank you very much for the thought! :slight_smile:

@knolleary Thank you for the reply as well. And for making the adjustment. I am pretty sure that I am not screwing anything up (I think...), and of course this could be an issue triggered by either my Raspberry Pi4 or HASS. But the steps that I use to reproduce this issue are as follows:

  1. Add the delay to a flow.
  2. Set the delay between 10 and 60 minutes. Deploy and run the flow using the "Inject" node.
  3. All works as expected.
  4. Re-open the delay node and change the time unit to seconds.
  5. Re-deploy, and trigger when the deployment is finished.
  6. Unit displayed will show the "s" indicating seconds, but if you add up the seconds, they are still calculating to minutes. In my pic above, 525.07s (= 8 minutes, 25.07 seconds). If I wait and watch the delay, sure enough it will wait 8 minutes and 25 seconds to continue, even though my selection reads between 10 and 60 seconds only. And come to think of it, it is not even between the original selection of 10 and 60 minutes... Maybe something in a previous node to this one is passing a payload that impacts the delay node... is that possible? Thanks!

I think we need some information on your environment.

What harware/OS are you running node-red on please?

Stop node red and then restart it in a terminal and paste the startup log here. Copy/paste rather than screenshot if possible please. That may show us something relevant. When you paste it use the </> button and paste it in, that makes sure the forum does not mess up the formatting.

Hello!

Raspberry Pi 4
16g ram
Home Assistant OS 5.13
128g micro SD

@EMC and the startup log....

@EMC you had not mentioned that you are using HA. I don't know how you see the startup log in HA, you may have to ask on an HA forum if you don't know.

Are you absolutely certain that you are not accidentally sending the node a message setting up the delay value? If you have not already tried it then try it with this flow.

[{"id":"50d51930.cd90f","type":"inject","z":"84405ff5.25fa6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":1440,"wires":[["849f2f54.6494a8","4b3bae41.273cc"]]},{"id":"4b3bae41.273cc","type":"delay","z":"84405ff5.25fa6","name":"Random delay","pauseType":"random","timeout":"12","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"10","randomLast":"60","randomUnits":"minutes","drop":false,"x":320,"y":1440,"wires":[["849f2f54.6494a8"]]},{"id":"849f2f54.6494a8","type":"debug","z":"84405ff5.25fa6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":410,"y":1380,"wires":[]}]

Hi Colin,

I never say never - It very well could be something that I did! :slight_smile: Problem is, I can't see what I could have screwed up very easily. That is why I asked about something in the payload possibly overriding the time set in the delay. It just that when I select minutes, it works, and when I just reset the same delay to seconds, then it stays at minutes. I think (hesitantly!) that if it was a payload issue... wouldn't it also affect the delay set to minutes?

Hey EMC - sorry to jump in late on this one - how are you using HA - in the docker container version with the Supervisor and their own OS ?

If so then NR will be running in a seperate container on the system. If that is the case can i suggest to you that you install Portainer (also available through HACS) and you will then be able to see what containers are running and to connect to their consoles for debugging/troubleshooting etc

Craig

No worries Craig and it sounds like a great plan. And yes to the HA OS/Supervisor/Docker question.

I’ll go ahead and proceed with Portainer and see what I get! Thank you both very much!

Try it with the flow I posted. If that shows the same problem then it is something going on with node. If it doesn't then it is something to do with your flow interacting with the node.

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