# Info about Eztimer

**URL:** <https://discourse.nodered.org/t/info-about-eztimer/28434>\
**Category:** General\
**Created:** [16 June 2020 21:13 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434 "2020-06-16T21:13:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Knot83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knot83/32/24260_2.png) [@Knot83](https://discourse.nodered.org/u/Knot83)\
**Post date:** [16 June 2020 21:13 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/1 "2020-06-16T21:13:34Z")

</div>

I've a simple flow where I'm using Eztimer ([https://flows.nodered.org/node/node-red-contrib-eztimer](https://flows.nodered.org/node/node-red-contrib-eztimer)).  
It basically provides an on/off message every day of the week. The 'on' msg.payload at 07.30am and the 'off' message at 07.32am.  
It can happen that for some reasons I've to temporarily suspend the 'on' payload only for a certain day and then reactivate it as per the original schedule on the next day. I've seen in the documentation that there're some options to send 'cancel' or 'on' and 'off' to the input of the Eztimer node but although I made some test, I'm still unable to get the correct result.

Can someone help me to solve this problem?  
Thanks

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 June 2020 21:20 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/2 "2020-06-16T21:20:53Z")

</div>

> [@Knot83](#):
>
> I've seen in the documentation that there're some options to send 'cancel' or 'on' and 'off' to the input

**My** take on the docs:

You send an `on` and it turns on.  
`off` turns it off.

But `cancel` only works if then `on` has been sent and you want to cancel that output.  
From the docs:

> Cancels the current run (if any) of the timer ( _without_ emitting an `off` event).

Which means an `on` has been sent and you want it to go `off` before the real time.

How about you post the flow (code) and people can look at it better?

---

<div class="post-metadata">

**Author:** ![Knot83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knot83/32/24260_2.png) [@Knot83](https://discourse.nodered.org/u/Knot83)\
**Post date:** [16 June 2020 21:29 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/3 "2020-06-16T21:29:40Z")

</div>

I'm still not understanding how cancel works. I'd prevent to send the 'on' at all. I mean supposing tomorrow morning I don't want Eztimer to send the 'on' event at 07.30, I'd send it a message for example at 07.28 in order to avoid it will send that 'on' event. But the day after it should again trigger the scheduled on and off normally.

This is my simple flow:

```auto
[{"id":"549011fe.913e","type":"eztimer","z":"b0466595.da9a28","name":"Abbassa tapparella salone","debug":false,"autoname":"07:30:00 - 07:32:00","tag":"eztimer","suspended":false,"sendEventsOnSuspend":false,"lat":"45.06562","lon":"7.6266","timerType":"1","startupMessage":true,"ontype":"2","ontimesun":"dawn","ontimetod":"07:30:00","onpropertytype":"msg","onproperty":"payload","onvaluetype":"str","onvalue":"ON","onoffset":0,"onrandomoffset":0,"onsuppressrepeats":false,"offtype":"2","offtimesun":"dusk","offtimetod":"07:32:00","offduration":"00:01:00","offpropertytype":"msg","offproperty":"payload","offvaluetype":"str","offvalue":"OFF","offoffset":0,"offrandomoffset":0,"offsuppressrepeats":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":500,"y":200,"wires":[["be374167.10607"]],"info":"Abbassa Tapparella"}]

```

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 June 2020 23:22 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/4 "2020-06-16T23:22:07Z")

</div>

Yeah, interesting.

Reading the docs again I find this bit ....... _interesting_:

> Cancels the current run (if any) of the timer ( _without_ emitting an `off` event).

Particularly the (_without_ emitting an `off` event).

If it is cancelling the current _run_ and it is **not** emitting an `off` event..... what exactly is it doing?

Maybe go to the github page and ask the person who wrote the node.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 June 2020 23:31 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/5 "2020-06-16T23:31:18Z")

</div>

So back to your question about how to "disable" the output for one day.

As I read it you want to _skip_ the next `ON` event, then go back to normal.

If so, here is a small bit of code/flow that does what you want.

```auto
[{"id":"152fbddb.4484da","type":"eztimer","z":"b9924a74.4d98f8","name":"Abbassa tapparella salone","debug":false,"autoname":"07:30:00 - 07:32:00","tag":"eztimer","suspended":false,"sendEventsOnSuspend":false,"lat":"45.06562","lon":"7.6266","timerType":"1","startupMessage":true,"ontype":"2","ontimesun":"dawn","ontimetod":"07:30:00","onpropertytype":"msg","onproperty":"payload","onvaluetype":"str","onvalue":"ON","onoffset":0,"onrandomoffset":0,"onsuppressrepeats":false,"offtype":"2","offtimesun":"dusk","offtimetod":"07:32:00","offduration":"00:01:00","offpropertytype":"msg","offproperty":"payload","offvaluetype":"str","offvalue":"OFF","offoffset":0,"offrandomoffset":0,"offsuppressrepeats":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":210,"y":2110,"wires":[["e09d7c3b.d296c"]],"info":"Abbassa Tapparella"},{"id":"e09d7c3b.d296c","type":"function","z":"b9924a74.4d98f8","name":"Skip","func":"let s = context.get(\"Skip\") || 0;\nif (msg.payload == \"Skip one\")\n{\n context.set(\"SKIP\",1);\n return;\n}\nif (msg.payload == \"ON\")\n{\n if (s == 1)\n {\n context.set(\"SKIP\",0);\n return;\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":2110,"wires":[["4d784638.133888"]]},{"id":"f1abf273.25a62","type":"inject","z":"b9924a74.4d98f8","name":"","topic":"","payload":"Skip one","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":270,"y":1990,"wires":[["e09d7c3b.d296c"]]},{"id":"4d784638.133888","type":"debug","z":"b9924a74.4d98f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":600,"y":2110,"wires":[]}]

```

The `inject` node can be what ever you want. So long as it sends "Skip one" as the payload.  
If you understand that easily, you can change it to what ever you want - so long as it isn't `ON` or `OFF`, of course.

The `debug` is there only to show you what is/not happening at the next node.

If you want help with what the `function` node is doing ask and I will try to explain.

---

<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:** [17 June 2020 00:16 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/6 "2020-06-17T00:16:50Z")

</div>

Instead of Easy timer - use Neil Cherry @ncherry Schedex - ```  
node-red-contrib-schedex

It will allow you to suspend from the commandline and then re-enable (again from the commandline)

Maybe stack two of them

First one runs at (say) midnight each day and sends an enable to the 2nd one - the 2nd one is where your work is done - this runs the schedule you want to use. In the event you want to suspend the schedule inject into the 2nd node the suspend (from an inject node or a dashboard icon etc)

That night the first node will run again and send the enable schedule to re-enable the schedule that you paused.

I also think i remember something about Peter Scargills BigTimer node having this capability natively - but that was a long time ago and is quite a complex node - so i may be wrong on that

Craig

---

<div class="post-metadata">

**Author:** ![Knot83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knot83/32/24260_2.png) [@Knot83](https://discourse.nodered.org/u/Knot83)\
**Post date:** [17 June 2020 18:09 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/7 "2020-06-17T18:09:08Z")

</div>

@Trying_to_learn I tried to use your skip function but it seems do not behaves as expected. These are the steps I followed:

- Set on and off time
- Deploy the flow
- Inject the 'Skip One'

It anyway schedule the ON event. See the picture attached

 ![Cattura](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/0/c06f30b50a8f5c743f5b3bdf9db2ffaa790c2290.jpeg)

An here the flow:

```auto
[{"id":"22f7eb35.b4b6e4","type":"eztimer","z":"b0466595.da9a28","name":"Abbassa tapparella salone","debug":false,"autoname":"20:04:30 - 20:05:00","tag":"eztimer","suspended":false,"sendEventsOnSuspend":false,"lat":"45.06562","lon":"7.6266","timerType":"1","startupMessage":true,"ontype":"2","ontimesun":"dawn","ontimetod":"20:04:30","onpropertytype":"msg","onproperty":"payload","onvaluetype":"str","onvalue":"ON","onoffset":0,"onrandomoffset":0,"onsuppressrepeats":false,"offtype":"2","offtimesun":"dusk","offtimetod":"20:05:00","offduration":"00:01:00","offpropertytype":"msg","offproperty":"payload","offvaluetype":"str","offvalue":"OFF","offoffset":0,"offrandomoffset":0,"offsuppressrepeats":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":540,"y":500,"wires":[["d85a32ac.4204d"]],"info":"Abbassa Tapparella"}]

```

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [17 June 2020 18:36 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/8 "2020-06-17T18:36:14Z")

</div>

> [@craigcurtin](#):
>
> Instead of Easy timer - use Neil Cherry @ncherry Schedex - ```  
> node-red-contrib-schedex

Alternatively, use [`node-red-contrib-cron-plus`](https://flows.nodered.org/node/node-red-contrib-cron-plus), which allows you to pause specific schedules and start them again later. Can be done thorough command messages going into the node. There's example flows included with the node explaining this kind of setup.

---

<div class="post-metadata">

**Author:** ![Knot83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knot83/32/24260_2.png) [@Knot83](https://discourse.nodered.org/u/Knot83)\
**Post date:** [17 June 2020 21:08 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/9 "2020-06-17T21:08:23Z")

</div>

> [@afelix](#):
>
> node-red-contrib-cron-plus

Thanks I'll give it a look tomorrow

---

<div class="post-metadata">

**Author:** ![Knot83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knot83/32/24260_2.png) [@Knot83](https://discourse.nodered.org/u/Knot83)\
**Post date:** [17 June 2020 21:11 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/10 "2020-06-17T21:11:44Z")

</div>

> [@craigcurtin](#):
>
> the suspend

Hi Craig,  
how to inject 'suspend' message to schedex? It seems it only accept the following as Inputs (ON, OFF, Toggle, Info, Info\_local, send\_state). Am I wrong?  
Thanks

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 June 2020 21:22 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/11 "2020-06-17T21:22:00Z")

</div>

> [@Knot83](#):
>
> @Trying_to_learn I tried to use your skip function but it seems do not behaves as expected. These are the steps I followed:
> 
> - Set on and off time
> - Deploy the flow
> - Inject the 'Skip One'
> 
> It anyway schedule the ON event. See the picture attached

Interesting.

Looking, at the output it seems correct.

Let's look at what you want/asked for and what I did:

You wanted to _skip_ an event happening. I took that is not accepting an `ON` signal for one time.

So: all things being normal, you would see:  
`ON` at the desired on time. and  
`OFF` at the desired off time.

That is what I am seeing in the right of the screen. Given you ran it twice.  
The first `ON` was blocked.

> [@Knot83](#):
>
> I've to temporarily suspend the 'on' payload only for a certain day

So you have multiple events on a day and want to suspend ALL those events? Ah!  
I took it as only one event.  
That may be where the problem lies.

If you want that, you are a few steps ahead of your skills I feel.  
And for me to show you how to do that - with my limited knowledge - will not really help either of us. Sorry.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 June 2020 21:25 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/12 "2020-06-17T21:25:02Z")

</div>

> [@Knot83](#):
>
> how to inject 'suspend' message to schedex? I

That is a bit _tricky_.

It isn't you send a `msg.payload` which is `suspend`.

You have to send:  
`msg.suspend` and have it set to `true`

Node example:

```auto
[{"id":"eff89cd5.6f9e1","type":"change","z":"b9924a74.4d98f8","name":"Suspend","rules":[{"t":"set","p":"suspend","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":2320,"wires":[[]]}]

```

I believe the latest version of Node-Red you can do this in the `inject` node.  
I don't have the latest version so can't show you how to do that.

---

<div class="post-metadata">

**Author:** ![Knot83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knot83/32/24260_2.png) [@Knot83](https://discourse.nodered.org/u/Knot83)\
**Post date:** [17 June 2020 21:38 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/13 "2020-06-17T21:38:54Z")

</div>

Unfortunatelly it doesn't skip the ON event (see the picture). Can you please make a test and send your screenshot? and flow...

No, you understood correctly at the beginning, I'd suspend only one event not the entire weekly schedulling. In fact I think your approach is correct but maybe it requires some refinements of the function. Or maybe we're still not on the same page 🙂

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/9/29e2c8f1213d96ec7251998a9394156add8962ae.png)

```auto
[{"id":"b0466595.da9a28","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"22f7eb35.b4b6e4","type":"eztimer","z":"b0466595.da9a28","name":"Abbassa tapparella salone","debug":false,"autoname":"23:32:00 - 23:33:00","tag":"eztimer","suspended":false,"sendEventsOnSuspend":false,"lat":"45.06562","lon":"7.6266","timerType":"1","startupMessage":true,"ontype":"2","ontimesun":"dawn","ontimetod":"23:32:00","onpropertytype":"msg","onproperty":"payload","onvaluetype":"str","onvalue":"ON","onoffset":0,"onrandomoffset":0,"onsuppressrepeats":false,"offtype":"2","offtimesun":"dusk","offtimetod":"23:33:00","offduration":"00:01:00","offpropertytype":"msg","offproperty":"payload","offvaluetype":"str","offvalue":"OFF","offoffset":0,"offrandomoffset":0,"offsuppressrepeats":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":540,"y":500,"wires":[["d85a32ac.4204d"]],"info":"Abbassa Tapparella"},{"id":"d85a32ac.4204d","type":"function","z":"b0466595.da9a28","name":"Skip","func":"let s = context.get(\"Skip\") || 0;\nif (msg.payload == \"Skip one\")\n{\n context.set(\"SKIP\",1);\n return;\n}\nif (msg.payload == \"ON\")\n{\n if (s == 1)\n {\n context.set(\"SKIP\",0);\n return;\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":760,"y":500,"wires":[["796828f3.7d1418"]]},{"id":"d8492445.f0b848","type":"inject","z":"b0466595.da9a28","name":"","topic":"","payload":"Skip one","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":600,"y":380,"wires":[["d85a32ac.4204d"]]},{"id":"796828f3.7d1418","type":"debug","z":"b0466595.da9a28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":970,"y":500,"wires":[]},{"id":"b9fdde31.6e20f","type":"change","z":"b0466595.da9a28","name":"Suspend","rules":[{"t":"set","p":"suspend","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":660,"wires":[[]]}]

```

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 June 2020 21:47 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/14 "2020-06-17T21:47:38Z")

</div>

Yeah, sorry. I can't say what happened.

Here is a working one.

With TEST buttons to help make it easier to test if it is (or not) blocking.

```auto
[{"id":"e09d7c3b.d296c","type":"function","z":"b9924a74.4d98f8","name":"Skip","func":"let s = context.get(\"SKIP\") || 0;\nif (msg.payload == \"Skip one\")\n{\n context.set(\"SKIP\",1);\n node.status({fill: \"red\",text:\"BLOCK\"});\n return;\n}\nif (msg.payload == \"ON\")\n{\n if (s == 1)\n {\n node.status({});\n context.set(\"SKIP\",0);\n return;\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":2110,"wires":[["4d784638.133888"]]},{"id":"152fbddb.4484da","type":"eztimer","z":"b9924a74.4d98f8","name":"Abbassa tapparella salone","debug":false,"autoname":"07:41:00 - 07:42:00","tag":"eztimer","suspended":false,"sendEventsOnSuspend":false,"lat":"45.06562","lon":"7.6266","timerType":"1","startupMessage":true,"ontype":"2","ontimesun":"dawn","ontimetod":"07:41:00","onpropertytype":"msg","onproperty":"payload","onvaluetype":"str","onvalue":"ON","onoffset":0,"onrandomoffset":0,"onsuppressrepeats":false,"offtype":"2","offtimesun":"dusk","offtimetod":"07:42:00","offduration":"00:01:00","offpropertytype":"msg","offproperty":"payload","offvaluetype":"str","offvalue":"OFF","offoffset":0,"offrandomoffset":0,"offsuppressrepeats":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":170,"y":2110,"wires":[["e09d7c3b.d296c"]],"info":"Abbassa Tapparella"},{"id":"f1abf273.25a62","type":"inject","z":"b9924a74.4d98f8","name":"","topic":"","payload":"Skip one","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":350,"y":2020,"wires":[["e09d7c3b.d296c"]]},{"id":"4d784638.133888","type":"debug","z":"b9924a74.4d98f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":600,"y":2110,"wires":[]},{"id":"4b1c827a.6cf4ac","type":"inject","z":"b9924a74.4d98f8","name":"","topic":"","payload":"ON","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":2170,"wires":[["e09d7c3b.d296c"]]},{"id":"e3e319e6.394528","type":"inject","z":"b9924a74.4d98f8","name":"","topic":"","payload":"OFF","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":2210,"wires":[["e09d7c3b.d296c"]]}]

```

The problem was the `function` node and I messed up with the `SKIP` name.  
In one line it was `SKIP` and in another it wasn't. That's a no-no! (Causes problems)

This one is tested.

It is also a bit more informative to you. When you press the `Skip` button the `function` node tells you it is blocking.  
After the node has blocked, it wipes the message and all things are normal.

---

<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:** [17 June 2020 21:58 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/15 "2020-06-17T21:58:26Z")

</div>

Or try this one

`[{"id":"9cebcacf.f2a138","type":"schedex","z":"6b000f73.b47a6","name":"The Actual Worker","passthroughunhandled":false,"suspended":false,"lat":"","lon":"","ontime":"07:30","ontopic":"","onpayload":"","onoffset":0,"onrandomoffset":0,"offtime":"7:50","offtopic":"","offpayload":"","offoffset":0,"offrandomoffset":0,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":930,"y":300,"wires":[[]]},{"id":"a4dbd03.4c2a03","type":"schedex","z":"6b000f73.b47a6","name":"The Controller","passthroughunhandled":false,"suspended":false,"lat":"","lon":"","ontime":"11:59","ontopic":"","onpayload":"suspended false","onoffset":0,"onrandomoffset":0,"offtime":"12:00","offtopic":"","offpayload":"","offoffset":0,"offrandomoffset":0,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":720,"y":200,"wires":[["36e28e66.06fce2","9cebcacf.f2a138"]]},{"id":"36e28e66.06fce2","type":"debug","z":"6b000f73.b47a6","name":"Test ","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":950,"y":200,"wires":[]},{"id":"2091b0d9.db256","type":"inject","z":"6b000f73.b47a6","name":"Suspend next schedule","topic":"","payload":"suspended true","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":760,"y":440,"wires":[["9cebcacf.f2a138","36e28e66.06fce2"]]}]`

Craig

---

<div class="post-metadata">

**Author:** ![Knot83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knot83/32/24260_2.png) [@Knot83](https://discourse.nodered.org/u/Knot83)\
**Post date:** [18 June 2020 15:39 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/16 "2020-06-18T15:39:58Z")

</div>

Great. It works as expected. Now I've seen at the bottom of the schedex documentation the payload you're using to suspend and resume through`suspend true` and `suspend false`.

---

<div class="post-metadata">

**Author:** ![Knot83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knot83/32/24260_2.png) [@Knot83](https://discourse.nodered.org/u/Knot83)\
**Post date:** [18 June 2020 15:42 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/17 "2020-06-18T15:42:39Z")

</div>

> [@Trying\_to\_learn](#):
>
> After the node has blocked, it wipes the message and all things are normal.

Very goog job!!! Also your way works as expected now!!! Thank you a lot for your effort. You also gave me the right directions to learn how to use functions. If you've some time could you please explain me a little bit more about what and how you defined the function?

Again thanks a lot!

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [18 June 2020 21:27 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/18 "2020-06-18T21:27:28Z")

</div>

Ok, lets look at the code in the `skip` node:

```auto
let s = context.get("SKIP") || 0;
if (msg.payload == "Skip one")
{
    context.set("SKIP",1);
    node.status({fill: "red",text:"BLOCK"});
    return;
}
if (msg.payload == "ON")
{
    if (s == 1)
    {
        node.status({});
        context.set("SKIP",0);
        return;
    }
}
return msg;

```

Line 1:  
This gets the `context` variable called "SKIP". If it isn't set it is given the value 0 (Number) This is stored in variable `s`  
Line 2:  
If the incoming message has a `payload` of (equal to) "Skip one"  
Line 3:  
then.....  
Line 4:  
Set "SKIP" to 1  
Line 5:  
Set the `node.status` up to indicate it is blocking.  
Line 6:  
`return`. As there is nothing there it basically exits this whole bit of code.  
Line 7:  
end the `then` from line 3

That is used to configure the node and sets a `context` variable to `1` (number)  
Now the part that is the filter part.

Line 8:  
If the incoming message has a `payload` of "ON"  
Line 9:  
then......  
Line 10:  
If variable `s` (from line 1) is `1`  
Line 11:  
then2.....  
Line 12:  
Wipe the `node.status`  
Line 13:  
Set the `context` variable `SKIP` to `0`  
Line 14:  
Line line 6, `return`. Again, just exit from this code.  
Line 15:  
End then2  
Line 16  
End then  
return the `message` as received.

That means that all messages are sent.  
So any `OFF` message would never even be looked at.  
Any `ON` message would depend is `s` is set to `1` or not.  
If `s` is/was `1` the code would just exit.  
If that _fails_ (isn't true) it gets to the last line and is returned in its original state.

Hope that helps.

---

<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:** [19 June 2020 00:34 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/19 "2020-06-19T00:34:36Z")

</div>

Happy to help

Good luck with it

Craig

---

<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:** [3 July 2020 00:34 UTC](https://discourse.nodered.org/t/info-about-eztimer/28434/20 "2020-07-03T00:34:44Z")

</div>

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