hamsando / node-red-contrib-stoptimer-varidelay

Apache License 2.0
7 stars 2 forks source link

Expired #16

Closed Fyril closed 1 year ago

Fyril commented 1 year ago

I have a 5min timer going. But every time when there is 2-3 sec left of the timer, it just sais expired, instead of triggering output and continue the logic.

Why do I get the expired status?

hamsando commented 1 year ago

Hmm - I'm not sure. I have probably 50-60 of these timers running and haven't seen that (and haven't had it reported before either). I'm going to need more detail:

  1. What version of NodeRed?
  2. What version of the timer?
  3. Are you setting the timer details dynamically (ie: via a message) or statically (ie: in the node configuration itself)?
  4. What are the settings you've defined for the timer node?
  5. Do you have other instances of the timer in other flows that are working correctly?
  6. Is the flow of the problem node simple enough to share?
  7. If you stick a debug node on the 3rd output (bottom), does it stop at 2 seconds?
  8. If you stick a debug node on the 2nd output (middle), does it send a message?
Fyril commented 1 year ago

Hi again Hamsando.

After investigating more I found out my issue.

My issue is that I have two timers in series. So in the chain, the one timer starts the second timer. And I see that when both timers have been stopped, then if the chain is started again (while both timers are in "stopped" status), the first timer starts counting down, but for some reason the 2nd timer will not start if the signal comes from the 1st timer.

In the attached picture I have set up a test loop. If you start one timer, then timer 1 will count down, activate timer 5, it will count down and start timer 1 in a loop.. All is good. If you stop the loop both timers stop. If you now start one of the timers, it will count down but the next timer will not start. Its stuck at "stopped". But you can manually start it with the timer. And then because the other timer is then in "expired" status, it will start again, and the loop is functioning again.

And I dont understand why the timer refuse to start from stopped status if the signal comes from a different timer, but from any other source, the timer will start again.

Skjermbilde

hamsando commented 1 year ago

This can be solved by enabling the "ignore incoming _timerpass" setting within the timer nodes. You can read about what it is and why it exists here: https://github.com/hamsando/node-red-contrib-stoptimer-varidelay#_timerpass

Fyril commented 1 year ago

This can be solved by enabling the "ignore incoming _timerpass" setting within the timer nodes. You can read about what it is and why it exists here: https://github.com/hamsando/node-red-contrib-stoptimer-varidelay#_timerpass

Ohh jeez.. Yeah it sais it there addressing my exact problem..
Sorry mate. Thank you for your help :D