Stop and reset countdown clock instead of restart

Dear,

I have installed an emergency close system with a 10 minute interval with option to stop / reset.
For visual / dashboard inspection, i have setup a "donut shaped" gauge countdown.

Problem:
Clicking ABORT will stop the (separated) process, but only resets the dashboard countdown, not stopping it.
How to stop / reset it?

Maybe i have overlooked, or you have other solutions. I have indeed set it up that the actual emergency close is working side by side with the countdown clock. The countdown clock is just for visual inspection.

Thank you.

COUNTDOWN.json (9.5 KB)

Hi @Observatory_Gromme

Suggestion:

brake the part/s down that are REALLY needed and make a test flow.

Try to NOT use DASHBOARD nodes - I'll get to that later.

Then with inject nodes for input and debug nodes for output make a small version of what you want to do.

Why you shouldn't use DASHBOARD nodes?
Well, they are nice, but if they aren't CRUCIAL to the workings: they are mere decorations to the problem, and don't really make any difference.

You have two MQTT nodes in that flow
That too is a problem.
I don't have access to your MQTT messages.
Don't include them. They don't help.

delete the two MQTT nodes, the gauge and button node.
Replace the button with an inject (and configure it to send what is sent by the button node.
Replace the gauge node with a debug and repost the flow.
There is another light green node I see on the right I can see just after (to the right of the function node.) Again: Unless crucial to the flow's working: Don't include it.

1 Like

Dear,

The part that is really needed, is actually working. For a year or so now.
Just for my information i would like to have that countdown clock couting down ( also works )
but when i press abort, the clock just resets and start counting down again.

That i want to happen.

The error closing goes behind dashboard and is not dashboard related. I will input debug messages this evening. I will let you know.

Ok, good to hear.

But as I didn't download/import the flow I don't know what nodes are used.

why not just name the node you are using as the countdown timer?

1 Like

If you send
{ "payload": "cancel", "timeout": 0 }
to the node, it will stop the timer but will set the counter to -1 (I think it should be 0).

If you want the counter to go to 0 you have a couple options:

  1. open an issue at the node's GitHub issues and ask the author to make the change (explaining what you think it should be)
  2. edit the code yourself (.node-red/node_module/node-red-contrib-mytimeout/mytimeout.js) and change all the -1's to 0 (there are 9 locations. Note: if you update the node, you. will have to make the changes again)
  3. Do it the way I got around it in my Coffee Pot Timer project. What I did was to add a text node and send the time to text node and overlayed that over the mytimeout display

Sep-21-2023 11-06-20

1 Like

Well thank you!

If you send
{ "payload": "cancel", "timeout": 0 }

That did the trick! Agree, timer stops then at -1, but i can live with that :).

Dang I missed all the fun! I think this is my mytimeout (I'm the author). I have a pause in the works but I haven't had time to post it (or fully test it). It's in one of my branches (pause 3.2.3 I think). At the moment I'm in the middle of moving my elderly Mom and my system crashed when upgrading to Bookworm. It's recoverable I need a new part.

1 Like

I shared this with Paul (Zenofmud):

On the subject of -1, not sure that's the correct change. I do think there is one other change that would work but I need to look at the code. I think stop could return 0 but cancel would continue to return -1. Let me alsos ee what over value I return. It's actually the testing part that makes this so complicated. I'll look at the code when I get the new part this weekend. Good news on my part, I used Github properly and all the changes are there so if the system is a loss I have lost the work.

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