# Visualizing Countdown

**URL:** https://discourse.nodered.org/t/visualizing-countdown/85026
**Category:** Dashboard
**Created:** [29 January 2024 19:25 UTC](https://discourse.nodered.org/t/visualizing-countdown/85026 "2024-01-29T19:25:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Berx](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Berx](https://discourse.nodered.org/u/Berx)
#### Post date: [29 January 2024 19:25 UTC](https://discourse.nodered.org/t/visualizing-countdown/85026/1 "2024-01-29T19:25:45Z")

</div>

Hi,

... after an event, I would like to visualize preset time in a countdown graphicon my dashboard.. So far I have a function node, which is node triggered by an injector repeating number ''1' every 200 milliseconds just for testing what it looks like and it seems to work fine - here the code within the function node:

if (context.get('count') === undefined)  
{  
context.set('count', 14);  
}

context.set('count', context.get('count') -0.5);

msg.payload = context.get('count');

if (context.get('count') === 0)  
{  
context.set('count', 14);  
}

[//msg.payload.toFixed](https://msg.payload.toFixed)(1);

return msg;

I used a the following gauge to show the ongoing countdown:

![cntdown](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/e/ce2ff7a935147bb7f7772906c3657ae2f87b95ba.png)

How can I get the remaining seconds to appear in the center and does anyone have any sugestions how to make a nice countdown display?

Any help/suggestinos are much appreciated, thanks.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [29 January 2024 20:28 UTC](https://discourse.nodered.org/t/visualizing-countdown/85026/2 "2024-01-29T20:28:56Z")

</div>

Take a look at this flow I’m still using

> [@Coffee Pot Timer](https://discourse.nodered.org/t/coffee-pot-timer/4743):
>
> platform: PiZero W also running MQTT SonOff S20 switch running ESPeasy mega-20181025 NR: v0.19.4 Node.js: v8.12.0 dashboard: v2.10.1 Extra node(s): node-red-dashboard node-red-contrib-mytimeout node-red-contrib-alexa-local (optional) Goal: Shut off a coffee pot 20 minutes after it is turned on and allow it to be turned on/off remotely or by voice (Alexa) The story: I make coffee for myself and sometimes (ok, enough times to make me come up with this solution) I forget to shut off the po…

This might fit your needs

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [28 February 2024 20:29 UTC](https://discourse.nodered.org/t/visualizing-countdown/85026/3 "2024-02-28T20:29:34Z")

</div>

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