# Pausing timer in mytimeout

**URL:** <https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425>\
**Category:** General\
**Created:** [25 September 2018 05:41 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425 "2018-09-25T05:41:59Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![whatsupskip](https://avatars.discourse-cdn.com/v4/letter/w/5f9b8f/32.png) [@whatsupskip](https://discourse.nodered.org/u/whatsupskip)\
**Post date:** [25 September 2018 05:41 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/1 "2018-09-25T05:41:59Z")

</div>

Situation:  
Pool pump is only to run while sufficient power from solar panels.  
Pool pump needs only to run x hours per day.

mytimeout seems to be a solution to the second part, but I can't determine how to pause the countdown timer.

For example; sufficient power from solar panels triggers the pool pump on and starts the mytimeout.  
Cloud comes over, insufficient power triggers the pool pump off.  
If I use stop, off or 0 input to the mytimeout the time remaining is lost.

Suggestions?

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [25 September 2018 06:57 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/2 "2018-09-25T06:57:02Z")

</div>

I have found two things that might help you

1. [https://www.youtube.com/watch?v=mUSxM6KTN9s](https://www.youtube.com/watch?v=mUSxM6KTN9s)

Shows how to track accumulated/elapsed time quite easily

Also

1. Our very own Steve Rickus helping someone out on the old forums  
[https://groups.google.com/forum/#!topic/node-red/YjEldxFUU\_o](https://groups.google.com/forum/#!topic/node-red/YjEldxFUU_o)

Craig

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [25 September 2018 07:53 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/3 "2018-09-25T07:53:29Z")

</div>

It's a similar use case we discussed here:

> [@Cumulative running time](https://discourse.nodered.org/t/cumulative-running-time/3278):
>
> I am looking for suggestions on a node, or way to capture cumulative running time of equipment. For example: a machine runs for 2 hrs, then is down for 20 minutes, then starts again for 3 hrs, so the cumulative time is currently 5 hrs. I would also like to access this value at anytime say 5 hrs 4 minutes, 5 minutes, 6 minutes etc... thanks

---

<div class="post-metadata">

**Author:** ![whatsupskip](https://avatars.discourse-cdn.com/v4/letter/w/5f9b8f/32.png) [@whatsupskip](https://discourse.nodered.org/u/whatsupskip)\
**Post date:** [26 September 2018 05:41 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/4 "2018-09-26T05:41:25Z")

</div>

Thanks for you suggestions.

I now have it basically working. Poorly coded and still looking for bugs.

The key I found was to use "stop", and not "off". Then feed back the last value of countdown timer back into the mytimeout using the JSON code.

Using this type of method I am able to inject/add the daily required pump time to the previous day. This is particularly useful if the day or days before were over cast, then the pump will run long on the following day(s).

```auto
[{"id":"c182c0c.cdb5a4","type":"tab","label":"Pump Timer","disabled":false,"info":""},{"id":"e9b94257.58865","type":"mytimeout","z":"c182c0c.cdb5a4","name":"Count Down Timer","outtopic":"TimerCountDown","outsafe":"on","outwarning":"Warning","outunsafe":"off","warning":"5","timer":"10800","debug":false,"ndebug":false,"ignoreCase":true,"repeat":false,"again":false,"x":550,"y":180,"wires":[["d2444abc.57f1b8"],["963ceca.f2ca51"]]},{"id":"d2444abc.57f1b8","type":"debug","z":"c182c0c.cdb5a4","name":"On/Off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":770,"y":160,"wires":[]},{"id":"963ceca.f2ca51","type":"switch","z":"c182c0c.cdb5a4","name":"Filter","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":750,"y":220,"wires":[["b6cf2b14.dcc918"]]},{"id":"760ae9da.fff238","type":"function","z":"c182c0c.cdb5a4","name":"Create JSON","func":"var timeout = flow.get(\"TimeRemainPool\",msg.payload);\n\nvar value = msg.payload; //value will equal pool pump status\n\n if (value === true){\n msg.payload = {\"payload\": \"on\", timeout, \"warning\": 30}; \n return [msg];\n }\n \n else {\n msg.payload = \"stop\"; \n return [msg];\n }\n","outputs":1,"noerr":0,"x":330,"y":180,"wires":[["e9b94257.58865"]]},{"id":"8b8f80a5.f2879","type":"debug","z":"c182c0c.cdb5a4","name":"TimeRemainPool","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1170,"y":260,"wires":[]},{"id":"b6cf2b14.dcc918","type":"function","z":"c182c0c.cdb5a4","name":"Create flow TimeRemainPool","func":"flow.set(\"TimeRemainPool\",msg.payload);\nmsg.payload = ((msg.payload)/60).toFixed(2);\nreturn msg;\n","outputs":1,"noerr":0,"x":900,"y":280,"wires":[["8b8f80a5.f2879","a5df946b.3477c8"]]},{"id":"a5df946b.3477c8","type":"ui_text","z":"c182c0c.cdb5a4","group":"fad07ad1.a0beb8","order":0,"width":0,"height":0,"name":"Pool Time Remaining","label":"Pool Time Remaining:","format":"{{msg.payload}}","layout":"row-left","x":1180,"y":320,"wires":[]},{"id":"4c61adff.8827c4","type":"function","z":"c182c0c.cdb5a4","name":"Get PoolPump Status","func":"var value = global.get(\"PoolPumpStatus\",msg.payload);\nmsg = { payload:value };\nreturn msg;","outputs":1,"noerr":0,"x":200,"y":120,"wires":[["3265b32.337834c","80d36119.11cbf"]]},{"id":"3265b32.337834c","type":"rbe","z":"c182c0c.cdb5a4","name":"Change Only","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":430,"y":120,"wires":[["760ae9da.fff238"]]},{"id":"b8a16315.3875d","type":"inject","z":"c182c0c.cdb5a4","name":"Trigger","topic":"","payload":"","payloadType":"str","repeat":"10","crontab":"","once":true,"onceDelay":"1","x":100,"y":40,"wires":[["4c61adff.8827c4"]]},{"id":"80d36119.11cbf","type":"debug","z":"c182c0c.cdb5a4","name":"Pool Pump Status","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":460,"y":60,"wires":[]},{"id":"454e5daf.54af64","type":"inject","z":"c182c0c.cdb5a4","name":"Daily Pump Time Required","topic":"","payload":"10800","payloadType":"num","repeat":"","crontab":"01 00 * * *","once":false,"onceDelay":0.1,"x":300,"y":360,"wires":[["396af68c.11318a"]]},{"id":"396af68c.11318a","type":"function","z":"c182c0c.cdb5a4","name":"Update day's target","func":"PumpTimeRequired = msg.payload; //value will equal pool pump status\nvar TimeRemainPoolYest = flow.get(\"TimeRemainPool\",msg.payload);\nvar TimeRemainPoolStart = 0;\nTimeRemainPoolStart = TimeRemainPoolYest + PumpTimeRequired;\nflow.set(\"TimeRemainPoolStart\",TimeRemainPoolStart);\nmsg.payload = TimeRemainPoolYest + PumpTimeRequired;\n\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":360,"wires":[["b6cf2b14.dcc918"]]},{"id":"fad07ad1.a0beb8","type":"ui_group","z":"","name":"POOL CONTROLLER V1.1","tab":"aa7a6127.8d57f","order":1,"disp":true,"width":"6","collapse":false},{"id":"aa7a6127.8d57f","type":"ui_tab","z":"","name":"Pool Settings","icon":"dashboard","order":1}]

```

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [26 September 2018 14:01 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/5 "2018-09-26T14:01:08Z")

</div>

Take a look at: [how to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![whatsupskip](https://avatars.discourse-cdn.com/v4/letter/w/5f9b8f/32.png) [@whatsupskip](https://discourse.nodered.org/u/whatsupskip)\
**Post date:** [26 September 2018 21:59 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/6 "2018-09-26T21:59:54Z")

</div>

Thanks. Fixed.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [27 September 2018 01:26 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/7 "2018-09-27T01:26:29Z")

</div>

> [@whatsupskip](#):
>
> [{"id":"c182c0c.cdb5a4","type":"tab","label":"Pump Timer","disabled":false,"info":""},{"id":"e9b94257.58865","type":"mytimeout","z":"c182c0c.cdb5a4","name":"Count Down Timer","outtopic":"TimerCountDown","outsafe":"on","outwarning":"Warning","outunsafe":"off","warning":"5","timer":"10800","debug":false,"ndebug":false,"ignoreCase":true,"repeat":false,"again":false,"x":550,"y":180,"wires":[["d2444abc.57f1b8"],["963ceca.f2ca51"]]},{"id":"d2444abc.57f1b8","type":"debug","z":"c182c0c.cdb5a4","name":"On/Off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":770,"y":160,"wires":},{"id":"963ceca.f2ca51","type":"switch","z":"c182c0c.cdb5a4","name":"Filter","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":750,"y":220,"wires":[["b6cf2b14.dcc918"]]},{"id":"760ae9da.fff238","type":"function","z":"c182c0c.cdb5a4","name":"Create JSON","func":"var timeout = flow.get("TimeRemainPool",msg.payload);\n\nvar value = msg.payload; //value will equal pool pump status\n\n if (value === true){\n msg.payload = {"payload": "on", timeout, "warning": 30}; \n return [msg];\n }\n \n else {\n msg.payload = "stop"; \n return [msg];\n }\n","outputs":1,"noerr":0,"x":330,"y":180,"wires":[["e9b94257.58865"]]},{"id":"8b8f80a5.f2879","type":"debug","z":"c182c0c.cdb5a4","name":"TimeRemainPool","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1170,"y":260,"wires":},{"id":"b6cf2b14.dcc918","type":"function","z":"c182c0c.cdb5a4","name":"Create flow TimeRemainPool","func":"flow.set("TimeRemainPool",msg.payload);\nmsg.payload = ((msg.payload)/60).toFixed(2);\nreturn msg;\n","outputs":1,"noerr":0,"x":900,"y":280,"wires":[["8b8f80a5.f2879","a5df946b.3477c8"]]},{"id":"a5df946b.3477c8","type":"ui\_text","z":"c182c0c.cdb5a4","group":"fad07ad1.a0beb8","order":0,"width":0,"height":0,"name":"Pool Time Remaining","label":"Pool Time Remaining:","format":"{{msg.payload}}","layout":"row-left","x":1180,"y":320,"wires":},{"id":"4c61adff.8827c4","type":"function","z":"c182c0c.cdb5a4","name":"Get PoolPump Status","func":"var value = global.get("PoolPumpStatus",msg.payload);\nmsg = { payload:value };\nreturn msg;","outputs":1,"noerr":0,"x":200,"y":120,"wires":[["3265b32.337834c","80d36119.11cbf"]]},{"id":"3265b32.337834c","type":"rbe","z":"c182c0c.cdb5a4","name":"Change Only","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":430,"y":120,"wires":[["760ae9da.fff238"]]},{"id":"b8a16315.3875d","type":"inject","z":"c182c0c.cdb5a4","name":"Trigger","topic":"","payload":"","payloadType":"str","repeat":"10","crontab":"","once":true,"onceDelay":"1","x":100,"y":40,"wires":[["4c61adff.8827c4"]]},{"id":"80d36119.11cbf","type":"debug","z":"c182c0c.cdb5a4","name":"Pool Pump Status","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":460,"y":60,"wires":},{"id":"454e5daf.54af64","type":"inject","z":"c182c0c.cdb5a4","name":"Daily Pump Time Required","topic":"","payload":"10800","payloadType":"num","repeat":"","crontab":"01 01 \* \* \*","once":false,"onceDelay":0.1,"x":300,"y":360,"wires":[["396af68c.11318a"]]},{"id":"396af68c.11318a","type":"function","z":"c182c0c.cdb5a4","name":"Update day's target","func":"PumpTimeRequired = msg.payload; //value will equal pool pump status\nvar timeout = flow.get("TimeRemainPool",msg.payload);\nmsg.payload = timeout + PumpTimeRequired;\n\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":360,"wires":[["b6cf2b14.dcc918"]]},{"id":"fad07ad1.a0beb8","type":"ui\_group","z":"","name":"POOL CONTROLLER V1.1","tab":"aa7a6127.8d57f","order":1,"disp":true,"width":"6","collapse":false},{"id":"aa7a6127.8d57f","type":"ui\_tab","z":"","name":"Pool Settings","icon":"dashboard","order":1}]

If you actually put the back ticks on seperate lines (i.e. above and below the text you are adding) then it puts the code into a flat 1 liner box (for our flows anyway)

Craig

---

<div class="post-metadata">

**Author:** ![whatsupskip](https://avatars.discourse-cdn.com/v4/letter/w/5f9b8f/32.png) [@whatsupskip](https://discourse.nodered.org/u/whatsupskip)\
**Post date:** [27 September 2018 04:32 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/8 "2018-09-27T04:32:33Z")

</div>

Third time lucky.

```auto
[{"id":"c182c0c.cdb5a4","type":"tab","label":"Pump Timer","disabled":false,"info":""},{"id":"e9b94257.58865","type":"mytimeout","z":"c182c0c.cdb5a4","name":"Count Down Timer","outtopic":"TimerCountDown","outsafe":"on","outwarning":"Warning","outunsafe":"off","warning":"5","timer":"10800","debug":false,"ndebug":false,"ignoreCase":true,"repeat":false,"again":false,"x":550,"y":180,"wires":[["d2444abc.57f1b8"],["963ceca.f2ca51"]]},{"id":"d2444abc.57f1b8","type":"debug","z":"c182c0c.cdb5a4","name":"On/Off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":770,"y":160,"wires":[]},{"id":"963ceca.f2ca51","type":"switch","z":"c182c0c.cdb5a4","name":"Filter","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":750,"y":220,"wires":[["b6cf2b14.dcc918"]]},{"id":"760ae9da.fff238","type":"function","z":"c182c0c.cdb5a4","name":"Create JSON","func":"var timeout = flow.get(\"TimeRemainPool\",msg.payload);\n\nvar value = msg.payload; //value will equal pool pump status\n\n if (value === true){\n msg.payload = {\"payload\": \"on\", timeout, \"warning\": 30}; \n return [msg];\n }\n \n else {\n msg.payload = \"stop\"; \n return [msg];\n }\n","outputs":1,"noerr":0,"x":330,"y":180,"wires":[["e9b94257.58865"]]},{"id":"8b8f80a5.f2879","type":"debug","z":"c182c0c.cdb5a4","name":"TimeRemainPool","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1170,"y":260,"wires":[]},{"id":"b6cf2b14.dcc918","type":"function","z":"c182c0c.cdb5a4","name":"Create flow TimeRemainPool","func":"flow.set(\"TimeRemainPool\",msg.payload);\nmsg.payload = ((msg.payload)/60).toFixed(2);\nreturn msg;\n","outputs":1,"noerr":0,"x":900,"y":280,"wires":[["8b8f80a5.f2879","a5df946b.3477c8"]]},{"id":"a5df946b.3477c8","type":"ui_text","z":"c182c0c.cdb5a4","group":"fad07ad1.a0beb8","order":0,"width":0,"height":0,"name":"Pool Time Remaining","label":"Pool Time Remaining:","format":"{{msg.payload}}","layout":"row-left","x":1180,"y":320,"wires":[]},{"id":"4c61adff.8827c4","type":"function","z":"c182c0c.cdb5a4","name":"Get PoolPump Status","func":"var value = global.get(\"PoolPumpStatus\",msg.payload);\nmsg = { payload:value };\nreturn msg;","outputs":1,"noerr":0,"x":200,"y":120,"wires":[["3265b32.337834c","80d36119.11cbf"]]},{"id":"3265b32.337834c","type":"rbe","z":"c182c0c.cdb5a4","name":"Change Only","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":430,"y":120,"wires":[["760ae9da.fff238"]]},{"id":"b8a16315.3875d","type":"inject","z":"c182c0c.cdb5a4","name":"Trigger","topic":"","payload":"","payloadType":"str","repeat":"10","crontab":"","once":true,"onceDelay":"1","x":100,"y":40,"wires":[["4c61adff.8827c4"]]},{"id":"80d36119.11cbf","type":"debug","z":"c182c0c.cdb5a4","name":"Pool Pump Status","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":460,"y":60,"wires":[]},{"id":"454e5daf.54af64","type":"inject","z":"c182c0c.cdb5a4","name":"Daily Pump Time Required","topic":"","payload":"10800","payloadType":"num","repeat":"","crontab":"01 00 * * *","once":false,"onceDelay":0.1,"x":300,"y":360,"wires":[["396af68c.11318a"]]},{"id":"396af68c.11318a","type":"function","z":"c182c0c.cdb5a4","name":"Update day's target","func":"PumpTimeRequired = msg.payload; //value will equal pool pump status\nvar TimeRemainPoolYest = flow.get(\"TimeRemainPool\",msg.payload);\nvar TimeRemainPoolStart = 0;\nTimeRemainPoolStart = TimeRemainPoolYest + PumpTimeRequired;\nflow.set(\"TimeRemainPoolStart\",TimeRemainPoolStart);\nmsg.payload = TimeRemainPoolYest + PumpTimeRequired;\n\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":360,"wires":[["b6cf2b14.dcc918"]]},{"id":"fad07ad1.a0beb8","type":"ui_group","z":"","name":"POOL CONTROLLER V1.1","tab":"aa7a6127.8d57f","order":1,"disp":true,"width":"6","collapse":false},{"id":"aa7a6127.8d57f","type":"ui_tab","z":"","name":"Pool Settings","icon":"dashboard","order":1}]

```

---

<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:** [27 September 2018 09:54 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/9 "2018-09-27T09:54:56Z")

</div>

In your first function node you have:

```auto
var value = global.get("PoolPumpStatus",msg.payload);
msg = { payload:value };
return msg;

```

The first line says you are getting `PoolPumpStatus` but I don't see you set it anywhere in the flow...

---

<div class="post-metadata">

**Author:** ![whatsupskip](https://avatars.discourse-cdn.com/v4/letter/w/5f9b8f/32.png) [@whatsupskip](https://discourse.nodered.org/u/whatsupskip)\
**Post date:** [27 September 2018 10:41 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/10 "2018-09-27T10:41:19Z")

</div>

PoolPumpStatus comes from another flow I am running. It comes from a TP-Link HS100 smart switch and is a boolean (true/false).

At the moment I am using the node-red-contrib-hs100, however there is now a better option in node-red-contrib-tplink-iot. The main improvement is in the handling of power events. With the node-red-contrib-hs100 I seem to need to continuously pole the switch to find out its condition.

I didn't want to include all the other code at the moment as I think it would be too confusing. I still haven't finished the code around the mytimeout. At the moment it is just producing some outputs and not switching the pool pump off when the timer runs out.

---

<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:** [27 September 2018 13:01 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/11 "2018-09-27T13:01:01Z")

</div>

> [@whatsupskip](#):
>
> PoolPumpStatus comes from another flow I am running. It comes from a TP-Link HS100 smart switch and is a boolean (true/false).

Do you mean another flow in the same tab or another flow in a different tab?  
If it is a flow on another tab, it will come back as "undefined"

So in your settings.js you have defined

```auto
	default: {
          module: "msg.payload"
	},

```

???

---

<div class="post-metadata">

**Author:** ![whatsupskip](https://avatars.discourse-cdn.com/v4/letter/w/5f9b8f/32.png) [@whatsupskip](https://discourse.nodered.org/u/whatsupskip)\
**Post date:** [28 September 2018 05:07 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/12 "2018-09-28T05:07:01Z")

</div>

The command is "global.get("PoolPumpStatus",msg.payload)", which as far as I know should take a value from any active tab. In this case it does.

---

<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 September 2018 08:49 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/13 "2018-09-28T08:49:35Z")

</div>

the reason I was bringing it up is the 'get' should just be coded `global.get("PoolPumpStatus")` unless you are being crafty.

in v0.19.0 with persistent context, the second option in the get - i.e. global.get(value1, value2) - is the 'key' name of the value to be retrieved. In your usage `global.get("PoolPumpStatus",msg.payload)`, the content of msg.payload should be the link to the storage type of `"PoolPumpStatus"` where the value will be gotten from.

Also, the first time you use the get, an warning will come up indicating that the store location is unknown. The warning will only show up once to avoid flooding the log.

So I suggest that unless you aren't being clever and using msg.payload to name the storage location, you change your  
`var value = global.get("PoolPumpStatus",msg.payload);`  
to  
`var value = global.get("PoolPumpStatus");`

---

<div class="post-metadata">

**Author:** ![whatsupskip](https://avatars.discourse-cdn.com/v4/letter/w/5f9b8f/32.png) [@whatsupskip](https://discourse.nodered.org/u/whatsupskip)\
**Post date:** [3 October 2018 04:39 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/14 "2018-10-03T04:39:05Z")

</div>

Thanks for this.

No I don't know enough to be clever. I clearly just picked up a bad bit of coding and continued to use it.

---

<div class="post-metadata">

**Author:** ![TrisWood](https://avatars.discourse-cdn.com/v4/letter/t/ea666f/32.png) [@TrisWood](https://discourse.nodered.org/u/TrisWood)\
**Post date:** [17 May 2019 17:43 UTC](https://discourse.nodered.org/t/pausing-timer-in-mytimeout/3425/15 "2019-05-17T17:43:45Z")

</div>

Hi... when I do something like this its going to continue advancing with millis rather than pause or stop with the button push. I have seen other stop watch examples that do this but they do not display the time in real time Im trying to have the time print in real time and when the button is pushed it would either freeze or print time at the button push.

[pcb manufacturing and assembly](https://www.7pcb.com/PCB-Manufacturing-Assembly.php)
