![]() ![]() This helps to ensure than anything else that needs to initialize before the stoptimer triggers, has a chance to initialize, it also helps so that if you happen to have a lot of timers, they don't all trigger at once and flood unsuspecting nodes/devices. Special Case If on restart or re-Deploy, there is less than 3 seconds remaining on the stoptimer (or if the stoptimer should have elapsed already) then the stoptimer is set to a random amount between 3 and 8 seconds.If you had a 10 minute stoptimer running, with 6 minutes elapsed (ie: 4 minutes left) and you stopped Node-RED for 2 minutes and then restarted it, normally the stoptimer would no longer be running, but if you have this feature enabled, the timer will continue running from the 8 minute mark (6 minutes from the original run + 2 minutes of Node-RED downtime) - counting down 2 more minutes and then trigger.If you had a 10 minute stoptimer running, with 6 minutes elapsed (ie: 4 minutes left) and you hit Deploy, normally the stoptimer would no longer be running, but if you have this feature enabled, the timer will continue running from the 6 minute mark (ie: counting down 4 more minutes and then trigger).What does that mean? A couple of examples will help here. ![]() If you ENABLE it (check the checkbox) then if the stoptimer is running and you re-Deploy the flow, or restart Node-RED, then the timer will automatically restart itself where it should be. For the purposes of the node status and output 3, except in theĬase where Reporting is set to None, the milliseconds are not displayed or provided on the 3rd output as it wouldn't make sense based on the available While you can set Milliseconds, I would not rely on the accuracy for anything critical. In the case of an unknown string, a warning message will appear in the Debug logs. ![]() In the absense of a 'msg.units', or an unknown string in msg.units the units configured within the node will be used. If the input contains 'msg.units', with a value of "Milliseconds", "Seconds", "Minutes" or "Hours" then that will over-ride what is defaulted in the node. If the value of 'msg.delay' is less than 0, then 0 is used. In the absense of a 'msg.delay', or a value in 'msg.delay' that can not be converted to an int, the value configured within the node will be used. If the input contains msg.delay, then the delay will be 'msg.delay' units of time, where the units are whatever the units are defaulted to in the node iteself. Overriding the node via incoming messages The default is hh:mm:ss (string), but it can be configured to present that as the total number of reamining seconds or minutes or hours (number). The format of the 3rd output reporting (and status) are defined by the "Reporting Format" option. (for example: 2.5 minutes will decrement to 2 minutes, then 1 minute, then every second down to zero) In that case, the first update will be for the partial minute, after which it will operate as noted above. The exception to this rule is if your duration is not a minute increment.At the 1 minute point, it will switch to reporting every second. While there is more than 1 minute remaining, the timer will decrement every minute.The status below the node as well as the third output can be configured to update at a frequency of: The third output will send the time remaining as time ticks away. If the timer is stopped, the second and third output will automatically send a payload of 'stopped'. The second output allows you to send an additional payload of a number, string or boolean when the timer completes. If a new msg is received before the timer has ended, it will replace the existing msg and the timer will be restarted, unless the new msg has a payload of 'stop' or 'STOP', in which case it will stop the timer. Sends the received msg through the first output after the set timer duration. Npm install node-red-contrib-stoptimer-varidelay General usage It can be configured to be persistent across reboot/restarts/redeploys. It also allows the node to stop the output. This node allows for pre-configured, or dynamic delay. Node-red-contrib-stoptimer-varidelay 0.5.3 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |