# Countdown timer, im missing a reset function

**URL:** <https://discourse.nodered.org/t/countdown-timer-im-missing-a-reset-function/55798>\
**Category:** General\
**Created:** [28 December 2021 16:13 UTC](https://discourse.nodered.org/t/countdown-timer-im-missing-a-reset-function/55798 "2021-12-28T16:13:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![syma33](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/syma33/32/30665_2.png) [@syma33](https://discourse.nodered.org/u/syma33)\
**Post date:** [28 December 2021 16:13 UTC](https://discourse.nodered.org/t/countdown-timer-im-missing-a-reset-function/55798/1 "2021-12-28T16:13:56Z")

</div>

this works but with flaws.. the goal is to set countdowntimer and have a resetbutton combined with the force button. (while forcing is set, timer will be set to reset) However, in this i tried but here isnt any way to stop the timer or set a new value to 0 to force timer to end.

How should you have done? build a function?

> **Summary**
>
> ```auto
> [
> {
> "id": "36b3d6632c413afb",
> "type": "tab",
> "label": "Flow 2",
> "disabled": false,
> "info": "",
> "env": []
> },
> {
> "id": "3ded2428931db138",
> "type": "Tasmota Switch",
> "z": "36b3d6632c413afb",
> "broker": "e2ab6a5a844ef0f2",
> "device": "TAS_motorv",
> "name": "Heater",
> "outputs": 1,
> "uidisabler": false,
> "fullTopic": "",
> "cmndPrefix": "",
> "statPrefix": "",
> "telePrefix": "",
> "qos": 1,
> "retain": false,
> "x": 370,
> "y": 240,
> "wires": [
> [
> "af619c4cc5014b86"
> ]
> ]
> },
> {
> "id": "7d01ede34d141d6c",
> "type": "ui_button",
> "z": "36b3d6632c413afb",
> "name": "",
> "group": "c24e4a9c.e31a68",
> "order": 0,
> "width": 0,
> "height": 0,
> "passthru": false,
> "label": "pushbutton, start heater 30min",
> "tooltip": "obs",
> "color": "",
> "bgcolor": "",
> "className": "",
> "icon": "",
> "payload": "",
> "payloadType": "str",
> "topic": "topic",
> "topicType": "msg",
> "x": 170,
> "y": 120,
> "wires": [
> [
> "f32dc433fd419a39"
> ]
> ]
> },
> {
> "id": "b59d7a4040054842",
> "type": "debug",
> "z": "36b3d6632c413afb",
> "name": "",
> "active": false,
> "tosidebar": true,
> "console": false,
> "tostatus": false,
> "complete": "false",
> "statusVal": "",
> "statusType": "auto",
> "x": 650,
> "y": 80,
> "wires": []
> },
> {
> "id": "4a445d20cccddd8f",
> "type": "ui_text",
> "z": "36b3d6632c413afb",
> "group": "c24e4a9c.e31a68",
> "order": 1,
> "width": 0,
> "height": 0,
> "name": "",
> "label": "Minutes left:",
> "format": "{{msg.payload}}",
> "layout": "col-center",
> "className": "",
> "x": 650,
> "y": 120,
> "wires": []
> },
> {
> "id": "f32dc433fd419a39",
> "type": "countdown",
> "z": "36b3d6632c413afb",
> "name": "",
> "topic": "",
> "payloadTimerStart": "true",
> "payloadTimerStartType": "bool",
> "payloadTimerStop": "false",
> "payloadTimerStopType": "bool",
> "timer": "30",
> "resetWhileRunning": false,
> "setTimeToNewWhileRunning": true,
> "startCountdownOnControlMessage": false,
> "minuteCounter": true,
> "x": 390,
> "y": 120,
> "wires": [
> [
> "3ded2428931db138"
> ],
> [
> "b59d7a4040054842",
> "4a445d20cccddd8f"
> ]
> ]
> },
> {
> "id": "686f35754394e116",
> "type": "ui_switch",
> "z": "36b3d6632c413afb",
> "name": "",
> "label": "Force start/ stopp",
> "tooltip": "ICE - just dont..",
> "group": "c24e4a9c.e31a68",
> "order": 2,
> "width": 0,
> "height": 0,
> "passthru": true,
> "decouple": "false",
> "topic": "topic",
> "topicType": "msg",
> "style": "",
> "onvalue": "true",
> "onvalueType": "bool",
> "onicon": "",
> "oncolor": "",
> "offvalue": "false",
> "offvalueType": "bool",
> "officon": "",
> "offcolor": "",
> "animate": false,
> "className": "",
> "x": 150,
> "y": 240,
> "wires": [
> [
> "3ded2428931db138"
> ]
> ]
> },
> {
> "id": "af619c4cc5014b86",
> "type": "ui_text",
> "z": "36b3d6632c413afb",
> "group": "c24e4a9c.e31a68",
> "order": 3,
> "width": 0,
> "height": 0,
> "name": "",
> "label": "True: running, False: not running",
> "format": "{{msg.payload}}",
> "layout": "col-center",
> "className": "",
> "x": 660,
> "y": 240,
> "wires": []
> },
> {
> "id": "e2ab6a5a844ef0f2",
> "type": "tasmota-mqtt-broker",
> "name": "",
> "broker": "192.168.1.211",
> "port": "1883",
> "clientid": "",
> "usetls": false,
> "keepalive": "60",
> "cleansession": true
> },
> {
> "id": "c24e4a9c.e31a68",
> "type": "ui_group",
> "name": "heater",
> "tab": "6310834e.f9ff6c",
> "order": 1,
> "disp": true,
> "width": "6",
> "collapse": false,
> "className": ""
> },
> {
> "id": "6310834e.f9ff6c",
> "type": "ui_tab",
> "name": "IOT - heater",
> "icon": "dashboard",
> "disabled": false,
> "hidden": false
> }
> ]
> 
> ```

---

<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:** [28 December 2021 21:46 UTC](https://discourse.nodered.org/t/countdown-timer-im-missing-a-reset-function/55798/2 "2021-12-28T21:46:15Z")

</div>

Acording to the 'Help' tab on the node:

> ### [Input](http://localhost:1880/#)
> 
> #### Starting the timer
> 
> payload
> 
> any `msg.payload` that does not stop the timer or reload the timer starts the timer.
> 
> #### Stopping the timer
> 
> payload boolean | number
> 
> if `false` or `0` : Immediately stops the timer.

It doesn't look like the 'Force start/ stopp' button is connected to the countdown node....

---

<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:** [26 February 2022 21:46 UTC](https://discourse.nodered.org/t/countdown-timer-im-missing-a-reset-function/55798/3 "2022-02-26T21:46:18Z")

</div>

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