# BigTimer does not turn off at Sunday midnight

**URL:** <https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134>\
**Category:** General\
**Created:** [21 September 2020 07:30 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134 "2020-09-21T07:30:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoltansz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zoltansz/32/7487_2.png) [@zoltansz](https://discourse.nodered.org/u/zoltansz)\
**Post date:** [21 September 2020 07:30 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/1 "2020-09-21T07:30:26Z")

</div>

Hi, does anyone else experience that BigTimer does not turn off at Sunday midnight? All other times and days are working fine for me.

I could solve it by moving the OFF time to 23:45 and add a 15m Delay, but that's not nice.

Thx,  
Z

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 September 2020 08:46 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/2 "2020-09-21T08:46:27Z")

</div>

Can you post a failing flow so we can check it and test (though that will have to wait for a week if we cannot see anything obvious in the failing config).

Also make sure you are using the latest version of the node.

---

<div class="post-metadata">

**Author:** ![zoltansz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zoltansz/32/7487_2.png) [@zoltansz](https://discourse.nodered.org/u/zoltansz)\
**Post date:** [21 September 2020 13:18 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/3 "2020-09-21T13:18:33Z")

</div>

Hi, this is a stripped down version of my flow.

- It switches ON on Saturday at 21:00.
- Switches OFF at Saturday midnight.
- Switches ON at Sunday at 21:00.
- Does NOT switch OFF on Sunday midnight.

It works fine on any weekdays, any time, but Sunday midnight.

Pls. note that...  
I do not have access to the host and the time zone is GMT+0 so I had to correct it with +2 hours. It is working fine. The switch occurs at the right time my local time. Also, I have added some holidays, but that should not cause any problems.

```auto
[{"id":"e3199b64.5e59b8","type":"tab","label":"BigTimer test","disabled":false,"info":""},{"id":"cebea97f.371b98","type":"bigtimer","z":"e3199b64.5e59b8","outtopic":"","outpayload1":"{\"state\":\"on\"}","outpayload2":"{\"state\":\"off\"}","name":"Timer program 3 (21:00-24:00, holidays)","comment":"","lat":"47.500338","lon":"19.055070","starttime":"1260","endtime":"0","starttime2":0,"endtime2":0,"startoff":"0","endoff":"0","startoff2":"0","endoff2":"0","offs":"+2","outtext1":"","outtext2":"","timeout":1440,"sun":true,"mon":false,"tue":false,"wed":false,"thu":false,"fri":false,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":"15","month1":"3","day2":"20","month2":"8","day3":"23","month3":"10","day4":"1","month4":"11","day5":"24","month5":"12","day6":"25","month6":"12","day7":"26","month7":"12","day8":"1","month8":"1","day9":0,"month9":0,"day10":0,"month10":0,"day11":0,"month11":0,"day12":0,"month12":0,"d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"repeat":false,"atstart":true,"odd":false,"even":false,"x":200,"y":80,"wires":[["b3949515.67e548"],[],[]]},{"id":"b3949515.67e548","type":"debug","z":"e3199b64.5e59b8","name":"DBG Big Timer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":470,"y":80,"wires":[]}]

```

As I said, I can fix this with an ugly solution using delays, but I'd like to keep my code nicer.

Thanks,  
Z

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 September 2020 13:47 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/4 "2020-09-21T13:47:20Z")

</div>

Which versions of the node and nodejs are you using?  
`node -v` for the nodejs version.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 September 2020 14:25 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/5 "2020-09-21T14:25:14Z")

</div>

I see you have said not to switch on Mondays, I wonder if it is getting confused by the fact that Sunday midnight is arguably Monday, and suppressing it.

**[Edit]** Or possibly the +2 hours offset you have specified, as that is well into Monday (server time). Or does the +2 mean that it should switch at 22:00UTC?

---

<div class="post-metadata">

**Author:** ![zoltansz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zoltansz/32/7487_2.png) [@zoltansz](https://discourse.nodered.org/u/zoltansz)\
**Post date:** [21 September 2020 14:50 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/6 "2020-09-21T14:50:56Z")

</div>

That's what I thought too. It must be the week change that causes the confusion. Midnight on a normal day makes no problem.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 September 2020 15:02 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/7 "2020-09-21T15:02:42Z")

</div>

> [@zoltansz](#):
>
> Midnight on a normal day makes no problem.

Have you tried a 'normal' day where the next day is not enabled? I was suggesting that it is not the Sunday that is the problem, but that the following day is not enabled.

Unfortunately I can't test this at the moment as I don't have a spare system that I can leave on overnight.  
Did you see my edit? You haven't said whether the +2 hours makes it trigger at 22:00 UTC or at 02:00 UTC. It is not clear to me from the spec which it is.

Also you haven't answered my previous questions.

---

<div class="post-metadata">

**Author:** ![zoltansz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zoltansz/32/7487_2.png) [@zoltansz](https://discourse.nodered.org/u/zoltansz)\
**Post date:** [21 September 2020 15:04 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/8 "2020-09-21T15:04:39Z")

</div>

So far, I only tested normal, but consecutive days as I suspected it was a 0:00 vs. 24:00 problem.

Good idea. I'll test it and report back.

Rgds,  
Z

---

<div class="post-metadata">

**Author:** ![zoltansz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zoltansz/32/7487_2.png) [@zoltansz](https://discourse.nodered.org/u/zoltansz)\
**Post date:** [21 September 2020 15:05 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/9 "2020-09-21T15:05:34Z")

</div>

I can only check version in the evening. I how I can find it or on the UI as I have no access to the command line.

---

<div class="post-metadata">

**Author:** ![zoltansz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zoltansz/32/7487_2.png) [@zoltansz](https://discourse.nodered.org/u/zoltansz)\
**Post date:** [21 September 2020 15:07 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/10 "2020-09-21T15:07:24Z")

</div>

Actually, the server runs local time -2 hours so thats the reason I had to correct. Normal switches occur at expected local time so the GPS code plus correction is fine.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 September 2020 15:08 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/11 "2020-09-21T15:08:53Z")

</div>

> [@zoltansz](#):
>
> how I can find it or on the UI as I have no access to the command line.

No idea on how to find the nodejs version without CLI access. Do you have access to the node-red logs? If so then it is in the node red startup log. Otherwise ask the system administrator.  
The bigtimer node version is in Manage Palette. Also tell us the node-red version (at the bottom of the hamburger menu dropdown).

---

<div class="post-metadata">

**Author:** ![zoltansz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zoltansz/32/7487_2.png) [@zoltansz](https://discourse.nodered.org/u/zoltansz)\
**Post date:** [21 September 2020 16:36 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/12 "2020-09-21T16:36:27Z")

</div>

Node-RED: 1.1.3  
BigTimer: 2.4.0

I'll have to ask the Admin for the nodeJS version.

In the meantime I configured a test this evening: 21:00-00:00, but no schedule for tomorrow. We'll see.

---

<div class="post-metadata">

**Author:** ![zoltansz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zoltansz/32/7487_2.png) [@zoltansz](https://discourse.nodered.org/u/zoltansz)\
**Post date:** [21 September 2020 16:49 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/13 "2020-09-21T16:49:54Z")

</div>

I just read your edit:

> You haven't said whether the +2 hours makes it trigger at 22:00 UTC or at 02:00 UTC. It is not clear to me from the spec which it is.

The host runs at UTC and my local time is UTC+2 so I added +2 hours. The schedule 21:00-00:00 is 9PM to midnight local time and on every other day it is working fine.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 September 2020 20:03 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/14 "2020-09-21T20:03:49Z")

</div>

@scargill. Peter, do you have any comment on this?

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [21 September 2020 21:16 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/15 "2020-09-21T21:16:43Z")

</div>

Taking a brief look - my timers (several of them) operate correctly - tested both back in the UK and here in Spain. Not sure what else I can say...

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 September 2020 21:21 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/16 "2020-09-21T21:21:44Z")

</div>

I am wondering whether it could be either the event at midnight where the next day is not enabled, confusing the algorthim into thinking that it should not generate the event due to the ambiguity between midnight at the end of the day and 00:00 at the start of the next day. Or alternatively the manual timezone setting having some similar issue with the crossover between the enabled and not enabled day.

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [21 September 2020 22:47 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/17 "2020-09-21T22:47:14Z")

</div>

I studiously avoid events at midnight – i.e.00:00 the next day. Best place to discuss this is in [https://tech.scargill.net](https://tech.scargill.net) under BigTimer, I don’t look in here that often.

Pete

---

<div class="post-metadata">

**Author:** ![zoltansz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zoltansz/32/7487_2.png) [@zoltansz](https://discourse.nodered.org/u/zoltansz)\
**Post date:** [22 September 2020 06:10 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/18 "2020-09-22T06:10:53Z")

</div>

@Colin you were right. My test node yesterday sent a switch ON at 21:00, but did not switch OFF at 00:00. However, its status shows "No action today" now.

This means that a switch off at midnight for a day that has no program for the following day will not issue the OFF command. At least for the "MAN UTC: +2" configuration that I need to use.

Luckily, this scenario can be tested every day so tonight I'll test it with offsets. I'll set OFF time to 23:45 and give an offset of 15 min.

---

<div class="post-metadata">

**Author:** ![zoltansz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zoltansz/32/7487_2.png) [@zoltansz](https://discourse.nodered.org/u/zoltansz)\
**Post date:** [22 September 2020 06:50 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/19 "2020-09-22T06:50:18Z")

</div>

@scargill Thx for the info. I did not like the idea of midnight either, but the customer explicitly asked for it. Not that he would recognize the difference between 23:59 and 00:00...

I'll register on your site.

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [22 September 2020 09:29 UTC](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134/20 "2020-09-22T09:29:11Z")

</div>

Thanks and welcome – meanwhile when I get a minute I’ll check to see if adding midnight is feasible without breaking compatibility – maybe 1 minute before midnight disguised as midnight. Bigtimer actually only understands a 24 hour period beginning at 0 minutes…

Pete

[Next page](https://discourse.nodered.org/t/bigtimer-does-not-turn-off-at-sunday-midnight/33134.md?page=2)
