BigTimer

BigTimerNodeRED is a fantastic and powerful yet easy to use programming tool for wiring together hardware devices, APIs and online services in new and interesting ways. For more information on Node-Red go to the Node-Red site.

After all, you probably don’t turn the outside lights ON at 6pm!! You most likely want them ON when it gets DARK. Nice to see BigTimer featured HERE.

Bigtimer has been steadily improved over several years in response to user feedback and remains powerful yet easy to use while retaining backward compatibility.

Bigtimer
Bigtimer

BigTimer is my own creation and is (IMHO) the most powerful and best-ever, most comprehensive timing node for Node-Red, providing a general purpose timer as well as handling summer/winter correctly as well as (importantly) lighting-up time (for which you should provide your longitude and latitude from Google maps or similar).

THIS page is the home of BigTimer. Questions about BigTimer should be placed in the comments section here. I’m currently pondering how to add winter and summer options for on-off times without making the setup page more cluttered – ideas welcome.

Update February 2023

Fixed a mistake in the July-December exclusion months

Update January 9, 2022

Added new “away” command – in minutes for now (away X) which can be as long as you like and will hold the first output off until you clear it with (away 0) or it runs out – this should be fully tested before deploying and you MUST have “repeat” ticked in the dialog for this to work . Also, one helpful blog subscriber pointed out an issue – special day included – month 9 was faulty – fixed – many thanks to everyone for you feedback on this very popular timer).

V2.8.1 fixed bug introduced in 2.8.0 to 2nd output payload.

End of update

I do not plan to spend any more time hunting through Node-Red forums for BigTimer queries, sorry… and the source is NOT in GITHUB  – you have the full source when you have BigTimer itself – the whole thing is only 2 files (a .js file and an .html file).

In version 2.5.0 I added separate on-off randomisation options.

The panel on the right is quite out of date now with many additional items in the actual panel.

For clarity: BigTimer works in minutes – in a DAY which consists of hours and minutes 00:00 to 23:59, where minute 1439 is the last minute of the day – that is why there is no MIDNIGHT in the settings. If you need something to happen at or near midnight –  I’ve now added a DAY END option to the OFF dropdown boxes – equating to 23:59 or one minute before “midnight” (the latter is in fact is the beginning of the next day).

At it’s simplest, BigTimer is a single block which can be used as the equivalent of a simple mechanical timer, seeding other Node-Red nodes or directly manipulating devices by, for example, MQTT protocol. The MQTT-compatible payload (ON and OFF msg)  is the main output and you should put a value in there even if not using MQTT. ON and OFF TEXT fields are optional – for speech or whatever use you have in mind.

BigTimers can be used singly or in groups. Full support is provided for dusk/sunset dawn/sunrise and variations also for day/week/month (and special days) control.

BigTimer has three outputs, the first of which updates when there is a change of state and presents one of two messages (for, for example, MQTT or other control mechanism)

The node offers outputs suitable for MQTT, speech and databases (but you don’t HAVE to use any of these). You can also manually over-ride the UTC time setting on the host computer if required.

The second of three outputs offers a simple 1 or 0 every minute in the output “payload” and also presents additional information reflecting the status message in msg.state, message.time and others – see the entire msg object output in debug for more.

The third output presents a message which could be used for speech or debugging.

There is also real-time status information displayed below each BigTimer node.

As always, the latest node-red-contrib-bigtimer is available at node-red-flows and at npmjs.com – put “scargill” in the search and you’ll see all my nodes and flows.

I’ve had the odd comment about BigTimer not giving the output someone wants… if the msg.payload from output 1 isn’t what you need, change it. Let me give an example, the segmented switch in BLYNK, assuming 3 outputs for this example – gives and needs values “1”, “2” and “3” – which I use for “off” “auto” and “on” states in BigTimer. A simple function node on either side of BigTimer sorts out that problem.

tmp71EF

Note the Blynk “Write Event” node on the left and the Blynk “Write” node on the right.

The functions are easy. Blynk might be controlling the lighting or the grey manual overrides, OR BigTimer may be running a schedule – it is important that all 3 methods are compatible and that they stay in SYNC.

First function node:

if (msg.payload=="1") msg.payload="off";
else if (msg.payload=="2") msg.payload="auto";
else msg.payload="on";
return msg;

Second function node:

if (msg.state=="off") { msg.payload="1"; return msg; }
if (msg.state=="auto") { msg.payload="2"; return msg; }
if (msg.state=="on") { msg.payload="3"; return msg; }

Easy – I have a ton of variations on that for different scenarios.

Back in February 2018 I added moonrise and moonset – as well as improving the layout and docs. The “moonrise” code in module sunCalc seems less than perfect so although I added the moonrise and moonset properties in 2.1.3 BigTimer, there were issues resolved in moonrise and moonset (from version 2.17 on) thanks to adding my own checking to the sunCalc module.

Recent additions/changes include timestamp on outputs, additional on/off inputs, improvements to “timer” input option (default seconds) example:

timer X (mins)

timeoff X (mins)

Features added in December 2018 include a seconds timer and even/odd day of the month selection. In manual override (injection), assuming the timer is off, inject “timer 30” to turn it on for 30 seconds. This is also handy if you have lights turning off at midnight for example and you need an extra hour of light and don’t want to have to remember to turn them off at the end of that period. Inject “timer 3600”.

As early as 2017, I added “toggle” override mode and as I then realised that the little icon was not quite the right format and might look odd on some people’s systems – something pointed out by the FRED people who want to use my nodes… I updated node-red-contrib-bigtimer, node-red-contrib-timeout, node-red-contrib-diode, node-red-contrib-grove and node-red-contrib-esplogin and also moved them to the “advanced” category.

BigTimer
BigTimers

What: Node-Red-Contrib-Bigtimer is both a simple timer – and a full-function timer – depending on your needs. At it’s simplest, you set on and off times, the topic and payload you need to go out to, say, MQTT and your longitude and latitude (most browsers will fill this in automatically), you then set your schedule and you are done.

Why: Existing timers didn’t do what I wanted – also – I have a watering system – I want it to run at dusk and dawn every day – but not in December through February (ice)!  I had to have control over both days of the week and months. Existing timers didn’t do that either. Many seemed to be based on the old mechanical timers but without moving parts. That won’t do.

Firstly: the name. It’s a timer – but it’s a BIG one – so I called it BigTimer. (note: the original “Scheduler” node is no longer developed – BigTimer does everything Scheduler did and much, much more).

Secondly: it has an input. You can inject various words into BigTimer – and get instant over-ride action. “1” or “on”, “0” or “off”. “auto” or  “default”, “timer”, “sync”, “manual” etc.

Does that need explaining? “on” for manual override to on, “off” for manual override to  off (both of which reset on the next auto state change), “default” or “auto” to return the timer to normal operation. More details further on.

Manual Override: If you set the timer to turn on, say at dusk and off at midnight, you can override the setting during the day by sending “on” to the input. This override will reset at the next auto change of state.

Please note: “night” and “endNight” are included for completeness but are not guaranteed to work depending where you are in the world. Perhaps better to stick with dusk/dawn, sunset/sunrise etc.

If you inject “manual” in conjunction with  “on” and “off”, the state will change until the set timeout (in minutes) times out – so if you turn the lights on in manual mode (as against simple override) and forget you did it?

The unit will return to default operation in X minutes (which you can set – defaulting to 24 hours – 1440 minutes) after any manual change you make.

You can also send a “sync” command which simply outputs the current state with a side effect of decrementing the timeout counter – handy for testing.

Here is a test setup for BigTimer, just using simply injection nodes:

BigTimer test setup

And here’s what happens if you manually press ON (a simple inject  in this example – you can send that message in the payload by any means you like)…

Bigtimer test setup[6]

But what are those other two outputs?

Output 1: is a message – you control the topic and payload – so I use it, for example, as I do, to send a message to MQTT to control something. You can have this message go out once – or every minute. There are other components to the msg object on the first and second outputs, use these extra messages or not as you prefer.

Object

In this example (version 1.5.5 of BigTimer onwards) you see various items in the output -also note that this view is in Node-Red 0.18.5 – I strongly recommend you upgrade if using an earlier version.

You can see the value in msg.payload which is whatever you enter in order to fire a message off to another node or function to make something happen. In addition (and not essential for normal operation) we have msg.state, msg.value, msg.AutoState, msg.manualState and others.

For simple use, you can of course ignore the additional outputs, but they are handy for checking. msg.state shows “on”, “off”. “auto” or “none” and in the case of the first two outputs, msg.duration shows the time until the next change of state and msg.now shows the time in minutes since midnight.

Output 2: outputs a 1 or 0 every minute when checking (in msg.payload) – you can use that to light up something.

Output 3: puts out another text message in msg.payload which you can set – I point it to a speech synth so it might say “external lighting coming on”. There is one message for the ON state, another for the OFF state. Ignore it if you don’t have a use for it.

December 2018: Typical use of BigTimer in my home, controlling ESP8266 and other devices and accepting control from manual overrides either directly in Node-Red or for example in the Node-Red Dashboard (mobile or PC screens).

BigTimer use in my UK home

And to get this node?

Make sure you are in your Node-Red installation folder (for example /home/pi/.node-red) and type:

npm install node-red-contrib-bigtimer

So in my case, I keep all my nodes under /home/pi/.node-red/node-modules.  So I do the install from /home/pi/.node-red

Restart Node-red and Bob’s your uncle – it should appear on the left with the other Nodes.

Actually today (in 2020/2021) there is no longer any need to use NPM install; simply install using the palette manager in Node-Red itself.

In addition, I have recently, as a response to a sensible request from one of our blog readers, changed the code so that if either the ON payload or OFF payload is blank – then no message will be sent at that time – this means you can now easily OR timers together. So if you need several time intervals in a day or other complicated setup you can simply use a number of timers and feel the first output to one common destination!

Here’s an example of TWO timers simply sending stuff to a debug node for testing…

two BIGTIMERS

Backtrack for Beginners: Node-Red is a simple-to-use but very powerful visual tool for wiring the Internet of Things and a tool for connecting together hardware devices, APIs and online services in new and interesting ways. It is also a lot of fun.

I control a range of ESP-8266/ESP32 devices using RPi4 (though older versions of RPi work well). You can of course run Node-Red and the other tools on a wide range of machines – Orange Pi, Odroid C2 etc using Debian, DietPi, Xenial etc. I’ve even had my normal installation script “The Script” running on a laptop using Mint Linux (some time ago).

On this particular RPi I run MQTT (Mosquito with Websockets), SQLITE, NGINX and Node-Red. I started using Blynk as my mobile remote controller then went on to using ImperiHome then Node-Red Dashboard which has (IMHO) so very much potential, however it also has lousy RGB control so for a while I reverted back to Blynk.  I then used Nextion touch-LCD display devices for local displays and now (2021) I use low-cost ILI9341 displays with ESP-HOME, the code talking back to Node-Red. All of this can be managed within Node-Red. If you find this interesting you might like my old  home control 2018 post here or the early Nextion Wi-Fi Touch Display article.

Above is a screenshot of a typical setup… click on the image to enlarge.

So in total you have a timer you can set to go on and off at specific times of the day, or dusk and dawn, on certain days, certain months, you can even set it to run on specific days of the month (Christmas day?) or even certain weekdays of every month (second Tuesday) – as of version 2.0.0 (August 2018) these can be included or excluded.

You can tick a box to have output on power-up or not, you can tick a box to have the node auto-repeat the message every minute or not. You can add positive and negative offsets to the times (including dusk and dawn etc.), you can optionally add your OWN offset to the UTC time of the host computer and you even select a random value within the limits of the offsets (security lighting etc.) You can temporarily suspend the schedule via a tick box or a message.

And here are the words the node will accept at the input to override automatic operations. The input is not case-sensitive.

sync simply forced output
on or 1turn the output on
off or 0turn the output off
default or autoreturn to auto state
stopstop the scheduler
on_overridemanually override the on time ( specify time as minutes or hours:minutes) – also if you specify the time in minutes, you can use special values like:

5000=dawn
5001=dusk
5002=solarNoon
5003=sunrise
5004=sunset
5005=night
5006=nightEnd
off_overridemanually override the off time( specify time as minutes or hours:minutes) – also if you specify the time in minutes, you can use special values like:

5000=dawn
5001=dusk
5002=solarNoon
5003=sunrise
5004=sunset
5005=night
5006=nightEnd
timera recent feature allowing manual override for X seconds (timer X) – handy for watering systems etc.

In August 2020 I added geo_override, fixed some minor “timer” issues and also with help from one of you – added on_offset_override and off_offset_override – updating the second output message accordingly.

In the drop-down boxes for on and off times you can select times or words like dusk, dawn, sunrise, sunset, night etc. All are dependent on the longitude and latitude you put into the relevant boxes and will adjust every day as necessary.

A good way to learn about BigTimer is to put a debug node (set to show the complete message) on the top output – and inject text payloads (using the INJECT node) to the inputs as demonstrated above.

Output from error and warnFrom the first output, as well as the normal msg.payload, you can extract msg.state which might be “on”, “off”, or “auto” – and msg.value which might be 1 or 0.  This is so that if you are using say, ImperiHome and store states in global variables, if the time reverts back to auto, you can let ImperiHome know what is happening.

Another way to test BigTimer  is as follows..

Big Timer Node

In the FUNCTION nodes to the right of BigTimer, I’ve simply put node.error(msg); and node.error(msg); respectively. The only difference is one has a red bar (error) the other a yellow bar (warn). These make a handy alternative to using the debug node for testing.

Recent additions to the inputs include on_override and off_override. These are in response to requests to be able to change the on and off times from the Dashboard. Please note that override information you inject here (in hours and minute or just minutes, space-delimited) is lost when Node-Red is restarted or the board rebooted.

Not shown on the photos above are two new options – to kill the output on even days of the month, odd days (or of course both).

If you make good use of this node – please put a link to this blog entry somewhere in your writings so people will come back here. Or if the node proves REALLY useful you could feed my Ebay habit – there’s a link on the right of the blog.

See the Node-Red info panel in Node-Red for up-to-date information.

July 2022 Quick Test

I juat added a new timer to a flow and did nothing more than test outputs 1 and 2 on the currently OFF timer – and got the expected results when injecting “auto” then “manual on” then “manual off” to a timer prefitted with payloads “on” and “off”. The first 2 debug outputs appeared on completing the flow update, the others on injecting auto, manual on and manual off respectively. All other settings were defaults.

[
    {
        "id": "403d2aae837a4874",
        "type": "tab",
        "label": "bigtimer test",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "e1483686f071ce5d",
        "type": "bigtimer",
        "z": "403d2aae837a4874",
        "outtopic": "",
        "outpayload1": "",
        "outpayload2": "",
        "name": "Big Timer",
        "comment": "",
        "lat": 0,
        "lon": 0,
        "starttime": 5001,
        "endtime": 1425,
        "starttime2": 0,
        "endtime2": 0,
        "startoff": 0,
        "endoff": 0,
        "startoff2": 0,
        "endoff2": 0,
        "offs": 0,
        "outtext1": "",
        "outtext2": "",
        "timeout": 1440,
        "sun": true,
        "mon": true,
        "tue": true,
        "wed": true,
        "thu": true,
        "fri": true,
        "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": 0,
        "month1": 0,
        "day2": 0,
        "month2": 0,
        "day3": 0,
        "month3": 0,
        "day4": 0,
        "month4": 0,
        "day5": 0,
        "month5": 0,
        "day6": 0,
        "month6": 0,
        "day7": 0,
        "month7": 0,
        "day8": 0,
        "month8": 0,
        "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,
        "xday7": 0,
        "xmonth7": 0,
        "xday8": 0,
        "xmonth8": 0,
        "xday9": 0,
        "xmonth9": 0,
        "xday10": 0,
        "xmonth10": 0,
        "xday11": 0,
        "xmonth11": 0,
        "xday12": 0,
        "xmonth12": 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,
        "randon1": false,
        "randoff1": false,
        "randon2": false,
        "randoff2": false,
        "repeat": true,
        "atstart": true,
        "odd": false,
        "even": false,
        "x": 1600,
        "y": 220,
        "wires": [
            [
                "b9a7d7728562fa9e"
            ],
            [
                "674e3a0fab0f9036"
            ],
            []
        ]
    },
    {
        "id": "b9a7d7728562fa9e",
        "type": "debug",
        "z": "403d2aae837a4874",
        "name": "out1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1850,
        "y": 160,
        "wires": []
    },
    {
        "id": "674e3a0fab0f9036",
        "type": "debug",
        "z": "403d2aae837a4874",
        "name": "out2",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1850,
        "y": 260,
        "wires": []
    },
    {
        "id": "2b5f995c17a902ec",
        "type": "inject",
        "z": "403d2aae837a4874",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "auto",
        "payloadType": "str",
        "x": 1430,
        "y": 140,
        "wires": [
            [
                "e1483686f071ce5d"
            ]
        ]
    },
    {
        "id": "3e5bc965ead87fd7",
        "type": "inject",
        "z": "403d2aae837a4874",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "manual on",
        "payloadType": "str",
        "x": 1430,
        "y": 240,
        "wires": [
            [
                "e1483686f071ce5d"
            ]
        ]
    },
    {
        "id": "a233611e23b794bb",
        "type": "inject",
        "z": "403d2aae837a4874",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "manual off",
        "payloadType": "str",
        "x": 1430,
        "y": 280,
        "wires": [
            [
                "e1483686f071ce5d"
            ]
        ]
    }
]

Enjoy and please do report any issues back here.


If you like this post – please share a link to it by social media, by email with friends or on your website.
More readers means more feedback means more answers for all of us. Thank you!

Facebooktwitterpinterestlinkedin

1,344 thoughts on “BigTimer

  1. If a manual UTC is entered (ie -7) then I simply delete the value and do not enter any value at all in order to return to original value (0 greyed out) to disable manual UTC again, node reports it is improperly configured.

    So I take it that a zero must be typed in again to disable it? Why not a check box to enable or disable so that the value would appear greyed out if disabled rather than having to know that 0 disables it.

    To save space, could you put special Weekdays of the month, days of the year and weekedays of the month on drop downs or popouts?

  2. Hi,

    Working on the use case flow below, I ran into a feature request.

    As described, I would like the node to be OFF by default and only be enabled by a msg.payload=auto.
    There is the “Suspend schedule” option, but that is fully static and cannot be overruled with a msg.payload.

    Workaround is to deploy the node and do a manual inject with msg.payload=manual after each deployment.

    Several ideas on improving this:
    – Have the option to overrule the suspend (either default or through a switch in the settings).
    – Have the option to determine the start state of the node in the settings.

    Thanks for considering this FR.

    1. Not sure I’m reading this correctly but it seems you’re suggesting a change to default behaviour. Any changes except for bug fixes, given the massive number of BigTimer users – could cause untold problems 🙂 You can of course make any changes you desire on your own setup as the only two active files are a .JS and a .HTML file, both human-readable and not that complicated. The files should be inside inside .node-red/node_modules/node-red-contrib-bigtimer folder.

  3. Hello,

    BigTimer looks really promising. However, I run in very strange behavior which make me having to do a ‘git reset –hard’ to get NR running again… without being able to use BigTimer.

    Situation:
    – BigTimer on latest HA (2024.2.2) with latest NR addon (17.0.7).
    – Goal of the flow is to have a trigger enable the BigTimer once to turn on sometime during the night (for test purposes other time in attached flow). When the timer turns off, it should disable itself again.

    – What happens is that after the timer goes off, it keeps sending messages with payload 0, as indicated by the debug node.
    – The most strange thing is that the sending of the messages continues EVEN AFTER the BigTimer node is DELETED from the flow (and the flow redeployed)… rather surprised how this is even possible.

    – I solve the situation by stopping the NR addon and restoring the project to a previous version and asking for help here. 😉

    Could it be related to this issue?
    https://community.home-assistant.io/t/node-red-bigtimer-stopped-working-at-end-of-january-2024/686356

    Thanks for any help!

      1. that has nothing to do with home assistant, he’s just using the nodered addon, which is identical to the normal ones, but has a basic integration so you don’t have to authenticate to both HA and NR: if you’re already logged in in HA it passes auth to NR, too

        btw, i suggest the commenter to try installing the same nodered version he sees in the nodered addon as a standalone setup and try there if it works, to see if the problem is with nodered, with bigtimer, or with the HA integration made by Frenck

        1. Thanks for the clarification and tip!

          Tried an empty NR docker container (latest version from Docker Hub, v3.1.5), installed BigTimer.

          First test: copy+paste originally attached flow; got the described behavior right after deploying.

          Second test: emptied the data directory again, re-installed BigTimer. Built the flow from scratch. Same issue.
          As soon as the msg.payload=manual hits the BigTimer node, it keeps sending messages, even when disabled or deleted.

          Had the suspicion that this might be caused by an infinite loop: BT gets manual message, sends another off message (while it’s already off), which results in another manual messages, which…

          Built in some tests to prevent the loop and it seems that I have at least a workaround.

          Potentially better way might be to add an option for the node to en-/disable sending the current state after receiving a message AND the message did not change the state.

            1. Run into some behavior of which I am not sure it’s a bug or a feature 🙂

              In the attached flow, the BigTimer node is configured to turn on and off at a certain time. For testing purposes with offsets differing by a minute, but same behavior with hours apart.

              The debug nodes show that BigTimer sends messages at the on and off moments despite being “OFF manual” at these points in time.

              Since my use case is rather simple, my workaround was to use a different node (stoptimer-varidelay) with a function node before it calculating the time until the “alarm time” and another varidelay set to a fixed period timeout period.

  4. I have an issue which is confounding me (this used to work OK). I have a simple Node Red automation which turns on my coffee machine at 7:30am and then off at 9:00am Mon to Friday. To cope with vacations etc I also an overide switch which sends “auto” or “stop” to the timer. The problem is, when the scheduler is stopped it still sends an “off” output at the scheduled time. the attached screen shot shows the flow and the issue. Any clues anyone? I am using the latest releases of HA, Node Red and BigTimer.

      1. Well, always good to know if there have (or haven’t) been changes. I’ve worked around the issue by putting another switch on the output of BigTimer and checking the msg.extState variable. If it equals “STOPPED Man. override.” I just dump the message, otherwise I let it through. Seems to work so far.

    1. I see exactly the same behavior. In the node-red workspace the big timer is stopped, but it sends the off message at the on trigger time though it is stopped. I looked at the code and saw that if a node is stopped it seems to send something in all cases. (line 1074 in bigtimer.js) I don’t know how to debug in node-red and I also don’t fully understand the treatment of the different states in the node but to me this looks fishy.

      1. As I recall I received comments that the timer could get stuck ON on day when it was supposed to be off – hence the deliberate OFF messages. That happened some time ago – over a year I would say.

        If you want to change yours… BigTimer consists merely of 2 files – a .JS file and an HTML file – you could change the behaviour in the .JS file (in .node-red/node_modules/node-red-contrib-bigtimer) – just back the files up first.

        Pete

        1. Given the behaviour is deliberate, I’d rather leave the code alone and just filter out the off messages when the scheduler is stopped. It’s easy enough to do, as long as the msg.extState variable is consistent, which it has been in my case. Thanks, Colin

        2. I’ve done the modification and it works for me as intended. it was basically to change line 1097 in bigtimer.js from:

          } else { if (change) node.send([outmsg1, outmsg2, null]); else node.send([null, outmsg2, null]); }

          to

          } else { if (change) node.send([null, outmsg2, null]); }

          The line number refer to https://www.npmjs.com/package/node-red-contrib-bigtimer?activeTab=code
          I assume you have quite some test scenarios to check for correct execution of big timer. It would be interesting to hear if the modification is compatible with your test scenarios.

          All the best – Ralf

          P.S. I attached my version of big timer.js (automatically reformatted)

          bigtimer.js

  5. Hi Peter,
    I’m using BigTimer since a while and it is really helpful to control things. Your work is amazing!

    I have one change request.

    I created a flow to override the on / off values enabling other people in the household to change values via the dashboard. This works perfect for the On Time and Off Time with on_override / off_override.

    But I’m also using On Time2 and Off Time2 as I control a lamp for my chickens in the morning and evening.

    I would like to recommend to create an on2_override and off2_override to be able to override the second timer as well.

    Your feedback is highly appreciated
    Best regards
    Thomas

  6. Hi, Love big timer, trying to do an alternating week notifitacton to our phones with one week saying Blue Bin and the other Black Bin.
    Without explicitly saying the dates of each month im not sure how i would go about this?
    Basically only output on odd weeks and I could have another node for only output on even.
    Have I missed something in the plethora of functionality? or is there another way?

      1. Ha! Always like to be the first! Ill keep my eye out but not be waiting for it any time soon! thanks for the reply!

  7. I ran into an issue using Docker. The container is using UTC, which I need to leave as is. I live at UTC-6 and have my Lat/Lon set in BigTimer. If I place the offset -6 into Man UTC, the start/stop times work correctly, but the Sunrise/Sunset are off by 6 hours. If I use Man UTC=0, then Sunrise/Sunset are correct, but the Start/Stop times are off by 6 hours. It appears that the Sunrise/Sunset functions do not take the offset into consideration.

    My workaround is to use Man UTC=-6 and enter my Latitude, but leave the Longitude as 0. Both timers work correctly. Not sure if there is a better way.

  8. Just for clarification: To prematurely turn it off once, but also make it turn on on the next auto time, do i send just “off” or “off” first and “auto” afterwards?

  9. Hi Peter, In Bigtimer there is an output called msg.duration. This calculates the time left in minutes till the next event. However, if not every weekday is checked e.g. It’s running on tuesday but wednesday is checked off it is still showing the duration until the next eventrigger in de start section. But after 0.00 hours (midnight) there is no output anymore because there are no events on wednesday (checked out)

    Q: How do I get the duration from the last event on e.g. tuesday until the next change on e.g. thursday (so I should be e.g. 2 days, 3 hours ande 7 minutes). But as it is now Bigtimers duration only lasts up to 24 hours
    Is it possible to get the below output somehow to the msg.payload? So I can set up a function node to calculate te remaining time to the next on/off event?
    “sun”: true,
    “mon”: true,
    “tue”: true,
    “wed”: true,
    “thu”: true,
    “fri”: true,
    “sat”: true,

  10. Hi Peter,
    Thank you. I’ve just come across BigTimer and love it. I want to introduce it to all my automated flows. I’m having trouble though with motion sensor flows. I’m using a state node for the motion sense on/off but I want it active only from dusk to dawn (for external lights).
    The trouble I have is the state node will not accept input from bigtimer and in reverse, the state node as an input to bigtimer forces the override on bigtimer so every time there is a motion detection then it overrides the schedule in bigtimer.

    Ideally I’m trying to create a simple flow to have the motion sensor active at night time using bigtimer’s dusk/dawn options. Do you have any suggestions on how I could do this ?

    Thanks
    Gav

  11. Good morning, first of all thank you for your node, it is a great help. Although I’ve been using it for a while, I have a question that I can’t solve. I have a lighting system that I have put 3 options on the dashboard: On, off and timer. What I try is that if I put it on, it stays on without a time limit (an on in the payload), if I put it off, that it is off and does not turn on (an off in the payload) and if I put a timer, I have a time selector in the dashboard and I send it in the on_override and the off_override and a timer in the payload too. I have been using this last option for a while and it works perfectly, it turns on and off when it touches. I am having the problem if I put Off, apparently the node indicates OFF in red, but when the time comes it turns on. I think I have the problem with the manual or auto option, I don’t know which one I have to put. Could you help me with this configuration? Thank you and best regards.

  12. Hi,
    Just started using Big Timer. I have noticed that if I set on time at lets say 18:00 and off time 19:00, the commands execute sometimes up to 1 minute after the time. So my light comes on at 18:00:54. Same for off time. But it varies. I am trying to figure out why. I played with a different timer (timer node) and it executes dead on based on my iphone. So I know it isn’t the clock on my NUC. This is thru Home assistant. Any thoughts on this it drives me nuts.

    1. The software is set to work at the minute at 0 seconds or later. Depends I guess what else your Node-Red is doing. I don’t use Home Assistant so can’t advise…

      Anyone else please feel free to step in…

      Pete

    2. Did you ever get to the bottom of this Kevin?
      I came here looking to see if I could figure this out, I see the same about ~50 second delay before BigTimer fires.

  13. Hi,
    I’m new to Big Timer. It looks very useful!
    I saw the opportunity to exclude and include certain days and thought that could be used to include public holidays into my weekend timers and exclude them from my workday timers!
    Is it possible to define date ranges in some way? I googled around and saw a few other who had asked the question and tried but not been able.
    For example I always have vacation between x-mas and new-years, so I would to include/exclude Dec 24-31 and then there are a bunch of other days.
    Just putting 24-31 does not work according to other people who have tried I don’t remember if anyone tried ” or ‘ or some brackets. I’m not that experienced in programming, so I don’t know what’s best chance to test and it takes some time to try it out as I have to wait till next day for each test…
    Is it possible to add date intervals, or can it be made possible (please!) :-))

    Other things that I think could be useful is other Public holidays like Easter that are “floating” would be nice to be able to include/exclude as well. Is that possible in some way?
    I saw someone gave an example with the function node, but I could not make that code working and it was dependent on an external web server.

    In Sweden, we celebrate Midsummer Eve, that is the Friday of June 19-25 and that can be week 3 or 4 of June…is that possible to define in Big Timer in some not too complicated way?

    1. Hi – I’ve not added new features to BigTimer for a while – as it is in use by LOTS of people and I’m the sole developer – continuous change is likely to cause issues for existing users who are happy with the current feature set. However as the souece is freely available (2 files – a JS file and an HTML file both exist in your installation), if anyone feels like submitting changes I’m more than happy to trest them and if happy, approve the changes.

      1. Hi again!
        Thanks for replying!
        I understand and have found what I thought was a perfect and even better way to handle holidays.
        I set up HA sensors for workday and workday+1 (workday tomorrow) (in/via configuration.yaml).
        Then I use those sensors to toggle my BigTimer schedules on and off by sending auto/stop.
        In that way I can take both weekends and public holidays into account.
        I have also two HA helpers/toggle switches for “vacation” and “guest mode” that can turn off weekday schedules and turn on weekend schedules when we take time off or have guests.

        It works perfectly well to have those sensors and switches toggling my BigTimers on and off the way I want.
        BUT – when those sensors and switches toggle BigTimers from auto-stop or stop-auto, BigTimer send actual state as payload just as when time conditions are met.

        Is there any way to have BigTimer only sending payload on configured times and not when toggling auto or stop?

  14. New user of BigTimer, and now a BigFan.

    I’m passing my Lat/Long in via msg.payload. Is there a way to verify (using debug) that the lat/long are set properly other than to wait for the pre-defined times (sunset, et. al.)?

    -Larry

  15. Hi Pete,

    I have a question about the ‘stop’ command. I was expecting it to make the timer go completely dormant and not do anything, but when ‘stopped’ it outputs the current status (on/off) at the scheduled times, which is causing me some grief.

    In my case, I have the timer setup to turn on an office heater from 0745 to 10.30 when required: When we know someone will be in the office, we set the timer to ‘auto’ beforehand, otherwise it’s set with ‘stop’ to disable it because this saves money when the office is not occupied (it’s not in use every day).

    Trouble is, the timer sends out an ‘OFF’ at 0745 and 1030 when ‘stopped’, so if someone manually turns on the heating for the day at, say, 0910, the stopped timer turns it off at 1030.

    Is this expected behaviour, or should ‘stop’ completely silence the timer output?

    The pic shows a test setup. When ‘stopped’ BigTimer sends an ‘OFF’ at 0745 and 1030.

    Thanks

  16. I’m seeing an odd issue with the “AWAY X” feature. When I set “away 30”, the actual length of time before the timer expires is just under 10 minutes, “away 3” give me an actual away time of around 1:40. Node red is running on a Raspberry Pi 4 and I don’t see any other time related issues – BigTimer works fine in all other ways I’ve used it, just not this one.

    (flow removed) as not fomatted)

    1. I removed your flow as nor formatted henc messing WordPress reply – no matter – I tested and simplied even furthe to inject:

      away 5 mins

      If does not work – you are correct – no idea why and about to go away for a few days.

      // manual override
      if ((inmsg.payload==1) || (inmsg.payload===0)) inmsg.payload=inmsg.payload.toString();
      if (inmsg.payload > “”) {
      inmsg.payload=inmsg.payload.toString().replace(/ +(?= )/g,”);
      var theSwitch = inmsg.payload.toLowerCase().split(” “);

      switch (theSwitch[0]) {

      case “geo_override” : change=1;
      switch (theSwitch.length) {
      case 3:
      lonOverride = Number(theSwitch[1]); latOverride=Number(theSwitch[2]); break;
      default: lonOverride = -1; latOverride=-1; break;
      }
      break;

      case “away”:
      if (typeof theSwitch[1] === ‘undefined’) awayMinutes=0; else awayMinutes=Number(theSwitch[1]);

      if (typeof theSwitch[2] === ‘undefined’) { awayMod=”mins”; awayDisp=0; }
      else if (theSwitch[2].toLowerCase().substr(0,1)==’h’) { awayMod=”hrs”; awayDisp=0; }
      else if (theSwitch[2].toLowerCase().substr(0,1)==’d’) { awayMod=”days”; awayDisp=0; }
      else { awayMinutes=Number(theSwitch[1]); awayDisp=0; }

      // }

      awayMinutes++;
      break;

      Ideas welcome. The JS file is in your folders along with the HTML file – any ideas anyone – only this override fails.

  17. Comment here from one of our subscribers – I offered advice on an issue he was having – up to now I don’t have good enough examples to be able to test this at an arbitrary time…

    I have to say that simply firing back flows in this format doesn’t help me a lot. BigTimer has thousands of users and most of the feedback i get is very positive.

    Here’s the feedback from reader “Sander” – anyway I’ve updated BigTimer accordingly:

    “This are my nodes:

    [{“id”:”11e2de82.7acf79″, “type”:”bigtimer”, “z”:”80438958.3845e8″, “g”:”7d0c4b3abd1aec47″, “outtopic”:””, “outpayload1″:”on”, “outpayload2″:””, “name”:”Weekdagen 7:30 + 15m random”, “comment”:””, “lat”:”xx.xxxxxxx”,
    “lon”:”yy.yyyyyy”, “starttime”:”450″, “endtime”:”5000″, “starttime2”:0, “endtime2”:0, “startoff”:”15″, “endoff”:0, “startoff2”:0, “endoff2”:0, “offs”:0, “outtext1″:””,
    “outtext2″:””, “timeout”:1440, “sun”:false, “mon”:true, “tue”:true, “wed”:true, “thu”:true, “fri”:true, “sat”:false, “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”:0, “month1”:0, “day2”:0, “month2”:0, “day3”:0, “month3”:0, “day4”:0, “month4”:0, “day5”:0, “month5”:0, “day6”:0, “month6”:0, “day7”:0, “month7”:0, “day8”:0, “month8”:0, “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, “xday7″:””, “xmonth7″:””, “xday8″:””, “xmonth8″:””, “xday9″:””, “xmonth9″:””, “xday10″:””, “xmonth10″:””, “xday11″:””, “xmonth11″:””, “xday12″:””, “xmonth12″:””, “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, “randon1”:true, “randoff1”:false, “randon2”:false, “randoff2”:false, “repeat”:false, “atstart”:false, “odd”:false, “even”:false, “x”:193, “y”:942, “wires”:[[“c0c69585.274fe8”], [], []]},
    {“id”:”ee055a73fa1be45b”, “type”:”bigtimer”, “z”:”80438958.3845e8″, “g”:”7d0c4b3abd1aec47″, “outtopic”:””, “outpayload1″:”on”, “outpayload2″:””, “name”:”Weekenddagen 8:30 + 15m random”, “comment”:””, “lat”:”52.0194446″,
    “lon”:”4.431991″, “starttime”:”510″, “endtime”:”5000″, “starttime2”:0, “endtime2”:0, “startoff”:”15″, “endoff”:0, “startoff2”:0, “endoff2”:0, “offs”:0, “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”:0, “month1”:0, “day2”:0, “month2”:0, “day3”:0, “month3”:0, “day4”:0, “month4”:0, “day5”:0, “month5”:0, “day6”:0, “month6”:0, “day7”:0, “month7”:0, “day8”:0, “month8”:0, “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, “xday7″:””, “xmonth7″:””, “xday8″:””, “xmonth8″:””, “xday9″:””, “xmonth9″:””, “xday10″:””, “xmonth10″:””, “xday11″:””, “xmonth11″:””, “xday12″:””, “xmonth12″:””, “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, “randon1”:true, “randoff1”:false, “randon2”:false, “randoff2”:false, “repeat”:false, “atstart”:false, “odd”:false, “even”:false, “x”:210, “y”:1006, “wires”:[[“c0c69585.274fe8″], [], []]}]

    This is my flows start:
    (see included image)

    I am not smart / capable the read/alter flow files, only to use them 😊.

    I noticed with this setup:
    1. From last Friday to Saturday at 0:00 the flow was kicked off (not wanted)
    2. From last Sunday to Monday at 0:00 the flow was kicked off (not wanted)

    And now I just wrote it as above I see some pattern… it is when the actual flows are “swapped”… As I do not know tha code and logic behind I do not know if this would be something to work with?

    Thank you so much! I really love this node and use It big time 😊!!!

    Regards,
    Sander”

  18. In your description (picture above) On Time2 is empty. In mine I can’t get that. I think it ever was empty but can’t recall. Now I have them set at 0.00 actions also fire at that time (unwanted).
    2 questions. Nowhere is described what “On Time2” even is for, what is it for? And secondly, how can I disable On Time2?
    Please assist me quickly since my holiday schedule ow starts midnight now unwanted due to On Time2.

    Thank you!

    1. Right now I’m on holiday so the short answer is I cannot do testing at the moment. Also, which picture? By default on a new BigTimer, “on time2” will be 0:00 and “off time2” will be 0:00

      I just injected auto and manual on, manual off one after the other to a timer currently off – and the outputs performed as they should..

      I put it into an example at the end of the blog entry here due to the difficulty in inserting images in this reply.

      Regards

      Pete

          1. Thanks for updating the photo. Can you please also answer the main question? What is on time2 for and how can I disable that due to it actually does fire (along time1)?

              1. Hi Peter, I have 2 nodes with output I’d like to send. they are indentically confgiured, but one (weekenddays) seems to also output on the swith (friday-saturday) on 0:00 via the ON1 output… (I only have the ON1 connected). Can I send a picture of the flow and the 2 bigtimer nodes to you for help?

                  1. They are, except for the days…

                    I think something must be wrong with the nodes? Where can I get some support for this? As seen above I am not alone with this issue 🙁

  19. Hello,
    Been using Big Timer for about a year or two.
    It works great for me when using no inputs, but seems strange when using “stop” or “manual” as input.
    I have a switch node after Big Timer which routes the payload by “on” and “off”. Everything is ok when input is “auto”.
    When input is “stop” or “manual”, Big Timer sends “off” payload at “On Time” and at “Off Time”.
    Is this a normal behavior? If yes, how can avoid sendig “off” payload when stopped or manual?

    1. Hi – I just checked your example. When you hit your MANUAL button there is an output on OUTPUT2 only, incidating that the output is zero. OUTPUT 1 gives no output. I’m not seeing what’s wrong with that…
      object
      payload: “off”
      topic: “”
      state: “off”
      value: 0
      autoState: 0
      manualState: 0
      timeout: 0
      temporaryManual: 0
      permanentManual: 1
      now: 394
      timer: 0
      duration: 0
      stamp: 1658810080100
      extState: “OFF Man. override. ”
      _msgid: “dca599cea1a5fa8c”

      I then set the on time in the timer to 5 minutes ago, no further output – no chang except in the BigTimer status – that’s because of the manual OFF command – that’s expected.
      I then injected AUTO and shortly thereafter – output 1 said the output was ON. Again expected.

      What’s wrong there? I’m not following the problem…

      1. I think it is easyer with an exapmle.
        Pease paste the code below, set the nearest on and off timers to your time, deploy and inject “manual off”. Debug 2 will show “off” immediatly, will show “off” again at “On Time” and again at “Off Time”
        In my example will show “off” when injecting “manual off”, at 17:45 and at 18:00.
        Hope this is a clear explanation of my situation.

        [{“id”:”e0d69f6e49f8dfe8″, “type”:”bigtimer”, “z”:”58265a15.3b5ce4″, “outtopic”:””, “outpayload1″:”on”, “outpayload2″:”off”, “name”:”Big Timer”, “comment”:””, “lat”:0, “lon”:0, “starttime”:”1065″, “endtime”:”1080″, “starttime2”:0, “endtime2”:0, “startoff”:0, “endoff”:0, “startoff2”:0, “endoff2”:0, “offs”:0, “outtext1″:””, “outtext2″:””, “timeout”:”1440″, “sun”:true, “mon”:true, “tue”:true, “wed”:true, “thu”:true, “fri”:true, “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”:0, “month1”:0, “day2”:0, “month2”:0, “day3”:0, “month3”:0, “day4”:0, “month4”:0, “day5”:0, “month5”:0, “day6”:0, “month6”:0, “day7”:0, “month7”:0, “day8”:0, “month8”:0, “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, “xday7”:0, “xmonth7”:0, “xday8”:0, “xmonth8”:0, “xday9”:0, “xmonth9”:0, “xday10”:0, “xmonth10”:0, “xday11”:0, “xmonth11”:0, “xday12”:0, “xmonth12”: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, “randon1”:false, “randoff1”:false, “randon2”:false, “randoff2”:false, “repeat”:false, “atstart”:false, “odd”:false, “even”:false, “x”:700, “y”:1140, “wires”:[[“a6f0d209504f0405”], [], []]}, {“id”:”a6f0d209504f0405″, “type”:”switch”, “z”:”58265a15.3b5ce4″, “name”:””, “property”:”payload”, “propertyType”:”msg”, “rules”:[{“t”:”eq”, “v”:”on”, “vt”:”str”}, {“t”:”eq”, “v”:”off”, “vt”:”str”}], “checkall”:”true”, “repair”:false, “outputs”:2, “x”:850, “y”:1140, “wires”:[[“8d940836f54ffd0b”], [“7df5a0fc8d88f022”]]}, {“id”:”33fe66595ed02387″, “type”:”inject”, “z”:”58265a15.3b5ce4″, “name”:””, “props”:[{“p”:”payload”}], “repeat”:””, “crontab”:””, “once”:false, “onceDelay”:0.1, “topic”:””, “payload”:”manual off”, “payloadType”:”str”, “x”:480, “y”:1140, “wires”:[[“e0d69f6e49f8dfe8”]]}, {“id”:”8d940836f54ffd0b”, “type”:”debug”, “z”:”58265a15.3b5ce4″, “name”:”debug 1″, “active”:true, “tosidebar”:true, “console”:true, “tostatus”:true, “complete”:”true”, “targetType”:”full”, “statusVal”:”payload”, “statusType”:”auto”, “x”:1030, “y”:1100, “wires”:[]}, {“id”:”7df5a0fc8d88f022″, “type”:”debug”, “z”:”58265a15.3b5ce4″, “name”:”debug 2″, “active”:true, “tosidebar”:true, “console”:true, “tostatus”:true, “complete”:”true”, “targetType”:”full”, “statusVal”:”payload”, “statusType”:”auto”, “x”:1030, “y”:1180, “wires”:[]}]

      2. Hello, Peter
        I just tested the new version, 2.8.2. Seems it is working as 2.8.1.
        My english is not so good, hope I can explain better this time.
        Big timer is working great on auto, as expected.
        On “manual on” and on “manual off” it outputs at scheduled times, not as expected.
        For example, on time is 18:45, off time is 19:00. All great on auto. On “manual off” it sends “off” at 18:45 and again “off” at 19:00. Is this expected?Expectation is to send nothing on manual.
        Hope my explanation is more understandable this time.
        Thank you.

  20. Hi, Thanks very much for BigTimer. It’s really a great tool for scheduling in Node-Red.

    Is there any way to override through an input message the days of the week that are selected in the node ? Ideally something like on_override and off_override but for days of the week instead of start and end times.

    1. Hi

      There isn’t – if enough people erquest such a feature, anything is possible but I’m averse to making changes without demand – no-one has ever asked for this before. Hope you enjoy BigTimer otherwise.

      Pete

      1. Thanks for your answer. Right I understand.

        After asking here, I started to look around and ended up on Schedex (node-red-contrib-schedex) a timer node inspired by BigTimer that already implements overrides for a lot of features (including day of the week).

        You might want to have a look if you don’t know it yet 😉

  21. Hi, I am just starting to try and understand Node Red. I have been using Bigtimer for my lights. For some reason I cannot find out how “randomise outputs” should work. I would like to set the “Off time” to e.g. 23:00 hrs, and would like the lights to switch off randomly somewhere between 22:30 and 23:30. Is there a way to set the randomisation timerange or do I use the “Off offset” for that? Many thanks.

    1. Its a long time since I used that but… if the random flag is ticked the ofsets will be between 0 and whatever you set as an offset.. it’s in the javascipt file in case you want to look.

      if (actualStartOffset == 0)
      { if (node.random) actualStartOffset = randomInt(0, node.startOff); else actualStartOffset = node.startOff;
      if (node.randon1) actualStartOffset = randomInt(0, node.startOff);
      }

      if (actualEndOffset == 0)
      { if (node.random) actualEndOffset = randomInt(0, node.endOff); else actualEndOffset = node.endOff;
      if (node.randoff1) actualEndOffset = randomInt(0, node.endOff);
      }

      if (actualStartOffset2 == 0)
      { if (node.random) actualStartOffset2 = randomInt(0, node.startOff2); else actualStartOffset2 = node.startOff2;
      if (node.randon2) actualStartOffset2 = randomInt(0, node.startOff2);
      }

      if (actualEndOffset2 == 0)
      { if (node.random) actualEndOffset2 = randomInt(0, node.endOff2); else actualEndOffset2 = node.endOff2;
      if (node.randoff2) actualEndOffset2 = randomInt(0, node.endOff2);
      }

  22. I am trying to turn on a light at 6AM and have it turn off at sunrise. It works fine in winter when sunrise is after 6am, but in the summer when sunrise is before 6am the light comes on and stays on all day. Is this the expected behavior?

    1. No ides Greg, I’ve never seen sunrise before 6am…. as the timer only thinks in terms of a single 24 hour period starting at 00:00 and ending at 23:59 that is quite possible.

      1. Where I live sunrise can be between 5am and 8 am.
        I think I will use two timers in parallel and use a function node to check the current month and redirect traffic to the summer timer or the winter timer.

  23. The current version (2.8.1) appears very broken, something with the on and offtimes. Take a default Big Timer instance with no changes other than on time and off time, leaving on time2 and off time2 untouched:
    On 01:00, Off 03:00
    When I deploy it shows ON for 1h 20m (current timestamp is 10:40 fyi so it should be off).
    Change to: 02:00 > 03:00 and it should show on for 0h 20m, instead it shows OFF for 0h 20m.
    I have been monkeying with this for about 45 minutes now and cannot get any consistency out of it. I have been using it for about 2 years without a problem until I upgraded this week.

    1. Hi

      I just took the Bigtimer on my PC, added an instance to a spare flow…. and did absolutely nothing other than set it to ON at 10:45am and OFF at 11:00am with ON payload being “1” and OFF payload being “0”, topic being “testtopic”- this was at 11:42am. I attached a debug to the first output and noted a pair of “0” messages before the “1” message came out, bang on time.

      I’m using version 2.8.1 which has been out for months – and has been installed on this PC for about the same time – I’m on GMT+1 here in Spain if that helps. Oh and seconds after 11am I noted the output in the debug was now showing “0” as expected.

  24. feature request:

    I’m using sunset/sunrise and dusk/dawn,as triggers, however, the weather conditions have an impact on how much light there really is. I have assembled a light sensor module (WSL125 – https://www.jameco.com/z/WSL125-Velleman-Light-Sensitive-Switch-Kit-12VDC-NO-NC-24V-5A_2196473.html), this input (off=light, on=dark – can be reversed) gives an idication of the real world experiance, for example:
    – last night sunset: timer: 1657396657 (21:57:37), sensor: 1657397916 (22:18:36)
    – this morning sunrise: sensor 1657423622 (05:27:02), timer 1657424634 (05:43:54)

    would it be possible to provide an extra input for bigtimer, that allows:
    – a delay for sunset / dusk if the sensor is indicating there is still sufficient light (still enough light, despite sunset / dusk).
    – an advance for sunrise / dawn if the sensor is indicating there is already sufficient light (already enough light, despite remaining time before sunrise / dawn)

  25. Hello,

    I’m going through this amazing project. The use case I’m looking for is the control of a boiler switch.
    1. set the daily schedule for the morning and evening shower
    2. stop the schedule when we are on holiday

    For the first part, the duration changes throughout the year (sun/electric boiler) and if the kids are home or not. Secondly, the starting point changes throughout the year.

    Based on my testing, the manual override is one for 1 schedule. Ideally, I would love to have a second override schedule. Is this something feasible to add ?

  26. Hi Pete,

    I hope that my note find You well in that strange times.

    A lot of time flown since my first contact with BigTimer. It is working for months, mainly for irigation system. I decideed to polish it a little bit and found two questions:
    1. what is ‘temporaryManual’ key in first node? It has value “0” for “stop” and “manual” (while ‘permanentManual’ for “stop” and “manual” shows alway “1”
    2. I was trying how does Timeout is working. I set it for 1 minnute to observe. I put “manual” but after 1, 2, 3 minutes the second node did report always “OFF Man. override. “. And that same below Node-Red node. For sure for longer time it does work but why not for 1 minute?

    verybest regards
    Qba

  27. Hi Peter

    I hope you are well.
    I would just like to know if it will be possible to set the times trough a UI and is this something you would be able to help me with?

    I am busy with a patent and I don’t want to give the users access to the backend hens the UI.

    1. Good afternoon Henk

      As per the blog, time setting is done via html or (see the table in the blog entry above) by manual override (on_override, off_override) – I guess you could feed that information in via a UI – not something I’ve done personally.

  28. Hello Peter
    I’m a newbie at HA and Node-Red.
    I’m using Big Timer in an automation to turn on lights at (ideally) dusk with an offset of around -45 minutes, then off again at 23:45 (if we have not turned them off manually).
    Is it possible to obtain the time of dusk – I understand there are a few “dusks” (civil, nautical and astronomical (see: https://www.timeanddate.com/astronomy/different-types-twilight.html) – which “dusk” does Big Timer use?

    I’ve also noticed the lights are on on the morning. I see from the light history that HA Supervisor turns on the lights at a minute or two after midnight (I used the Timer2 On and Off defaults of 00:00). I suspect this is due to ‘finger trouble’!
    I would appreciate advice on debugging something like this.

    Temporarily, I have used an inject node to turn off the lights off at 00:02.

    Appreciate any help you can give.

    Regards

    Stuart

    1. There are two relevant not-that-big files in the node-red-contrib-bigtimer folder… one is .js and that will tell you all you need about dusk and dawn (the other is .html) – neither are compressed or obfuscated. The timer is also dependent on a 3rd party library (again Javascript).

      Regards

      Pete

  29. Is it possible to override the days in a week when the alarm goes off? I know I can set the days in the config, but is it also possible to override them, just like you can use “on_override” for overriding the time?

    I want to add toggle switches to my dashboard for each day of the week. When I am working normally, I just switch on Monday-Friday, but for example when I don’t have to work, I would like to just manually toggle a switch to prevent the alarm from turning on on these days – without completely turning the entire timer off.

  30. I have a BigTimer component On-time set to “06:45” and the Off-time set to “Dawn”. My expectation is that if this resolves to a negative time window on a 24h scale, the BigTimer does not fire the “On” event, but it seems, this is not true.

    During winter time, dawn is as late as about 08:00h in my area and then I the component fires the ON event at 06:45 and the off event at the respective dawn time. Which is exactly what I want.

    But now, dawn is at around 06:30h and since this is before 06:45h I was hoping the component would not fire, since this evaluates to a negative difference between the two points in time.

    Instead, the component simply fires at about 06:30h (dawn) for the OFF-time and then at 06:45h for the “ON”-time. I see that there might be use cases for exactly that behaviour, but wouldn’t it make sense to have a setting to disallow negative time difference?

    How could this be accomplished?

    TIA, Andre

    1. My current solution is to evaluate the “duration” property. If that is something higher than 3hrs I assume this is due to dawn being before 06:45h. I guess an additional indicator would be cleaner.

  31. Need the ability to tell bigtimer to use the lat/long from Home Assistant. It’s already set up there. I don’t want to repetitively copy/paste these values across dozens of nodes. This is a maintenance burden if I ever move or need to update the values for other reasons. I’d even be OK with the ability to override the values with an input. Just let me pass in `msg.latitude` and `msg.longitude`.

  32. Hello Peter, Great node with so much flexibility. I did happen to run into a particular issue using your manual override feature by injecting an “on” into the input of Bigtimer. I was having an issue with it not working at all and finally discovered it was because I have Bigtimer configured for Monday – Friday on this particular schedule and was trying to do some troubleshooting on a Saturday. Apparently, the manual override does not work outside of the weekday limitation on my schedule. When I updated Bigtimer and checked Saturday I was then able to use the manual override. You may be aware of this but thought I would mention it since I struggled with doing some testing today (Saturday) due to this. Thanks again for continuing to support Bigtimer.

  33. Ok, I will keep looking.
    I am using Node-red via Home-assistant plug-in.
    So far, I add no issues.
    I will update the HA core and restart again.

    Really puzzling, ouput 2 and 3 are running really fine, but not output 1…..
    If I don’t find anything, I will revert to using output 3 instead.

    Thanks for your help.

      1. Indeed, this how I have ever used it.
        But currently, I can’t find why, I have zero outputs, no matter whether the “repeat” is ticked or not.

        On the other hand, on output 2, it repeats every minutes ONLY if option “repeat” is ticked. If not ticked, I have only at start-up or changed …
        It could look like my output2 has the intended behavior of output 1.
        And output 3 is as expected.

  34. Thanks for looking at it Peter,
    indeed, this is really weird, because I have restarted everything (host, HA, Node-red, …) etc. and I still can’t get any output out of output_1…
    Do you actually use more the output_2 ou the output_1?

    Who you have any advice about a direction to look into for the root cause of such behaviour?

    1. Hi

      No, I rarely use output 2 which is why I didn’t spot the issue earlier – I use Output 1 Payload on several BigTimers and all is well, some are feeding simple 1 and 0 to Tasmota devices via MQTT, others are feeding more complex text to my ESP-GO units – no problem – if there was, I’d know about it as we’d have no heating 🙂

      I should stress I’m using the 2.8.1 update exactly as published – on a RPi4 – no docker, just simple Node-Red 2.1.3 and Mosquitto MQTT.

  35. Hello,

    me again,
    after the first automation trigger check of the day, and it seems I have no output 1 at all anymore.
    It is not even empty, it is just not sent…
    Output 2 working fine, but I’d rather use the one-off message…

    1. Not sure what’s happening there as my entire home is runninf on the RPi4 I did the updates on – and all my lights etc are running – I did not have to replace the timers. I did reboot Node-Red after making the changes to ensure all was well, otherwise everything is running smoothly – if it were not, I’ not be able to find my way around the office to write this reply – the light are all on BigTimer.. as is my office heating.

      Regards

      Pete

  36. Good Morning Peter,

    Thanks for keeping a look and updating your node.
    It is indeed a great one that I use.
    In particular, I am relieved to see that you have been aware of the issue I have faced, like others, since early Jan, as my bigtimer nodes started to NOT trigger at the expected time, as it seems I had the same “empty” payload issue.
    In my case, notice that it was on both outputs 1 and 2 that I had empty payload.

    I have just updated to your latest version 2.8.1 this morning and I will keep you informed.
    It seems ok on the short term debug I could run, but I’ll wait to see all my triggered automations run through the day today.
    Also, a bit weird, after updating the palette and restarting Node-red, I also had to delete the “old” pre-existing bigtimer nodes and plug in new ones pulled from the palette. Is it a normal way to do? Should have the palette updated the already used nodes after the restart?

    Thanks again
    Vdelab
    (PS : I’d love to rate your node contrib, but it seems I do not have such action rights on the flow page).

  37. Hi, I’ve been using BigTimer for a while but today I’ve had issues with it. After updating to NodeRed 10.3.1 overnight, this evening all my BigTimers failed to trigger, using a debug the Payloads are all coming back as blank (“”). BigTimer version being used is 2.7.8.

    Thanks

    1. Ok now you have me at a loss, the latest Node-RED that I’m aware of is 2.1.3 – not 10.3.1 – and I updated BigTimer to 2.7.8 on my main RPi – and my lights etc (all using BigTimers) are still working. Want to check and elaborate? For reference I’m on npm 6.14.5 and node 14.18.2 – all of that is reasonably up to date.

      I published the code wtraight from my main Pi so no chance of mistakes on the way.

      1. As I have no IDEA when this change occurred as I’ve never noticed it before (I use output1 payload normally), I’ve just downed tools and fixed it. To clarify – output2.payload is now identical to output1.payload and as I watch my lights go off and on as I use my NR dashboard to check this.

        Hence, cacheing permitted you will now find that the current version of BigTimer is 2.8.0 (as of 7.55pm UK time on Jan 1, 2022)
        https://flows.nodered.org/node/node-red-contrib-bigtimer

        You can imagine as the sole developer I am always worried about making hasty changes – 1574 downloads this week alone. However, that was percisely one line of change. Could someone please comment in here that 2.8.0 is up there. And if it is ok can you please rate it. (Every little helps as they say at Tesco or somewhere).

        1. I just updated bigtimer to v2.8.0 via the Node-red palette manager in HA. I am running Node-Red 2.1.4 (as listed in the actual HA node-red info page) BUT I am still running v10.3.0 of the Node-red Add-on in HA (I have not upgraded to v10.3.1). Bigtimer appears to be working fine. I will upgrade the node-red add-on from 10.3.0 to 10.3.1 which is the latest version available and report back. I’ll do that a bit later today.
          Pete – where would I go to rate it please?

        2. Hi, I’ve updated to 2.8.0, unfortunately the payload is still coming back as blank. Hopefully Windsurferw can update their node-red addon to 10.3.1 and be able to confirm if they also have the issue or it’s just me.

            1. Check cacheing – I definitely saw the issue, reliable blank payloads on the second output – somewhere along the way, the line copying msg1.payload to msg2.payload had gone astray so I fixed it – and here is the result again after a reboot… I now repeatedly see the same output on the second payload as I do on the first. See debug image included here.

          1. I just updated the Node-red add-on version in HA to 10.3.1. It seems to give me the same output as 10.3.0 (yes I’m getting a payload from output 2). I did restart the add-on and to test and also I clicked on the Deploy drop-down then ‘Restart Flows’. In my case my payload is: “turn-on”.
            Let me know if there is something I can try for you.

            1. Hi All,
              First thanks for BigTimer, very usefull node.

              I too had issues with the latest update. I was using output 2 and expecting a 0 or 1 (and recently when I added a ON Time2 a “2”), as per the documentation.

              “Output 2: outputs a 1 or 0 every minute when checking (in msg.payload) – you can use that to light up something.”

              That 0 and 1 disappeared with the latest update, and was just putting out “”. I was able to just put 0 and 1 into the on ON Msg and Off Msg fields and that works fine for me. I didn’t need the “2” output for On Time2, but it would still be a problem if I did.

                1. And now v2.8.1 fixes the output2 payload issue that you guys spotted – BigTimer now has 0 or 1 as second output payload. If the new command “AWAY” is in action, it will also be 0.

                  I’ve just been over to node-red flows page to make sure it’s updated to 2.8.1

          2. I also updated and it’s still outputting an empty string “”. It should default to a 1 or 0 according to the help section. However it does not.

            A workaround for me was to set the msg to “on”/”off” and then in the switch node right after change the logic. However this is a hefty task for those who have a lot of bigtimers implemented.

  38. Hello,

    Since the 1/6 update, the msg.payload of the middle output (the one which outputs every minute) is always “”. I’ve worked around this by parsing msg.state, but that doesn’t seem like an ideal solution.

    Loren

  39. Pete, your update heading should be “Update January 6, 2022”. Don’t make me relive 2021 again. 🙂

    1. Where would I be without you. Fixed.. No, no-one wants to relive 2021 – horrible year. Best forgotten. It’s 2022 now – and I belive our Prime Minister has developed some balls and is going to start lecturing the anti-vaxxers 🙂

  40. Hi Peter,
    I think I found the issue. Would you mind checking line 137 in bigtimer.js? I am using release 2.7.6. I believe the current line
    node.month9 = n.month;
    should be
    node.month9 = n.month9;
    Thank you in advance for checking

  41. Hi Peter – not sure if I entered my post correctly; sorry for any duplication.
    Happy New Year! I am enjoying my first holiday season using bigtimer – kudos to you for this. I’m not sure if this is the best place to report a possible issue..
    Everything has been working well until today my lights did not activate, in fact my bigtimer nodes all report for today ‘No action today’. What I have determined by experimenting is that – under ‘Include special days of the year’ – Day 9 does not activate. If I put today’s date (Jan 5) in the Day 9 position, it does not work. If I put today’s date in any other position under ‘Include special days’, then bigtimer triggers just fine.
    Is there some other setting that I’m possibly missing that could be causing this?

  42. Hello Peter,
    really great work, thanks a lot for the node 🙂
    I’m wondering how to configure BigTimer to avoid switching off on the given day? i.e. “switch on” today but “switch off” tomorrow?

  43. Can BigTimer do an off-on transition every 30-45 minutes or do I need another tool? I own a Super Feeder automatic cat feeder. When its power is applied, it dispenses a programmable amount of pet food. I bought it with a mechanical rotary lamp timer that has a plastic detent for every 15 minute interval and use a pencil to set the detents to try to get it to power up for 15 minutes and down for 30, repeating all day. (My fattest cat would eat the whole tank of kibble and barf it up, so I have to do this to slow him down.) Ideally, I’d like to say “on at 00:00, off at 00:15, repeat every 00:45”. I’ll also be hooking up an Inject node to be able to “treat” the cats in between cycles from my desk or phone.

    1. BigTimer id meant as a sophisticated version of old-fashioned wall timers, not what you are after – so one timer can do 2 on-off times a day – of course – as they are free you could probably use several to get what you want. On the other hand look at my node-red-contrib-timeout… ???

      Pete.

  44. Hi
    Thx for making this great node for node-red. I use it for christmas light and now for outdoor light.

    I have a wish for adding a 3rd ontime/offtime if possible.

    The reason for this is following usercase:

    1. Want light to turn on at 6am and off at sunrise.
    2. turn on again at sunset and off at 1-2 am.

    This is not possible because 1-2am crosses the midnight and then runtime starts over.
    If there was a 3rd ontime it could be as following:

    Ontime1: 00:00 offtime1: 02:00
    Ontime2: 06:00 offtime1: sunrise
    Ontime3: sunset offtime3: 00:00

    Hope you can see the point.

    Thx again for the node and merry christmas.
    Kind regards
    Thomas

    1. And merry Christmas to you, Thomas

      Given the emails I’ve had over the second timer, I’ll politely decline adding a third as there is too much risk of introducing issues with previous versions.

      Regards

      Pete.

  45. Hi – I would like to set the Big Timer to turn on exactly at 11:10 a.m. and turn off exactly at 11:15 a.m. Unfortunately, I noticed that the on/off is shifted by several seconds (please look at the attached screenshot). The offset depends on which second the deploy occurred.
    Is this a deliberate action or a bug?

    Second question, how to disable the second timer (Time2)? Is it enough to set it to 00:00? (but then how to set the 2nd timer to 00:00)?

    1. A1: The timer works on the minute. If the time on your RPi or whatever you are using for NR, is not correct, then NR node timings will not be correct.

      A2: Second timer – either leave unused or set start and stop to 00:00

      Pete.

      1. Dear Peter, thank you for your prompt reply.
        1: This seems to be standard in NR – I did a test for a regular Inject node, deployed it at 52 second past the minute, I get outputs every minute (at 52 second).
        Unfortunately, I still don’t know how to set the Big Timer to a specific time (e.g. 14:00, 00 seconds).
        If I set it to 14:00 and deployed a node at 15 second (e.g. at 13:45:15) then I get output at 14:00:15….

        2 – I don’t understand. I would like to disable Time2 (leave it unused), but there is no such selection in the drop-down… I can leave it on 00:00 but then it is disabled or set to 00:00?

        1. Set the 2nd ON time to 00:00 and the second OFF time to 00:00 – I just did that and that effectively disabled the second on and off times. BigTimer never intended to be aurate to the second, just accurate to the minute – it depends what the rest of your NR installation is doing.

          Pete

          1. Thank you.
            You wrote (Set the 2nd ON time to 00:00 and the second OFF time to 00:00 – I just did that and that effectively disabled the second on and off times.) – the question then is how to set Timer 2 to 00:00?
            Wouldn’t it be the simplest and most elegant solution to add the option to the drop-down list (Disabled)?
            It would be great if every timer had an option to disable (1st On, 1st Off, 2nd On and 2nd Off) – many people would like to use only 1st On for example.
            I don’t want to be stubborn, but I saw that many people have the same problem – the inability to disable Timer 2 and pointed to the above solution as expected.
            Anyway, thank you for your work!

            1. If timer2 is never used it is disabled. If it has been set, setting the start and end to 00:00 disables it.

              I just disabled timer2 a few minutes ago by putting in 00:00 for both start and stop times.

              You do that as you would set any other part of the timer…. in the dropdown box – select 00:00

              See image.

            2. I’ve made a local version with overrides for the second timer and second set of offsets but I’ll want to see this running for some time before publishing – so easy to get that wrong.

              Pete.

    2. But then, the node only checks every minute, if it checked every second, this would take up unreasonable resources, especially where multiple Bigtimers are used in a single installation.

      Pete

  46. I’m using the fantastic BigTimer with options on on Dask and off on Dawn
    The On Offset and Off Offset parameters mean that the timer switch before or after the Dask time ? Negative value are supported ? ie if I set On Offset to -30, the timer switch on 30 minutes before Dask ?
    Thank for yuor time !

  47. Henrik, for that kind of routines You do not need swiss knife as BigTimer. Simple inject-node in NodeRed does this job. Just change “Repeat” for “at specific time”.

    1. Correct, I would still have to do the Countdown node for the unplanned starts, though. Thus I could keep it as it is.
      My question remains: Have I misunderstood BigTimer or am I doing it wrong?

  48. Hi there.

    I’m trying to start my car heater every weekday morning. All good and well, the tick boxes at the bottom of the list does the trick.
    However, I also would like to be able to start the car heater on command for other times. But; when the tick boxes for saturday and sunday is empty, Big Timer doesn’t answer to any commands. Not “timer 3600”, not “Auto”, heck, not even “sync”. Ticking the boxes makes it answer to the same inputs, though. For now I’ve put an external countdown timer to do the trick, but it would be neater to have it inside the same node. I’ve scorched through the manuals, videos and forums, but to no avail. Is this as designed or am I doing something wrong? The image is with the boxes unticked.

  49. Hi Peter

    Seems lige BigTimer is very nice indeed. But im having a single problem,

    I want to start some lights 1 hour before sunrise, and then turn them of again 30 min after sunrise, but if i set OnTime and OffTime both to sunrise, but with -120 and +30 offset respectively, the timer is disabled, as on off is the same. Maybee dont disable a timer if OnTime and OffTime is the same, but the offsets differ?

    Or did i misunderstand something?

  50. Hi there,

    I am kind of new to Home Assistant, Node-red and BigTimer, but so far, so good and enjoying it.

    My use case, that I want to set up, is: turn on garden lights in the morning, then turn them off after some short time (in reality based on position of the sun), and do the same (on/off) in the evening, again based on sun.

    At first I did not quite understand how to set up BigTimer, or at least did not get it to work properly (thinking I did understand). But working on this test of mine (see picture attached) I think/hope I can figure it out, and make it work… 😉 Reading a manual is not my best skill, and maybe it is not even in there… Trial and Error are my friends…

    Points of attention:
    * for my use case, all four elements ontime, offtime, ontime2 and offtime2 needed to have their own ‘unique’ time settings. Not yet looked at exactly what makes them disabled or not.
    * when looking at the relevant flow in Node-red, then the status (indicated with A in the image) below the BigTimer node -tmo- is somewhat misleading: when on/offtime1 finished, their (on/offtime1) own indication for the next period is shown, NOT the one next for on/offtime2. This will be shown right after on/offtime2 was activated. In my head I was expecting to see the time untill the next action, in my case for on/offtime2…
    * the payload value is different for on/offtime2, compared to on/offtime1. See attached image: 0, 1 and 2. Value for “state” is constant in my test (“ON Auto” / “OFF Auto”).
    * I will use the second output from BigTimer. I disabled both ‘Repeat output’ and ‘Output at startup’

    Just posting this so it might be of help for the reader.

    Cheers,
    Jaro

  51. Hi,
    I would like to set the offset from input, because then it can be possible to read the weather data for example if it is raining and set the offset to turn on early that day or if the sun is shining then it can delay the offset for that day.
    Can this be done?
    Thanks.

      1. I am new to node-red I try to understand, I have tried this:
        to set msg.onOffsetOverride and msg.on_offset_override to -60 and other but it does not work. Can you please give me a push in the right direction? Thanks.

        1. Hi Peter,

          I just stumbled across BigTimer and am trying to accomplish the same thing as Talzac, and can’t figure out how to use the input for msg.on_offset_override to work properly. I have only been able to find vague references about this input, and no examples.

          I set the On Time to Dusk, Off Time to 23:45 (On & Off Time2 values are default 0:00), Lat to 40.014, and Long to -83.143 (Eastern UTC -4). As I write this it is 2:23 PM EST on my comuter, and the BigTimer node status shows “Off for 3 hours 24 minutes”. I have tried using an inject node with different values for msg.on_offset_override (60, -60, 400, -400, 1:00, -1:00, 4:00, & -4:00). The status never changes other than counting down the minutes.

          Please provide details with an example of how to use this input.

          Here is debug output from inject node:
          {“_msgid”:”301dd3f12a1eceda”,”on_offset_override”:”1:00″}

          Here is debug output from BigTimer node resulting from injection:
          {“payload”:0,
          “reference”:”:::877″,
          “topic”:”status”,
          “state”:”OFF Auto”,
          “time”:”03hrs 10mins”,
          “name”:”Big Timer”,
          “lon”:”-83.143″,
          “lat”:”40.014″,
          “start”:1067,
          “end”:1425,
          “dusk”:1067,
          “dawn”:409,
          “solarNoon”:738,
          “sunrise”:438,
          “sunset”:1038,
          “night”:1132,
          “nightEnd”:344,
          “moonrise”:923,
          “moonset”:149,
          “now”:877,
          “timer”:0,
          “duration”:190,
          “onOverride”:-1,
          “offOverride”:-1,
          “onOffsetOverride”:-1,
          “offOffsetOverride”:-1,
          “stamp”:1636918639183,
          “extState”:”OFF for 03hrs 10mins”,
          “_msgid”:”ba613505e8749b86″}

  52. Hi Peter

    Thanks for using your time on this plugin 🙂

    I can see that this has been asked before, but the only answer I can find is that time2 should be later than time1 and that it is.
    I have this simple timer, but On Time2 doesn’t run.
    I haven’t touched any settings that can’t be seen on the screenshot.
    The last debug message is manual override just to make sure the On Time2 time was passed. When the Off Time1 has been triggered, it also says “OFF for 23 hrs 56 mins”.

  53. Hey
    I try to get Bigtimer to On Time 4:30 p.m. and Off Time 1 minute, every month on the 24th. I configured Day 1: 24 and Month 1: 1-12, I deselected everything else. However, the status always reports no action today, even on Day 24.
    What am I doing wrong?

    Thanks
    Heinz

      1. Great, got it. Thanks.

        Another questions. I’d like to inject an event at specific days in a month (e.g. every 10th and 20th at 02:00am every month in a year). How do I configure that?

  54. Hi Peter,

    first thanks for the node and the value you provide to the tech community every day.

    I have a very basic issue with big timer. I just does not work. I’m working with node red for some time and have a good knowledge but I cannot get the timer to work. Even not the simplest flow.

    2 Injects with msg.payload – String “on” and “off” and “on text” and “off text” configured in the big timer node. I can see that it works because of the mini text below the node saying “on-temp override” etc. But I do not get a message from output 1. I’m getting a message from output2 (debug) but output 1 channel is dead. Even with inject not pushing the sync command, output 3 remains quite.

    I have NR version 1.2.3 and Bigtimer version 2.7.5.

    What have I missed?

    thanks
    Horst

  55. Request for new feature

    Hello Peter,
    first of all I want to thank you for the bigtimer, which is really fantastic and one of my favorites in nodered.

    However, I have a question about whether the name of a timer can somehow be generated automatically from the values stored in the timers field values.

    For example, it would be ideal if the name could be generated from the field values of “On Time”, “On Offset”, “Off Time” and “Off Offset” (see screenshot). The result would then be shown in the screenshot. This would make it easier to keep track of what time a timer becomes active, when using several timers.

    many greetings

    Michael

    1. I have always had trouble getting my head around the connection from variables back to the webpage-entered name. As you have the source code (one JS page and one html page) in your /home/pi/.node-red/nod_modules/node-red-contrib-bigtimer folder – feel free (make a backup first) to attempt changing the JS to suit (in a simple text editor). If it works, send back to me with your changes commented and I’ll give it a whirl.

  56. Hi, seems to me as if “manual on” and “manual off” are effective until the next scheduled action (on/off) while based on the description the “manual” should be permanent, did I understand correctly? (Thanks for your great work!)

  57. Hi, is it possible to output the full message just once a day? I know I can get it from the second output, but I don’t need it every minute.

    My use case is that I want to calculate how many minutes are between sunrise and sunset. I am going to be making an API call to OpenUV, but my account only has 50 calls / day. So I was going to do something like [minutes of daylight] / [45] so it dynamically picks the correct call rate through the whole year.

    Thank you!

      1. Thanks for the reply. Is there a way to force the output from Output 2 to go through 1 or 3 instead? I only need to calculate once per day, so was hoping to not have to have the output firing minutely.

  58. I’m sorry, I was probably not clear enough.

    When using only On and Off the timer shows On/Off Temp override and the status shows On/Off override which like you said is OK.

    When using Manual and Off the timer shows OFF Man. override and the status OFF Manual which is OK I think.
    However when using Manual and On the timer shows On Man. override (correct) but the status shows On Override which is not correct.

    Regards, Ed

  59. Hi Peter,

    I ran into a small issue with bigtimer. When using “on/off” with “manual” the state is not reflected correctly. Using “on” with “manual” gives “on override” where “off” with “manual” gives “off manual” (as it should be). I’m having some leds based on the status so would appreciate it to be corrected.

    Thanks for all the work,
    Ed

    1. When I use on and off as manual overrides, in the first output, state=”on” and state=”off”. If I look at the second output, I get state=”ON Override” and state=”OFF Override” (without quotes of course).

      Regards

      Pete

  60. Hello Peter,

    First off, like many that have come before me, thank you for developing, and maintaining, BigTimer.

    I am having a problem that I am hoping you can assist with. Through trial and error I have gotten my setup for BigTimer working to randomize my living room lights to come on and turn off during the day and night. However, I want 2 of the lights to come on specifically at 4 PM (16:00) EST/EDT. I previously had set the “On Time2” with a -30 minute offset and to randomize the turn on. Now I have the “On Time2” set at 16:00 with no offset (0) and unchecked the box to randomize On 2. Ever since making the change, the lights are still coming on randomly around 16:00. What am I missing? Please help!

    Thank you!!!

    P.S. – If I remove the offset from “On Time1” it seems to fix the problem, which shouldn’t be the case.

    1. That’s odd. Well, I’ll check next time I’m doing updating but meanwhile, you have full access page /home/pi/.node-red/node_modules/node-red-contrib-bigtimer/bigtimer.js – a mere 35K long readable file – if you happen to spot any issue, please do write back in. BUT a word of caution, back up the file before tinkering – and whenever yyou make changes to any NR file, it is as well to restart NR when you’re done. NOT doing that has caught me out in the past. Also when you unchecked the box – did you restart NR before coming to the clonclusion that something was wrong? Same thing… a restart ensures that NR is working wityh the latest changes.

  61. Pete,
    I’m using the latest version of your BigTimer and have a small problem. By using “On Time2” and “Off Time2” and Sunrise was before “On Time2” setting it should not switch but it does.

    See attached PNG.

    Is that a fault or do I miss something?

    1. At first glance might the issue be that you have set time 2 early in the day than time 1? Time 2 settings should always be later than time 1 off. The timer does not understand overlapping days – just a 24 hour period starting at 00:00 and ending at 23:59:00

      1. Hi Pete,

        I did that what you suggested with no luck. I think you should compare ontime and offtime as long as one of each is variable like sunrise. If sunrise already accured before ontime then you should not switch.

        Should be possible to manage in BigTimer.
        Regards

        1. Easy except it is AGES since I looked at that code. Suggestion – for a quick fix, in /home/pi/.node-red/node_modules/node-red-contrib-bigtimer there are only two relevant files – an .html and a .js – calcs are done in the .js file – you have full access to them as usre pi – but don’t forget to restart node-red if you make a change (and I suggest backing them up first).

  62. I only wish to set one timer, how do I do this? There are two timers in the interface and no option to clear the ON / OFF times. So how do I ensure it doesn’t send ON and OFF on the second timer?

    I can’t help thinking I wouldn’t be the only person to ask this, but having searched this page clearly I am!

  63. Peter, thank you for Big Timer. This page probably has the longest comment section in all of the Internet. And now I’ll add to it.

    What is the recommended approach to have a timer that is only active between specific dates? There are months than can be checked but what would I do to have the timer act only between December 25 and April 15?

    1. Hi Mark

      The timer works by months as that is the most common use-case.

      One way around this would be to put the output through a function node who’s output only operates if a global variable is true.

      In that case you could use an INJECT node firing out a timestamp every 5m minutes (for example) into a function node.. if you are greater than or equal to December 25th, the funcion could send the “auto” command to bigtimer.. sfter April 15th it could send the “stop” command to BigTimer….

      Just a thought..

      Regards

      Pete

      1. Hi Pete,

        Thank you for your response and the suggested workaround. I also thought about some additional filtering function but wanted to make sure I didn’t miss a setting.

        Regards
        Mark

  64. Hello,

    How do I disable ‘On Time2’ and Off Time2? Do I have to set it to same values as On/Off Time1, if applicable also use the same offset as for Time1?

    I believed the default values of 00:00 for Time2 meant they are disabled by default, but they arent in my case.

  65. Hello,

    Thank you for your excellent work on this node! I have been using it flawlessly for months, but all of a sudden (the day after DST) it is 2 hours “off”, my timer that is supposed to end at 23:00 is set to turn off at 01:00 the next day. I am a bit confused as to how bigTimer actually gets the UTC offset, but I have confirmed the following: my system time is correct UTC -0600, and my docker time is correct UTC -0600 and I have also entered in the lat/long in the bigTimer (not sure what this is used for if the system time is used), I have also confirmed the MAN UTC is 0. if I run a debug to print out the system time, it is correct. Everything seems as it should, except the bigTimer node.

    Please help, I don’t know even where to look at this point.

    1. I can only say that my BigTimers take DST into effect and are working fine. I don’t know what you are using but in my case it is a Raspberry Pi – and it is running on Brussels time correctly. The long/lat determine dawn/dusk etc.

      1. Thank you for taking the time to reply, and I know everything is working fine for you, but I am hoping as the designer you would have potential insight into why it would not be working for others. Or maybe how to troubleshoot where the node is picking up the localization.
        What information could I provide you to help? I am running the latest node-red in a docker container, which I believe is built on a ubuntu distro.

        1. Hi Brian

          The node picks up it’s time from the Raspberry Pi – and gets it’s dawn/dusk information from the longitude/Latitude.

          There is one Javasscript file containing the code – this sits at (in the case of user Pi on Raspberry Pi) /

          /home/pi/.node-red/node_modules/node-red-contrib/bigtimer

          I am on CET (Central European time).

          Regards

          Pete

          1. Thanks again… after a late night, later then I would care to admit, I can confirm there is a system problem that is not directly related to BigTimer. even though all the components in the system appear to be set correctly Node-Red is pulling and reporting times that are 2 hours off.

            Thank you for your time,

            1. Hey, again thanks for the help. The js you pointed out to me gave me the code needed to run in a function within node-red, to prove that even though everything was “set correctly” the date being returned was in the wrong timezone. This had nothing to due with BigTimer but you helped me troubleshoot it. For those interested I had to force my docker instance to have my timezone, even though everything was setup correctly with the localtime.

              -e TZ=[your timezone]

  66. Hello, I have unchecked the boxes Repeat output and Output at startup, but keep sending outputs every minute out of output 2.
    Should I stop sending when you uncheck the boxes?
    Thanks.

    1. That’s what Peter written one post before:
      The output 2 will ALWAYS send every minute.
      Use output 1 to send only on status change !

  67. hi i’m new to nodered. Thank you very much for creating bigtimer.
    I have a problem: output two of the node sends the status every minute and also at power up. I have unchecked the options at the bottom of the settings tab, but it keeps happening.
    Thanks a lot.

  68. Hey
    Im trying to get Bigtimer to send On 06:45 and Off 01:00 under the date interval of 11th of December to 10th of January.

    But I dont get it to work. It send on/off every day.

    1. Hi Niclas. That’s not making sense. Two things… OFF time should be later than ON time – and also BigTimer control does not specifically include date interval control. There are 12 special days for the purpose of date intervals (holidays etc) – but generally you can control by month and if needed, by day of the week.

  69. Hi,
    thank you for creating the BigTimer node.

    I’ve tried some time but couldn’t figure out what’s wrong.
    I tried to switch on a plant lamp in the morning and in the evening.
    On 120min before sunrise, off 60min after sunrise.
    On 60min before sunset and off 120min after sunset.
    But my BigTimer config switch only On Time and On Time 2 is ignored.
    Any idea for me ?

    [{“id”:”b09c3664.113068″,”type”:”bigtimer”,”z”:”29af218d.34f36e”,
    “outtopic”:””,”outpayload1″:”an”,”outpayload2″:”aus”,
    “name”:”Big Timer 1″,”comment”:””,”lat”:”49.4664926 “,”lon”:”8.5003212″,
    “starttime”:”5003″,”endtime”:”5003″,”starttime2″:”5004″,”endtime2″:”5004″,
    “startoff”:”-120″,”endoff”:”60″,”startoff2″:”-60″,”endoff2″:”120″,
    “offs”:0,”outtext1″:””,”outtext2″:””,”timeout”:1440,”sun”:true,”mon”:true,
    “tue”:true,”wed”:true,”thu”:true,”fri”:true,”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″:0,
    “month1″:0,”day2″:0,”month2″:0,”day3″:0,”month3″:0,”day4”:0,
    “month4″:0,”day5″:0,”month5″:0,”day6″:0,”month6″:0,”day7”:0,
    “month7″:0,”day8″:0,”month8″:0,”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,”xday7″:0,”xmonth7″:0,”xday8″:0,”xmonth8”:0,
    “xday9″:0,”xmonth9″:0,”xday10″:0,”xmonth10″:0,”xday11”:0,
    “xmonth11″:0,”xday12″:0,”xmonth12″: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,”randon1″:false,
    “randoff1″:false,”randon2″:false,”randoff2″:false,”repeat”:false,
    “atstart”:false,”odd”:false,”even”:false,”x”:290,”y”:200,
    “wires”:[[“755a6749.1a6498”],[],[]]}]

          1. Well,sorry Ralf, I can’t see why that’s not working… I just did a very quick test – I set a timer to some on at 10:45am and off at 10:45am and as it was a little earlier than 10:30am, I set the on and off offsets at -15 and -13 minutes respectively.

            It worked a treat. See image. The output stayed on for a couple of minutes.

            1. Hello Peter,

              thank you for your help.
              Maybe it’s a problem with sunset/sunrise and the change of the day at midnight ?
              I’ve tested again (see the screenshot) and although I set sunrise (timer1) and sunset (timer2) the bigtimer shows “Off for 19h” (I tested it at 11:00).
              So it set only the sunrise at the next morning.

                1. When I use in both timer something else as a strikt time it’s only working for timer 1.
                  But I’m building now a workaround with 2 bigtimer.

                  1. Hi Ralf
                    Did you find a solution to timer2 not being triggered? I have exactly the same problem, where time2 is being ignored.

                    Thanks

  70. Thank you for answering my previous post. I did get this working after your comments and some trial and error.
    I have 9 Bigtimers now in this automation to control an InputSelect for various special days to control a lighting setup.

    Due to how BigTimer handles added days, I simply used multiple for some things and some extended times. No big deal.

    My challenge is to add a specific day, but one that the date varies but is always on the same day (US, Labor Day, the first Monday of September)

    I appreciate a suggestion how to configure BigTimer for the first Monday in the 9th month.

  71. Hi Peter,
    Love the BigTimer node but I’m trying to use it in a situation where I can turn the schedule on and off… I can’t figure out how to STOP the schedule and KEEP it stopped unless I turn it on again…
    Using the ‘stop’, ‘manual’ and ‘off’ payloads all work temporarily but the schedule always reverts and starts again the next time around. Is there something I’m missing?

    Cheers,
    Liam

      1. Hi Peter,
        I have a few use cases for the functionality of being able to have the schedule persistently on or off but not based on a time schedule like you mention.
        For an example, having a timer turn a light on & off if I am away, but disabling it if I am at home.
        Is the temporary nature of the overrides intended? Or would it be possible to include this functionality in Bigtimer, eg. ‘on/off’ being temporary but ‘manual/start/stop’ functioning as a permanent override…

        1. I could have sworn one of the overrides was permanent… ok, it’s on the mental TODO list. Erm, but… your first requirement… if you are at home presumably you have some kind of sensing to know you are at home – so a simple function node after BigTimer would stop it turning something on…

          1. Yeah it seemed to me like one of the override options was intended to function that way, as there are many options! But alas… they all seem to reset.
            I am currently using workarounds for these cases similar to what you have described but it would be cleaner having this ability baked in 🙂

  72. Hi
    just started to used node red and have added the big timer to the first project. it is set to turn on and off at sunrise and sunset, both with an offset of +30 minutes.
    I want to be able to change that +30 minutes via a numeric spinner. I have tried several things to try to send the numeric value to bigtimer but with no luck. is there a way to do that?

    TIA
    Paul

    1. Both the on offset and off offset can be overriden numerically… it’s in the bigtimer.js file – you can see it alongside the other manual override inputs…

      case “on_offset_override”: change=1;
      switch (theSwitch.length) { //DJL this case block
      case 1: onOffsetOverride = -1; break;
      case 2: var switch2 = theSwitch[1].split(“:”);
      if (switch2.length==2) onOffsetOverride = (Number(switch2[0]) * 60) + Number(switch2[1]);
      else
      {
      switch(theSwitch[1])
      {
      case ‘dawn’ : onOffsetOverride=5000; break;
      case ‘dusk’ : onOffsetOverride=5001; break;
      case ‘solarnoon’ : onOffsetOverride=5002; break;
      case ‘sunrise’ : onOffsetOverride=5003; break;
      case ‘sunset’ : onOffsetOverride=5004; break;
      case ‘night’ : onOffsetOverride=5005; break;
      case ‘nightend’ : onOffsetOverride=5006; break;
      case ‘moonrise’ : onOffsetOverride=5007; break;
      case ‘moonset’ : onOffsetOverride=5008; break;
      default: onOffsetOverride = Number(theSwitch[1]); break;
      }
      }
      break;
      case 3: onOffsetOverride = (Number(theSwitch[1]) * 60) + Number(theSwitch[2]); break;
      }
      break;
      case “off_offset_override”: change=1;
      switch (theSwitch.length) { //DJL this case block
      case 1: offOffsetOverride = -1; break;
      case 2: var switch2 = theSwitch[1].split(“:”);
      if (switch2.length==2) offOffsetOverride = (Number(switch2[0]) * 60) + Number(switch2[1]);
      else
      {
      switch(theSwitch[1])
      {
      case ‘dawn’ : offOffsetOverride=5000; break;
      case ‘dusk’ : offOffsetOverride=5001; break;
      case ‘solarnoon’ : offOffsetOverride=5002; break;
      case ‘sunrise’ : offOffsetOverride=5003; break;
      case ‘sunset’ : offOffsetOverride=5004; break;
      case ‘night’ : offOffsetOverride=5005; break;
      case ‘nightend’ : offOffsetOverride=5006; break;
      case ‘moonrise’ : offOffsetOverride=5007; break;
      case ‘moonset’ : offOffsetOverride=5008; break;
      default: offOffsetOverride = Number(theSwitch[1]); break;
      }
      }
      break;
      case 3: offOffsetOverride = (Number(theSwitch[1]) * 60) + Number(theSwitch[2]); break;
      }
      break;

  73. Thank you @Scargil,

    Bigtimer has become the heart of my home automation for water pumping and boiler. Thanks for the great work.
    I have a small problem however. Only one of the timer seems to work. Time2 does not work in all the nodes I used it. That forced me to run multiple nodes to accomplish a task that one bigtimer node should be able to handle. In addition, is it possible to have more than 2 timers?
    Thanks.

    1. I just tried the second timer (who’s start and end time should always be greater than the first one in order to use successfully. I set the second timer to come on at 12:15 and off at 12:30. At 12:12 the output was still off – but as expected at 12:15 the output came on and a debug node on output 1 confirmed this.. it would be possible to have multiple timers – but then the menu would start to get so big as to be unfeasible – It is already past a typical screen full…

      1. Thank you. I will still check. Kindly consider adding one more timer. Or just simply make it possible to add the number of timers needed like it is implemented in “timerswitch” node.

        Thanks for this very useful node.

      2. Oh I only catch this now : “the second timer (who’s start and end time should always be greater than the first one in order to use successfully)”.

        Well I like to have my covers opened around at a fixed hour or later if dawn is later… But Dawn is sometimes before sometimes after that fixed hour depending the season in the year… Does it mean I have to use 2 nodes somehow because the 2 timers in one node would not be robust ?

  74. Sorry to ask, but I am a bit stuck.

    I am helping someone with using the node.

    Reading the docs:
    Whether or not you use the optional Topic Msg (MQTT Topic), the first output sends out a message with the text from the ON Msg (MQTT Payload) and OFF Msg (MQTT Payload) fields at your set ON and OFF times (and if the repeat tickbox is ticked – every minute)

    The second output has a topic of “status” and simply sends the state – 1 or 0 every minute as well as echoing the status in msg.state and msg.time. (from v1.5.6 onwards several properties have been added to msg)

    The third output sends an optional message, ON Text and OFF Text – suitable for speech output or a log (this happens only at ON or OFF times, NOT every minute).

    The node is configured to send a `0` or `1`.

    Why am I seeing a `2`? (Middle output)

    1. On the second output, msg.payload shows the state of the output which could be 1, 0 (on, off) or 2 (auto). It is not the same as the payload of output 1 which shows the actual control message you entered.

      1. Ok, but unless I am seriously having problems reading the docs in NR (I pasted an extract) a `2` isn’t mentioned.

        Again – from the node’s help screen:
        “`
        Whether or not you use the optional Topic Msg (MQTT Topic), the first output sends out a message with the text from the ON Msg (MQTT Payload) and OFF Msg (MQTT Payload) fields at your set ON and OFF times (and if the repeat tickbox is ticked – every minute)

        The second output has a topic of “status” and simply sends the state – 1 or 0 every minute as well as echoing the status in msg.state and msg.time. (from v1.5.6 onwards several properties have been added to msg)

        The third output sends an optional message, ON Text and OFF Text – suitable for speech output or a log (this happens only at ON or OFF times, NOT every minute).
        “`

        > The second output has a topic of “status” and simply sends the state – 1 or 0 every minute

        I think the documents need updating.

        1. Actually that was incorrect, the second output – payload SHOULD only show an output of 0 or 1. My comment of Jan 6 at 11:12 was wrong, I’ve no idea why you would see “2” on that output. The payload for output 2 should only show 1 or 0.

          1. Ok thanks.

            It seems I can’t post code here.

            Not to rub it in, but more seeking help, how could I show you it failing?

          2. (Sorry)

            I did a bit more digging and found this to be happening.

            If you only have the node and no `inject` nodes setting it up the middle output sends a `2` every minute.

            So if the person uses the node and forgets to *establish* the node’s mode (auto,sync,on,off etc) it sends unexpected/undocumented messages out the ports.

            Or so it seems

            1. Well now – I just went into an empty flow – and dragged three BigTimers into it – with the second output of each feeding into a debug node…. and here is the result…. so if there is something wrong, that’s not it. See photo.

  75. Mr. Scargill,

    Thank you for your contributions. I’ve been using BigTimer for two years without intervention to open and close a chicken coop door and it’s worked perfectly.

  76. You are a great man ! Thank you for taking into account my user feedback ! If you find that the menu too long, I guess few people would mind – not even me – if you limit the stacks to 9 days and not 12 (so that you keep your menu length unchanged as a whole).

    I have only 2 ways to contribute as I am not a developer :
    1/ user feedback – Done !
    2/ pay you a coffee for your superb node – I have yet to find your Paypal button ( ? may be my antipub)

    1. Hi Jerome

      Not the first time anyone has had trouble with the Paypal Link. You have to be logged into the site and I guess viewing on a PC to see the right side info.

      If you don’t end up seeing the link, please do let me know – I try not to be too overt with that and I don’t do things like popup ads or sponsors etc so I really need that link to work 🙂

      I did the update to 12 includes and excludes. If anyone looking in knows how to TAB the info section in the node – that would help, I never did figure that out.

      1. Happy to help with another feedback !

        Well, I did some tests with 2 web browsers, logged in into an newly created site account or not, with anti-pub active or not, cache reloading or not.

        If I do no wrong, I can tell that your PayPal button only appears when logged in, else it never appears.

        May be it is the behaviour you wish… Only you can tell.

  77. Congratulations for this wonderful node !

    I’ve got a simple “request”.

    Lucky man I am as there is more “not working” days in my country than 6.

    The node configuration lets include up to 12 days a year to take this into account, but lets exclude only 6 days a year.

    Symetrical numbers of exclude / include days a year would help make my automations at the simplest, let says 9 and 9 (if you need to keep the same whole number of lines in the UI) or 12 and 12.

    Best Regards

    1. Jerome – this could be your lucky day. Node-Red-Contrib-Bigtimer as of this afternoon thanks to your input, now has symetrical include and exclude days – 12 of each. That menu is starting to get long – but there we are. I also fixed a minor bug at the same time in one of the months.

      Regards

      Pete
      (and now back to working on this months new gadgets so far).

  78. Hi there,

    i’m trying to use big timer, i currently have version 2.7.2.
    I have configured the node with my GPS coordinates, on time to be dawn, off time is dusk. on msg and off msg are respectively on and off. everything else is configured to default.

    In my output i selected, i expect to receive a message once at dawn and once at dusk but instead i receive the full message every minutes as if i had chose the “outputs every minutes” output, which i didn’t …

    am i doing something wrong, or is there a bug?

    1. At the bottom where all the options are – there’s a REPEAT tick box – untick it.
      The SECOND output of BigTimer is every minute – the FIRST output is one-time ronly unless the “repeat output” tickbox is ticked. It IS ticked by default I believe.

      🙂

      Pete

  79. To the many BigTimer users out there – thanks for using BigTimer.

    A comment and a request..

    The comment first. As many of you know, Bigtimer is based on a 24 hour period starting at 00:00 – well, I just realised that my own OFF OFFSET can wrap around to the next day – problably many of you already realised that. I have a pergola light that comes on at dusk and goes off at 23:45. I put a 45 mionute OFF OFFSET on it just to check and sure enough it works – turning off at 00:30 in the morning. Just in case you’d been wondering.

    And now the request: I just cannot get my head around GitHub markdown. I put a trial BigTimer repository on Github – I generally don’t do that as I don’t have the time or patience to maintain local and remote repositories. SO I’m experimenting with STACKEDIT which SHOULD make life easy according to the docs – I have the test github repository at

    scargill/node-red-contrib-bigtimer

    but when I try to edit my readme.md, can I HELL get STACKEDIT to accept any path I try, to sync my Stackedit updates in the browser directly with GitHub, can anyone put me out of my misery?

  80. Hi Pete… as per my previous comment – I wrote some code that works for me… could you review it?

    Purpose: I want a timer that has one fixed and one dynamic time to not “invert” over seasonal variation (ie a light that should only come on on during dark mornings should not suddenly be on all day and night in the summer!)

    https://github.com/phedders/node-red-contrib-bigtimer/commit/4eff4c257371f34d1906f15a3283397cd2381d9c

    I really would like to spend a little more time on the inversion logic. At the moment it is very simple: is the end time going to be earlier than the start time – ie will it wrap through midnight. Ideally it would really check to see if the “on” time will be greater than 12 hours which would allow for timers over midnight still not inverting.

    (I would paste a diff but the blog will make it unreadable – sorry!)

  81. Hi Pete – love BT but there is one thing missing. (Yea really.. 😉 but only one.. I think.)

    Say I want a thing to come on from 7 -> Sunrise, it would seem easy.
    But as the year progresses and Sunrise goes from being after 7am to before 7am, a timer running from 0700->Sunrise will actually run all day and night until sunrise – the timer gets inverted.

    So I think what is missing (at least for me it would complete BT) is a “midnight cutoff” or “no inversion” option that would circuit break “inverse” behaviour.
    Perhaps a logical way of thinking would be a “short time only” ie if the timer would be over 12hrs – disable it.

    Apologies if I missed a blindingly obvious option there…

    Thanks!

  82. Hi Peter,

    I think I may have found unexpected behaviour when using the timer mode of the BigTimer (see image). In this case I wanted to set a timer for 17:10, which is not an option in the dropdown so I set an on time of 17:15 and an on offset of -5 minutes to trigger it at the time I wanted. I then set the off time to “1 minute” later, thinking it would then go off at 17:11. This was however not the case, instead it went off at 17:16, so 1 minute after the set on time, but 6 minutes after the actual on time because of the offset. As you can understand from why I am writing you, this confused me. I modified the off offset (see image) to account for this by setting this to -4 but I think this should not have been necessary and also gives unwanted results when using randomised offsets.

    Can you tell me what your thoughts are on this?

    With kind regards,
    Thomas

      1. Hi Peter,

        Can you tell me what off time you were using for that case? Like I said, I expected the timer to be on for 1 minute after being triggered (so On Time – offset -> on Time – offset + 1 minute), as that seems to be implied by the “1 minute” part, and what I saw was not the behaviour I expected.

        Also, I found what I believe is truely a bug with positive on offsets when dealing with “x minute” off time. I managed to inverse the on/off time contradictory to how BigTimer seems to be configured. Please see the image attached. It was 00:00 (UTC+1) at the time of the image (approximately).

        With kind regards,
        Thomas

        1. Addendum because I was too fast responding and too slow in reading:Could you try it with “Off Time x minutes” as I did in my case instead of setting a pre-defined end time from the dropdown menu, without setting an off offset too?

          Thank you

            1. Hi Peter,

              But that would remove the following scenario:

              On time set to 20:00
              On offset set to -60
              Randomised (on) offset enabled
              Off time: 30 minutes

              In this case, someone might want to trigger actuator A to be on for exactly 30 minutes, but not at the same start time every day but between 19:00 and 20:00. There is no absolute off time when dealing with the randomised on offset, except for “on time – offset + 30 minutes”. I know this might be a bit of an outlier in terms of scenarios but it was the best I could come up with at this time.

              If I read between the lines correctly I can see you have no intention to changing the current behaviour. Thats a pitty, but thanks for replying though.

              With kind regards,
              Thomas

              1. You can’t have exact time with randomised offsets. The off time range of say 30 minutes was never meant to compensate for that. Last time I looked at that part of the the code has to be at least 2 years ago. But you have the full source if you want to tinker. Changing the current behaviour is fraught with potential ssues. How long after such a change before someone gripes that it now doesn’t do what they expected.

                I’ll take a look over Xmas – always possible it could be easier than I remember.

  83. Hey, I’m new on this forum stuff so apology in advance if a make any mistake.

    I just want to say this node is wonderful and it is fantastic how good it works. It adapts so fine to home automation!!

    One question, is it expected to be possible (sooner or later) to override special days?

    I’d like to configure the special periods from the dashboard and i cannot figure out how to do it with bigtimer as it is right now…

    Again, thanks for this node and i hope it can even gets better!!

  84. Hi Peter.
    I hope you are well.
    I use your bigtimer in many flow.
    Now I’m trying to have an output with the same input message during a specific timing. I know that can I use 0 or 1 in a function to enable or disable a variable and then enable my message, but I’d like to simplify my flows. I’m trying to insert something link msg.payload in ON text box, but doesn’t work.
    Do you have an idea for me?
    Thanks and greetings from Italy
    Fabio

  85. Hi, I’m a Node-Red beginner and bigtimer looks great but I’m having trouble passing in the lat/lon via “geo_override”.

    If I manually enter the lat/lon in bigtimer, I noticed the values appear as a string in the status output and all the calculations are correct.

    However when passing in the lat/lon via the node input using, for example “geo_override 41.680015 -85.698192”, the lat lon values appear as a number and many of the related calculations (sunrise, sunset, dusk, dawn, etc.) all show as NaN.

    Is this a bug or is it me? I am passing the lat/lon this way because my automation project is on an RV and the location changes frequently. I’m primarily hoping to use bigtimer to get accurate sunrise/sunset times regardless of location.

    Thanks for your help!

  86. I am new to bigtimer and trying to implement four processes that will fire an ON message at the beginning of every day, week, month, and year. I am stuck and would appreciate your help. I am using version 2.6.3.

    For new day, I have On Time set for 0:00 and Off Time set for 1 minute. All days and months checked. Repeat output unchecked. Status message on dashboard indicates Off for n hours, n minutes, which is correct.

    For new week, I have On Time 0:00, Off Time 1 minute, special weekdays Day 1-5 set to 1, Week 1-6 set to 0. Sunday is checked, Mon-Sat unchecked. Jan-Dec checked, Repeat output unchecked. Status message on dashboard shows No action today.

    For new month, I have On Time 0:00, Off Time 1 minute, Day 1-12 set to 1, Month 1-12 set to 0. All days and months are checked, Repeat output is unchecked. Status message on dashboard indicates Off for n hours, n minutes, which is incorrect.

    For new year, I have on Time 0:00, Off Time 1 minute, Day 1 set to 1, Month 1 set to 1, Day 2-10 set to 0, Month 2-12 set to 0. Sun-Sat are checked, Jan is checked, Feb-Dec unchecked. Status message on dashboard indicates Off for n hours, n minutes, which is incorrect.

    Please advise what is needed to make these process perform as desired.

    1. I’m a bit lost on this – BigTimer is for repetitive situations – typically I would set a light to go on at dusk and off at 11:45pm (with options to manually override).

  87. Peter,

    The sidebar text should clearly state that the first output comes from ON Msg and OFF Msg fields and not from ON Text and OFF Text fields. Myself included, I know of 3 people that have been tripped up by this just this week and spent far too long trying to get it to work as expected. It wasn’t until I came upon this web page that I saw it clearly stated.

    Thanks

      1. Yes it does but it is ambiguous which fields should be populated with text to send on the 1st output. And there is no clarification in https://flows.nodered.org/node/node-red-contrib-bigtimer either.

        In the 6th paragraph of this page you write “The MQTT-compatible payload (ON and OFF msg) is the main output and you should put a value in there even if not using MQTT. ON and OFF TEXT fields are optional” which removes the ambiguity.

        So a user has to be fairly intrepid to come upon the clarification. My suggestion is change the (right panel) description from

        “The first output sends out a message at your set ON and OFF times……”

        to

        “Whether or not you use the optional Topic Msg (MQTT Topic), the first output sends out a message with the text from the ON Msg (MQTT Payload) and OFF Msg (MQTT Payload) fields at your set ON and OFF times……”

        and just below that

        “The third output sends an optional message, ON Text and OFF Text, – suitable for…”

  88. Found a bug, the second output (that outputs a message every minute), use topic “status” for it’s messages, regardless of what topic is set to in the node configuration.

    The first output, that only sends a message on state changes, is using the correct topic, set in the configuration.

    Also, have you considered putting the project on github / gitlab, so others can contribute to the project?

    1. Hi Thomas

      You nearly had me there, it is a long time since I added the second output… however, not a bug… as the README.MD file clearly states that on the second output, the topic is “status”. As for Github.. anyone using BigTimer has the two .js and .html source files.

      So… from readme.md

      The second BigTimer output (v1.55 onwards) now outputs a range of values every minute (in minutes past the beginning of the day) including sunrise and sunset.

      Example:

      payload: 0
      reference: “sonoff02/toesp:{out12:1}:{out12:0}:1287”
      topic: “status”
      state: “OFF Not-today”
      time: “”
      timer: 0
      name: “Office Green Light Timer”
      start: 1395
      end: 1425
      dusk: 1108
      dawn: 372
      solarNoon: 740
      sunrise: 407
      sunset: 1073
      night: 1190
      nightEnd: 290
      now: 1287
      timer: 600
      duration: 0
      timer_left: 10
      onOverride: -1
      offOverride: -1
      stamp: 1544959537232

      1. Hi Peter

        That is not reflected in the online help (I’m running mine in docker, so I’m not looking at the readme file at all):

        — copy from the online help —
        The first output sends out a message at your set ON or OFF times (and if the repeat tickbox is ticked – every minute)

        The second output simply sends the state – 1 or 0 every minute as well as echoing the status in msg.state and msg.time. (from v1.5.6 onwards several properties have been added to msg)

        The third output sends an optional message for ON and OFF both states – suitable for speech output or a log (this happens only at ON or OFF times, NOT every minute).

        About github, yes I know that everyone got a copy of the files, but collaboration is so much easier with things like github.

        1. Hi

          Well, sorry if you’re not reading the readme – that’s where I put that info – I’m not using Docker – and BigTimer has managed to attract many, many users – NPM shows 2100 downloads a week – BigTimer is available from https://flows.nodered.org/ and as of 2.6.1 (just now) I’ve made that second output topic even clearer in the readme file and the online doc.

          Putting it on GitHub means more work for me – keeping Github and my local PCs in sync

          1. It’s actually not that hard to keep github up to date. if you are using git for version control (Which I think is the only tool for version control these days), then it’s only

            git push <- to push local changes to github
            git pull <- to fetch changes from github to local pc.

            It will also make it easier to collaborate on the project.. But of course, it's up to you..

  89. Feature request: In some curcumstances it would be nice to be able to change the input without sending an output. like “ON_No_Out” for on with no output

      1. its because if you connect the input of bigtimer to a same light switch (button) that it controls it causes a loop. That is easily fixed but also causes other problems. The reason I do this is to use The timeout feature in bigtimer from the switch. I have solved the problem with functions by blocking the input when there is an output and blocking the output when there is an input only from the switch. Some of the new Tuya MCU switches flashed with tasmota cannot send a unique topic if the switch is pressed from the location or if its turned on by bigtimer.

  90. Hi Peter,

    thank you for that greate node! I’m using it for controlling lights and RC sockets via the RaspyRFM radio module. Would it be possible to select the datatype of the payload sent out like the inject node? With this feature bigtimer could send numbers, strings, JSON objects, …, without the need of an additional change node.

    Kind regards
    Stefan

    1. That’s quite an undertaking including debugging. As you have the source for Bigimer (one html page, one JS page) if you’d care to have a go and let me know the result I’ll be happy to consider incorporating the change.

  91. I use bigtimer for many things, contrlling our general exterior lights to turn on in the evening and off when the sun comces up, control nightlites for the kids, etc.
    I used the node frequently.

    However, I am trying to apply another scenario using bigtimer that I cannot seem to get to function the way I expect.
    I have several exterior lighting setups that I do for specific times of the year (halloween, and christmas), but only during a specific date range (i.e. Christmas from 11/20 through 1/5 for example).
    I want to create something that will change and input select based on the time of year. I was hoping to use bigtimer for this. But I cannot seem to get a date range to work.
    I add two bigtimer nodes, one configure for Halloween dates (10/20-11/2) and one for christmas (11/20 – 1/5), but they show show up as ‘on’ during the time window. Only one should be one given the current and non-overlap of date.
    I put in ‘include’ special days 20-30 include month 11 in one instance of bigtimer but not in the other instance, but both say on for the same amount of time.
    Not sure how to fix this

    1. BigTimer does months – when I’m back in the UK I don’t leave certain lights on in Spain etc, so they only run during certain months. I can’t satisfy every requirement I’ve read in here or I’d end up with a menu a mile long. I have 12 special days – if you turn OFF the months they are in – you can select them.

      Pete

      1. Understood, I certainly wouldn’t expect you to do everything people have requested. Let me make sure I follow your statement above.
        If I want ‘on’ (or whatever the on message is) to be from November 20 to January 5, I would turn OFF the months at the bottom (Nov,Dec,Jan) and add months 11, 12, and 1, and the days under the add days/months area?
        The rest of the time it would show/send the ‘off’ message?
        Do I have that correct? if so, thats perfect.

        1. CJ Ramseyer, Did you get your Halloween and Christmas scenario working using Big Timer? I’m looking to do the same with Big Timer. I don’t want to go the function node/JavaScript route just yet

          1. Mark,

            I did in-fact get it to work. I have it shared on GitHub. Sorry I took so long, I did not see your message til now coming back here to try and add to the solution.

            In any case, you can find my NodeRed automations here: github.com/cjramseyer/nodered I welcome input and suggestions for improving my automations. But please drop a comment in GitHub if you have any questions or comment

  92. Hi Peter,

    I took the liberty and added global variable support to my version of your amazing node. I wanted to use values stored in global variables as message payload. I am not good at writing code but it does its job. Perhaps you would like to add it (in a more polished fashion) to a future version.

    In the settings, when I put an On Message value in double curly brackets it is interpreted as a global variable name and the value is read from the variable when the message gets sent. E.g. {{heating.daytemp}} becomes whatever is stored the the global variable ‘heating’ under the key ‘daytemp’.

    Here’s what I did:

    // At the beginning of the bigTimerNode function I added this:

    var globalContext = this.context().global;
    function getGlobalVarIfCurly(string)
    {
    if ((/[^{\{]+(?=}\})/).test(string)) {
    var gvar = string.match(/[^{\{]+(?=}\})/)
    return String(globalContext.get(gvar));
    } else {
    return string;
    }
    }

    // I modified the definition of var outmsg2 as follows:

    reference: node.outtopic + “:” + getGlobalVarIfCurly(node.outPayload1) + “:” + node.outPayload2 + “:” + today,

    // in the check for ‘actualState’ I modified the outmsg1.payload assignment to this

    outmsg1.payload = getGlobalVarIfCurly(node.outPayload1);

    This is pretty basic and just a proof of concept but perhaps it is useful to you or others.

    1. When you come up with the “more polished version” as I’m sure you will – be sure to give it a thorough test and send it in here. I’m all for adding new function ality but paranoid about breaking backward compatibility as you can imagine.

      Pete

  93. Hello,

    I’ve an issue with Bigtimer.

    For some reason and I really cannot figure out why, the Bigtimer is sending out an off payload while the Bigtimer has been “Off Manually Override” by an input signal “Manual” or “stop”.

    As I can read in the instructions of Bigtimer when you send a “Manual” or “stop” input the timer should pause/stop, but then why is it sending out an Off payload causing my lights to go off while the timer shouldn’t do anything. Now it is causing my lights to go off while I’m home instead of the timer to be off until I’m away from home.

    Hope to solve the issue with you, thanks!

    1. because before that was added I had people complaining that when the timer was set to “not today” – there was always the possibility of the output being left ON. Can’t win really.

  94. I am using BigTimer to manage a few schedules and trying to use “sync” to reset the state after exceptions. While testing, I find that excluding days (like the weekends), “sync” does not result in an “off” message being sent during these days. Is this by design?

    A specific example that breaks with the current BigTimer sync design:
    – Turn the heat on m-f, 7:00 – 18:00.
    – When a light is turned on, always turn on the heat.
    – When a light is turned off, send sync to bigTimer
    (heat stays on during normal heat time and goes off any other time)

    1. When the timer is turned off (ie, not acive, if you exlucde weekends for example) then nothing happens as the timer is turned off.. I’d have to think very carefully about changing that behaviour.

      1. Understood. In my opinion, the current design is not clear and more limiting. However, I understand your logic. A mention of this in the blog is probably warranted.

        Thank you for your consideration.

  95. Picking up on the timezone. It seems that timezone settings (Man UTC) is being applied both to manual set fixed times, and to sunrise / sunset.

    Shouldn’t this only be applied to the manual set times? The sunrise / sunset etc. is calculated for the location, and it seems that these are working correctly with an UTC offset of 0.

    Timezone of nodered is CEST. Semi workaround is to just subtract the offsets from all manually set times, so if I want to turn on lights at 6am (CEST) I just put in 4am instead.. But it looks a bit awkward when looking at it after a couple of months..

  96. I’m really pleased to see there is no ‘midnight’! There’s a very good reason military operations start at 23:59 or 00:01 – need I say more? 🙂

  97. Hi Peter,

    I’ve been using your fantastic node for some time now.. but after an update (I think) I’m sort of stuck and need some advice, because big-timer stopped outputting the one-off messages, the every minute and speech/log are working. Am I doing something wrong?

    I’m running version 2.5

    Thank you, Zareh

  98. Just discovered Bigtimer, fantastic, thank you! Regarding the random offset function – is it possible to only randomize one of the offsets eg the OFF offset? Easy to do with both ON and OFF randomized but I want the ON time to stay static (well half hour before dusk at least)

    would like
    ON – 30 minutes before dusk
    OFF – randomize within 15minutes of 22:30

    1. Hi Matt

      The random value is between 0 and the offset values used for the on and off times. If you want the ON time to be FIXED, simply don’t add any offset to that time.
      That of course means you can’t set the ON time to half an hour before dusk.

      In principle it would be easy to add extra tickboxes for individual on and off times (i.e. 4 new options in addition to the existing overall random tickbox). If someone were to motivate me I could add that in. 5 minutes programming, a couple of hours to ensure there is no compatibility break.

      Regards

      Pete

  99. I’m fairly new to Node-Red, but found Big-Timer early on, and have found it to be very useful many of my automations for Home Assistant. Currently I’m using a few Big-Timers in a build out of automations for a pool pump and chlorinator.

    Most of the time I have the pool pump in “Auto” mode which will run the pump twice per day. On occasion, I want to be able to run a timer for a few hours to circulate the water for chemicals. I have everything setup to input “timer 120 m”, which works great, unless I’m close to the end of one of the schedules. Let’s say the auto schedule has 30 minutes left, if I set the timer for 120 minutes, the auto schedule still shuts off the timer 30 minutes later, rather than allow the 120 minute timer to complete. Is that the expected behavior? If so, is there a recommendation to easily do what I’m looking for? Thanks so much for any help

    1. Auto should reset any manual settings – the idea being you can manually turn a light on – but at the next change of state of schedule, that will automatically reset in case you forget.

      1. Thanks for the confirmation and quick reply. I could use a function to set it to manual, then turn on the timer. Before I do that, wanted to confirm there isn’t a way to already do that in one input string? Thanks!

  100. Hi,
    I’m kind of stuck here and need some advice.
    I’m trying to build a flow, where big timer is automatically disabled in some situations. I just need it to be completely silent, at least on output 1.
    After some failures, I just built a test setup that can be seen in the image. No matter, how I externally configure big timer, it always generates outputs. I tried to inject “stop”, “quiet” and “manual” and get outputs for on- and off-events from all of them. The only possibility to turn of the timer seems to be to check the “suspend” checkbox. However, that can not be externally configured.

    Am I doing something wrong?

    I’ll post the code for my test setup as a reply

  101. Hi Peter,

    I notice that when the schedule is disabled for a day, bigTimer does not taken even manual “on” “off” etc commands. Is this expected behavior? I thought by disabling a schedule it should disable only schedules actions. Shouldn’t it allow manual actions?

      1. Well actually it *does* take manual commands, provided that the command spells “manual on” or “manual off”

  102. Thanks for this great extension to NodeRED! I noticed something that *may* be an error (or intended behaviour).

    I’m focusing on the second output:

    “The second output simply sends the state – 1 or 0 every minute as well as echoing the status in msg.state and msg.time. (from v1.5.6 onwards several properties have been added to msg)”

    and I’m using those properties for various functions. I noticed that a message is sent each minute as mentioned plus immediatly when I’m giving a command at the input (“off manual”, “default” etc).

    The problem is that while in a day not configured for operations, the status is not generated each minute. It indeed happens that a “off manual” is mirrored at the output, while a “default” never appears. Intended or glitch?

    1. It looks like – you will see output if the node is not suspended AND either it is a good day OR permanent manual is on….

      Long time since I wrote that code and I’ve not changed any conditions recently – so it looks like that was deliberate. It is all in the same area near the end of the .js file if you wish to tske a look and suggest specific improvements.

      Pete

      1. Thanks a lot Peter I’ll try to have a look and suggest some improvements, or maybe also develop a slightly different approach and submit. You’re not using github/gitlab for code aren’t you?

        1. Hi – no I’m not using GitHub – it is simpler for me given that there are only 2 files to just develop locally and publish when I’ve tested. Doug just recently made a souple of simple additions which only involved the one file – so I took a look at his mods and incorporated them with my own improvements before publishing.

            1. Thanks Stefano – I’ll take a look and if I can convince myself that I’m not opening up a can of worms I’ll look at incorporating the changes – current version is later than the one you’ve worked on..

              1. Yes sorry, I worked on the current install of Node-Red and realized later that was not the latest. But i don’t see any difference in this part of the code, do you want me to switch to latest?

  103. I wanted an input override for setting off_offset so I could use a Dashboard element or stored configuration file to set the off_offset from the special times(Dawn, dusk, etc). ie setting On and Off time to dawn with a 15 hour off_offset_override allows the off time to move as dawn moves.

    The input is a string in the HH:MM format for hours:minutes and called with off_offset_override {{payload}}

    I’ve uploaded my modified version of bigtimer.js if anyone wants to use or look at it.
    https://drive.google.com/file/d/1cB2G0QIkprP26aHeMcTGzvz0B9it9-jB/view?usp=sharing

      1. Hi Peter, I’ve added a comment( //DJL ) to the lines I changed and since 2 case statements were added, I noted in the comment that the entire case block was new. I’ve been using the off_offset_override functionality and it seems to work well but have not tested the on_offset_override functionality but it “should” work the same right. 😉

        The commented file is called bigtimerDJL.js and can be found at this link:
        https://drive.google.com/file/d/1lwVzDKD88MvbfMT6GB9vpUqHTW6y97QX/view?usp=sharing

        PS, thanks for pointing out the node-red-contrib-ui-led nodes in one of your videos. They are nice UI elements.

        1. Hi – you missed the comment on a couple of lines at the end… anyway all sorted – my geo_override is in, the timer issue is fixed and I’ve just uploaded v2.4.0 – it could take a few hours to appear – DO let me know if you spot any issues 🙂

  104. Hi Peter,

    I’m using bigtimer with Home Assistant and it works great. Just wondering if there’s a way to use global context data as latitude and longitude instead of hard coding it in the bigtimer node?

    The reason I ask is because Home Assistant automatically passes in latitude and longitude as part of global context data, so keen on using that instead of hard coding. 🙂

    Keep up the amazing work as always.

    Regards,
    Davy

    1. Davy – I’ve made changes adding a new command ll_override but it’s going to need some testing before being officially updated to v2.4.0 to ensure it does not break compatibility – lots of people use BigTimer. I’ve also made improvements to the timer command and that too needs a good checkout before being released.

      1. Did this latitude and longitude override got implemented ?

        NodeRed has access to my HA configured latitude and longitude values. So i would like to inject them instead of hardcoding them in every instance of BigTimer.

    1. Initially I thought the suspicious behavior is only with 3rd output (speech/log). Yet I performed more tests with debug nodes on 1st and 3rd outputs. I found that this is the same behavior with both 1st and 3rd outputs.
      I have taken few snapshots during my test and attaching theme here.

      1. I cannot enlarge your image…. I note in your original message you mentioned issuing a command to turn the timer off. When the timer expires – the off message is activated – this has nothing to do with manual overrides and simply means the timer has expired.

        1. Exactly – when “off” command is issued, Big Timer shoots out “OFF” messages appropriately and instantly. The problem is Timer continues to run until expiry and once expired it shoots out yet another set of “OFF” messages — these extra messages are the problem.

            1. Works great. When commanded to go “off” Timer stops instantly and we don’t get any duplicate “off” outputs any more.
              Many Thanks Peter.

  105. I have been using the bigTimer for years now and I find it the most effective component in my home automation project.
    Lately I have been noticing a possible glitch with BigTimer.
    I use a command “timer 40 mins” to turn ON my water pump. If the over head tank is filled before 45 minutes, sensors pick it up and issue a command “OFF” to the bigTimer and the pump in turn is turned off. Say this event happened at 37 minutes duration. BigTimer keeps running till 40th min and then shoots another output “OFF” from the 3rd output as soon as timer expires.
    This does not create a problem for my pump. But it adds an extra “OFF” state to my transaction database (and create other problems there on).
    Is there a way to supress this extra “OFF” when the output is already turned “OFF” before timer expiry and timer expiry is triggering this extra output?

      1. I double checked and “Repeated output” option is unchecked. I also upgraded the bigTimer node and functionality remains same.

        Simple to recreate the behavior –
        – turned ON the output using command “timer 5 mins” -> node status is – ON, ‘Timer’ 5 mins left.
        – after a minute – issue a command to turn off – “off”
        – output is turned off with appropriate outputs from all 3 outputs.
        – Node status now shows – OFF ‘Timer’ 3 mins left.
        – after 3 minutes, timer expires and we get another output with payload “OFF” from the 3rd outlet (speech/log output)

        this last “OFF” seems to be unnecessary as the output is already “OFF” and it is just that timer is expired.
        Ideally, once we issue “off” command, timer should have been killed along with the paylof “off”. Instead, payload is switched OFF and timer continues to run.

  106. Right I think I’m with this – The OFF time should be a time, not a duration, so you could set the timer to start at 20:00 and end at 20:15 for example. Another example might be to start at dusk and end at 23:45

    And you need to fill in your longitude and latitude as provided by Google maps

  107. Hi,

    I’m using Bigtimer to fire some events. Duration does not matter to me. I encountered some strange behaviour using offsets: The duration seems to be computed wrong (see screenshot). Although duration is set to 1 min, the status is “on for 04hrs 12mins”. I’m using latest node-red and latest bigtimer…

  108. Ok, I’m done – there is nothing wrong – it is Saturday – I just set a brand new timer to TURN ON 8am – saturdays only. It is 8:29pm – and as it should, the timer says ON.

    1. Peter,
      I am not sure how I can explain it more clearly.

      If timer is set to turn on on Saturdays 8AM ONLY and we have Saturday 8PM, the start was in the PAST or will be in NEXT Saturday.

  109. (I made here another thread as previous one started to have very narrow place for text; but in fact I am talking about new issue here but connected somehow to the previous one)

    Moreover:
    If You set “Turn On on 8am” and “only at Saturdays”.
    At Saturday evening, let say at 8PM, You will see “Off for 12 hrs 00 mins”. What is not true. It will no turn on for next 6 1/2 days.
    So I expect rather “Off for 156 hrs 00 mins” or the best “Off for 6 days 12 hrs 00 mins” or at least “No action in 24 hrs”.

    1. Peter, I still see there a bug.
      (And I was asking about disappearing because I have no info that You changed Your message and/or delete mine).

      1. I just tested exactly what you referred to Saturday only 8am start – works perfectly. If you wish to progress this I need an exact description – version of big timer, version of Node-Red, any other relevant installation info, on time, off time, any other changes from the default settings. My (standard Raspbian Buster) installation is working perfectly as are numerous BigTimers.

        ‘If You set “Turn On on 8am” and “only at Saturdays”.
        At Saturday evening, let say at 8PM-

        I will be back in my office after travelling, probably by friday.

  110. Hi, I faced another questions in BigTimer. Is it true/intended that:

    1. When Big Timer is in OFF Manually mode, than HA reset and even Deploying, reset ting BigTimer to AUTO mode?
    2. When it is Tue evening and BigTimer is set for 8AM and only in the Wednesday, BigTimer node is showing in NodeRed “No action today”
    3. 2nd output node do not resend every minute when the OFF Msg is not set? ON Msg, Topic Msg has no this impact.

    best regards
    Jakub

    1. Did you mean for HA Home Assistant? If so , BigTimer has nothing to do with Home Assistant, it is a node for Node-Red.

      You didn’t say if 8am is start or end time. Best use for BigTimer is in one 24 hour period. Say for example start at dusk, end at 11:45pm.

      2nd output, I don’t recall stating if the second output is repeated or not. Check the two files in your installation – /home/pi/.node-red/node_modules/node-red-contrib-bigtimer – there is one .html file and one .js file, the latter will tell you. After making a backup you can of course change the behaviour.

      1. Thanks Pete for prompt answer.

        Ad. 1. HA = Home Assistant, sorry. It is node for Node Red but I do have Node Red as add-on for HA. But what about “deploying”?
        Ad. 2. 8AM is start time. End time in that example doesn’t matter. 24 hour counting as a time window from now for 24 hour or as 0:00 – 23:59?
        Ad. 3. 2nd output is repeating (beside that example). 1st output should repeat when “Repeat” box checked.

        Anyway, I do see that BigTimer is not Your favourite kid now;) I completely understand and thanks for that You’ve already done. Anyway it is worth for someone to tune it to not waste Your great work. Unfortunatelly I am not skilled in this area.
        I will put that on issues to not loose that thoughts if someday someone will have time to work on it.

        1. On ther contrary I use BigTimer every day to control loads of devices – I’m the author of BigTimer – but with loads of users out there I tend not to make changes very often as it just works for most folk. Right now after months of lockdown I’m gtting ready to head off to the sun, so you can imagine my time is limited.

          Bigtimer works as well in Node-Red when it is loaded HA as it does stand-alone – but I’m not about to comment on HA use until I have more experience.

          Time starts at 0 minutes offset from midnight – 1440 minutes in a day. First output does repeat when the box is checked.

        2. I just took another look – if the start time is 8am and you have selected Wednesday-only operation then of course yes on Tuesday you will see “no action today”.

          1. Generally speaking You are completely right but… when BigTimer is set to start e.g. everyday at 8AM, in this same situation (we have evening the day before start) it will tell in how many hours it will start instead of telling “no action today”.
            So the messages in this cases are a little bit inconsistent.

              1. Let me try outline it:

                Two settings:
                1. BigTimer set to start at 8am every day of the week
                2. Bigtimer set to start at 8am every Wednesday.

                Suppose we have Tuesday, 8pm.

                1. in the first case – we we can see, under the node, info “Off for 12hrs 00 mins”
                2. in the second case we will have “no action today”.

                Is it clearer now a bit?

                1. I changed that to Friday and Saturday as that’s what it is right now. So, 1: running all days – start 8:00am, off 11:45pm – at 6pm it correctly says “on for 5 hours 45 minutes” 2: only running on Saturday – so today (Friday) it correctly says “no action today”

                  1. strange, my comment disappeared.

                    Anyway, if what You stated is no mistake than it looks like a bug (but I do not notice that).
                    In my opinion, in Your case at 6pm You should see “Off for 14 hrs 00 mins”

                    1. Your comment disappeareed because I fixed the error in my comment above – didn’t you see? There’s no bug.

  111. Hi Pete,

    thanks. I know about that. But I want to change the value during the runtime. I would like to do that in the same way as the import parameter ‘off_override’. Example: OFF-Time in the main panel = dusk
    offset -120. result of the Big Timer is e.g. 10:00 p.m. If I had an Import parameter “off_offset” and would set them to -60 the result of Big Timer would be 11:00 p.m.
    Many thanks in advance.
    Spunckie

  112. Hi Pete,

    I like the Big Timer very much and use ist for all my time depending projects. But now have a little problem. I would like override the offset-fields via input. Obviously there is no input for this case. Is this correct or I am not able to find the right way? If it’s not possible, could you please add this possibility to the Big Timer?

    Thank you.
    Spunky

  113. First of all – great work with BigTimer!

    What I miss is a simple tweak, I hope you could think of implementing it in future version… it’s a different output on 1st and 2nd On / Off command.

    For example: I want my roller blind to:
    – open full at 7:00 (100%)
    – close partially at 11:00 (like 15%)
    – open full at 14:00 (100%)
    – close full at 21:00 (0%)

    I use the On/Off fields to send the percentage. Any chance to go with this suggestion?

  114. Bonjour

    Comment simplement régler le ON TIME1 et OFF TIME1 depuis de dashbord ?

    How to simply set ON TIME1 and OFF TIME1 from dashboard?

    thank you

    1. You set them in the panel in Node-Red, along with long-lat, any other requirerments like which months they should operate etc. All documented in the blog entry on BigTimer.

  115. Bonjour

    Comment simplement régler le ON TIME1 et OFF TIME1 depuis de dashbord ?

    How to simply set ON TIME1 and OFF TIME1 from dashboard?

    thank you

  116. Great work!
    I’m trying to use it for starting my vacuum robot every other night at 00:30 and it work fine. At 00:30 it switches to ON and 00:31 it switches back to OFF. The vacuum starts at the ON command and runs until I has finished.
    The only issue is that I would like to know how much time is until the the vacuum starts again.
    I have configured the timer to skip ODD days to only start every other day which works fine, but the time displayed that shows how much time is left until the next “ON” does not take into account that I have chosen to skip ODD days and will show a countdown on EVEN days and when the time passes 00:00 and the day gets ODD the countdown will stop showing until it passes 00:00 again and we have an EVEN day…

    I would like to create a alert or turn on some lights to indicate that within the next 12 hours the vacuum will start, but that is not possible as the counter only starts correctly 30 minutes before my start time 00:30.

    Can this be fixed you think?

    1. BigTimer general math does not think outside of the 24 hour period in minutes. You have the source of the two files (bigtimer.html, bigtimer.js) most likely in your /home/pi/.node-red/node-modules/node-red-contrib-bigtimer folder. Backup before tinkering – and restart node-red before testing changes.

  117. Thanks Qba for the link & your thoughts on this. I had not seen that others were having issues with the 2nd time slot. I am “sheltering in place” and have some time so ran another experiment.
    This experiment worked & I certainly think it will do the job for me. I am hoping it works when I substitute “Sunset” for “18:45” (3 places). If so I am good with it. All messages synced with Sunset time.

    Experiment #3 (this one worked as expected)
    Configuration;
    On Time 18:45 Off Time 18:45
    On Time2 18:45 Off Time2 5 minutes
    On Offset -2 Off Offset -1
    On Offset2 3 Off Offset2 4
    ON Msg 3 OFF Msg 4
    Debug messages;
    6:43pm, payload “3”, duration 1, “on for 1 mins”
    6:44pm, payload “4”, duration 1439, “off for 23hrs 59mins”
    6:48pm(45+3), payload “3”, duration 6, “on for 6 mins”
    6:54pm(45+5+4), payload “4”, duration 1429, “off for 23hrs 49mins”

  118. There were reported problems with 2nd timer (On Time2).
    https://bit.ly/2AV2LyJ

    I think the problem occurs when 2nd timer has this same value for On and Off (18:00 or Dusk in both fields) regardless of the Offset.

    E.g.
    DON’T works: On Time2 = 18:00, On Offset2 = 0, Off Time2 = 18:00, Off Offset2 = 15
    DO works: ……On Time2 = 18:00, On Offset2 = 0, Off Time2 = 18:15, Off Offset2 = 0

    1. Dear @Peter Scargill,

      could You please comment this issue as an author? Am I right about 2nd timer issue?

      best regards
      Jakub

      1. Right now Jakub – fixing user registratopn isssues – can’t stop – not aware of Timer 2 issues – if anyone wants to tackle – you have the source locally, just one html file and one js file. backup first…. /home/pi/.node-red/node_modules/node-red-contrib-bigtimer

        1. Thanks Peter for a prompt answer. Not expecting immediately repair, it is your hobby and free, huge contribution in the NodeRed community in spare time.

          Unfortunately, I have no sufficient knowledge to try repair so what I can do only, I can report an issue on GitHub to collect that data for the future if anybody will find time to look at it.
          I found also another issue. Minor one. BigTimer is generating the wrong time in `msg.time` and `msg.exState`, not taking into consideration the second timer. Despite it shows right in Node-Red under the node.

  119. Recently updated my NodeRed bigtimer node to v2.3.1 and am running with
    NodeRed v0.19.3.
    Previously using 10 bigtimer nodes (v1.x.x) and was very happy with them.
    Saw the 2nd On/Off Time configuration fields and the 2nd On/Off Offset
    fields and was interested as I had several things that had 2 On/Off time
    slots in each 24 hours. Could see the opportunity to reduce the number
    of bigtimers in my flow.
    So configured them and ran into a bit of a problem in that I was not seeing
    the 2nd time slot On/Off messages.
    Did some experiments with fixed times and found the following:

    Experiment #1 (this one worked as expected)
    Configuration;
    On Time 17:30 Off Time 17:30
    On Time2 17:30 Off Time2 17:45
    On Offset -2 Off Offset -1
    On Offset2 0 Off Offset2 0
    ON Msg 3 OFF Msg 4
    Debug messages;
    5:28pm, payload “3”, duration 1, “on for 1 mins”
    5:29pm, payload “4”, duration 1439, “off for 23hrs 59mins”
    5:30pm, payload “3”, duration 15, “on for 15 mins”
    5:45pm, payload “4”, duration 1423, “off for 23hrs 43mins”

    Experiment #2 (this one did not work as expected, no 2nd slot messages)
    Configuration;
    On Time 18:00 Off Time 18:00
    On Time2 18:00 Off Time2 18:00
    On Offset -2 Off Offset -1
    On Offset2 0 Off Offset2 15
    ON Msg 3 OFF Msg 4
    Debug messages;
    5:58pm, payload “3”, duration 1, “on for 1 mins”
    5:59pm, payload “4”, duration 1439, “off for 23hrs 59mins”

    Looks like the last non zero offset (Off Offset2 15) killed the 2nd
    slot messages here. My aim is to change the four “18:00” to
    “Sunset” and use all 4 Offsets here so the messages are synced
    to Sunset time. Anyone run into this and/or have a solution?

  120. Hi Peter, thanks for your great work on Big Timer!
    I wonder if there is a way to do the following: I have a function, that, based on a precipitation sensor, outputs a number which I want to use as “OFF Offset” in a big timer schedule.

  121. Hi Peter,
    Thanks for your work on the big-timer !
    I just started to use it and already love it, especially the ‘every minute’ output which contains a ton of useful information. However I am missing some basic useful info like year, month, dayofmonth, dayofweek, maybe you could add that in a future release ?
    Also I found no way to automatically correct for ‘daylight saving’ is there already a way ? Or could it be added ?

    Regards,
    Peter Goderie

    1. Daylight saving is handled by the device on which BigTimer operates – as is local time. Check thte README file for the other items you mention.

      1. The strange thing is that date on rpi gives correct time. node-red timestamp => moments gives correct time, but bigtimer (and bigtimer.stamp => moments) gives incorrect time without utc correction.

        1. I am UK based and at various times I spend months in Spain, in both cases BigTimer is fine – Mr Shark just confirmed it is fine in Italy too.

    1. Sorry I wrote that post without actually looking at the node and realise that Offsets should fix that requirement!. It would appear an offset of -15 (mins?) can be set. I will give that a try tonight!

  122. Sorry to hear about the dismal weather where you are Pete. Here in Sydney Australia we have lots of clear sky and sunshine 😎. So much so bigtimers interpretation of dusk seems to be to late. I suspect that it is actually correct and legal however I would like to have it turn on 15 minutes earlier. Can someone please help me with a correction to my lat&long, (33.806152,151.237737) to move me 15 minutes east

  123. Hi, there is the possibility to set an offset from input?
    For example i added a block with this code:”on_override sunset”
    I’d like to add an offset to sunset, for example in this way “on_override sunset + 5 minutes”.
    I’m trying every possible way to add 5 minutes but i can’t (00:05; 0:5; +5; …).
    Could you help me?
    Thank you very much!

      1. do i have to set “override + 5″? I tried but It didn’t work”.
        Can you show me an example of msg.payload structured for input?
        Thank you so much for your help

  124. Love your blog; whatever projects I play with google always sends me back to you; you got there first!
    Playing with Dawn/Dusk and timers over midnight and things get…interesting.
    For example, for a light setting a timer from Dusk till 20:00 I was hoping it just wouldn’t turn on if dusk was after 20:00, but I think it’s turning off at 22:00 and on at Dusk, so on most of the time.
    if (actualStartTime = actualStartTime) && (today = actualStartTime) || (today < actualEndTime)))
    autoState = 1;
    }

    I guess this falls into "undocumented design decision which doesn't suit my use-case"!
    Anyway, keep up the good work.

  125. How do I make a delay of 10 min. work?

    Currently it is turning off when I switch of the light, with out the delay of 10 min.

    Looking forward to hear from you!
    Robert

    1. BigTimer does on and off times – it does not make tea, perform time travel or add additional delays. Yould could of course use a delay node on the output depending on your application (the delay node comes with Node-Red). Presumably you don’t want a delay whhen turning on so mayeb add a funtion node, so if turning on, pass the instruction through immediately, if turning off, delay to minutes.

      Here’s a test I did to make sure I’m not dreaming… a simple flow – inject, function, delay, debug. Instead of inject you want your BigTimer – instead of debug you want your MQTT or whatever output node you are using… depending on your output for on and off you might want a different comparison in the function – and I use 5 seconds delay for testing – you want 10 minutes. Works a TREAT. Just paste that into wherever you need it.


      [
      {
      "id": "e356bd4.d3f5a4",
      "type": "delay",
      "z": "2cc9e9b.cf76b16",
      "name": "",
      "pauseType": "delay",
      "timeout": "5",
      "timeoutUnits": "seconds",
      "rate": "1",
      "nbRateUnits": "1",
      "rateUnits": "second",
      "randomFirst": "1",
      "randomLast": "5",
      "randomUnits": "seconds",
      "drop": false,
      "x": 920,
      "y": 120,
      "wires": [
      [
      "7518d098.24d13"
      ]
      ]
      },
      {
      "id": "a1416eba.a62ad",
      "type": "function",
      "z": "2cc9e9b.cf76b16",
      "name": "ON or OFF",
      "func": "if (msg.payload==\"ON\")\nreturn [msg,null];\nelse return [null, msg];",
      "outputs": 2,
      "noerr": 0,
      "x": 750,
      "y": 80,
      "wires": [
      [
      "7518d098.24d13"
      ],
      [
      "e356bd4.d3f5a4"
      ]
      ]
      },
      {
      "id": "7518d098.24d13",
      "type": "debug",
      "z": "2cc9e9b.cf76b16",
      "name": "",
      "active": true,
      "tosidebar": true,
      "console": false,
      "tostatus": false,
      "complete": "false",
      "x": 1070,
      "y": 80,
      "wires": []
      },
      {
      "id": "b4fd712d.4f916",
      "type": "inject",
      "z": "2cc9e9b.cf76b16",
      "name": "",
      "topic": "",
      "payload": "ON",
      "payloadType": "str",
      "repeat": "",
      "crontab": "",
      "once": false,
      "onceDelay": 0.1,
      "x": 570,
      "y": 80,
      "wires": [
      [
      "a1416eba.a62ad"
      ]
      ]
      },
      {
      "id": "67fa70df.5bce1",
      "type": "inject",
      "z": "2cc9e9b.cf76b16",
      "name": "",
      "topic": "",
      "payload": "OFF",
      "payloadType": "str",
      "repeat": "",
      "crontab": "",
      "once": false,
      "onceDelay": 0.1,
      "x": 570,
      "y": 120,
      "wires": [
      [
      "a1416eba.a62ad"
      ]
      ]
      }
      ]

  126. Hi Peter,

    First of all thank your for all your work you have put into Big Timer!

    I have a problem getting it to work.
    I would like to have a delay after I witch off the timer.
    For a test I set the OFF time to 1 min.

    The Mqtt Topic is: cmnd/ventilator/power
    I’m using a Tasmota Sonoff version 8.2.0 with Node red and your plug in Big Timer.

    What kind of OFF MSG chould I use?

    Kind regards,
    Robert

    1. Off time,. like ON time, is the time of day. The payload for ON and OFF would typically – with “on” or “off” in the scenario you describe.

  127. Hello Peter, very nice node. Thank you for developing this one!
    A simple question: for some reason it looks like when I am applying a temporary override with a timeout of 2 minutes or bigger, the override is accepted. Now when I apply a timeout of 1 minute (instead of the 1440), the temporary override does not seem to function. No fancy coding here, just replaying your ‘BigTimer Update’ on youtube with adjusted values.

    Rgds,
    Sander.

    1. As the timeout was intended to stop the likes of heaters staying on I will have set that to the nearest minute in real time, not one minute in seconds from now…

  128. Yuri

    Probably by morning – BigTimer version 2.3.0 will appear – and there are now 12 special days/month combos (there were 6 and the last one didn’t work) so you can turn on the timer only one day a month if you wish. That will cover the whole year.

    Regards

    Pete

  129. Hi Peter:
    Question about Man UTC and how to get Big Timer to use my local timezone (including daylight savings.)

    Does Man UTC = 0 mean ‘don’t use a manual offset’ (i.e. use local timezone), or does it mean ‘use an offset of zero hours’ (appropriate for London but not elsewhere)? A blank Man UTC field generates an invalid properties error, so I’m trying to figure out how to get it to use my local timezone. Maybe a checkbox for ‘enable Man UTC offset’ would be appropriate?

    Thanks for your good work! Best regards,
    DC

      1. Thanks for the reply, Peter.

        I’ve confirmed my Pi’s TZ and time are correct. Only Bigtimer is off unless I manually override the TZ by setting it to my local UTC offset. This has only started happening in the a couple of days ago, and I’ve not updated anything. Before this Bigtimer was flawless. Is there a dependency that could have changed that I can check?

        DC

        1. Not anything I’m aware of – my BigTimers appear to be working ok and the change I made yesterday to BigTimer had nothing to do with time. I’ll just check one of my lights… Nope, all coming on when they should. I’m in the UK.

          Pete
          (Peter Scargill – Administrator)

          1. Thank you for checking, Pete. I believe you would not see the issue I am seeing in your timezone. Steps to reproduce what I am seeing:

            1. enter ‘date’ at the Pi command prompt and confirm that the local time and timezone are correct. I am in California and my local timezone is PDT.

            2. create a new Node-RED flow, add a Bigtimer node (v2.2.6), set its longitude and latitude fields to my location (37,-122), set the ON time to one hour in the future (local time) and the OFF time to two hours in the future (also local time.) Make no other changes to Bigtimer. Deploy.

            3. wait a few seconds and observe Bigtimer’s status text. In my case it says “off for 18 hours.” I would expect it to say “off for 1 hour”

            4. open Bigtimer and set Man UTC to ‘-7’ corresponding to my PDT offset. Deploy.

            5. observe Bigtimer’s status now correctly says “off for 1 hour.”

            Is this the expected behavior? If you were to override your system’s timezone do you see this?

            I will upgrade to V2.3.0 and recheck.

            Thanks again for your time. Stay safe!
            DC

            1. I have a timer that says “on for 6 hours” right now – if I go in and set man utc to 1, it says “on for 5 hours”. If I change man utc to -1 it says “on for 7 hours”. Seems reasonable.

              Pete

              1. Yes, I would expect that as well. Man UTC works as expected.

                My system is behaving as if Bigtimer is getting UTC from the system instead of local time. Or rather it is unable to get the correct local TZ from the system and is using London as the default when making its TZ offset calculations. Overriding via Man UTC can correct this sort of, but doesn’t automatically account for daylight savings, TZ change, etc.

                I just upgraded to V2.3.0, rebooted the Pi, and re-ran the steps above with no change in behavior.

                DC

                  1. Yes in London’s TZ, everything will work fine. Can you try overriding your system’s timezone to confirm it works as intended in other TZs? Thanks! DC

                    1. Hi Peter:

                      I traced the issue: I didn’t realize it but Node-Red was actually running inside a Docker container, and the container’s TZ was out of sync with the system’s. Editing the container’s TZ environment variable to match the systems’ fixed it. Hopefully this post can help others with this issue.

                      Thanks again, and best regards. DC

                    2. Hi David – I have the exact same issue, but I can’t tell that Node Red is running inside a docker container. How is it that it was running there without you knowing? I’m not sure if I have the same root issue. Bigtimer was working great for me until recently as well.

    1. I would be glad, but it does not work with marks. If not difficult, try setting the timer to run once every day for every month. only 12 times a year and show a screenshot.

        1. I think he meant monthly – but not a good explanation. Now sorted as I found a bug anyway and it makes sense to allow 12 special days as there are 12 months in the year. Quite a LOT of updating to do that – took me all night.

          1. Yes, Peter. I apologize if it is not clear I am writing through a translator, while I think in Russian. But you get the point. But maybe 12 special days are not necessary? Maybe all the same ranges will look better? 1-12 or 1,2,3? Outwardly, it will be more compact.

        2. obviously it seems. the timer should work on a certain day, for example, today 26 and so on a monthly basis. Total 12 times a year. January 26, February 26, March 26, etc.

  130. No, this does not work. It only works if I specify the month number specifically. For example 3. And with checkmarks, he does not work out on the necessary day of the month.

  131. Thanks for your work. But some things are not obvious to me. For example, I thought that if it says month = 1-12, then I can indicate this interval 1-12. But no, that doesn’t work. But as? How to specify a period of 1 year?

    Thanks in advance. Yuri.

    1. At the bottom of BigTimer properties window – tick the months you want the timer operating – all of them if you want the timer to run every months – etc.

  132. I have a wish that I can let the bigtimer to be the master schedule for a group of lights.
    So eg if the schedule for a set of lights should be on between 8-10 it will tell and sort that out and trigger on at 8 and off at 10. Great!

    But then I would like to have an input to the bigtimer for the same group of lights affected. (The off trigger) to the big timer if someone turns any of the the lights off and IF its done in between 8-10 nothing should happen, since the schedule is the master.

      1. So what’s the difference between an override and auto? My purpose is to have all OFF triggers verified against the big timer and send the corresponding output.

  133. Can I have a GUI or Dashboard Connected Bigtimer to change all the settings ?
    When I say all settings ,it include the day selection ,offset ,start time or anything which we configure in the Node.

      1. I went through readme ,but I did not see any configuration to change the settings for a day .Say I have checked Sun in the Node ,now I need to unckeck or disable it using input so that it will not run on Sun.
        Is there a way to inject and overide this setting .Any documents which explain how to change each and every configuration in the node?.

  134. Hi Peter,
    I have a quick question. Is it possible to have the BigTimer outputting nothing during “Off Time” times, even if there is an ON or OFF in the input?
    I only get no output when the status of the timer is “No Action Today”, but if the status is “Off for x hours”, if I input an Auto or OFF, I get an output. The idea is to have no output at any “OFF Time” period. Is this possible?
    Thanks
    Rui

  135. Hello,

    I LOVE BigTimer!

    …. but i’m missing one “override” feature 🙂

    I’m using BigTimer to change heating-modes in my smart home. BigTimer toggles between normal heating and economy-heating by sending thus modestates via ON/OFF payload. But sometimes it is necessary to activate the boost-mode (full-power-heating) by sending a payload differing from the ON/OFF payloads.

    It would be nice if BigTimer gets a second input where you can put manual payloads for the override function and passes them to the output (at least output one). After the set timeout it should fall back to “default”.

    Thanks for the fantastic work on BigTimer

    Sebastian

  136. Hi Peter,

    I’m struggling with this for months and I can’t figure it out. No one seems to have the same issue as far as I can see.

    My big timer nodes are sending an ON signal at midnight. I originally thought this was at time2 wasn’t set and was defaulting at 00:00, but I’ve since changed this to duplicate the first settings and I still have an on signal coming from the node at 12:00am.

    The offending node is only being used for turning on lights at sunset and switching off at a certain time, so it’s not complicated.

    Can you maybe point me in the direction of what I could check to debug this? I have a logger connected to the output of the node, so I can see the on signals being sent.

    What’s interesting is that I use two separate timers, one for the weekend and one for during the week. The midnight signal only gets sent from the timer that’s currently active. It also doesn’t get sent every night. It seems to be sent on the day the timer becomes active?

    Here’s a screenshot of the weekend timer logs, showing the on, off and errant midnight signal: https://i.ibb.co/gW7DzsS/image.png

    Here’s the timer settings. I’ve left out all the calendar stuff, it’s all set to 0.
    https://i.ibb.co/v1Lq8wc/image.png
    https://i.ibb.co/Rjdv365/image.png

    Here’s the setup: https://i.ibb.co/BNCHQG6/image.png

    Thanks for your time. I really love big timer and had a plan to use it for a heating node, but I need to make it reliable before I can trust it with more than turning on a few lights 🙂

    Thanks!

    1. Hi James, I dont understand in first settings photo why you are using BOTH timer settings and both the same. In those circumstances I make the second set zero. Personally I also tick REPEAT OUTPUT. I use several BIGTIMERS, one from 8pm to 11pm, the rest dusk to 11:30pm or thereabouts – all 100% reliable. v2.25

      1. As I said, I filled in the second timer as I thought it may be causing the issue with it being 00:00. I can’t use repeat output for my purpose and it wouldn’t help fix my issue anyway.

      2. Hi Peter,

        To get back to the issue. Have you any idea why this midnight output is happening? (see the log in my previous post)

          1. Oh, that’s unfortunate. Thanks for your time anyway Peter!

            I’m going to try and hack something together that throws away any output from the timers at midnight 😀

  137. Hi Pete.

    Really like BigTimer, and use it with Home Assistant and Node-Red to control lights (nothing complicated). I had a node set to use On/Off Time 1, and used the second output to pass the times to a function to calculate on/off times (again, nothing complicated).

    I then added to that node to use On/Off Time 2, but noticed that these times weren’t passed to the output. So, I hope you don’t mind, but I added these two times to outmsg2 in bigtimer.js. They are now passed to the output and I can calculate the second pair of on/off times. Nothing for you to do here, this is just feedback for your info.

    Thanks for a very useful node, and a very interesting blog.

    1. Hope you’re having fun. I’m on holiday right now so can’t verify any comments anyone makes about BigTimer or other nodes I’ve written. I have only a tablet – no Node-Red etc. I can follow anything up later.

      Pete

  138. I’m trying to set up BigTimer so it’ll be completely manual. No scheduled time at all. Ocassionally, it should get on_override [time] and off_override [time] which will trigger something. After this override times are over, it should revert back to doing absolutely nothing.
    I did this simply by selecting the same on time and off time in the drop-downs, realized that if I do that then when that on\off time occurs it does nothing. So then I can override these with my own times whenever I want. Is this a normal behavior I can count on? Putting the same time for on and off is supposed to do nothing? If so, then great… The intuitive move should be a toggle in UI for manual override (that’s what I thought the “Suspend” option was for, turns out it just permanently suspends the node). Using the “manual\on\off” input parameters are less intuitive IMHO.

  139. Pete – Bigtimer is a great tool, it is a silly question, but does it need a constant route to the internet to work?
    I ask as my test bigtimer turns on at dusk and should turn off at dawn. But it turns off at 2345hrs and stays off until the next expected event the following day.
    Now 2345hrs is when my Draytek internet router is set to do a restart. So at that time internet drops, dhcp server restarts etc. I dont think that the pi hosting the nodered / bigtimer gets upset about the the Draytek restarting.
    Any suggestion?

  140. In the BigTimer parameters, I can not blank out the “On Time2” fields, so it defaults to “00:00”. It is not clear to me if this will trigger now an ON event at midnight or not?

  141. Hi
    Just starting out with Node-Red and Big-Timer.

    I have Big-timer set with 2 timers.
    Timer one starts at Sunrise + 2hr and stops at Sunrise + 4hr
    Timer two starts at Sunset – 4hr and stops at Sunset -2hr
    An inject node sends ‘Auto’ every 5 minutes.
    Output 3 sends ‘On’ or ‘Off’ accordingly to control a water pump.
    ‘Repeat Output’ is unchecked.
    After the first timer expires, the status shows ‘Off’ till next Sunrise + 2hr, not Sunset – 4hr. Is this expected behaviour?

    Also, how can I extract timer information like ‘time to run’?

    Thank you.

      1. Hi
        Still trying to figure out Time2.
        It does not trigger as can be seen in the 5th & 6th message in the debug window when the payload should be ‘2’

        I have Big-timer 2.2.5

        .

    1. Hi

      Trying to figure out why Timer 2 is not working in some cases.

      The screenshot shows my settings

      If I understand it correctly, sunset is at 1023. On Time2 is set to sunset-400 ie 623. Off Time2 is set to sunset-120 ie 903
      The current time is 744. Payload is 0.
      Shouldn’t the timer be on at this time?
      Or have I got it all wrong?

  142. I am using bigtimer to build a sprinkler system. I am using timer X to trigger the zone run times.

    What I have found is the timer will not run for more that exactly 24 minutes “timer 1,440‬”. No matter what value you put in over that barrier.

  143. Hi I am using the timer trigger for a water system but I have found that the timer resets after exactly 24 minutes no matter what time you set (over 24 minutes).
    It displays the correct time left when running but it will always reset (stop) after 24 minutes.

    I am running version 2.2.5

    I need to run a zone for an hour.

  144. I’m using the big timer node to build a heating system that will switch on the heating 3-times/day – morning, lunchtime and evening. Your upgrade to 2-off timings per node simplifies things significantly. A third timer entry per node would be awesome. I wonder whether others would benefit from such a further upgrade?
    I have attached a screenshot of the front end and backend.
    The time to the start of the next “on” or “off” is brilliant.

    1. Nice job by the look of it. That LCD looks familiar. I took a different route for my thermostat – you can see on the blog. I have hourly settings. Node-Red Dashboard of course. And I monitor the stat in Graphana – various temperatures and humidities.

      1. Pete,

        I have been lurking and learning for quite a while. Your one is brilliant and I did explore the background code to understand how you programmed it. (actually it was your work that got me into the WEMOS D1) I started my project as a joint thing to help my brother who was late in his MSA (Multiple System Atrophy) journey and a personal habit of me being lazy. I wanted something that closely reflected the physical Drayton controller to make it instantly usable. I started in PHP and Crontab and swapped to node-red. I dropped it a few years ago when the circumstances changed and the customer became only me. I have just picked it up again. I continued to use crontab up until the point the bigtimer had two activation times which made using it more fruitful. I’m more a mechanical engineer rather than a programmer so my coding is more by trial and error. I have chosen the Pi ZeroW as the hardware as I wanted the system to be independent of the WiFi. Yes you also spotted your timer front end, it is brilliant. I’m also working on using WH2A sensors and RTL_433 and/or Wemos d1 & BME280 as my distributed temp/humidity sensors.

  145. I am working most successfully with bigtimer and Home Assistant with node-RED. I have been using the “Random Interval” option but see no variations other than a few seconds to almost a minute late.

    Can you tell me how “Randomise offsets” works in three use cases…
    When I set On or Off Offset to a value > 0?
    When I set On or Off Offset to a value < 0?
    When I set On or Off Offset to 0?

    Can I adjust the range of Offset?

    thnx, Jim D.

      1. Not sure if I got the right source. I used bigtimer.js R 2.2.0 @ https://github.com/gablau/node-red-contrib-bigtimer and collected the following.
        – When Offset is set to 0, Randomise has no effect.
        – When Offset is set > 0 e.g. 6, Randomise will use a value between 0 and Offset. I.e., between 0 and 6.
        – When Offset is set < 0 e.g. -6, Randomise will use a value between 0 and Offset. I.e., between 0 and -6.

        Offset can be either a randomized positive or negative offset from On or Off. I.e, not a range of On and Off around a central On-Off set point.

        A few experiments verify this. Comment and verification welcome.

  146. Hi,

    I am trying to schedule my heating system with NodeRed. I would like to use BigTimer to trigger the heating, but I would like to use the ON and OFF_override function with an input_datetime in order to be able to change the on and off in my home assistant interface.

    However, I don’t understant how to connect the input_datetime with the BigTimer node. Could you give me an easy example ?

    Thanks

    1. Manual override is covered here – in the INFO page in Node-Red for BigTimer. You can enter time manually – beware it will not survive power cycling. I don’t use Home Assistant so I can’t comment about that. If you want to send something in a different format, simply run it via a function node first to get from the time ormat you have to the format expected by BigTimer manual override.

      Inputs
      The input can be used as an override by simply sending a text or numeric message. Valid (case-insensitive) messages passed in via msg.payload include:

      1 (or on)
      0 (or off)
      auto (or default)
      manual
      sync
      stop
      on_override
      off_override
      timer
      Manual Overrides
      The first two override messages (1/0) time-out after 24 hours (1440 minutes, user-settable) OR at the next change of schedule. If you have also selected “manual” – the outputs will NOT revert back at change of schedule (auto to reset).

      The schedule can be paused by the interface tick box or by the “manual” command (use the “auto” command to return to normal)

      The on_override and off_override fields can be used to supercede the set inputs for on and off times (in minutes) – “on_override 20:15” for example (without the quotes) for 8:15pm. These settings are volatile, i.e. not restored when Node-Red is restarted. It may take up to a minute for these controls to take effect. Use for example “on_override” with no arguments to set the auto-on time back to normal.

      Manual UTC is optional offset (hrs) in case you have a special reason not to have the right time on your computer! Normally 0.

  147. Hi Peter, as first, thank you for your great work.
    I’ve been using BigTimer for some time now, and I love it.

    I use it to set different temperatures depending on weekdays or weekend and day/night time.
    I’m just wondering if it’s already possible to use flow or global variables to set ON and OFF time (or maybe if you can modify BigTimer to implement it), this would really help me and maybe others, and BigTimer flexibility, I think.
    Thanks again !

    1. I’ve just commented to another user.

      Manual override is covered here – in the INFO page in Node-Red for BigTimer. You can enter time manually – beware it will not survive power cycling. I don’t use Home Assistant so I can’t comment about that. If you want to send something in a different format, simply run it via a function node first to get from the time ormat you have to the format expected by BigTimer manual override.

      Inputs
      The input can be used as an override by simply sending a text or numeric message. Valid (case-insensitive) messages passed in via msg.payload include:

      1 (or on)
      0 (or off)
      auto (or default)
      manual
      sync
      stop
      on_override
      off_override
      timer
      Manual Overrides
      The first two override messages (1/0) time-out after 24 hours (1440 minutes, user-settable) OR at the next change of schedule. If you have also selected “manual” – the outputs will NOT revert back at change of schedule (auto to reset).

      The schedule can be paused by the interface tick box or by the “manual” command (use the “auto” command to return to normal)

      The on_override and off_override fields can be used to supercede the set inputs for on and off times (in minutes) – “on_override 20:15” for example (without the quotes) for 8:15pm. These settings are volatile, i.e. not restored when Node-Red is restarted. It may take up to a minute for these controls to take effect. Use for example “on_override” with no arguments to set the auto-on time back to normal.

      Manual UTC is optional offset (hrs) in case you have a special reason not to have the right time on your computer! Normally 0.

  148. I use bigtimer to switch the relay of a sonoff device which has my own firmware using MQTT.
    Unfortunately the WiFi is unreliable where the device is placed.
    This means from time to time the sonoff misses a switching command.

    I compensate this with a node-red flow which stores the desired state triggered by bigtimer into a global variable. The sonoff anyway sends its status each minute. I then compare the received status with the stored status and resend a switching command if necessary.

    If bigtimer could do this for me this would reduce the complexity of my flow significantly.
    Bigtimer would need a second input where incoming messages are compared with the internally stored status. If it matches, do nothing. If it does not match, resend the msg.

    Does this make sense to anyone else than me?

  149. First off thank you Peter Scargill for Bigtimer – a vital & versatile addition to Node Red.

    For some time, I’ve been successfully controlling a number of Ikea Tradfri lights and sockets around my home using Bigtimer and node red. I’ve already managed graphing outputs from my solar panels, central heating and Darksky weather, using Grafana & Influxdb, but my grey cells are failing with Bigtimer.

    One thing i’ve tried and failed to do is to produce a bar chart of the day lengths over the year, using something like sunset – sunrise to calculate the day length.

    However I’m having trouble getting these two values out of the Bigtimer payload.

    Could someone explain how it’s done? (I’m a newbie to javascript so please keep it simple.)

    1. Hi
      Bigtimer outputs a lot more than just msg.payload. It is only MQTT that is limited to handling msg.payload and msg.topic. The msg object as more than that info and this is documented with bigtimer…. if there was a demand I could add even more.

  150. hi, great compliment: great node!
    i am wondering why the timepinput is fixed dropdown with 15 min presets.
    the node “within-time-switch” allows that. what about big-timer?
    why cant i put just free timedates in numbers like 06:12, or 21:21?

    thx,regards,
    toz

    1. You could ask.. why doesn’t it make coffee… Because that’s how I put it together. Big timer contains the html and JS, all there when you install it. If you want finer grain control, by all means change your copy.

  151. It would be nice to have a .pdf file of the big-timer post so I could print it out as a reference. I would like to not include the clutter not related to it.

  152. Hi, I have “problems” when there is two of “Big timers”…
    I made first one, set “On Time”, “Off Time”, “On Time2” and “Off Time2”. Everything fine.
    Then I made copy of that timer and changed only “Topic” to point different lamp. Still fine.
    Now I change (at that copy) “On Time2” to one hour later and everything goes wrong. Timer seems to “forget” it’s location and moves itself from GMT+2 to GMT

  153. Peter,

    Not sure if i am missing something but i thought i would be able to over ride the MAN UTC of zero by sending a payload of Man UTC -3 or something like that to what ever desired offset needed to be. Is this not the case? I need to be able to change the offset via an input node as my server is stationary but my outputs go to locations that change regularly and the schedule needs to be in the timezone of the location of the outputs.

    Thanks Tim

  154. Hi Peter,

    using node-red-contrib-bigtimer 2.2.5 in node-red 1.0.2 in docker container on RPI-4B.

    On the Output 1 (one-off message) are appearing messages in one minute period together with messages on output 2 (outputs every minute).

    Quick idea where to look?
    Thanks

  155. I dont want to use “off” feature, and not timer 2.
    How do I disable the send of “off” and timer 2?
    I cant see any “disabled” in the drop down menus?

  156. Man UTC is described as optional and intended for situations where the rpi doesn’t have the right time. I’m seeing it being required, and BigTimer does not activate at the correct time without it. I have to set it to the -4 instead of the default 0.

    I don’t know if this makes a difference, but the flows were exported and reimported after updating to raspbian 10 Buster from the previous raspbian version and probably an older BigTimer.

    I’ve attached a screenshot of the output of timedatectl showing that the raspberry pi has the correct time and timezone set up.

    Installed version 2.2.5 of BigTimer.

    1. Hi, this same issue has been bugging me since I started using BigTimer (which is excellent BTW, except for this longstanding bug). In my case I notice the following:

      – `date` on the CLI shows correct UTC and correct local time (GMT+1 in winter, GMT+2 in summer), system time is configured correctly;
      – debug nodes in Node-Red also show the correct timestamp for each debug message (timestamp in local timezone), so Node-Red is fine too;
      – “sunset” in BigTimer works fine too;
      – specific On and Off times in BigTimer are off by my timezone’s offset, i.e. 1 hour (or 2 in summer), it’s as if those times were always interpreted as UTC.

      I can fix both of these issues combining various offsets, but it’s still a bug. Do note, that it’s not even possible to have correct behaviour with only the manual UTC offset (with this I can fix the regular On/Off timers, but then sunset/sunrise are wrong…)

      My main use case for BigTimer is turning some lights around sunset and turning them off at a fixed time. This combination is particularly impacted by this issue.

      (Also, over the last week I’ve redone my whole Node-Red setup for unrelated reasons and, yeah, the bug is still present. Node-Red is running on Alpine Linux in an LXD container, but that should be irrelevant, given that everything else seems to show and use the correct time.)

      I’ll gladly provide more info if needed. (E.g. output of some low-level time/date functions that BigTimer uses, etc. Just tell me.)

      1. Hmm, you may disregard my previous comment. I really don’t get it, but now the time in my node-red setup is indeed wrong. I must have messed up with all the (re)configuration stuff I did recently.
        I fixed my time setup and it seems as though now it’s fine.
        Anyway, Bigtimer is great 🙂

  157. Hi Peter,

    First of all, great work. I’ve been using BigTimer for some time now, and I love the flexibility and functionality.

    I recently upgraded my NodeRed palette nodes, and I’ve noticed some different behavior w/ BigTimer. I’m not sure if this is as design, so I won’t equate it to a bug, but instead I’ll run the use-case by you.

    I had some BT nodes that I used for seasonal purposes (eg Halloween, Christmas, etc), and therefore were disabled most of the time (payload=stop). Let’s say the BT config had ON @ dusk and OFF @ dawn, for example. Nothing would trigger (neither ON or OFF) at these times when payload=stop (Halloween is off), which was exactly what I was looking for.

    When Halloween mode was turned on, I’d have BT use the set times as set in the node configuration by setting payload=auto. With auto, an ON would be sent at dusk, and an OFF would be set at dawn, again exactly what I was looking for.

    I noticed that after the update, when I’d turn Halloween back off (payload=stop), at dusk I’d get an OFF, and at dawn and I’d get an another OFF. Basically, the timer was still running, but just sending OFFs at each time “thresholds”, even if payload=auto.

    I was able to verify this in a stand-alone BT flow – setting ON and OFF times, setting payload=stop, and observing the outputs at the respective ON and OFF times (seeing offs sent each time).

    Is this a bug or running as designed? If I manually turned on individual Halloween lights, they’ll now turn off even if the schedule is disabled. I’ve created a workaround in my node-flow, but wanted to verify if this is the expected behavior.

    Thanks!

      1. Hi Peter,

        Yes – funny enough I would send a 0 prior to stopping the schedule, so that made sense to me, but still having the schedule run but send OFFs at the scheduled times seems a bit weird – as I interpret the schedule as being OFF as analogous to disabling a cron job as opposed to outputting OFFs at the existing schedule, but that’s just my opinion. I’m not in a position to complain, as I stated, I enjoy using BT.

        My workaround is to use a switch node after the BT to conditionally send the output (if the schedule is ON or disabled). I’ll just apply my workaround across all my flows. No worries.

        Thanks for the clarification.
        -Roy

  158. Actually I have a use for something not un-similar, as I need to lower he heating during the day if it is sunny – I don’t have a light sensor on the system so using the forecast might be helpful.That does not have to be attached to the timer but it might help. As BigTimer already knows the longitufe and latitude you would think it would make sense to tie that into the forecaster reader – but this would make for excessive use of the forecaster if one has LOTS of bigtimers, so now you bring it to my attention I’ll put some thought into this.

    1. Here is what I ended up doing:

      I have setup the following variables:
      – Threshold of rain amount (in mm) (eg: 4mm)
      – Threshold of % chance of rain (eg: 80%)

      I have a timer that runs each hour that checks the rain forecast, and if both the rain amount, and chance of rain is greater than my thresholds, I set the BigTimer to STOP. Once the forecast is below the Thresholds, I set the BigTimer back to AUTO.

      I’ve then added some sliders to my dashboard so that I can tweak the thresholds to get it working accurately.

      Seems to be holding up quite well.

  159. Hey Pete,

    My watering system has been working flawlessly for a number of years, based around your Big-Timer. Thank You!

    I was hoping to integrate some rain forecasts into the flow, so that if it is going to rain today, or has rained a lot in the last day, don’t allow the current schedule to run.

    How would you suggest this might be achieved? Can you tell the timer to stay on AUTO, but skip a schedule?

    Or a separate timer that checks the weather, and depending on the forecast/actuals turns the auto feature on/off?

    Cheers!

    Nathan

  160. Hi Peter,

    I’m using your powerful, best ever BigTimer node all around my home system and with very good results 🙂

    I’m changing and adding some functionalities to my installation and found something that I’m not sure if it’s a bug or it’s working as designed but I missunderstood. I’m operating stuff based on external temperature, hour of day and manual change from a blynk operation, and I need to know if the output of bigtimer is because of a manual input (on/off), a stop input or time, so I’m reading the “temporaryManual (tM)” and “permanentManual (pM)” outputs. I built a simple flow to check. Here are my resuls and what I would expect:

    case a
    1) inject auto => tM=0, pM=0
    2) inject stop => tM=0, pM=1
    3) inject on => tM=0, pM=1 shouldn’t it be tM=1, pM=0?

    case b
    1) inject auto => tM=0, pM=0
    2) inject on => tM=1, pM=0
    3) inject stop => tM=1, pM=1 shouldn’t it be tM=0, pM=1?
    4) inject off => tM=1, pM=1 shouldn’t it be tM=1, pM=0?

    Thank you for your help!

    test flow:
    [{“id”:”72c18c62.2ee7e4″,”type”:”bigtimer”,”z”:”7947db3d.fb3ae4″,”outtopic”:””,
    “outpayload1″:”me enciendo”,”outpayload2″:”me apago”,”name”:”Big Timer”,”comment”:””,”lat”:”40.526″,”lon”:”-3.932″,”starttime”:”1020″,
    “endtime”:”1320″,”starttime2″:0,”endtime2″:0,”startoff”:0,”endoff”:0,
    “startoff2″:0,”endoff2″:0,”offs”:0,”outtext1″:””,”outtext2″:””,”timeout”:1440,
    “sun”:true,”mon”:true,”tue”:true,”wed”:true,”thu”:true,”fri”:true,”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″:0,”month1″:0,
    “day2″:0,”month2″:0,”day3″:0,”month3″:0,”day4″:0,”month4″:0,”day5”:0,
    “month5″:0,”day6″:0,”month6″: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”:true,”atstart”:true,
    “odd”:false,”even”:false,”x”:580,”y”:280,”wires”:
    [[“d156bae6.9f8cf8”],[],[]]},{“id”:”c81df84c.8f3bd8″,
    “type”:”inject”,”z”:”7947db3d.fb3ae4″,
    “name”:””,”topic”:””,”payload”:”auto”,”payloadType”:”str”,
    “repeat”:””,”crontab”:””,”once”:false,”onceDelay”:0.1,
    “x”:330,”y”:220,”wires”:[[“72c18c62.2ee7e4”]]},{“id”:”a1287347.9ffe6″,
    “type”:”inject”,”z”:”7947db3d.fb3ae4″,
    “name”:””,”topic”:””,”payload”:”stop”,”payloadType”:”str”,
    “repeat”:””,”crontab”:””,”once”:false,”onceDelay”:0.1,
    “x”:330,”y”:340,”wires”:[[“72c18c62.2ee7e4”]]},{“id”:”2c6d39bc.8691b6″,
    “type”:”inject”,”z”:”7947db3d.fb3ae4″,
    “name”:””,”topic”:””,”payload”:”off”,”payloadType”:”str”,
    “repeat”:””,”crontab”:””,”once”:false,”onceDelay”:0.1,”x”:330,
    “y”:300,”wires”:[[“72c18c62.2ee7e4”]]},{“id”:”9b74522c.c748a”,
    “type”:”inject”,”z”:”7947db3d.fb3ae4″,
    “name”:””,”topic”:””,”payload”:”on”,”payloadType”:”str”,
    “repeat”:””,”crontab”:””,”once”:false,”onceDelay”:0.1,
    “x”:330,”y”:260,”wires”:[[“72c18c62.2ee7e4”]]},{“id”:”d156bae6.9f8cf8″,
    “type”:”debug”,”z”:”7947db3d.fb3ae4″,”name”:””,”active”:true,
    “tosidebar”:true,”console”:false,”tostatus”:false,
    “complete”:”msg.payload & \” – tM: \” & msg.temporaryManual &
    \” pM: \” & msg.permanentManual”,”targetType”:”jsonata”,”x”:760,
    “y”:260,”wires”:[]}]

      1. Hi

        When I have time to go through your flow I’ll take a look, right now still problem solving heating systems, catching up etc and upgrading my UK installation to Busterfor RPI4. NOT easy – which is probably why the RPI guys just cop out by saying “do a fresh install”.

  161. Hi Peter,
    absolutely great node, but a little hard to get the best out of it 🙂
    One question: Is there a way to combine on_override and off_override in one payload? I have the problem, that when i send both payloads in succession the bigtimer node get’s triggered twice and this leads to two “Window shutter open” (for example) commands.
    Wouldn’t it be better to have “msg.on_override” and “msg.off_override”?

    1. Hi there Kai – I’ll have to have a think about that, but bad timing I’m afraid, we’re in Spain for the summer and leaving this weekend, returning to the UK Northeast on Wednesday night, so I’ll be out of action in the meantime then as you can imagine after 6 months absense I have some duties to attend to before I can even look at this – I’m leaving this email marked for review. If you wish, on your local copy (after backing up of course) you can play with the bigtimer.js files.

      case “on_override”: change=1; switch (theSwitch.length) {
      case 1: onOverride = -1; break;
      case 2: var switch2 = theSwitch[1].split(“:”);
      if (switch2.length==2) onOverride = (Number(switch2[0]) * 60) + Number(switch2[1]);
      else
      {
      switch(theSwitch[1])
      {
      case ‘dawn’ : onOverride=5000; break;
      case ‘dusk’ : onOverride=5001; break;
      case ‘solarnoon’ : onOverride=5002; break;
      case ‘sunrise’ : onOverride=5003; break;
      case ‘sunset’ : onOverride=5004; break;
      case ‘night’ : onOverride=5005; break;
      case ‘nightend’ : onOverride=5006; break;
      case ‘moonrise’ : onOverride=5007; break;
      case ‘moonset’ : onOverride=5008; break;
      default: onOverride = Number(theSwitch[1]); break;
      }
      }
      break;
      case 3: onOverride = (Number(theSwitch[1]) * 60) + Number(theSwitch[2]); break;
      }
      break;
      case “off_override”: change=1; switch (theSwitch.length) {
      case 1: offOverride = -1; break;
      case 2: var switch2 = theSwitch[1].split(“:”);
      if (switch2.length==2) offOverride = (Number(switch2[0]) * 60) + Number(switch2[1]);
      else
      {
      switch(theSwitch[1])
      {
      case ‘dawn’ : offOverride=5000; break;
      case ‘dusk’ : offOverride=5001; break;
      case ‘solarnoon’ : offOverride=5002; break;
      case ‘sunrise’ : offOverride=5003; break;
      case ‘sunset’ : offOverride=5004; break;
      case ‘night’ : offOverride=5005; break;
      case ‘nightend’ : offOverride=5006; break;
      case ‘moonrise’ : offOverride=5007; break;
      case ‘moonset’ : offOverride=5008; break;
      default: offOverride = Number(theSwitch[1]); break;
      }
      }
      break;
      case 3: offOverride = (Number(theSwitch[1]) * 60) + Number(theSwitch[2]); break;
      }
      break;

      Add in a third option called on_off_override and say goodnight to several hours – I suggest a cup of coffee first.

      For now I’m out of time here.

      Pete

      1. Hi Pete,
        spending the summer in Spain sounds good and makes me a little jealous, but the german summer wasn’t that worse this year, so i’m okay 🙂
        Thanks for the quick response and hints, but i don’t think i will get this working because of two things: Lack on coding knowledge and hassio running on a Rpi 3 (can’t find bigtimer.js)
        All the best for you and myabe you can look into it if your time allows it.
        Kai

  162. Hi Peter,

    A very basic question. Apologies. I read every single article and post to setup a schedule which runs on 10rd of every month at 9am. But I am not able to figure out how to do this basic thing.
    I entered time as 9am in ‘ON time’ box and then entered text I want to send in ‘ON Text’. I also set ‘DAY 1’ as 10 in Include special days. I didn’t fill anything in months (let it be 0) since i want it to trigger every month.
    But bigtime status just show that it is waiting until next day’s 9 am and not until 9am of 10th.

    I am sure this should be stupid easy, but I can’t figure out what I am doing wrong.

    Please help.

      1. Apologies for typo. I meant 10th. I think if you include few examples on how to configure different schedules, it will immensely help people using this node.

  163. Hi Pete or anyone else that knows a whole lot more than me about Node red and bigtimer. Im having an issue with the on offset. I have a timer set to turn on at Dusk (Off for 3hr 52 mins for example). If i put -10 into the On offset i get (Off for 03hrs 42 or so minutes). But, if i put +10 into the On offset i get (On for 03hrs 52 mins). I was expecting (Off for 4hr 02 mins). Maybe im not understanding how this offset works. Id like to delay Dusk turning on by x number of minutes? Any ideas?

  164. I’ve been asked if it is possible to override the on and off set times (other than manual on-off controls) – of course you can. The commands “on_override” and “off_override” are for that purpose.

    Used as above with no arguments, they return the on and off times to that set in the NR control flow. Used with values they can override the settings you originally put in the node settings area…

    i.e. “on_override 21:00” “off_override 22:00”

  165. Hi Peter, Many thanks for your answer which is logically correct if stop means stop and not suspended. In my case however for a switch [OFF – AUTO – ON] I want bigtimer to suspend and give not any output while in suspend mode, especially if when manually ON is selected because it would go off as soon as the time ON_TIME or OFF_TIME occurs. However output 3 will be sufficient for my solution as long as it does not change at next version. My code snipped below for better illustration and perhaps there is a better way to implement. Best Jens

    [{“id”:”64b2a292.56b004″,”type”:”inject”,”z”:”fc0a89b.3d584f8″,”name”:””,”topic”:””,
    “payload”:”0″,”payloadType”:”str”,”repeat”:””,”crontab”:””,”once”:false,
    “onceDelay”:0.1,”x”:190,”y”:140,”wires”:[[“fbf67018.8f7b58”]]},
    {“id”:”cce694f5.6c3a2″,”type”:”inject”,”z”:”fc0a89b.3d584f8″,”name”:””,
    “topic”:””,”payload”:”1″,”payloadType”:”str”,”repeat”:””,”crontab”:””,
    “once”:false,”onceDelay”:0.1,”x”:190,”y”:180,”wires”:[[“fbf67018.8f7b58”]]},
    {“id”:”42c29b86.f63284″,”type”:”inject”,”z”:”fc0a89b.3d584f8″,
    “name”:””,”topic”:””,”payload”:”2″,”payloadType”:”str”,”repeat”:””,”crontab”:””,
    “once”:true,”onceDelay”:0.1,”x”:190,”y”:220,”wires”:[[“fbf67018.8f7b58”]]},
    {“id”:”fbf67018.8f7b58″,”type”:”switch”,”z”:”fc0a89b.3d584f8″,”name”:””,
    “property”:”payload”,”propertyType”:”msg”,
    “rules”:[{“t”:”eq”,”v”:”0″,”vt”:”str”},{“t”:”eq”,”v”:”1″,”vt”:”str”},
    {“t”:”eq”,”v”:”2″,”vt”:”num”}],”checkall”:”true”,”repair”:false,
    “outputs”:3,”x”:360,”y”:180,”wires”:[[“7a5c2773.89d47″,”354f2bfc.07c0f4”],
    [“354f2bfc.07c0f4″,”7a5c2773.89d47”],[“6c5b21cf.f24a”]]},
    {“id”:”7a5c2773.89d47″,”type”:”function”,”z”:”fc0a89b.3d584f8″,
    “name”:””,”func”:”node.status({fill:\”green\”,shape:\”dot\”,text:\”Status: \”+msg.payload});
    \n\nreturn msg;”,”outputs”:1,”noerr”:0,”x”:870,”y”:180,”wires”:[[“c2271c5d.13c04”]]},
    {“id”:”6c5b21cf.f24a”,”type”:”function”,”z”:”fc0a89b.3d584f8″,”name”:”auto”,
    “func”:”msg.payload = \”auto\”;\nreturn msg;”,”outputs”:1,”noerr”:0,”x”:490,”y”:300,
    “wires”:[[“96fb52ec.c3134”]]},{“id”:”354f2bfc.07c0f4″,”type”:”function”,”z”:”fc0a89b.3d584f8″,
    “name”:”stop”,”func”:”msg.payload = \”stop\”;\nreturn msg;”,”outputs”:1,
    “noerr”:0,”x”:530,”y”:260,”wires”:[[“96fb52ec.c3134”]]},{“id”:”c2271c5d.13c04″,
    “type”:”debug”,”z”:”fc0a89b.3d584f8″,”name”:””,
    “active”:true,”tosidebar”:true,”console”:false,”tostatus”:false,”complete”:”false”,
    “x”:1010,”y”:180,”wires”:[]},{“id”:”83596be1.c9571″,”type”:”debug”,
    “z”:”fc0a89b.3d584f8″,”name”:””,”active”:true,”tosidebar”:true,”console”:false,
    “tostatus”:false,”complete”:”false”,”x”:910,”y”:260,”wires”:[]},
    {“id”:”73e8b7b3.05ef98″,”type”:”debug”,”z”:”fc0a89b.3d584f8″,”name”:””,
    “active”:true,”tosidebar”:true,”console”:false,”tostatus”:false,
    “complete”:”false”,”x”:910,”y”:300,”wires”:[]},{“id”:”e5fc1692.baf008″,
    “type”:”debug”,”z”:”fc0a89b.3d584f8″,”name”:””,
    “active”:true,”tosidebar”:true,”console”:false,”tostatus”:false,
    “complete”:”payload”,”targetType”:”msg”,”x”:910,”y”:340,”wires”:[]},
    {“id”:”96fb52ec.c3134″,”type”:”bigtimer”,”z”:”fc0a89b.3d584f8″,
    “outtopic”:”timer”,”outpayload1″:”on text”,”outpayload2″:”off text”,
    “name”:”Big Timer”,”comment”:””,”lat”:”0″,”lon”:”0″,”starttime”:”5004″,
    “endtime”:”5003″,”starttime2″:0,”endtime2″:0,”startoff”:”0″,”endoff”:”0″,
    “startoff2″:0,”endoff2″:0,”offs”:0,”outtext1″:”1″,”outtext2″:”0″,
    “timeout”:1440,”sun”:true,”mon”:true,”tue”:true,”wed”:true,”thu”:true,
    “fri”:true,”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″:0,”month1″:0,”day2″:0,”month2″:0,”day3″:0,”month3″:0,”day4”:0,
    “month4″:0,”day5″:0,”month5″:0,”day6″:0,”month6″: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”:true,”atstart”:true,”odd”:false,
    “even”:false,”x”:700,”y”:260,”wires”:[[“83596be1.c9571”],[“73e8b7b3.05ef98”],
    [“e5fc1692.baf008″,”7a5c2773.89d47”]]},{“id”:”6ab83af7.65c9bc”,
    “type”:”comment”,”z”:”fc0a89b.3d584f8″,
    “name”:”Switch item=Garden mappings=[ 0=\”- OFF -\”, 2=\”- AUTO -\”, 1=\”- ON -\”]”,”info”:”0 off\n1 on\n2 auto”,
    “x”:380,”y”:100,”wires”:[]}]

  166. PS: Just a remark on my earlier post.
    I seems like output 3 has implemented the suspend function and behalfs accordingly during STOPPED/Manual mode. Would be great to know if this is a feature for output 3 by purpose or output 1 shall have same function. Many thanks Jens

    1. I seem to recall requests for the output to be set to “0” when STOP was input, as “stopped” indicates the output be off. Guess I can’t win on this? Output 3 is info only – so there is no point in it outputting anything after “stop” but I had to ensure that if ouput 1 was ON, it went to OFF. You have the code, if there is a mistake anywhere, please do feel free to put a comment in with any fix.

  167. Just re-installed version 2.2.3 to make sure that I have the latest version to try suspend mode of bigtimer with newly introduced input command “stop” so that no output will happen on output 1.
    Following is the behaviour I have recognized.
    After executing stop as input the timer signals “STOPPED, Man. override; however if during that state a “On Time” or “Off Time” occurs the time the output 1 gets a “0”.
    Not sure what has happened between that final version 2.2.3 and last pre-version where “quiet” was used and worked really as a suspend. While I am not on names as long as a function works, in my eyes a suspend command should have “suspend” as input value, similar to scheduler node. Hope to see the suspend function working in a next vesion. While module scheduler supports suspend (and it works) bigtimer is the far better option. Thanks Peter for bigtimer. I know it is hard work and the more complex it gets the more diffiucult it is to test it.

  168. Appreciate this node!

    I’m trying to control a switch in another time zone using a mix of geographic and explicit times.

    The node-red host is in Los Angeles (v2.2.3) but switch is located in Japan (16 hours ahead).

    When I configure the UTC on the Los Angeles node to +16, the off/on-until seem to make sense. But when I add a geographic dependency such as sunrise until 9AM, the off/on times appear to be incorrect.

    This worked perfectly on v2.0.7 but its on a node that’s in Japan (local to the switch). I’m going to lose my remote access, so I was trying to move the function to my LA host.

    Thanks.

    1. As I’ve not changed anything to do with time zones, I’m not sure now I can be of help here. I have a system in the UK and another in Spain, 1 hour apart, both seem to be functioning well.

      1. Hi Peter,

        Thanks for the reply. I wasn’t suggesting this broke as a result of a code change. I’m changing my setup by configuring a node in Los Angeles to control something in a different time zone. A UK Big Timer node configured with Spanish time to control something in Spain using both clock times and descriptions would be equivalent.

        If I configure the Los Angeles node using clock times in JST with the offset set to +16 (the difference), it seems to work. Side-by-side, you can see they are showing the same countdown time on the node.

        Also, if I configure the LA node using only the time descriptions DAWN and DUSK, the countdowns match. However, I needed to remove the +16 offset.

        If I mix clock times and descriptions (DAWN to 09:00), I get an incorrect countdown on the Los Angles node.

        My feeble mind believes the offset may be the issue. An offset is needed to emulate clock times in a remote timezone but not required for descriptions such as SUNRISE, DAWN, etc.

        Thanks.

  169. Having a strange issue with v2.2.1. And times.
    If i set the MAN UTC to -4 (my time zone) and put times in for the On and Off they match my local clocks.
    However Sunset and Sunrise are off by -4.
    So if I want my ON time to be between Sunset and 2200, I must set the MAN UTC to 0 and the OFF time to 2200+4 or 0200.

    So it seems half of the Bigtimer logic is getting the timezone from the system right and the other half is not.

  170. Heya and thanks for the nice timet node!
    But I have to agree with Steve28, I need the node not to send output when controlling its state.
    Generating an additinal message when setting the state with an incoming message is really easy to accomplish but surpressing the output of a node is not easy and failsafe.
    At the moment I use the gate node contribution wich closes on messages the output of bigtimer when control messages arrive but reooening the gate is made with a time inout which has several disadvantages.
    For me a clean solution would be also no output when I control the timer with messages.
    Also I found that the addtional stats are not accurate, I „stop“ a timer with that message but the state still says it is on auto, just extState says STOPPED no other var gives me something…

      1. I think I am confused. What I (we?) are trying to do is enable/disable BigTimer without it sending anything when it is commanded to enable/disable. Essentially, if I send “stop” I want it to do nothing upon receiving “stop” other than to unschedule any future events. When I send “start” don’t do anything until it gets to the next scheduled event. Is there a way to make it do this?

        Let me give you an example. I have “vacation lights” schedule where a bunch of lights in my house come on in the evening for slightly varying amounts of time when I am away. When I come home in the evening, some of the lights are are on and the house is not dark… if I “stop” BigTimer at that point (because I am now home). BigTimer shuts off all the lights and I am standing in a dark house.

        Also, as Alex9779 said, some node output a message even though the state did not change. I.e., a switch might send “off” because the thing it represented rebooted or reconnected or similar… so even though the switch WAS off, it will still send off again. If this switch is there to enable/disable a timer, this will also cause BigTime to turn off anything it’s connected to, even though it was already in the “Stopped” state.

        1. What STOP is intended to do is top scheduling from right now…. the problem was that it might’ve stopped scheduling, possibly leaving the lights ON, not a good idea. Perhaps we need another command set, pause and resume, which would not trigger any changes?

          1. > the problem was that it might’ve stopped scheduling, possibly leaving the lights ON, not a good idea.

            I guess this a matter of opinion… I gave an example where it _was_ a good idea 🙂 … and is the exact behavior I intended (i.e., not turning off the all the lights because I ‘stop’ the BigTimer upon my arrival home.)

            >I’ve added a command “quiet” which does the same as “stop” but doesn’t change the state or put out a message.

            Thanks! I will give this a try, but sounds like exactly what I need.

        2. I’ve added a test command in 2.2.3 – no guarantees this will do the job as we all seem to have differing view as to what STOP is supposed to so. I’ve added a command “quiet” which does the same as “stop” but doesn’t change the state or put out a message. Should be up later today.

          Let me know if it does the job. Deliberately not documented at this point.

          Pete

  171. Do you think there could be a way to have to not output ANYTHING when you send the stop command? Especially if they are already stopped. Sending the stop command to an already stopped timer sends out the the stop command again. Or have an option of what to do upon receiving an off command? Thanks!

    1. We’re getting into dangerous territory here, of course I can make changes – no output when changing state is of course possible with a change – but what about those people (and there are lots of users) who are used to output occurring when state changes. The only way I can think of doing this would be to freeze development on BigTimer, start some beta testing of, say, “BigTimer2” and when enough people agree that the changes are valid, then make that the current version. If several of you agree on a definite BUG as against a desire to do things differently I’ll take a look at further changes. Hope this helps.

  172. Peter, updated to 2.2.1 just now and it’s still sending off for the auto/default input command.

    1. Hi James

      I’m not following that. On mine, lt says the current state is sending payload “myon”….. and I hit STOP…. it now sends “myoff”….. if I then hit “auto” – it sends “myon” – thats all assuming the timer schedule for now is ON.

      1. Peter, forgive me, I was being stupid, I made some changes while trying to get around the issue that you have fixed, I put another state check in down the flow and it was that which was sending off each time, not bigtimer, so sorry about that. Your code change is working now. Thank you for providing such an amazing little tool.

  173. Coolduke… Setting timer manually when there is no action today Is I believe correct behaviour?… no manual override of schedule when there is no schedule today….

    I’ll take a look later…. just off shopping..

    1. RIGHT – v2.2.1 now sets the output to the off message when you use STOP (permanentManual to 1) – I’m sure SOMEONE, SOMEWHERE will gripe about this but it does seem like that was an oversight on my behalf. Thanks for bringing that to my attention. The update to 2.2.1 should be published before the end of the evening.

    2. my use case: automatic irrigation on monday and thuesday.

      the problem is that I can not manually override to start watering with a TIMER on wednesday because there is no action planned on wednesday.

      how can I solve this issue?

      thx

  174. I just recently noticed that when I send the stop command to bigtimer, it’s sending out my on msg, not the off msg, it was fine for a while just noticed tonight (June 24th). I thought my config had changed (it hadnt), my lights were coming on even though I wasnt on vacation. So I did some testing and sure enough BigTimer is showing up in the stopped state but instead of sending out the stopped message it’s sending out the on message.

  175. Hi Peter,

    BT is an excellent node. Well done! I hate to ask this given you’ve incorporated so much into it already however ….

    Q1: Provided NR is not reset, does (time) override remain until next change? (IE: for days, weeks, months?)

    Q2: Is there anyway to force BAN ODD or BAN EVEN via variable input?

    Q3: Anyway to change ON TEXT and OFF TEXT via variable input?

    I control 10 Sonoff switches (BT x 10) via MQTT and use ON TEXT / OFF TEXT for voice messages that are heard throughout the home. Switch action is delayed until the voice message is processed, IE: “It seems dark enough so I’ll turn on the rear landscape lighting now.” [click] (dusk – 30 minutes)

    Half of these Sonoff switches could be repurposed at any time (short extension cords with Sonoff). I’d like to allow (reasonable amount of) timer reprogramming for users via Dashboard without granting access to the NR editor. I’ve already built the switch selection, naming and programming logic to do this via Dashboard. It just doesn’t do anything at this point.

    Thanks Daniel

  176. Hi,
    I use the bigtimer to turn on my lamps.
    But I run in to a problem. I want to turn on the lamp at dusk and off at 22.00.
    Have configured the bigtimer as attached figure shows.
    But the problem is that the bigtimer gives on during the day.
    When it should be off.
    What I’m I doing wrong?

  177. Hi Peter, great job on this!

    how can you override ON and OFF time in BigTimer and make them permanent? (for example, when start and stop time come from a textbox)

  178. Peter,

    You are correct. If I fill in the topic in Big Timer settings I now get output from output 1 and you are also correct there is no output when sending stop.

    My use case is that I am starting and stopping different video players on a schedule for architectural applications. is there a way to pass the incoming msg.topic through the timer so I can filter which device the signal goes to?

    Thanks

  179. hi peter,

    appreciate your updates on bigtimer – especially the timer minutes is really great and reduces the payload on my pi3 🙂

    I have two questions:

    a) when setting am timer with “timer 10 m” (for 10 minutes) and you cancel that timer with “auto”, the msg.timer on output 2 still remains counting down (even though the switch turned off) . I think when canceling the timer, the msg.timer should be resetted to zero immediately.

    b) it would be great if could add the extendend status eg. “ON “timer” for 4 mins.” to the output2 of the node, in order to have a nice status for the remaining time. in msg.state it “only” says “ON override”, which is good but in case of a timer no so 🙂

    hope you keep up the great work!
    best!

    1. … when looking at the code at line 272:

      case “auto”: temporaryManual = 0; permanentManual = 0; change = 1; stopped = 0; goodDay = 1; break;

      should be:

      case “auto”: temporaryManual = 0; permanentManual = 0; change = 1; stopped = 0; goodDay = 1; precision = 0; break;

      to solve case a) 🙂

      best!

      1. I tried adding your changes – Cool Duke – but the line numbers you suggested don’t seem to make sense. The precision=0; I’ve added to line 284 when auto is set…. that’ll do – outmsg2.extstate=node.status.text on the other hand fails miserably – I’ve always set the text property of msg.status but never tried reading it – must need something like but not the same as node-status.text – thoughts?

          1. I know nothing about the “waspinator” version. Current version of BigTimer is 2.1.9

            https://www.npmjs.com/package/node-red-contrib-bigtimer

            https://flows.nodered.org/node/node-red-contrib-bigtimer

            I’ve not publlished the change “precision=0” or the failed change using node.status.text – I’ll leave both until you or someone comes back to me with suggestions based on my version 2.19 – I can’t afford to endanger compatibility with the current version. Thanks for the feedback.

            1. hi pete,

              a) “precision=0” works as expected… no problem at all

              b) node.status.text doesn’t work at all. maybe it is not readable. I have no clue…

              workaround 1: I use a status node to grab the status from the bigtimer node, so no code change required but I have a addtional status node and another function node to parse the text from the message.

              workaround 2: use an addtional variable in your code to store the statustext before writing it to node.status. this variable could then be used to set outmsg2.extstate.

              eg:
              statustext = “ON” + manov;
              node.status({fill: “green”,shape: “dot”,text: statustext});

              outmsg2.extstate = statustext;

              which do you prefer?

              I could give workaround 2 a try and send you the working code, if you will…

              thx

              1. Righto, Cool Duke. I’m trying “precision=0;” and workaround 2, but initialising statusText to “” when creating it and capitalising outmsg2.extState and statusText. Seems to be working.

                In the process I spotted an error at the original line 768 and fixed it by moving the semicolon to the end.

                outmsg2.time = pad(parseInt(duration / 60), 2) + “hrs ” + pad(duration % 60, 2) + “mins”; +manov

                That also led me to put the extension message into output 1.

                This (2.2.0) will be live later today, hopefully without issue,

                thank you.

                1. hi pete,

                  just updated to 2.2.0 via node-red and I am happy to say, that both changes works like a charm!

                  thank you very much for making these changes, they really help me a lot.

                  but curious that the initalising and capitalising finally did the trick with statusText.

                  thank you!

                  1. No problem – and thanks for the feedback which helps confim the changes have not messed things up = always a potential issue with long term projects. As for capitalisation that’s just a habit I try (not always successfully) to remember- all but the first word in a multi-word variable capitalised, instead of using underscores. I would bw far happier if C and other languages would ignore case (then it would not matter if you screwed up occasionally) but that’s life and my view is most likely NOT universal.

                    1. hi again,

                      after using the big-timer for my irrigation, I think I found two more issues:

                      a) msg.extState = shows still eg “Off for 05hrs…” (which is wrong) even when there is “no action today”. In contrast the node.status is “no action today”. So the msg.extState simply is not updated correctly, when setting the node.status to “no action today”.

                      b) moreover I can’t set a timer manually when node.status is “no action day”. Example: on monday there is no irrigation (checkbox monday NOT checked); then I can’t start a irrigation manually when injecting “timer 30m”… simply nothing happens.

                      as always.. thanks for help pete!

            1. Good point Antonio – anyway I’ve updated BigTimer after reading all of this and hopefully made some minor improvements. Up there already,

              Pete

  180. as of today with a fresh install of node-red and BigTimer there is no output from output 1. Only 2 and 3 so following your documentation no longer applies.

    1. On mine, if STOP commend is sent, nothing gets send out of the first output – the second output gets state: ON Stopped

      It’s a while since I looked at this command but I can’t help thinking that the state (stopped) should be set on the first output as well.

      I’ll have to take a look.

      Pete

  181. Hi Peter,

    BigTimer is very nice and easy to handle.
    But i think, i found an Issue with the override Timer-Function and the Timeout.
    By default the Timeout is set to 1440.
    I was plaing aoround with Bigtimer and set the Timeout to 10, what should means 10 Minutea. If i now inject “timer 15” it reset to off after 10 Seconds. This 10 Seconds a realated the the Timeout value…

    greatings from Germany
    Peter

    1. Timeout and timer are not related. The default timeout is in minutes…. timer mode can be in seconds or minutes….

  182. I just put an inject node into the input.

    I inject off_override 8

    BigTimer suddenly says: On for 15 hours 8 minutes
    (It has been about 5 since I did it.)

    Look at picture.

  183. Hi everyone.
    I have only just updated to the latest version

    I’m again stuck with a part of Big Timer.

    I have tried reading the instructions but am confused by the wording.

    Quote:
    Recent additions/changes include timestamp on outputs, additional on/off inputs, improvements to “timer” input option (default seconds) example:

    timer X (mins)

    timeoff X (mins)
    End quote.

    Seconds…. (mins)
    Lost me.
    Which is it?

    I inject `on_override 1` and it says it is OFF for some weird amount of time.
    It has been a few minutes so I can’t say the exact amount.
    Re-injecting it doesn’t seem to do anything.
    (just tried again. No, nothing changes.)

    Just a bit further down from my first quote I find this:
    quote:
    December 9, 2018. Recent features include a seconds timer and even/odd day of the month selection. December 2018 I note I have not yet documented the timer mode – so here goes. In manual override (injection), assuming the timer is off, inject “timer 30” to turn it on for 10 seconds.
    end quote:

    Inject “timer 30” to turn it on for 10 seconds.

    Sorry?

    So the value is how many 1/3 of a second to be active?

    I’m also stuck trying to get a proper understanding of what you can send it as “controls”.

    I get there is:
    on
    off
    auto
    on_override
    off_override

    There is also:
    sync
    timer
    timeroff

    but I can not get a good explanation of the commands and the parameters.

    I’ve tried the on_override and it takes seconds not minutes – mentioned that – and the timer option. But that also seems unclear to what you send. Minutes, Seconds or 1/3 of a second.

    It isn’t I am wanting to be difficult, but I am really not getting what is written to what is happening.

    1. Timer 30 would turn on the timer for 30 seconds – I don’t do 1/3rd seconds… unless of course the next argument is “m” for minutes… you have the source code – presumably in /home/pi/.node-red/node_modules/node-red-contrib-bigtimer check out bigtimer.js and you’ll see what I’m talking about – it is a human-readable file.

      /home/pi/.node-red/node_modules/node-red-contrib-bigtimer/bigtimer.js

      1. Well, yes, I shall go digging for the file.

        But I am pointing out that it is written on this page (way near the top)
        >> Inject “timer 30” to turn it on for 10 seconds. <<

        How does that work?

  184. Henrik, could you configure some code to use an alternative start / stop time for the Summer months, possibly using a second Bigtimer? I am no expert on BigTimer so it is only a suggestion.

    1. I made a better solution, I think.
      In BigTimer I just unchecked the summer months, so it will not trigger.

      I read that on reddit. Had hoped the developer would have suggested it instead of that silly answer he gave.

      But for now it will work 🙂

  185. I have a problem, and seems that many nodes have the same problem.
    When using a start time that comes after end time, 24 hours are added to the on time, which is not good.

    For instance, I’m using on time: dusk, end time 22.00, but now in the summer dusk is after 22.00, resulting in my lights are on all night.

    Basically when the start time is after the off time, is should not trigger.

    How can I overcome this problem ?

      1. Is that really your answer??

        As I said I’m using dusk as start, so how can I use a start time less than that?

  186. I am trying to come up with a solution, but the “suspended” functionality has me a bit confused. I was hoping I could leave the node/timer in “suspended” state and then push an “auto” input to it when my alarm is set to away…basically, I want my house to go into night mode when I arm the alarm to stay, but when I’m not there and it’s in “away” mode, I want the timer to resume. Does that make sense? I feel like I’m missing something pretty basic.

  187. Peter,

    Thank you for such a well thought out product. I have read through all the documentation and understand it all very clearly. However… when I hook up a test rig as you have done in the docs I never get an output from 1. All of mine come out of output 2 and 3? Thoughts?

  188. Not a question, a comment: I’ve been following your blog (lurking) for quite some time now and have found it amazingly educational. I registered because of BigTimer – it’s everything you say it is and then some (“all that and a bag of chips [crisps]” as we would say). So far EVERY question I have had has been answered either in the documentation or in this thread. I’m an engineer nearing retirement and looking forward to having MORE time to play with this stuff.

    1. Thanks so much, Jeff. I rarely get feedback when things work as they should. I usually get questions like “Can BigTime do stuff it was never designed to do?”. So nice to see a happy user. I’m already just retired and I often wonder how I found time to make things like Node-Red nodes, “the script” and “esp-go” while focussing on 2 careers, not to mention our homes in the UK and Spain (where I am now). Thsnkfully, these days my non-tech duties are more or les limited to home and car maintenance so when not out and about enjoying retirement with my wife and friends, I get to spend a little more time on my tech toys and keeping my home control installations up to date. I’m also grateful for friends I’ve made over the web who often help when I go in over my head. I wish you well.

      Pete

      1. You need a “Like” button.
        The cool thing was saying to myself “Damn, Dusk to too late, I need to have them go on at Dusk – 90 minutes, I wonder if there’s a way to do that?” and 5 minutes later, they went on at Dusk – 90 minutes. Problem solved.
        Please keep up the good work. At the moment, most of my Technology-Inspiration is coming from the UK….

  189. Hi Peter, love your BigTimer because it makes life so much easier
    Just one more thought.
    I want to use BigTimer having with on-time and off-time set for “auto” mode.
    However want to feed same BigTimer via input with additional timer requests, e.g. “timer 2”. My expecation would be that BigTimer stays in same mode after timer expires, e.g. “auto” or “manual”. Actually it does in auto mode, but when in manual mode it switches back to auto. Just wondering how whether this could be implemented.
    Best Jens

    1. I don’t gfollow your requirement. Use multiple BigTimers if you need to. Manual override is just that, it remporarily overrides the auto setting.

  190. Hi Peter,
    I love your work on BigTimer, and i use it a lot in combination with openHAB.
    But since i am not a programmer, i run into a problem with BT and Philips HUE lamps.

    I can simple switch the HUE light just with input nodes true and false.
    But when i use BigTimer, this gives an output of “true” and “false”.
    The Philips hue light can’t handle that. So i guess i need somehow to convert the output in double quotes to an output without quotes, i think with a function node.

    Could you ore someone else who is reading this show me how to do this?

    I could provide a test flow for this…

    1. BigTimers give whatever output you want. If the standard msg.payload isn’t what you want, change it. Rather than mess with images here in comments I’ll amend the blog entry BigTimer. Check tomorrow.

    2. Hi Peter and others,
      I found a solution to convert the BigTimer output, which is of type String in my opinion, to Boolean with a function node:
      if(msg.payload === “true”){
      msg.payload = true;
      }
      if(msg.payload === “false”){
      msg.payload = false;
      }
      return msg;

      Kind regards, Bert

    3. Hi Peter,
      I think i found a solution using the function node:

      if(msg.payload === “true”){
      msg.payload = true;
      }
      if(msg.payload === “false”){
      msg.payload = false;
      }
      return msg;

      Sorry, but i am not a programmer, and this is all new to me.
      Kind regards, Bert

        1. I read your blog post regarding my issue and would like to thank you for the alternative solution.

  191. Hi Peter
    First of all thank You for Big Timer and all Your other blogpost.
    I was wondering is there anyway get this value and the status(stopped,override).So i will be able monitor status of the big timer using blynk app.

    1. Look at the various outputs and not just msg.payload, see entire message in debug… you’ll find lts of status info.

  192. Hi Peter
    First of all thank You for Big Timer and all Your other blogpost.
    I was wondering is there anyway get this value and the status(stopped,override).So i will be able monitor status of the big timer using blynk app

  193. Hello Peter
    First of all thank You for Big Timer and all Your other blogpost.
    I was wonderring if it possibel to disable either on or off times, so you only use those you need? F.ex. have a value in the timelist “not in use”.
    Now it it is possible to set 2 timeset in one timer. If you only want to use one timer, how do you then deactivate the second set?
    If it is not possible I would like to suggest it as an approvement.
    An examble for use is if I want to turn something on or off every day, whether it is on or not, and leave it in that state until some thing else change the state. Or if I use two nodes for going over midnight, without being forced to make offset on both on and off-times. Then one do the change in the evening and one do the change the next day. I can put in the right on/off times and weekdays.
    I want to turn something off friday evening, on saturday morning, off saturday evening, on sunday morning, and then leave on until next weekend. I can not find out to do that now without offset, and that makes it a bit confussing.

    Another approvement could be to only send only the payloadfield from an output and to choose type in/of the payloadfield, f.ex. number, binary as in injectnode. But thats minor, and can easly be solved with other nodes.

    Best regards
    Brian, Denmark

      1. Oh, so when equal, it is not in use. Thats fine and easy.

        But how about, only on or off direction/state?

  194. Wow. I can’t believe that 4 years later you are still answering comments. Impressive. Not to mention the famous node!

    DISCLAIMER: I am somewhat new to Node-Red…

    I would like to adjust certain settings of BIGTIMER via the input. Is there a chart, or any documentation that delineates what each field is called?

    Forgive my ignorance.

    In other words, let’s say I would like to set the “Off Offset” time by sending a message to the node’s input. Is this possible? I see that I can send “on” “off” and “auto” as payloads in order to manually override the timer, or reinstate it. VERY COOL!

    But if I want to do the same for other parameters, how do I ascertain their respective variable/ msg.parts names?

    Thanks for creating such a versatile node and especially for the continued (and unprecedented) support.

  195. Hello,

    Thank you very much for Bigtimer. It works very well! Only thing I would like to see is if it can output (4th output maybe?) its own current state like auto, manual/temp on/off etc. This for other nodes to be informed what state it is in.

    Thank you again for this great node!

    1. Don’t just look at msg.payload on the outputs when using the debug nodes. Look at the whole message – lots of information.

      Pete

  196. First of all, you created an awesome node. Thank you. I have a situation where I would like to only trigger floor lights to turn on when motion after dark. Is there a way to trigger the output to be sent instantly when an input is detected? I don’t want to modify the output. I just want to trigger a resend of the output. Currently, I need to create a variable from BigTimer that I check against when I detect motion.

    In my attached image, the first row is where I save a variable to trigger on or off based upon the timer. The third row shows my implementation using this variable. I don’t prefer this approach because the variable saving steps aren’t inline with the automation.

    The second row is my attempt to put the BigTimer inline with my automation. The problem is that the output is not sent past BigTimer. I also don’t want BigTimer to trigger the lights on without motion.

    Do you have a solution for this with the current BigTimer node?

    1. I figured out how to get the instant output (move connection to the second output node of BigTimer.

      The problem I now have is that it triggers an output when the timer kicks in. Is there a way to deactivate the output for the time and only trigger an output when there is an input?

      1. I had to add an extra check state to check for motion after BigTimer. It would be nice to have a 4th Output to output only when input is received or to have a check box within the BigTimer config to select this as an option. Please let me know if there is currently that option.

  197. love your work.
    not sure where i have gone wrong though. i am (trying to) use bigtimer to control a device based on off-peak times. so power off from 7am to 11pm monday to friday, but with a manual override. (which will ultimately be controlled by presence of excess solar power).
    but….if i have only mon-friday ticked, then i cant turn on for the weekend, and i found even a manual override on doesnt work.
    any hints as to how i can achieve this?
    (i thought a second timer for the weekend might work, but dont seem to be able to configure for 24hour ‘on’.

    1. Manual override doesnt work when a day is not selected… because it is an override, overriding the times. If the timere is not active on a given day there is nothing to override.

  198. I assume you are referring here to a BigTimer in manual timer override mode – which does work in seconds unless you use a suffix for minutes “timer 2 mins” or timer “1 min” etc… Current version of the timer is 2.19 from December 2018. Only the first letter of the suffix is used so “m” will do.

  199. I have a flow set up with a timer that uses an override, and it was working perfectly until 2.0.1, the the time would stop after 24 minutes. I have found that now the second output is sending and the timeout is incrementing every second instead of every minute. I have upgraded to 2.0.2, and see the same behavior.

  200. Hi,

    Great node and just learning to work with node red.

    I have a porch light, which should switch on at 6:00 and goes off at sun rise. but if sunrise is earlier then 6:00 it should do nothing.
    So what happens with the use of this node, if sun rise is earlier then 6:00. Will the light then stay on the whole day, or is the on message blocked by the node, due to the fact sun rise (off time) is earlier than 6:00 (on time).

    greetings

  201. Quick – dumb – question:

    Output #2 (which gives/has all the values):
    I want to set context values for them.

    So, I will set a “sunrise” context, a “sunset” context, etc etc etc.

    I know the msg.payload (the big one) has all that, but I lack the knowledge how to “split it up and set the contexts”.

    Anyone – please?

  202. Sorry but I haven’t read all incident above – theres a loooot. But I’m experiencing an odd behavior of my Bigtimers.

    When bigtimer is turned on I get an update of state update each minute even if I’m using the first connection from the top (right side) – this I would expect from the last connection on the right side. Is my installation wrong in anyway or is the Bigtimer broken?

    1. You must have repeat setting on in which case you would get an output every minute – turn it off if you don’t want that.

  203. Would it be possibile to change the default schedule or any other option using simple payloads as inputs?
    I’m using Home Assistant as a frontend and it will be great to change the scheduling options using a payload, instead of just doing the overrides that resets after the timeout expires.
    I mean, I have in my HomeAssistant interface few inputs, but with BigTimer, which I love because it has the BAN option for odd or even days (for watering plants it’s so cool) I can’t set the default scheduling by using an input, I can just override it temporarly. Would be very handy.
    Another timer node exists, Schedex, and It was inspired by your BigTimer, it’s not complete as yours so for me it does not do the job, but it has the possibility to change the default scheduling just using a payload…
    Hope you can add this feature.
    By the way… it’s a great node!!!

  204. Awesome tool,
    Have you ever thought of adding the ability to check when the previous or next time a change will happen, with a return on #3?

    Say you send a next payload, and it returns the upcoming Time/Date On/Off
    Send a last payload, and it returns the most recent Time/Date On/Off

    I haven’t noticed how to get this info out of it yet, mostly so I can check via slack what the next open time will be for my chicken door.

  205. Hello !!!

    Realy nice Work this Node ….

    But i can set what I want

    Dusk -> Dawn or Dawn -> Dusk
    Sunrise -> Sunset or Sunset -> Sunrise

    I’m allways becaoming TRUE …. ON Msg

    What am I doing wrong ?

    Have an nice Weekend

    1. Don’t try to do day overlaps – use two timers or both of the sets of times if you want something straddling over midnight.

  206. Greetings from latitude 24.07602, and thank you for your work.

    Big-timer is controlling my outdoor lights.
    In the morning On time UTC 4:45, Off time at Sunrise.
    In the evening On time at Sunset, Off time UTC 21:30.

    The summer is coming and already sun rises earlier than my On time. In this case Big-timer calculates Off time to the sunrise of the next day. My expectation was lights wont turn On at all in the morning, instead Big-timer calculates On for almost 24 hours. Also at the very moment Big-timer says On for 8hrs 07 mins, and current time in UTC is 20:37. Sunrise time tomorrow in UTC is 4:39 and Sunset time 16:24. My expectation is it should say On for 0hrs 53 mins. Time on raspberry is correct, longitude and latitude are correct.

    If taking the day change into account is a tedious task, other possibility could be a setting for maximum On/Off time and if big-timer calculates more than the setting value, do nothing.

    Other thing I noticed at least on older version, offsets are not calculated to the sun based times.

    Node-red v0.20.1
    Big-timer v2.1.9

  207. I wish I could remove this above comment. I feel so foolish. I had my off time < sunset, so it was reversing my intent. Damn DST, which should have been my first clue since the issue started Monday…

  208. Hi,

    There is a bug in one-off message feature. It doesn’t hit once when time comes, but hits every minute, like output #2, but instead of number it emits On-Msg or Off-msg.

      1. You’re right Pete, I’ve missed that option. What came to my mind is that maybe it should be turned off by default to be aligned with name of the first output… but indeed it’s not a bug 🙂 Thank you for the explanation!

  209. Hi Peter; first of all thanks for awesome and by far my most important node in my home-automation setup. I’m running latest 2.19 version and would like to understand whether i’m hitting a bug or intended working.
    I have a bigtimer node for setting the time i want my lights on for sure, but would like to extend that time based on presence detection. I’m able to inject a “timer 900” every time i have a valid presence detection, but regardless of that being set, at the exact original ‘time off’ time the bigtimer node sends out the off-message. Can I somehow dynamically extend the ‘time off’ without intermediate messages?

    1. Hi Manfred,

      I have something not quite the same, but similar. You could approach it by…

      Having a switch node after Big Timer. Send “OFF” payloads down a route with a “stoptimer” node, which will halt the payload for x seconds.

      You can then have your PIR trigger feeding into the stoptimer node. This will reset the timer to 900 every time motion is detected and only send the “OFF” payload onto the next node once the stoptimer has finally stopped.

      Hope this helps.

  210. Hi,
    Really love your awesome work!

    One thing I just can’t get my head around.

    I want to open my shutters at sunrise (working so far) but NOT before 7 am. (There was a similar question in 2016 or so in this thread)

    Any suggestions how I could do this using nodered and home assistant?

    Thanks!

      1. that has nothing to do with home assistant, it’s a request about bigtimer… if it works in nodered, using with home assistant is just a “home assistant service node” to which send into the output of bigtimer from nodered, nothing else…

    1. I had same question. Resolved it by using “node-red-contrib-light-scheduler”. I set the times I wanted my shutters to be down for sure (the ‘on’ periods) and set the on and off payloads to ‘on’ and ‘auto’ as input for bigtimer, which in turn controls the shutter. This way I can still use the suncalc values, while not opening the shutters when the boys are still sleeping 😉

      You can probably use a second instance of bigtimer as well; I just like the visual weekly schedule this other node brings.

    2. Hi Warmooz,

      One approach would to be to use the “time range” node after your Big Timer node.

      You could restrict the 7am piece in Home Assistant using “conditions” with a script or automation, but if you’re using the Node Red Big Timer for the trigger then I would say best to have it all in Node Red.

      Thanks,

      Marc

  211. Hi,

    Thanks for the awesome tool.

    Can you please explain how the new second (timer2) on the December release works or rather how to switch it off? It seems like when there is an offset on the on time that it will always run and likely override the original timer1.

    thanks

  212. Same here, bigtimer makes nodered crash suddently :-/

    node-red_1 | 11 Feb 00:34:47 – [red] Uncaught Exception:
    node-red_1 | 11 Feb 00:34:47 – TypeError: Cannot read property ‘getHours’ of undefined
    node-red_1 | at bigTimerNode. (/usr/src/node-red/node_modules/node-red-contrib-bigtimer/bigtimer.js:205:22)
    node-red_1 | at emitOne (events.js:96:13)
    node-red_1 | at bigTimerNode.emit (events.js:188:7)
    node-red_1 | at Timeout._onTimeout (/usr/src/node-red/node_modules/node-red-contrib-bigtimer/bigtimer.js:866:9)
    node-red_1 | at ontimeout (timers.js:386:11)
    node-red_1 | at tryOnTimeout (timers.js:250:5)
    node-red_1 | at Timer.listOnTimeout (timers.js:214:5)
    node-red_1 |

    1. I just got that for thew first time – apologies to those affected. Its the sunCalc.getMoonTimes function in sunCald module. Either I’ve mis-read it or it is not working properly – one way or anothe this is going to work – if i have to take moontimes out so be it. The VAST majoity of functions wok just fine without it. I just tried a try-catch – not something I’vve use before – if anyone wants to step in, in the next hour, feel free to do so… I’ll publish a fix today hich may or may not include moon functions.

      1. Peter, thank you for developing this great node. It is doing awesome things for many of us. Unfortunately, it lately caused many of us some severe issues. I believe the community would highly appreciate if you put your code on GitHub. Contributions would become much easier and everyone would benefit. I hope you will reconsider your opinion. Thank you!

        1. Hi Cornelius – with respect it is the third party sunCalc that caused the issue – now sorted and next time someone asks for something new there will be a considerably longer test period before it goes live. As for GitHub I have no intention of using Github for this or other nodes. That would be somewhere else I have to monitor, so that’s a no – no benefit whatsoever in this case. I’m not sure if you’ve spotted but you have the full source on your computer – wherever NR has installed your Bigtimer.

          1. Never mind, Pete. Having the source code on my disk doesn’t allow me to inspect recent changes. Nor can anyone from the community easily contribute to your project (e.g. via pull request). I don’t get how GitHub would add a burden on you. Instead of having to scroll through this growing list of unstructured comments on your blog, users could file GitHub issues with their questions and suggestions. It can not get any more organized than that. And having to enter “git push” in addition to “npm publish” is not really that much of an extra effort, is it?

  213. I found solution by adding a delay, which limits msg rate to 1/s and drop intermediate messages. Now everything is working as it should! Posting, as it may help others noobs=)

    1. Just had the same issue as above. Seems I have to have the node Suncalc installed else Node-Red crashes. You do have it listed as a dependancy but I wasn’t expecting it in an update.

  214. I have some problems with my idea above.
    Big timer is working like it should when receiving button inputs like timer 5, default and manual off.
    I get problems with my “function”. On-off from Bigtimer goes into counter and then into switch, which only send forward values above 10. These values go into Change node and after that into the manual off button.
    If i debug without wires to Big Timer, everything is working like it should, and I get command manual off, when counter is above 10. When last wire is connected to Big timer, program get into a loop which causes crash.
    I tried to get around with a help of a friend and javascript, but we came to the same problem. Any ideas?

  215. Hi Peter, you did an excellent work on the Big Timer. It is very simple to use, with some nice options.
    I will use it with a pump (relay) to water my plants. Plan is to have a large 20L container of water and pump 2L daily, so water supply should be good for 10 days.
    I dont plan to forget that container should be filled, but im thinking on simple counter to 10, which will send Big Timer manual off command, when value is 10. This way, pump wont run without water, and I will have information on how much water is left in the container.
    Thanks again for Big Timer!

  216. I added a couple of lines in the switch statement looking for end timer offset so that these values could changed with node red on the fly. Perhaps you might consider adding this small feature change to the main version. Only took 2 lines of code to
    add.
    ..”switch (theSwitch[0]) {
    case “sync”: goodDay = 1; change = 1; break;
    case “sunsetoffset” : actualEndOffset = parseInt(theSwitch[1],10); break;
    case “sunriseoffset” : actualStartOffset = parseInt(theSwitch[1],10); break;”

    or somethinglike that

  217. After installing bigtimer I’m getting the following error on Node Red that’s crashing my docker container. Any ideas? Below is the error log from Node Red.

    6 Feb 20:22:01 – [red] Uncaught Exception:,
    6 Feb 20:22:01 – TypeError: Cannot read property ‘getHours’ of undefined,
    at bigTimerNode. (/data/node_modules/node-red-contrib-bigtimer/bigtimer.js:205:23),
    at emitOne (events.js:116:13),
    at bigTimerNode.emit (events.js:211:7),
    at Timeout._onTimeout (/data/node_modules/node-red-contrib-bigtimer/bigtimer.js:866:9),
    at ontimeout (timers.js:498:11),
    at tryOnTimeout (timers.js:323:5),
    at Timer.listOnTimeout (timers.js:290:5),
    npm ERR! code ELIFECYCLE,
    npm ERR! errno 1,
    npm ERR! node-red-docker@1.0.0 start: `node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS “–userDir” “/data”`,
    npm ERR! Exit status 1,

    1. I need more info – are you using BigTimer 2.1.5 version of BigTimer – 2 releases behind that might have that issue, if not, upgrade. If still there, I need your long/lat and time settings and time of problem to progress as it doesnt ever happen to me.

      1. I was able to repair my issue by reloading Node Red with the latest BigTimer. I was on an older release of BigTimer and the update had issues. Everything seems to be working as expected now.

        1. I was working on a flow with bigtimer, suddenly the node red started to restart in a loop:
          11 Feb 02:31:59 – TypeError: Cannot read property ‘getHours’ of undefined
          at bigTimerNode. (/opt/node_modules/node-red-contrib-bigtimer/bigtimer.js:205:23)
          at emitOne (events.js:116:13)
          at bigTimerNode.emit (events.js:211:7)
          at Timeout._onTimeout (/opt/node_modules/node-red-contrib-bigtimer/bigtimer.js:866:9)
          at ontimeout (timers.js:498:11)
          at tryOnTimeout (timers.js:323:5)
          at Timer.listOnTimeout (timers.js:290:5)
          npm ERR! code ELIFECYCLE
          npm ERR! errno 1
          npm ERR! hassio-addon-node-red@ start: `node $NODE_OPTIONS node_modules/node-red/red.js “–settings” “/etc/node-red/config.js”`
          npm ERR! Exit status 1
          npm ERR!
          npm ERR! Failed at the hassio-addon-node-red@ start script.
          npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
          npm ERR! A complete log of this run can be found in:
          npm ERR! /root/.npm/_logs/2019-02-11T01_31_59_911Z-debug.log
          > hassio-addon-node-red@ start /opt
          > node $NODE_OPTIONS node_modules/node-red/red.js “–settings” “/etc/node-red/config.js”
          11 Feb 02:32:05 – [info] Welcome to Node-RED

          Updated to 2.1.5 in config:
          “npm_packages”: [
          “node-red-contrib-bigtimer@2.1.5”
          ],

          but same problem
          I had to disable bigtimer manually in /config/node-red/.config.json and then node red starts normally

  218. I only want to set one “On” time, but the control panel gives me On Time and On Time 2. Is there any way around this?

      1. I’m having the same issue. The way the node seems to work now, is it by default has 00:00 set as On Time 2. There is no blank in the drop down list to select…

        1. I’m having this issue as well. On Time 2 and Off Time 2 are both 00:00, but the timer is sending a message at 00:00.

          It might have something to do with the offset I’m using for On Time 1 and Off Time 1?

          A blank item in de drop down list would be great.

          1. 2.1.9 just published – should appear within the hour – that SHOULD do it. The second pair of times now have their own offsets. Please test.

  219. Hey Pete,

    Not sure what is different in mine, but even with 2.1.4 I still have the issue with getHours being undefined:

    5 Feb 07:25:14 – TypeError: Cannot read property ‘getHours’ of undefined
    at bigTimerNode. (/Users/Media/.node-red/node_modules/node-red-contrib-bigtimer/bigtimer.js:203:24)
    at bigTimerNode.emit (events.js:182:13)
    at Timeout._onTimeout (/Users/Media/.node-red/node_modules/node-red-contrib-bigtimer/bigtimer.js:866:9)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

    Here are the lines:
    200 if ((moons.alwaysUp!=true) && (moons.alwaysDown!=true))
    201 {
    202 date2=moons.rise;
    203 moonrise = (date2.getHours() * 60) + date2.getMinutes();
    204 date3=moons.set;
    205 moonset = (date3.getHours() * 60) + date3.getMinutes();
    206 }

    And I’m at 2.1.4. SunCalc is at 1.8.

    Went back to 2.1.1 and no issue there.

    1. Hi

      I have no idea. The check at line 200 should ensure that neither moons.alwaysUp nor moons.alwaysDown are true before checking the hours and mins… I used that as checkinf for false wasnt perfect – I can only put it down to an issue with suncalc module (I didnt write that). Possibly send and example including your long and lat coords as you used in the node?

  220. First at all, thanks a lot for the node. Is great.
    I want use the options “On time 2” and “Off time 2”.
    But when set the hours on the “time 2” fields it overrides the “time 1” how you can see on the next image.
    Should show “Off for 27 mins” but instead shows “Off for 09 hrs 27 mins” ignoring the “On time 1” parameter.
    Thanks!

      1. Any value produce this error.
        The parameters of the image:
        On1: 13 hs
        Off1: 14 hs
        On2: 23 hs
        Off2: 23:30 hs

        Or this node for example:

        [{“id”:”67ebcc9d.ec9d14″,”type”:”bigtimer”,”z”:”f899cdef.d8ade”,”outtopic”:”aire”,”outpayload1″:”1″,”outpayload2″:”0″,”name”:”Aire1″,”comment”:””,”lat”:”-27.466631″,”lon”:”-58.835564″,”starttime”:”780″,”endtime”:”840″,”starttime2″:”900″,”endtime2″:”960″,”startoff”:0,”endoff”:0,”offs”:”0″,”outtext1″:””,”outtext2″:””,”timeout”:”1440″,”sun”:true,”mon”:true,”tue”:true,”wed”:true,”thu”:true,”fri”:true,”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″:0,”month1″:0,”day2″:0,”month2″:0,”day3″:0,”month3″:0,”day4″:0,”month4″:0,”day5″:0,”month5″:0,”day6″:0,”month6″: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”:false,”odd”:false,”even”:false,”x”:287,”y”:162.5,”wires”:[[“f3b10ac.50bdbf8″,”90d380dd.a5cec”],[“257b3bbd.b8d304″,”f93e6461.43e948”],[]]}]

        Thanks for the reply!

        1. Check out 2.1.4 – which should be live any time – it is already on npm. That should do it – was just the display.

          1. Hi Peter! I’ve got the 2.1.4 version now, but the error remains. In fact, it is only the state, because the actions are executed correctly.
            More specifically this happens when the actual time is >off2.
            For example, if it is 23 o’clock and:
            On1: 09:00hs; Off1: 10:00hs; On2: 21:00hs; Off2: 22:00hs
            The status will show “Off for 22 hrs” instead of “Off for 10 hrs”

            1. I definitely fixed one display error… ok I’ll try for that one now, thanks… but I’ll re-jig it rather than wait until 11pm….

              1. Thanks to you. With any value whenever the current time is greater than “off2” the same thing happens.

                1. in the file bigtimer.js (there are only bigtimer.js and bigtimer.html active files) – from line 711 – feel free anyone to dive in with suggestions, I’m having trouble getting my head around this one….

    1. example: let’s say you’re a vampire in a 2.0 fashion, very geeky and with IOT interests… using it you can check if it’s the case of going out and risk your life in a final, epic bonfire of flesh, bones and teeth, or rest in peace in your grave till dusk comes down… just be sure to set longitude and latitude correctly!!!

      p.s.: sorry, couldn’t resist 😀

  221. Hi Pete,

    I’m having the same problem. I reinstalled suncalc and bigtimer to be sure I have the newest versions but stil get the same error: Cannot read property ‘getHours’ of undefined.

    From a dark and unresponsive home in the Netherlands 🙂

    regards, Ed

    btw Yesterday before bedtime all functioned OK.

      1. This is what I see when starting node-red:

        Welcome to Node-RED
        ===================
        26 Jan 12:09:41 – [info] Node-RED version: v0.19.5
        26 Jan 12:09:41 – [info] Node.js version: v10.15.0
        26 Jan 12:09:41 – [info] Linux 4.14.79+ arm LE
        26 Jan 12:09:47 – [info] Loading palette nodes
        26 Jan 12:10:12 – [info] Dashboard version 2.13.0 started at /ui
        26 Jan 12:10:17 – [info] Settings file : /home/pi/.node-red/settings.js
        26 Jan 12:10:17 – [info] Context store : ‘default’ [module=memory]
        26 Jan 12:10:17 – [info] User directory : /home/pi/.node-red
        26 Jan 12:10:17 – [warn] Projects disabled : editorTheme.projects.enabled=false
        26 Jan 12:10:17 – [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
        26 Jan 12:10:18 – [info] Server now running at http://127.0.0.1:1880/
        26 Jan 12:10:19 – [warn]
        ———————————————————————
        Your flow credentials file is encrypted using a system-generated key.
        If the system-generated key is lost for any reason, your credentials
        file will not be recoverable, you will have to delete it and re-enter
        your credentials.
        You should set your own key using the ‘credentialSecret’ option in
        your settings file. Node-RED will then re-encrypt your credentials
        file using your chosen key the next time you deploy a change.
        ———————————————————————
        26 Jan 12:10:19 – [warn] Error loading credentials: SyntaxError: Unexpected token i in JSON at position 0
        26 Jan 12:10:19 – [warn] Error loading flows: Error: Failed to decrypt credentials
        26 Jan 12:10:20 – [info] Starting flows
        26 Jan 12:10:20 – [error] [openweathermap in:Boskoops weer] No API key set
        26 Jan 12:10:20 – [error] [openweathermap in:Boskoops weer] No API key set
        26 Jan 12:10:23 – [error] [openweathermap in:Boskoops weer] No API key set
        26 Jan 12:10:23 – [error] [openweathermap in:Boskoops weer] No API key set
        26 Jan 12:10:24 – [error] [openweathermap in:Boskoops weer] No API key set
        26 Jan 12:10:24 – [error] [openweathermap in:Boskoops weer] No API key set
        26 Jan 12:10:25 – [error] [openweathermap in:Boskoops weer] No API key set
        26 Jan 12:10:25 – [error] [openweathermap in:Boskoops weer] No API key set
        26 Jan 12:10:25 – [info] Started flows
        26 Jan 12:10:26 – [red] Uncaught Exception:
        26 Jan 12:10:26 – TypeError: Cannot read property ‘getHours’ of undefined
        at bigTimerNode. (/home/pi/.node-red/node_modules/node-red-contrib-bigtimer/bigtimer.js:197:27)
        at bigTimerNode.emit (events.js:182:13)
        at Timeout._onTimeout (/home/pi/.node-red/node_modules/node-red-contrib-bigtimer/bigtimer.js:859:9)
        nodered.service: Main process exited, code=exited, status=1/FAILURE
        nodered.service: Unit entered failed state.
        nodered.service: Failed with result ‘exit-code’.
        nodered.service: Service hold-off time over, scheduling restart.
        Stopped Node-RED graphical event wiring tool.

        gr. Ed

        1. Right, until I (or someone else) figures out why that damned getHours function is failing for moontimes, I’ve taken that one new addition back out. I’ve left the style changes in however. Published ve 2.1.1 without moon times.

          1. Pete,

            Thank you very much for the time taken to look into it.
            It’s functioning again over here.

            Kind regards.

            1. My current guess is a fault in SunCalc.getMoonTimes which returns ride and set as dates.. if the moon is always up or down in your area for the testing day I’m guessing it returns null (invalid) date items…hence getHour and getMinute would not work on them – wverything worked fine for me but I can’t be putting out an update which fails in some installations.

          2. After I had updated BigTimer to 2.1.5 yesterday, I received the same errors as ‘Ed Claus’ is reporting above. (TypeError: Cannot read property ‘getHours’ of undefined) I have the lasted version of suncalc (v1.8.0) installed.

            To (temporarily) fix my now unresponsive NodeRED installation, I reverted back to BigTimer 2.0.9 and everything is working fine again.

            If it helps, I’m also situated in the Netherlands.

            1. You have no idea how much hassle moontimes has caused me – one guy asked for it so I put it in – firstly the moonTimes function in sunCalc would not seem to handle FALSE correctly, so I stopped using FALSE. I could not replicate the isue here until tlast night (late) – this morning I pushed out Bigtimer 2.1.6 with the moon section disabled – should work now…. in the meantime I tried a try-catch on it to test and clearly I’m not using try-catch correctly as THAT failed – ideas welcome. See latest blog entry..https://tech.scargill.net/try-catch-in-nodejs/

              Meanwhile 2.1.6 BigTimer should work fine. Its working here.

  222. Pete,
    I had to revert to the previous version (today I had updated to 2.1.0) :
    $ npm install node-red-contrib-bigtimer@2.0.9

    I suppose I’m missing some value in a field that generates this error:
    26 Jan 01:04:48 – [red] Uncaught Exception:
    26 Jan 01:04:48 – TypeError: Cannot read property ‘getHours’ of undefined
    at bigTimerNode. (/home/gerardo/.node-red/node_modules/node-red-contrib-bigtimer/bigtimer.js:197:27)
    at emitOne (events.js:116:13)
    at bigTimerNode.emit (events.js:211:7)
    at Timeout._onTimeout (/home/gerardo/.node-red/node_modules/node-red-contrib-bigtimer/bigtimer.js:859:9)
    at ontimeout (timers.js:482:11)
    at tryOnTimeout (timers.js:317:5)
    at Timer.listOnTimeout (timers.js:277:5)
    nodered.service: main process exited, code=exited, status=1/FAILURE
    Unit nodered.service entered failed state.
    nodered.service holdoff time over, scheduling restart.
    Stopping Node-RED graphical event wiring tool….

    Anyway, I love your Bigtimer node!

    Thanks!

    1. Well, you’ve lost me Geraldo… I added in a BigTimer checking for moon times .. and here in the UK it is claiming (this morning) 14 hours until the next moonrise, no problem. I note that SunCalc is up to v1.8 – whereas my REQUIRE simply states 1.* – I wonder if you have an early version?

      1. Pete,
        SunCalc version seems to be ok.

        node-red-project@0.0.1 /home/gerardo/.node-red
        ├── moment@2.21.0
        ├── node-red-configurable-ping@1.0.1
        ├── node-red-contrib-advanced-ping@1.2.0
        ├─┬ node-red-contrib-bigtimer@2.0.9
        │ └── suncalc@1.8.0

  223. Hi Pete, awesome node. Thanks for all your efforts.
    I like to use big Timer to turn on and off light in a Time window and also by a PIR Sensor.
    If big timer is in auto mode I can use the PIR input and set timer 120 at the input. It works fine.
    Problem: If I do Manual on and the PIR sends timer 120 it turns off the light after 120 second out I accept the light stays on because Manual ON.

    1. That’s because you’ve used manual on – thats the general idea. If you want timed output – use auto – that’s why you have auto.

      1. Thanks for your Reply. My setup is like Auto from sunset to 22 clock, and in the night a Pir sensor. Now at Halloween for example I do not like the light to turn on. So I do Manual OFF. But the PIR turn the light on.
        How can I fix this Problem?
        Thanks

  224. Hi Peter,

    First thank you for your big-timer, I like it !
    There is something I don’t understant with big timers : the overrides seem to only work if there is something schedule for the day. In my case, where there is a “no action today” under the big timer, sending a 1 on its input doesn’t change anything.

    Is it the expected behaviour ? Is there another way to override a big timer even if there is “no action today” ?

    Many thanks,
    Nicolas

    1. Well done – you spotted an error – now fixed in 2.09 – just published. “manual on” and “manual off now work as they should.

  225. Hi Pete,

    I use bigtimer to switch on a porch light just before sunset (-30) and off again late at night, 23.45 + 60. What I see in the log is a OFF at 00.45 but the same day not the next day. How do I get the OFF command firing the next day?

  226. “… the outputs will NOT revert back at change of schedule ”
    I added to my mind “… but if the timeout expired …”.

    I guessed a problem with this timeout, because several times the output of my sockets changed in manual mode without any interaction. In one case a long 3D print was interrupted during the night.
    Nevertheless I understand that the timeout counter will be stopped in manual mode and I have to check all possible reasons that may lead to my problems.

    Thanks for your support.
    Mario

  227. Well, I read:
    “If you inject “manual” in conjunction with “on” and “off”, the state will change until the set timeout (in minutes) times out …”
    Did I get something wrong?

    1. Thats not what it says in the README file..

      manual – When using (1/0) to override output, this will stop reversion at schedule change)

      Also in the HTML file

      The first two override messages (1/0) time-out after 24 hours (1440 minutes, user-settable) OR at the next change of schedule. If you have also selected “manual” – the outputs will NOT revert back at change of schedule (auto to reset).

  228. Hi Peter,
    Concratulations, you did a very good job. I like your BigTimer very much and use it with all my moveable MQTT Sonoff S20 sockets.
    Because I change the usage of the Sonoffs sometimes the control via Node-Red Dashboard should be similar to all with manual and auto mode.
    As I understand the manual mode, after setting on or off the timeout reverts the output to the „default“ state. That is not always what I want.
    My question is now: Is it possible to disable the timeout for instance with setting the timeout value to -1?

    Thank you for the answer in advance.
    Best regards
    Mario

  229. Hello,

    Thanks for the nice work on Big timer.
    I am in UTC +1 timezone and have problems with the negative Off Offset on Dusk.
    See attached image. Can somebody help me?

  230. Hi Peter, I am so glad to see you are still active on this. I have watched your videos and have many ideas on how to use bigtimer when I have the hardware in place.

    However ( hahaha ) I just tried making a time based flow in nodered today and thought I could use bigtimer but it either doesn’t support what I want or I can’t work out how to do it!

    I have an event I would like to pass through bigtimer based on the timings I have set in bigtimer ( AKA BT )
    E:G I send message “ON” to BT and if the time equals what I have set in big time it passes the message on. But if I send the “ON” to BT and the current time does not equal the schedule I have set in BT it blocks it.
    I hope this makes sense
    Mark

    1. Nope – that didn’t make sense to me. The ON and OFF commands are just overrides – BigTimer is meant to work on on-off times you enter during setup ie the schedule.

  231. Your server/computer/pi that is running the show takes care of timezones – not BigTimer – which is merely interested in long/lat to get dusk and dawn times.

  232. I confess I did not read every comment above…

    I used to be able to set the offset for NewYork with -300 on the one computer I cant control the system time on. Now that seems impossible? Is there a new way to do this???

    Also just now starting to play with your old thermostat code. Great stuff… Thx

  233. Love Big Timer and use it for most of my light automations.

    Is it possible to override the offset time in any way? I want to be able to change the timers from Home Assistant.

  234. Hi Pete,

    I’ve been using Big Timer for quite a few months now and found it very useful and rock-solid. Many thanks for sharing your efforts.

    I know it’s got zillions of features and seems the ultimate in configurabilty but there’s something that could be added and I think it would be useful to me and other users:-

    Up until the time that the days were getting shorter, I only used Big Timer for switching on the lights in the evening. However, now I also use it to switch on lights automatically when I get up at 7 AM and off at dawn.

    The problem comes next spring time when the days get longer. I will not require the light on if the Sun is already up. So, would it be possible to have a checkbox in Big Timer that basically says “only switch on if dark“?

    Keep up the good work.
    Keith.

    1. I have a different setup with lights that come on from dusk to about 10pm and then can be triggered by PIRs after 10pm till dawn. During daylight hours, the lights do not come on.

      I used two BigTimers to do the job:

      The first sets a global variable whether is it is light or dark and then a 2nd BigTimer does the Dusk to 10pm and it is then a simple test on whether the lights relays should be triggered.

      This worked a treat.

  235. Hi Peter,
    there is a bug in 2.0.7 on file bigtimer.js line 135-136
    node.d5 = n.d6;
    node.w5 = n.w6;
    should be:
    node.d6 = n.d6;
    node.w6 = n.w6;
    and the same on line 148-189
    node.xd5 = n.xd6;
    node.xw5 = n.xw6;
    should be:
    node.xd6 = n.xd6;
    node.xw6 = n.xw6;

    best regards

    1. Gabriele – thank you for that. I’ve released 2.08 with that fixed. Much appreciated feeback. Quite often, people just say “there is something wrong” without taking the time to work out the correction. That’s a good one.

  236. Hi Peter,
    thank you very much for this useful node.
    I use bigtimer to switch a light automaticly off, when someone forgot to switch it off manually. this should happen after 1min.
    Therefore i trigger bigtimer with a “timer 1 min” to activate the timer and a “0” to deactivate it.
    i do that with this function:

    var off = global.get(‘off’)||0;

    if(msg.payload === “ON”){
    msg.payload = “timer 1 min”;
    }
    if(msg.payload == “OFF”){
    var off = 0
    msg.payload = off;
    }
    return msg;

    This works, but when bigtimer got the timer once injected by the function, it will return in a “Off for xxhrs xxmins” – mode. that causes, that the light will turn on after that time. but that´s not what i wanted 😉
    what i need is that bigtimer returns in a “OFF Temp.override” – Mode after the timer is finished ( so no need to schedule ).

    Could you please give me a hint for this…?

    Thanks a lot!
    Greetz Bernd

      1. Hi Peter,
        i´m on 2.07 and the “timer x” – function is also in use, as i described it above.
        But i would need a fallback to the previous state of bigtimer and that was in my case “OFF Temp.override” and not “Off for xxhrs xxmins”.

        Did i anything miss to adjust in the bigtimer-settings?

  237. It could very well be my system I guess. I am using the docker container for raspberry pi and v8 javascript engine. I have done nothing else. I uninstalled bigtimer and re-installed it and then created this very simple setup. I only ever see data coming out of OUT2 and nothing from OUT1

      1. Just tried on a Pi3, latest Node-RED v0.19.5, NodeJS v8.14.0, Rasbian Stretch. Bigtimer 2.0.6.

        All the tests worked.

        One thing. “timer 10 sec” worked OK but then resets to auto rather than the previous setting – which happened to be manual off.

        Also, is it possible to turn off on a time injection rather than only turn on?

          1. I figured it out. I was putting the payload into ON Text field instead of the ON Payload field. The help text says MQTT Payload which threw me off. Maybe set it to ON Payload or something like that and the help text for ON Text says something associated with the 3rd output or something. Thanks!

              1. It might be worth menitoning somewhere in the node info that output 1 will not work unless these two properties are set. alternatively default the on msg & off msg to 1 & 0 or “on” & “off”, I’ve just spent 30 mins trying to get the timer to send anything out of the first output.

                1. The MQTT outputs must be set, otherwise there will of course be no output – MQTT isn’t mandatory – that’s just the first use case I had for the timer – the output can go anywhere you like – but with no output – nothing happens. I’ll make that clearer near the top of the blog though countless folk have used BigTimer without hitting such an issue.

                  1. In my case I wasn’t usng MQTT, I just added BigTimer and set the start and end times. It only started sending messages on output 1 after I added the on and off messages (not payload, I think I replied to the wrong comment)
                    I thought it would have worked ‘out of the box’ as such.

                    Ta!

  238. This looks really cool. I just installed the version from today and I’m not getting anything from the first output. I setup some sample inputs with overrides and debugs to the 1st and 2nd outputs. I only see stuff coming from the second output. Is that expected? See attached screenshot.

    1. One particular test I am sending an input using the “timer” command ie “timer 15 mins” without the quotes to turn on a heater for a short burst, it also comes on at 7am every day for 15 mins.

      1. 🙂

        Not bored – well maybe a little. Got bored of tweaking some noses on Twitter and spotted your post. I always like to keep up with what’s happening not only on your blog but especially with Bigtimer.

        Hopefully your time travel device uses an ESP32 so that I can think of something actually useful to do with mine.

  239. Thanks Pete, for considering to accommodate this timestamp 🙂

    I upgraded to v2.0.5, restarted nodered and i can see the two timers.
    But i don’t have the msg.stamp on neither the first nor the second output.
    I assume you retracted it from 2.0.4 to 2.0.5 due to some issue? or something wrong with my setup… ?
    Thanks again!
    -a

      1. 🙂 thanks Pete! got 2.0.6 & it works fine!

        BTW, i am also encountering same issue with no output (really nothing) on out1. Like Zack Brown.
        But this behavior is since before the update, so unrelated.

        My setup is node red v0.19.4 in docker, on RPI 3, along with hassio (home assistant in docker), both on resin os.

  240. hello Pete,

    Thanks for the big timer! I am using it in my home automation flows.

    Is there a way to output a timestamp from bigtimer, in the same format as the one from Input>Inject node?

    Or transform the output to a timestamp format?

    I generate some ui dashboard charts; synchronizing the inputs to the charts is the only way i can make use of the chart colors consistently.

    thanks,
    -a

    1. What you could do is have a function node with two inputs – one from the timer and one from an inject timestamp module. Set the inject nodule topic and the repeat frequency to whatever level of accuracy you need. Then in the function node, if the message topic is the timestamp then store it in a context variable and send no output. If the message is from the timer retrieve the context variable timestamp and add it to the message you pass on.

      1. thanks Steve, that might work 🙂
        even if in that case, it will pass a “past” timestamp.
        But it’s minor issue, if frequency of inject node is high (e.g. every 15-20 seconds).

        will update back…

        1. Yup, that sounds like a perfectly reasonable way to do it. The inject node can be used at higher frequencies than that no problem and generates just what you need.

          1. thanks both!

            I put the below code into a function node, which receives 2 inputs from 1) Big Timer (second output) & 2) an inject node (which gives payload timestamp, with topic defined as “timestmp”)

            //function starts here
            var timestmp = context.get(“timestmp”);

            if (msg.topic == “timestmp”) {
            //message is from inject node
            timestmp = msg.payload;
            context.set(“timestmp”, timestmp);
            }
            else if (msg.payload == 1 && timestmp !== undefined){
            // msg is not from inject node, but from Big Timer
            //interested only when Big Timer is ON (payload is 1)
            msg = {payload:timestmp};
            return msg;
            }

            1. Given what you want to achieve you could leave out the timestamp inject and the context variable and set your function node to

              if (msg.payload == 1 ){
              //interested only when Big Timer is ON (payload is 1)
              msg = {payload:Date.now()};
              return msg;

              This will give the same miilisec output as the inject node and accurate to the highest possible level.

            2. Let me save everyone a lot of messing about. Version 2.04 just published, has msg.stamp on both the first and second outputs – a standard timestamp.

              Also – and the main reason for doing the update, to on and off times – and the timer input command – added a while ago for people wanting to turn the thing on momentarily – which until now took seconds only now does TIMER X (s|m|h)

              ie. timer 2 is 2 seconds
              timer 2 m (or mins or minutes) is 2 minutes etc.

              Enjoy.

  241. Hi all,

    I would really like to big timer to my node-red setup. I do however have a hass.io installation running on a RPi where I have node-red activated as a plugin to hass.io. As far as I understand it, then it means I’m unable to use npm. Are there any alternative ways to install big timer?

  242. Hello Peter,
    Huge thanks for bigtimer.

    I am having a similar issue to “Sydknee”. The only way i can get it to “override” is to set it to manual and then sent a “1” but then the override is permanent.

    NodeRed v0.19.5
    Raspberry PI Zero on latest Stretch

  243. I’m having a bit of an problem with inputs on the big timer, whatever I try they don’t seem to work.

    I might be missing something obvious but from reading above I just need to inject a 1 or 0 (simplest form).

    I’ve tried also on and off also on_override but nothing happens. Does it need a topic?

    Pretty new to Node-Red but liking the other functions of Big Timer.

    1. Whether you need a topic depends on. What you are feeding. For input values see the readme. 1 and 0 are good are on, off and auto.

      1. I got to the bottom of the problem with a bit of fiddling . The timer was set to a specific day of the week and won’t override unless it’s on that day. Either this is by design or a bug but as I only want to override on that day it works out ok for me.

  244. Hi Peter,

    First and foremost, absolute big fan of your big timer node. I’ve been using it since I started building upon my smart home and am actually astonished that you keep up with it and all the other projects you are conquering. I do have a question though.

    I am using the bigtimer node to as a regular timer in one part of my home, I send a timer 45 input to set the timer to turn off after 45 seconds. Is there a way to cancel this action after its sent?

    Thanks,
    – M

  245. Hi Pete,
    Is it possible to see in the dashboard the status messages of bigtimer?
    The messages “On Temp. override”, “On for 8Hrs 22Mins”… just like you see it the nodes.
    Thank you again for all.

  246. I miss MoonRise and MoonSet events just like from the OpenHab. Can you implement them?

    Also the Sun times are few minutes different from OpenHab, also WeatherUnderground reports other numbers…so I do not now what is the correct one:)

  247. Hello Pete,

    many thanks for all the contribution in your blog, I learned a lot.

    Regarding the bigtimer, I’m searching for a way to have an UI, e.g. checkboxes for weekdays, text-input for a time string etc. and to translate this UI content into a “timer instruction”.
    Example could be a cron like input, e.g. “0 0 2 ? * SUN,TUE,THU,SAT *” to fire at 2 o’clock on Sunday, Tuesday, Thursday and Saturday.

    1. You don’t. BigTimer allows you to select, for example the first Sunday, second Sunday etc. It does not know how many Sundays there will be in the month. I’ve never been asked that question before.

  248. Hi,
    I just noticed that changing the payload texts only affect the first output. The second output (every minute) keeps going with 1 & 0 instead of payload texts. Is this normal behavior or I is like it should?
    You think is a good idea to have a setting to set the time you want to have this second output (every minute)? maybe to have like 1, 2,5,12,15,20,30,60 minutes?
    Thank you again

  249. Hi again
    I found Martins code (from 3 december 2017). However it seems to require that both timers send 1 or 0 before the function node outputs anything (or one timer sends again).
    This may work when deploying if both timers have “Output at startup” set, but later when one of the timers sends a 1 or 0, nothing will happen until some timer sends a new 1 or 0 (if you follow me). I tried it out with some inject nodes.
    I followed your suggested mehod of setting Timer1 to output 10 and 11 and Timer 2 to output 20 and 21. However, what would the function look like? I managed to write some logic to get it working (using global variables) but do you have some logic you could share as i think your method would probably be better than mine. I think this is of general interest tomany and to see how it should be done correctly.

    1. Hi

      I don’t think anyone has asked for this particular facility. I’ve given you an outline as to how you might do this in a function. So if the function recieves 11 OR 21 it sends out 1, if it recieves 10 or 20 AND the LAST received value was 20 or 10 (or there has been nothing before) then turn the output off. That all seems simple enough.

      I’ll leave the rest to you. Should not be too hard to expand this idea to multiple time blocks (timers) per day? I’m experimenting with a second set of on-off times right now (and just, incidentally, added a comment field). I have to take it easy and fully test any changes as LOTS of people use BigTimer.

  250. Hi
    I’m having trouble using 3 Bigtimers (morning, afternoon, weekend) to control the setpoint of the temperature controller in the office.
    They seem to be overwriting each other, as the all send to the same topic. Also having trouble sending the msg.state to the temperature controller (to be shown in display along with actual setpoint). Have you any eksamples showing how to glue more Bigtimer together to control the same value ??

  251. Great node.
    But how can i program more than one schedule the same day.
    Say i want a lamp to turn on at 07.00 and off att 08.00 and then later turn on at 11.00 and off at 12.00.
    I’ve tried using 2 BigTimers programmed to different times of day but when i deploy one oyutputs off and the other one on. (=collission)

    1. Simple glue logic in a function fed from 2 timers. Call first timer output 11 and 10, second timer 21 and 20. Do on if either on, only do off if both off. Simples!

  252. Hi Pete

    Thanks for the deep explanations and all you articles.

    I’m trying to use the bigtimer to turn on a lamp 15mins before sunset and only if I’m at home and if lamp is off.

    So I set bigtimer On Offset to -15 and the Off Offset to 10.

    What I would like to do is to have the lamp to be turned on only the first time all conditions (timing, presence and lamp off) are ok.
    If, for example, the lamp was turned on by the flow and then turned off and time is still in between the range and I’m at home, I don’t want the flow to turn it on again.

    Do you thing it is possible?

    Thanks
    Woody

  253. Hi Pete,
    I been using for a long time your node and want to thank you for your dedication.
    Have one question and one plead for help for you…
    a) I am trying to change the payloads to X and Y instead of 1 and 0 but I keep having just numbers on debug… is it possible to do?

    b)I just want you to ask for advice of this requirement since you know a couple of things about timers…
    I need to have intervals of 8 and 4 hours – inside this intervals I need to be running on and off loops . Inside the 8 hour interval need to be running 5 min and resting for 10 in a loop. and in the 4 hour interval need to run 10 minutes and rest for 30min.

    Can you help me on the way to start to achieve this?… I tried some dirty chain of delays but it didn t work … and I am not sure if this is the best approach… do you have any sugestion on the easy way to do this or example to share with me or whatever light?

    Thank you again 🙂

    1. Is this what you are referring to “The on_override and off_override inputs can be used to supercede the set inputs for on and off times (in minutes) – “on_override 20:15″ for example (without the quotes) for 8:15pm” – If so I suggest you refer to the module information tab.

  254. Hi Peter,

    i plan to use your timer on a remote location.
    However most of the time there will be no internet availible.
    Time is arranged by a local (gps based) ntp server.

    What will happen when i set the time to sunset. when there is internet and then the internet is lost for about a week?
    Will it keep the last known value and update it as soon as the connection is restored?

    PS Thanks for the great work you did.

  255. Pete,

    I’m trying to setup Holiday triggers and I’m noticing that the month filters at the bottom don’t seem to be working. I set it up for the fourth week of the month, 5th & 6th day and only turned on November at the bottom but it’s been on all this week. Am I misunderstanding something in it’s usage or is it a bug?

    Thanks

    1. Well, I set a timer (very bottom) to operate anytime OTHER than September – and of course, NO ACTION TODAY. So then I set 4 (for the week) in the top right of the “include special weekdays of the month” section and 6 in the top LEFT of the same section – result ON FOR X HOURS… I changed day 6 to day 5 and NO ACTION TODAY as you’d expect. Works a treat.

      1. Here is my node config which is still showing on today if you don’t mind taking a look and letting me know what I’m doing wrong.

        Thanks

        [{“id”:”91e2269a.b90a78″,”type”:”bigtimer”,”z”:”864e4169.fd187″,”outtopic”:””,”outpayload1″:”HOLIDAY”,”outpayload2″:”OFF”,”name”:”Thanksgiving”,”lat”:”39.7388″,”lon”:”-104.4083″,”starttime”:”0″,”endtime”:”0″,”startoff”:”1″,”endoff”:”-1″,”offs”:0,”outtext1″:””,”outtext2″:””,”timeout”:1440,”sun”:false,”mon”:false,”tue”:false,”wed”:false,”thu”:true,”fri”:true,”sat”:false,”jan”:false,”feb”:false,”mar”:false,”apr”:false,”may”:false,”jun”:false,”jul”:false,”aug”:false,”sep”:false,”oct”:false,”nov”:true,”dec”:false,”day1″:”0″,”month1″:”0″,”day2″:”0″,”month2″:”0″,”day3″:0,”month3″:0,”day4″:0,”month4″:0,”day5″:0,”month5″:0,”day6″:””,”month6″:””,”d1″:”5″,”w1″:”4″,”d2″:”6″,”w2″:”4″,”d3″:0,”w3″:0,”d4″:0,”w4″:0,”d5″:0,”w5″:0,”d6″:””,”w6″:””,”xday1″:”0″,”xmonth1″:”0″,”xday2″:”0″,”xmonth2″:”0″,”xday3″:”0″,”xmonth3″:”0″,”xday4″:”0″,”xmonth4″:”0″,”xday5″:”0″,”xmonth5″:”0″,”xday6″:””,”xmonth6″:””,”xd1″:”0″,”xw1″:”0″,”xd2″:”0″,”xw2″:”0″,”xd3″:”0″,”xw3″:”0″,”xd4″:”0″,”xw4″:”0″,”xd5″:”0″,”xw5″:”0″,”xd6″:””,”xw6″:””,”suspend”:false,”random”:false,”repeat”:false,”atstart”:true,”odd”:false,”even”:false,”x”:150,”y”:1400,”wires”:[[],[],[]]}]

  256. Peter – thanks for introducing me to node-red. After some successful testing. I’m expecting to make significant use of big-timer.
    But I’m unclear on one thing. If I’m using LAT/LONG in order to determine my location will the timer know I live in a location that doesn’t observe DST? Like not just a random little city but my entire province of Saskatchewan, Canada

    1. Hi – no idea. Never been anywhere that doesn’t do summer/winter time. Europe has been talking about it for years but never done anything.

  257. Hi Pete,
    First thanks for the great job, this module is really nice.

    I’m just concerned about the time offset difference.
    As I’m located in France I have to change the offset to UTC+2 .. which works fine except that I will have to change the offset according to the daylight saving time.

    If I understand correctly when there is a DST change I have to manually change the offset in BigTime.

    Can you confirm my understanding is correct?

    If yes, below some improvement ideas:
    – add an offsetOverride in BigTimer
    – automatically manage the offset (including the DST changes) based on the GPS location

    what do you think?
    best regards,
    Fred

    1. I am currently in Spain it works operfectly there and in Britain where I spend my winters. Others use it all over Europe, in America and elsewhere.

        1. Go on then, tell me. I’ve heard of Bluemix but have no idea what it or or why it may be interesting. May as well ask while we’re here.

          1. Bluemix is a cloud system from IBM, mainly used for IoT. They sell you some services (there is also a free offer with some limitations but sufficient for a small app). In my case I have a VM hosting my node red server and a local db, very easy to set up. You can define an alias address to access it … nothing revolutionary but quite convenient.

  258. Hi Pete,

    switch off at 23.45 + 60 minutes does not extend into the next day 00.45. What would be the work around to prevent numerous bigtimers?

    kind regards

    Han

  259. Hi Pete,

    This is clearly a great timer which I am definitely going to start using.

    However, I have a scenario which I thought I would be able to do but I don’t think I can, unless you can tell me otherwise please.

    I would like to specify special days whereby it will trigger the timer only on those days.

    For example I would like some things to only run on Christmas Day.
    In particular I was going to use a couple of timers to specify the bank holidays for the year and get it to turn on my devices on those days, as I will be at home rather than at work.

    If you can tell me if this is possible or indeed if there is another node that can do this that I’m missing it would be really appreciated.

    Many Thanks.

      1. That’s what I thought! But it says no action today when it’s on a special day and I get no output from either of the 3 nodes when I deploy even though I have the box selected to run on startup. Because of this I thought it was just to prevent running on special days.

        I will try again and also check my version of Nodered etc.

        Many thanks.

        1. So, let’s pick a simple example – it is August, Thursday morning and you have elected something to come on all morning BUT you’ve NOT selected August. You will get NO ACTION TODAY. You want the exception to be every Thursday morning. Simply select up to five weeks – i.e. 1,2,3,4 and 5. With that, select day 5 in each case (Thursday). It does work. Here’s the first example..

          1. and the second example… a specific day in August. You must of course select a time. Hence you can select Christmas day or any other special day.

            1. Hi Pete,

              Thank you for your help. I have finally figured it out!

              I think because I tried so many things my original explanation wasn’t really the actual problem. My actual problem was not getting an output out of the first output due to not populating the payload fields, I had populated the “on text” and “off text” fields but not the “on msg” and “off msg” fields. Thankfully someone else had made the same stupid mistake as me: https://groups.google.com/forum/#!topic/node-red/mGkT4WYOdPw.

              Thanks for the taking the time to reply.

  260. Hi!
    I wanted to use BigTimer but it seems that I can not set the time which I need. How do I get Times like 20:04 or 10:03? Or maybe to start a device at 20:00 for three minutes? It seems to me that I can only choose the time from some pre-defined times, but that can’t be it, or is it?
    Kind regards,
    Frank

  261. Peter,

    Downloaded and using 1.08 – i have looked at the JS and can see where you assign the timedown value to node.countdown – i have tried directing this to a debug node with complete message object and am not seeing anything come up in the debug window for the node – i have updated to the latest Node-red – any ideas ??

  262. Peter, Question about your TImeout Node (can not see a seperate thread anywhere for that one) – i am using this and it is great – i was wondering is it possible to get the countdown time remaining as part of the output message ? I am using this node to do a Countdown on a manual over ride – i would like to put onto the Dashboard to the amount of time that is left in the countdown – it does not currently look like it is part of the output stream though ?

    Craig

    1. It is now, I’ve just added msg.countdown to the output (v 1.08) so as long as you have autorepeat turned on, every second you can get the remaining seconds in msg.countdown.

  263. I am sorry to leave this here. I am trying to use your timer to open my chicken coop door at sunrise and close it at sunset. I am hoping you could look over my flow to see where I may need improvement. I dont think I have it configured properly. I am using sequent microsystems relay mega io module on the pi3 for relays and a linear actuator. The relay commands work on the trigger because I have to fire 2 relays to make it work. My question/comment can you look over my “output” of your timer to make sure it triggers the relays? I have spent several days off and on with this. If I just use the UI and pushbuttons it works great but that behooves the point of automation.

    [{“id”:”a94237de.1c6758″,”type”:”exec”,”z”:”5e1e0515.37daec”,”command”:”megaio”,”addpay”:true,”append”:””,”useSpawn”:”false”,”timer”:”4″,”oldrc”:false,”name”:”MEGA-IO”,”x”:776.5000381469727,”y”:321.75000381469727,”wires”:[[],[“276a7ac1.0dc386”],[“276a7ac1.0dc386”]]},{“id”:”276a7ac1.0dc386″,”type”:”debug”,”z”:”5e1e0515.37daec”,”name”:”Door Toggle debug”,”active”:true,”tosidebar”:true,”console”:false,”tostatus”:false,”complete”:”payload”,”x”:1017.2500762939453,”y”:330.0000171661377,”wires”:[]},{“id”:”2acccef7.c800c2″,”type”:”ui_button”,”z”:”5e1e0515.37daec”,”name”:””,”group”:”29f62e5d.a7b452″,”order”:0,”width”:0,”height”:0,”passthru”:false,”label”:”DOOR OPEN”,”color”:””,”bgcolor”:””,”icon”:””,”payload”:”true”,”payloadType”:”bool”,”topic”:””,”x”:178,”y”:207.5,”wires”:[[“64f386e3.68c8f8”]]},{“id”:”624c496a.fbcf18″,”type”:”ui_button”,”z”:”5e1e0515.37daec”,”name”:””,”group”:”29f62e5d.a7b452″,”order”:0,”width”:0,”height”:0,”passthru”:false,”label”:”DOOR CLOSE”,”color”:””,”bgcolor”:””,”icon”:””,”payload”:”true”,”payloadType”:”bool”,”topic”:””,”x”:172,”y”:392.25,”wires”:[[“e3b78acc.1c57d8”]]},{“id”:”64f386e3.68c8f8″,”type”:”trigger”,”z”:”5e1e0515.37daec”,”op1″:”0 rwrite 2=off “,”op2″:”0 rwrite 1 =on”,”op1type”:”str”,”op2type”:”str”,”duration”:”250″,”extend”:false,”units”:”ms”,”reset”:””,”bytopic”:”all”,”name”:”Door Open”,”x”:567.5,”y”:258.25,”wires”:[[“a94237de.1c6758″]],”inputLabels”:[“OPEN”]},{“id”:”e3b78acc.1c57d8″,”type”:”trigger”,”z”:”5e1e0515.37daec”,”op1″:”0 rwrite 1=off “,”op2″:”0 rwrite 2 =on”,”op1type”:”str”,”op2type”:”str”,”duration”:”250″,”extend”:false,”units”:”ms”,”reset”:””,”bytopic”:”all”,”name”:”Door Close”,”x”:568,”y”:381.5,”wires”:[[“a94237de.1c6758″]],”inputLabels”:[“CLOSE”]},{“id”:”afd18e22.d2165″,”type”:”bigtimer”,”z”:”5e1e0515.37daec”,”outtopic”:””,”outpayload1″:”OPEN”,”outpayload2″:”CLOSE”,”name”:”Door Timer”,”lat”:”36.7937″,”lon”:”92.5757″,”starttime”:”5004″,”endtime”:”5003″,”startoff”:0,”endoff”:0,”offs”:0,”outtext1″:”Coop Door Open”,”outtext2″:”Coop Door Close”,”timeout”:1440,”sun”:true,”mon”:true,”tue”:true,”wed”:true,”thu”:true,”fri”:true,”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″:0,”month1″:0,”day2″:0,”month2″:0,”day3″:0,”month3″:0,”day4″:0,”month4″:0,”day5″:0,”month5″:0,”d1″:0,”w1″:0,”d2″:0,”w2″:0,”d3″:0,”w3″:0,”d4″:0,”w4″:0,”d5″:0,”w5″:0,”suspend”:false,”random”:false,”repeat”:true,”atstart”:true,”odd”:false,”even”:false,”x”:229,”y”:311.5,”wires”:[[“64f386e3.68c8f8″,”e3b78acc.1c57d8”],[],[“ea02b348.da29d”]]},{“id”:”ea02b348.da29d”,”type”:”ui_text”,”z”:”5e1e0515.37daec”,”group”:”29f62e5d.a7b452″,”order”:0,”width”:0,”height”:0,”name”:””,”label”:”Timer Status: “,”format”:”{{msg.payload}}”,”layout”:”row-right”,”x”:541,”y”:319,”wires”:[]},{“id”:”29f62e5d.a7b452″,”type”:”ui_group”,”z”:””,”name”:”COOP DOOR”,”tab”:”f13d9697.b2ff88″,”disp”:true,”width”:”6″,”collapse”:true},{“id”:”f13d9697.b2ff88″,”type”:”ui_tab”,”z”:””,”name”:”COOP CONTROL”,”icon”:”dashboard”}]

  264. Hi Peter, awesome work on BigTimer. Thanks so much! Been learning Node-RED past week and so glad I found your timer.

    Problem: I think it has an issue with Daylight Savings time.

    Attached pic shows my timezone is “PDT” and time is 23:49. I’ve set the OFF time to be 23:00 but BigTimer says ON for 11 more minutes, so it thinks time is 22:49.

    Yeah, I really wish the U.S. would do away with this silly daylight savings (along with imperial units) but aside from that, is there a way to fix it? Thanks!

    (Edit: I edited my comment and the pic disappeared. I can re-upload if needed.)

    1. No problem that I’m aware if. We have daylight saving in the UK and here in Spain (I agree with the sentiment).

  265. Hi Peter,

    do you plan to add an input that allow to send initial configuration to the node ?
    I would like to write an external app that is able to configure the node using HTTP POST instead of using Node-Red workspace.
    Is this feature still available and i’m missing it ? 🙂

    Thanks for you great work!!!

  266. Hi Pete, awesome node. Thanks for all your efforts.

    Quick question. Is it possible to for BigTimer to fire on alternate weekdays ? or does someone have thoughts on a reliable way to achieve the following functionality ?

    I want to trigger an action every Wednesday, however I want to alternate the response. Concrete example:
    1. Wed 11th Jul,2018 Announce “Put out green bin”
    2. Wed 18th Jul,2018 Announce “Put out yellow bin”
    3. Wed 25th Jul,2018 Announce “Put out green bin” Note this is same as 1.
    4. Wed 1st Aug,2017 Announce “Put out yellow bin” Note this is same as 2.

    When I say reliable, I mean which Wed is important so when node-red restarts or is re-deployed, it can’t arbitrarily reset the alternating sequence i.e. Wed 18th will always be yellow bin night.

    Regards and appreciate feedback

  267. Hi there,

    is it possible to put the on_override and off_override command in one payload?

    Thanks in advance.

    Peer

  268. Sure 🙂 but then the value is wrong for normal use. It should always be minutes in every mode. Otherwise it is very confusion.

    It would be great if the timer mode will also work with minutes eg “timer 90m” for 90 minutes or “180s” for seconds.
    Best!

  269. hi everybody!

    I am planning to use the bigtimer for my pool pump as a simple countdown to turn the pump off after a specific period of time, which I set in the node red dashboard.

    So setting up the bigtimer with “timer 300” for a 5 minute countdown – so far so good.

    But when I also set the timeout property to 5 (which should be 5 minutes) the timer will be canceled after 5 seconds – NOT minutes!

    When using the timer function the timeout value is seen as seconds value, instead of minutes value.

    Did someone experience a similar behaviour? Bug or feature :)?
    thx!

  270. Hi Pete, i want to thank you for sharing your knowledge this way, i seen your blog from time to time, until a few days ago when i decided to start playng with IoT stuff and had to spend a few days inside here 🙂
    I was using cloudmqtt to see a few sensors on my phone, and now with your script i got those sensors being stored for grafana in influx and sending me telegram posts. (HiGrow, esp32 with mongoose) I have yet to see your firmware.

    I have a lot of questions, but i can’t find a clue of some, and here they are:

    1- do you run various instances?
    I i made two projects, one had a flow which send mqtt to influx, and noticed it stopped when i used other projects :\

    2- how do organize your flows and stuff? Do you have a flow full with lots of small flows? im trying to make one flow for alll mqtt, one for all notificattions, etc

    3- do you develop on that same instance and keep restarting all the thing?

    And the final one, because there are no blocks for some ideas…
    I have a node for receiving, evaluating and storing all mqtt, the evaluations (sensor levels) would trigger a template message to another flow via virtual wire to send me a telegram message. but i want an option to request a reading.
    But I do not know how to ask for a new sensor reading from a flow where it could take 5 minutes to get an update from mqtt

    Also: please try to evaluate nginx as a web server for the script, its a lot smaller in memory footprint, very efficient and could do a lot more for you as a frontend for all the stuff 🙂

      1. Yep Docker is definitely the way to go for each of the components and then call them in as needed.

        I have just rebuilt a centos server at home – moved all the stuff that i had natively installed previously into prebuilt docker images and it is magic

  271. Hi Pete,

    I fixed my mistake. I took the latitude and longitude for my location from another program that I use that required them to be specified with a colon instead of a period. (33:40, instead of 33.40)

    I discovered my mistake when writing a quick js program to test the suncalc module.

    Changed to 33.40 and everything work OK.

    Thanks for a great node.

    -Bob

  272. Hi Pete,

    Long time follower of your blog. I’ve recently installed bigtimer and I can’t seem to get the dusk feature working.

    Here’s an node.error(msg) from output #2:

    {“payload”:0,”reference”:”toSonoff-Dual:sw1-on:sw1-off:791″,”topic”:”status”,”state”:”OFF Override”,”time”:0,”name”:”Porch Lights”,”start”:1200,”end”:240,”dusk”:null,”dawn”:null,”solarNoon”:null,”sunrise”:null,”sunset”:null,”night”:null,”nightEnd”:null,”now”:791,”timer”:0,”duration”:0,”onOverride”:-1,”offOverride”:-1,”_msgid”:”34a10903.608756″}

    The values associated with the “suncalc” module are null. I do have suncalc installed in my home/pi/.node-red/node_modules directory.

    I’ve used node-red for many years and I usually do not have any problems installing and using nodes. In this case, I just don’t know what I’m doing wrong. Any ideas?

    -Bob

    1. Hi

      I’m dealing with a potential issue with night and nightend (which i never usr) but dusk and dawn are working a treat..

      Pete

  273. Hi Pete,
    I’ve come across a bug with version Big Timer version 1.9.2.
    If “Night” is selected as the On Time and “Night end” as the off time, and Latitude and Longitude values are populated then it produces a “Not a Number” error in both the output and the text displayed below the node…

    status : msg : Object
    object
    payload: 0
    reference: “:::525”
    topic: “status”
    state: “OFF Auto”
    time: “NaNhrs NaNmins”
    name: “Big Timer”
    start: null
    end: null
    dusk: 1256
    dawn: 197
    solarNoon: 726
    sunrise: 241
    sunset: 1211
    night: null
    nightEnd: null
    now: 525
    timer: 0
    duration: null
    onOverride: -1
    offOverride: -1
    _msgid: “df695832.283b88”
    5/28/2018, 9:46:45 AMnode: 45aeb0cc.10082

    Pete.

  274. Peter,

    One thing I would like to check is output #2’s “formatting”.
    As I mentioned in my reply to another person asking about breaking down the times, if the minute value is less than 10, it is truncated to just a single digit.

    Though “legal” it is confusing to read.

    eg: Sunset 18:03.
    Rather than seeing 18:03, the time is output as 18:3.

    I know a bit of magic can fix it, but I’m just asking could it be formatted with leading zeros before it is sent out?

  275. Hi Peter
    is it possible to use bigtimer if i want to turnOff a switch after 120min? If switch turnOn then wait 120 min before it should turnOff

    I am using bigtimer for sunrise and sunset and that works great but i have not got the timer settings to work. (because i do it wrong…)

    Regards
    Jonny Larsson

      1. when i turnOn my switch i want bigtimer to automatically turnOff after 120minutes.

        sorry if it was unclear.

        //Jonny

        1. The purpose of bigtimer is to switch things on and off at certain times of the day. Check out my node node-red-contrib-timeout if you want something turning off x minutes after you turn it on….

  276. Sir allow me re phrase the question.from the screen grab you see your basic example with my mods. under big time you see the timer info I refer too. I am not asking how to make a GUI page rather how to get that time data out of big timer to do with what I may. I want to display X min till on or X min to off. Hope this clears the question up. Ron.

    1. Hi

      Outputs from Bigtimer are described in the readme. Where you send them to is up to you. Not at my computer but all outputs start with msg. and there is far more than just .payload

      1. I’ve updated the BigTimer documentation – in the first two outputs you can grab msg.duration which will tell you in minutes how long to the next change of state. Also the value msg.now shows the time now in minutes after midnight.

    2. Here is my effort though there is a “bug” that the times are not formatted to be two digits.
      So if sunset is (say) 18:03 you get 18:3

      Requirements:
      String node.

      Hope it helps.

      Code follows:
      [{“id”:”2fff825f.4c298e”,”type”:”function”,”z”:”c636aa5a.cc34″,”name”:”Build message”,”func”:”// zeroPad(5, 2);\nvar sunrise_H = parseInt(msg.sunrise / 60);\nvar sunrise_M = msg.sunrise % 60;\nvar sunset_H = parseInt(msg.sunset / 60);\nvar sunset_M = msg.sunset % 60;\nmsg.payload = \”Sunrise \”;\nmsg.payload += sunrise_H;\nmsg.payload += \”:\”;\nmsg.payload += sunrise_M;\nmsg.payload += \” Sunset \”;\nmsg.payload += sunset_H;\nmsg.payload += \”:\”;\nmsg.payload += sunset_M;\nmsg.payload += \” \\r\\n \”;\nmsg.payload += msg.state;\nreturn msg;”,”outputs”:1,”noerr”:0,”x”:470,”y”:150,”wires”:[[“37a58358.ee718c”]]},{“id”:”37a58358.ee718c”,”type”:”split”,”z”:”c636aa5a.cc34″,”name”:””,”splt”:”\\n”,”spltType”:”str”,”arraySplt”:1,”arraySpltType”:”len”,”stream”:false,”addname”:””,”x”:620,”y”:150,”wires”:[[“dadb071b.eb16f”]]},{“id”:”dadb071b.eb16f”,”type”:”string”,”z”:”c636aa5a.cc34″,”name”:””,”methods”:[{“name”:”trimRight”,”params”:[]}],”prop”:”payload”,”propout”:”payload”,”object”:”msg”,”objectout”:”msg”,”x”:740,”y”:150,”wires”:[[“e212189.8b4fc68”]]},{“id”:”e212189.8b4fc68″,”type”:”switch”,”z”:”c636aa5a.cc34″,”name”:””,”property”:”payload”,”propertyType”:”msg”,”rules”:[{“t”:”cont”,”v”:”Sunrise”,”vt”:”str”},{“t”:”else”}],”checkall”:”true”,”repair”:false,”outputs”:2,”x”:860,”y”:150,”wires”:[[“c9ef329a.334a48”],[“99ccbaea.dc46c”,”c86cd450.f1626″,”2873e35b.cb383c”]]},{“id”:”c9ef329a.334a48″,”type”:”split”,”z”:”c636aa5a.cc34″,”name”:””,”splt”:”13″,”spltType”:”len”,”arraySplt”:1,”arraySpltType”:”len”,”stream”:false,”addname”:””,”x”:990,”y”:150,”wires”:[[“86068149.7ef358”]]},{“id”:”86068149.7ef358″,”type”:”switch”,”z”:”c636aa5a.cc34″,”name”:””,”property”:”payload”,”propertyType”:”msg”,”rules”:[{“t”:”cont”,”v”:”Sunrise”,”vt”:”str”},{“t”:”cont”,”v”:”Sunset”,”vt”:”str”}],”checkall”:”true”,”repair”:false,”outputs”:2,”x”:1110,”y”:150,”wires”:[[“6a18edea.14f8bc”,”b9735a41.7b3e3″,”102884b3.42318b”,”b00a2963.bce03″],[“2ff54103.bf99d6″,”d0e40658.d09b2″,”a64ffaf0.de09c8″,”263c048a.3e52d4”]]},{“id”:”6a18edea.14f8bc”,”type”:”debug”,”z”:”c636aa5a.cc34″,”name”:”HS”,”active”:false,”tosidebar”:true,”console”:false,”tostatus”:false,”complete”:”payload”,”x”:1260,”y”:110,”wires”:[]},{“id”:”b9735a41.7b3e3″,”type”:”ui_text”,”z”:”c636aa5a.cc34″,”group”:”143d1a28.fd350e”,”order”:2,”width”:”5″,”height”:”1″,”name”:””,”label”:”Sunrise time”,”format”:”{{msg.payload}}”,”layout”:”row-spread”,”x”:1280,”y”:140,”wires”:[]},{“id”:”2ff54103.bf99d6″,”type”:”debug”,”z”:”c636aa5a.cc34″,”name”:”HJ”,”active”:false,”tosidebar”:true,”console”:false,”tostatus”:false,”complete”:”payload”,”x”:1260,”y”:170,”wires”:[]},{“id”:”d0e40658.d09b2″,”type”:”ui_text”,”z”:”c636aa5a.cc34″,”group”:”143d1a28.fd350e”,”order”:3,”width”:”5″,”height”:”1″,”name”:””,”label”:”Sunset time”,”format”:”{{msg.payload}}”,”layout”:”row-spread”,”x”:1280,”y”:200,”wires”:[]},{“id”:”143d1a28.fd350e”,”type”:”ui_group”,”z”:””,”name”:”Times”,”tab”:”4bedbfa3.4576c”,”order”:1,”disp”:true,”width”:”5″,”collapse”:false},{“id”:”4bedbfa3.4576c”,”type”:”ui_tab”,”z”:””,”name”:”Sun Times”,”icon”:”dashboard”,”order”:5}]

  277. Pete quick question: How can I display the time info in my GUI interface as at the bottom of the big timer node in the node-red design flow? Thanks Ron.

  278. Well, after a lot of messing about I made a bit of code to help me try and track down what is going on.

    See attached.

    The times are right as per what BigTimer says, so why is it telling me that it is night time?

    The DayMode button is to the left, meaning NIGHT MODE.

  279. Ok, something is going on.

    Today I am programming and look at BIG TIMER’s output.

    It says the sun will rise in about 3 hours.

    Local time is 13:50.

    It was (or seemed to be) behaving yesterday.

  280. Thanks.

    Well, the confusion grows.

    I’ve deleted the UTC offset and things are looking better.

    The “Every minute” problem is resolved.

    I was looking at the wrong output. Sorry.

  281. Hello Andrew
    I have just tested and have no problems. I run node red 0.17.5 and node.js 6.x as I remember. Bigtimer is 1.8.0 so I am not on newest version. It puts out at message from first output every minute.
    For test you can set Your debug node to show “complete msg object”. You Will then have at lot more information from Bigtimer, which You Can show here.
    Regarding to sunrise/sunset confusion, it might be the Man UTC, which You have set to 10 hours. This shift both sunrise and sunset.
    I think Longitude should be with minus when You are East. Then I think You Can see sunrise and sunset-times to be OK. Have Man UTC to 0 and 12 and look below the node, as You have already in a square, to see next change. With wrong sign, it become about 20 hours off track.
    Best regards Brian

    1. I was wrong about the sign. That part is right in Your setting if You live netarkiv Sydney. Mine are 55.11 , 10.17 🙂 and calculation of sunrise/sunset seem OK.

  282. Thanks.

    What was also “killing me” was the ON/OFF SUNRISE/SUNSET.

    See attached.

    Local time is 11:45
    It is set to: ON TIME = SUNRISE
    OFF TIME = SUNSET
    ON TEXT = Sun rise
    OFF TEXT = Sun set – though you can’t see that.
    Bit of you look to the right: It has just said: Sun set.
    If I reverse the ON TIME and OFF TIME, it gives me Sun rise now.

    Another problem I also noticed is the “Repeat output” button is TICKED.
    This was explained that if set, it (big timer) would send out the message every minute.

    See second attached picture.
    I reversed the On Time and Off Time settings to the opposite to what I would have thought. The message was then sent: Sun rise. That was at 11:45.

    It is now 11:53 and there has only been ONE output.
    What am I missing?

    Oh, only 1 attachment per post. Stand bye.

  283. Ok, I’m stuck.

    On an older (now deleted) flow in NR, BigTimer worked.

    I can’t vouch for the EXACT times, but for Sunrise/Set they were close enough for what I needed.

    The computer died, I lost the flow. Had to rebuild. Got latest version of BigTimer.
    AFAIK, I put in the same values.

    The times it gives me back are…….. weird.

    Screen shot included.
    Local time: 21:59
    Location: S 33.51
    E 151.12
    Date 5/5/2018
    Nominal Sunrise/set times: 06:10 17:20
    BigTimer is telling me the sun will set in 1 hour 46 minutes from now. 21:59.

    Nah. It set a LONG time ago.

    Granted the On Time Off Time may not be correct. As the UTC Offset.

    Tried permutations of. No better.

    Can someone tell me what I am missing?

    1. Hello Village
      It seems you have set Off time to a fixed time 23.45. In the dropdown choose Dawn, or some other variabel which depend on the sun.
      There is 1 hour 46 min from 21.59 to 23.45.
      Best regards Brian, Denmark

  284. When I override the node by sending a msg the node sends my ON Text. Can I stop this? So, when I ovveride the note by msg it dosen’t output anything?

  285. Hi Pete,
    Sorry for this question. You already answered this to Gordon McLellan.
    issue solved. Please delete my stupid question 😉 I should have read all comments thorougly.
    Thanks again for a great timer!
    Kind regards, Bert

  286. Hi Pete,
    A wonderful and very powerfull timer you made! Thank you for that.
    Apart from the single timer use, i try to use it as your example above using TWO timers. But That doed not work with me. I am sure i probably missed some setting, but when i configure bothe timers, with different times of cource, as soon BigTimer 1 fires ON, after one minute BigTimer 2 will switch it OFF.
    And that continues.
    Can you explain me what i am doing wrong here? I put the config here:

    [
    {
    “id”: “b48d24b6.510718”,
    “type”: “bigtimer”,
    “z”: “1cb8a570.7e361b”,
    “outtopic”: “”,
    “outpayload1”: “ON”,
    “outpayload2”: “OFF”,
    “name”: “Big Timer”,
    “lat”: “51.995”,
    “lon”: “5.22778”,
    “starttime”: “480”,
    “endtime”: “480”,
    “startoff”: “5”,
    “endoff”: “10”,
    “offs”: 0,
    “outtext1”: “Lamp Aan”,
    “outtext2”: “Lamp Uit”,
    “timeout”: 1440,
    “sun”: true,
    “mon”: true,
    “tue”: true,
    “wed”: true,
    “thu”: true,
    “fri”: true,
    “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”: 0,
    “month1”: 0,
    “day2”: 0,
    “month2”: 0,
    “day3”: 0,
    “month3”: 0,
    “day4”: 0,
    “month4”: 0,
    “day5”: 0,
    “month5”: 0,
    “d1”: 0,
    “w1”: 0,
    “d2”: 0,
    “w2”: 0,
    “d3”: 0,
    “w3”: 0,
    “d4”: 0,
    “w4”: 0,
    “d5”: 0,
    “w5”: 0,
    “suspend”: false,
    “random”: false,
    “repeat”: true,
    “atstart”: true,
    “odd”: false,
    “even”: false,
    “x”: 380,
    “y”: 500,
    “wires”: [
    [
    “30c420c.04cb06”,
    “bd742da5.8ced98”
    ],
    [],
    []
    ]
    },
    {
    “id”: “30c420c.04cb06”,
    “type”: “debug”,
    “z”: “1cb8a570.7e361b”,
    “name”: “BigTimer 1/2”,
    “active”: true,
    “tosidebar”: true,
    “console”: false,
    “tostatus”: false,
    “complete”: “true”,
    “x”: 630,
    “y”: 500,
    “wires”: []
    },
    {
    “id”: “f2932925.8f0b28”,
    “type”: “inject”,
    “z”: “1cb8a570.7e361b”,
    “name”: “”,
    “topic”: “”,
    “payload”: “ON”,
    “payloadType”: “str”,
    “repeat”: “”,
    “crontab”: “”,
    “once”: false,
    “onceDelay”: 0.1,
    “x”: 150,
    “y”: 440,
    “wires”: [
    [
    “b48d24b6.510718”
    ]
    ]
    },
    {
    “id”: “8b76f042.21ecd”,
    “type”: “inject”,
    “z”: “1cb8a570.7e361b”,
    “name”: “”,
    “topic”: “”,
    “payload”: “AUTO”,
    “payloadType”: “str”,
    “repeat”: “”,
    “crontab”: “”,
    “once”: false,
    “onceDelay”: 0.1,
    “x”: 150,
    “y”: 520,
    “wires”: [
    [
    “b48d24b6.510718”
    ]
    ]
    },
    {
    “id”: “a153cf39.3aacb8”,
    “type”: “inject”,
    “z”: “1cb8a570.7e361b”,
    “name”: “”,
    “topic”: “”,
    “payload”: “OFF”,
    “payloadType”: “str”,
    “repeat”: “”,
    “crontab”: “”,
    “once”: false,
    “onceDelay”: 0.1,
    “x”: 150,
    “y”: 480,
    “wires”: [
    [
    “b48d24b6.510718”
    ]
    ]
    },
    {
    “id”: “1cded6b0.d966e9”,
    “type”: “bigtimer”,
    “z”: “1cb8a570.7e361b”,
    “outtopic”: “”,
    “outpayload1”: “ON”,
    “outpayload2”: “OFF”,
    “name”: “Big Timer”,
    “lat”: “51.995”,
    “lon”: “5.22778”,
    “starttime”: “480”,
    “endtime”: “495”,
    “startoff”: “12”,
    “endoff”: “10”,
    “offs”: 0,
    “outtext1”: “Lamp Aan”,
    “outtext2”: “Lamp Uit”,
    “timeout”: 1440,
    “sun”: true,
    “mon”: true,
    “tue”: true,
    “wed”: true,
    “thu”: true,
    “fri”: true,
    “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”: 0,
    “month1”: 0,
    “day2”: 0,
    “month2”: 0,
    “day3”: 0,
    “month3”: 0,
    “day4”: 0,
    “month4”: 0,
    “day5”: 0,
    “month5”: 0,
    “d1”: 0,
    “w1”: 0,
    “d2”: 0,
    “w2”: 0,
    “d3”: 0,
    “w3”: 0,
    “d4”: 0,
    “w4”: 0,
    “d5”: 0,
    “w5”: 0,
    “suspend”: false,
    “random”: false,
    “repeat”: true,
    “atstart”: true,
    “odd”: false,
    “even”: false,
    “x”: 380,
    “y”: 660,
    “wires”: [
    [
    “a72c8d85.0e898”,
    “bd742da5.8ced98”
    ],
    [],
    []
    ]
    },
    {
    “id”: “a72c8d85.0e898”,
    “type”: “debug”,
    “z”: “1cb8a570.7e361b”,
    “name”: “BigTimer 2/2”,
    “active”: true,
    “tosidebar”: true,
    “console”: false,
    “tostatus”: false,
    “complete”: “true”,
    “x”: 630,
    “y”: 660,
    “wires”: []
    },
    {
    “id”: “23eb978.f6597e8”,
    “type”: “inject”,
    “z”: “1cb8a570.7e361b”,
    “name”: “”,
    “topic”: “”,
    “payload”: “ON”,
    “payloadType”: “str”,
    “repeat”: “”,
    “crontab”: “”,
    “once”: false,
    “onceDelay”: 0.1,
    “x”: 150,
    “y”: 600,
    “wires”: [
    [
    “1cded6b0.d966e9”
    ]
    ]
    },
    {
    “id”: “9a3b9767.dd1cd8”,
    “type”: “inject”,
    “z”: “1cb8a570.7e361b”,
    “name”: “”,
    “topic”: “”,
    “payload”: “AUTO”,
    “payloadType”: “str”,
    “repeat”: “”,
    “crontab”: “”,
    “once”: false,
    “onceDelay”: 0.1,
    “x”: 150,
    “y”: 680,
    “wires”: [
    [
    “1cded6b0.d966e9”
    ]
    ]
    },
    {
    “id”: “51754311.d90474”,
    “type”: “inject”,
    “z”: “1cb8a570.7e361b”,
    “name”: “”,
    “topic”: “”,
    “payload”: “OFF”,
    “payloadType”: “str”,
    “repeat”: “”,
    “crontab”: “”,
    “once”: false,
    “onceDelay”: 0.1,
    “x”: 150,
    “y”: 640,
    “wires”: [
    [
    “1cded6b0.d966e9”
    ]
    ]
    },
    {
    “id”: “bd742da5.8ced98”,
    “type”: “mqtt out”,
    “z”: “1cb8a570.7e361b”,
    “name”: “Sonoff_8S20”,
    “topic”: “tasmota/Sonoff_7S20/cmnd/POWER”,
    “qos”: “”,
    “retain”: “”,
    “broker”: “63290974.7c5b1”,
    “x”: 630,
    “y”: 580,
    “wires”: []
    },
    {
    “id”: “63290974.7c5b1”,
    “type”: “mqtt-broker”,
    “z”: “”,
    “name”: “broker.mqtt-dashboard.com”,
    “broker”: “broker.mqtt-dashboard.com”,
    “port”: “1883”,
    “clientid”: “”,
    “usetls”: false,
    “compatmode”: true,
    “keepalive”: “60”,
    “cleansession”: true,
    “willTopic”: “”,
    “willQos”: “0”,
    “willPayload”: “”,
    “birthTopic”: “”,
    “birthQos”: “0”,
    “birthPayload”: “”
    }
    ]

    1. Sorry, my description above of the behaviour is not correct.
      As BigTimer 1 fires, almost immediately BigTimer 2 switches off. And after one minute this process repeats itselve.
      The same when BigTime 2 is on its turn to fire. Then BigTimer 1 switches immediately off. with the repeat after one minute…

      Btw, it does not make a difference when i use my own broker in stead of broker.mqtt-dashboard.com.

      1. I can only speak for installations using local mosquitto (as per “the script”) though I’m not sure what any of that has to do with BigTimer.

  287. There is what I try to achieve:
    Scheduled on Thursday but could be on for 1 minute anytime..

    Flow below:

    [{“id”:”ef59c07a.7f32e”,”type”:”bigtimer”,”z”:”f37d448c.779bb8″,”outtopic”:”bigtimer”,”outpayload1″:”on”,”outpayload2″:”off”,”name”:”Big Timer”,”lat”:”55.019300″,”lon”:”-7.777090″,”starttime”:”1200″,”endtime”:”1260″,”startoff”:0,”endoff”:”0″,”offs”:0,”outtext1″:”on”,”outtext2″:”off”,”timeout”:1440,”sun”:false,”mon”:false,”tue”:false,”wed”:false,”thu”:true,”fri”:false,”sat”:false,”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″:0,”month1″:0,”day2″:0,”month2″:0,”day3″:0,”month3″:0,”day4″:0,”month4″:0,”day5″:0,”month5″:0,”d1″:0,”w1″:0,”d2″:0,”w2″:0,”d3″:0,”w3″:0,”d4″:0,”w4″:0,”d5″:0,”w5″:0,”suspend”:false,”random”:false,”repeat”:true,”atstart”:true,”odd”:false,”even”:false,”x”:448.3660583496094,”y”:190.52999877929688,”wires”:[[“ad78c49a.4bcfa8”],[“542d8484.494a3c”],[“43a67352.2cfa0c”]]},{“id”:”ad78c49a.4bcfa8″,”type”:”debug”,”z”:”f37d448c.779bb8″,”name”:””,”active”:true,”tosidebar”:false,”console”:false,”tostatus”:true,”complete”:”payload”,”x”:667.3290405273438,”y”:139.01602172851562,”wires”:[]},{“id”:”542d8484.494a3c”,”type”:”debug”,”z”:”f37d448c.779bb8″,”name”:””,”active”:true,”tosidebar”:false,”console”:false,”tostatus”:true,”complete”:”payload”,”x”:667.3200073242188,”y”:189.0159912109375,”wires”:[]},{“id”:”43a67352.2cfa0c”,”type”:”debug”,”z”:”f37d448c.779bb8″,”name”:””,”active”:true,”tosidebar”:false,”console”:false,”tostatus”:true,”complete”:”payload”,”x”:671.300048828125,”y”:244.01998901367188,”wires”:[]},{“id”:”1872cacd.bf5b45″,”type”:”change”,”z”:”f37d448c.779bb8″,”name”:”default”,”rules”:[{“t”:”set”,”p”:”payload”,”pt”:”msg”,”to”:”default”,”tot”:”str”}],”action”:””,”property”:””,”from”:””,”to”:””,”reg”:false,”x”:94.96902465820312,”y”:268.9590148925781,”wires”:[[“49dac20e.fda04c”]]},{“id”:”49dac20e.fda04c”,”type”:”delay”,”z”:”f37d448c.779bb8″,”name”:””,”pauseType”:”delay”,”timeout”:”1″,”timeoutUnits”:”minutes”,”rate”:”1″,”nbRateUnits”:”1″,”rateUnits”:”second”,”randomFirst”:”1″,”randomLast”:”5″,”randomUnits”:”seconds”,”drop”:false,”x”:259.38299560546875,”y”:226.09901428222656,”wires”:[[“ef59c07a.7f32e”]]},{“id”:”3a8a9b85.1f18d4″,”type”:”inject”,”z”:”f37d448c.779bb8″,”name”:””,”topic”:””,”payload”:”on”,”payloadType”:”str”,”repeat”:””,”crontab”:””,”once”:false,”onceDelay”:0.1,”x”:89.49502563476562,”y”:189.04501342773438,”wires”:[[“1872cacd.bf5b45″,”ef59c07a.7f32e”]]}]

  288. Hi Pete

    If I have only one day checked (Thursday) I can’t override state by injecting on/off on another day.
    Is it expected behaviour?

  289. Hi Peter. Good job on the bigtimer.
    I noticed that the override input does not produce any output if the day is not selected. In other words, the override does not work on the unselected days. The info under the node box changes but no output.
    Thank you,

    1. Right, I’m taking a look at this. There are two types of override, temporary and permanent. It makes no sense to have a temporary override to a timer that is not on today, but perhaps the permanent override could run regardless.

      I’ll need to ensure this does not create any conflicts, and if not, then I’ll arrange so that if you preselect manual then select 1 or 0, there’s an output regardless.

      That should keep everyone happy.

  290. Hi Peter… I love what you’ve done with bigtimer. 🙂 I downloaded it a put it into a bunch of light flows I have for evening scenes in my house, however, once I replace the standard time node with bigtimer, they stopped working. 🙁

    I’ve done some troubleshooting, and I find that no matter what time setting I try, or manual inputs I push through bigtimer, I NEVER get anything out of the first (topmost) output on bigtimer. If I connect debug to the second output, I get the message as intended, at switch time, and every minute as well, and when I manually push ON or OFF through input. But in any of those circumstances, I NEVER see any output through the first output… Any ideas why this isn’t working?

    PS – I have tried this on several different new bigtimer nodes, and even on multiple tabs and flows… I get the same results each time. Thanks for any advice!!

        1. I’m using 1.9.1 and I’m seeing the same behavior with the first output not outputting anything. I’ve tried injecting both numbers/letters. I swear this was working yesterday with the exact same flow.

          I’m seeing this in my logs.
          15 Apr 21:41:57 – [info] [mqtt-broker:adb4bcac.b3178] Connection failed to broker: node-red@mqtt://192.168.2.40:1883

          1. I pointed out earlier that the temporary manual override won’t do it – there is nothing to override. Input “manual” first, then 1 or 0. I have it working here and that is what was published. 1.9.0 worked fine but I’d neglected to update the status display on the node itself hence 1.91 – let me know how that goes.

  291. Is there a way to change on wihch days the timer repeats, by input?
    For example:
    You send a msg with Monday = true and Saturday = false to let the timer repeat on Monday but not on Saturday.

    1. The repeat only refers to the output message. You turn the timer on and off by selecting which days you want it to run.

          1. It would help me immmensely if you would put your signature and date on any changes so I can easily identify and test before incorporating.

  292. Hi Peter
    Thanks for BigTimer, it is really great!
    But I have a little problem with it when I want to override the timer. In my node you can see that I inject bigTimer with the MQTT payload to temporally override the timer. When I do this with a debug node at the end it works fine but as soon as I connect the output back to the MQTT output the system (Raspberry PI) goes down.

    On the right side you can see the debug messages when fireing some MQTT messages from my smartphone to override the timer.

    Do you have any idea why the system goes down as soon as I connect BigTimer to the MQTT output?

    Thanks
    Chris

  293. Is there a possiblity to configure the timer completely from the UI?
    For examle to specify the Weekedays or the Months?

    I would like to create a special Alarm Clock which is modifyable. But it seems the commands accepted are limited?

  294. Is Override really Override?
    I thought that a manual Override of the BigTimer (v1.8.0) would force the output at any time, but it only works on scheduled days and also if it’s not suspended.
    So if I’d like to manually turn on my lights on a non-scheduled-day, then I need to pass the On/Off messages not only to BigTimer but also straight to the node at the output of BigTimer. And that would make on_override HH:mm kind of useless since you yourself needs to remember if it is a scheduled day or not, otherwise the BigTimer does nothing. Funny enough thedot (node.status) is updated regardles.

    if ((!node.suspend) &&(goodDay)) { … node.send([outmsg1, outmsg2, outmsg3]) … }

    Well, apart from that, BigTimer is great work!

  295. Hi.
    I’m not able to stop the Timer by Inject PayLoad ‘stop’. All other like ‘on,off,auto’ are functional. Any idea why ‘stop’ is not working ?

  296. Hello Pete

    just spotted your comment- I am so pleased to see you a bit active again, and that you will soon be back to your family and friends.

    Just to show how much help your blog has been to me – have script running in various mods on my system. Have boards running, even managed to do Eclipse and made some roms just changing the passwords etc. Done flows in Nodered
    on Rpi- . This all in the last quarter of 2017. This for my sons house. I never thought at my age I could do this. MANY Thanks TO YOU.

    This website has formulas for virtually every programming language to convert
    Epoch time might be of interest.

    https://www.epochconverter.com/

    Regards

    Brian

      1. Thanks Pete! So, is there a way, for example: I want ot start something for the next 3 month and stop it in other 3 months… Is there a way to setup that?

  297. I really appreciate this smart timer. But in the very moment I need help. I want to use this timer only at Mondays, Tuesdays and Wednesdays, but I need a topic/payload-massage the other days due to an AND-function which I realize with a join-node. When I blank i.e. Friday, Big-Timer’s status is ‘No action today’ with no message at any output. Any idea?

  298. Hello, I’m starting with Bigtimer to send notifications to my SLACK, but I need to know how I can schedule for specific DAY of the month, independent of month of the year.

    For example: Every Day 5 at 12:00

    I tried to put in DAY1: 5 and keep Month with 0 but not works.

    Can you help me?

    Thank you very much

  299. Hi Pete,

    Love the Big Timer, just started playing with it now.

    One thing I noticed, and I worked around it by changing my Deploy to ‘only nodes that have changed’, was that every time you click Deploy in a ‘deploy all nodes’ setting it resets the Big Timer back to auto even if I’d turned it off or stopped it. Took me a while to figure out what was happening when I was working on other parts of my automation. Just something for the noobs out there like me.

    Second thing is the ‘speech/txt output’ only outputs when the timer sends out an on or off signal. Would be great to have this also output the state of the timer, so I can see on my dashboard whether it’s actually stopped, or only temporarily off etc.

    I’d like to have it turn the output off when I stop the timer too. At the moment when I stop it, it just leaves everything on as it was. Is that possible?

    Cheers,
    Joe

  300. Hi,
    i really like bigtimer, starting using it for automated 433Mhz electric socket.
    Now i´ve learned how to use the override which is fine.

    Is it possible to change the on off time with input variables ? Would be fine to build a ajustible timer for waking up in the morning

    Would be really great if it´s possible

  301. I am using bigtimer with Home Assistant. The Home Assistant service call node requires the input to be in a strict JSON format, i.e. {“service”:”turn_on”}. I’ve tried to get bigtimer to output a message exactly in this format by putting that in the ON Msg (or OFF Msg) config field, but the debug output shows its then sending the msg as payload: “{“service”:”turn_on”}” (notice the extra quotes around the brackets.

    Is there any way for me to configure this with the correct JSON?

    1. I would +1 this request. I also need to send JSON messages. Currently I need a function node in between to translate from text to jsnon. My preference(from a user perspective), would be tohave the payload edit field be identical to one in the standard inject node. Here you can choose from a dropdown menu what the payload type is. You can choose text and json and then fill in the data in the edit box.

  302. Hi,
    first of all very very good work. Thanks
    I noticed the following:
    I want to use BigTimer as simple timer via injecting “timer xx”.
    so far so good. but i don’t want any schedules. but if i check suspend schedule the timer also dosn’t work anymore.
    kind regards
    Max

  303. Hello,
    I found that BT returns wrong values when Node red is running on Synology. Only remaining time is same, start, dusk, sunrise, now, etc. are one hour less. Left side on the picture is PI3, right side Synology. Settings, (time, location, timezone) are same.

      1. On picture above is time on both platforms 17:39, I expect that this is system platform time.
        Nevertheless time on Synology is correct in DSM and also in shell.

        1. I compared component SUN in Home assistant. Left side is PI3, right side Synology. Both platforms show correct values. It looks like issue is in BigTimer.

            1. One more test. I added node sunrise with same coordinations.
              At 15:14 BT says is past sunset, but node sunrise shows still day, which is correct. I looks like problem with timezone for sun events, time NOW is correct.
              Maybe that problem is on the way between BT and Synology (Node red, python, docker… ?)

  304. Hello Pete,
    Could I suggest an option for First/Last (Weekday) of the month.
    The current options only let you choose the week.
    For example: Last Sunday of March (Clock change!!) I enter weekday 1 week 4 and weekday 1 week 5 on the timer. This (Some years) when there are 5 Sundays in March will trigger twice.
    Thanks

  305. Hi Pete
    currently writing function to turn on and off outside lights by pinging android phones to detect presance (won’t work with i-phones wi-fi sleep etc, etc) obviosley i don’t want them to come on when its light outside. So i thought use BigTimer dusk / dawn to set a global then my function can just test the global.get. although this would work ok, and i have many of your big timers in my flows, is there a way to just check for dusk /dawn without having the big timer setting the global. ie global.get from one of the many other big timers in my flows ?
    Chris.

  306. Pete

    this is really interesting all this time stuff, is there a start time for bigtimer to start timing from ie 00.00 midnight or is it sun depenent?and start from sunrise

    as i cant see why 10.00 would be start=600

    object
    payload: 0
    reference: “:1:0:592”
    topic: “status”
    state: “OFF Auto”
    time: “00hrs 08mins”
    name: “Big Timer”
    start: 600
    end: 630
    dusk: 990
    dawn: 436
    solarNoon: 713
    sunrise: 477
    sunset: 949
    night: 1075
    nightEnd: 351
    now: 592
    timer: 0
    duration: 8
    onOverride: -1
    offOverride: -1

  307. Hi getting to grips,with big timer love it thanks

    How can I show how long to go until on time on node-red dashboard and how to go before switch of time please

    1. Good morning Nigel.

      That is an excellent question and one which until now could not be answered. If you would care to update to the latest version as of this morning – you will find that the msg objects output from the first and second outputs – now include msg.duration in minutes.

      Regards

      Pete.

      1. Morning Pete

        Glad you liked my question. I have updated big timer and now can see duration in minutes. If I wanted to display in hours I would need to x 60. Would I need a function node to do this. I cannot code could you give me a Idea please.

        1. A reminder to all about the message on my blog – I don’t do training – that is what Google is for – mind you a donation to the blog can always change my mind if it is easy.

          Yes you will need a function node…. drop it in and… well, this might give you a head start…

          msg.payload= “Off for ” + pad(parseInt(duration / 60), 2) + “hrs ” + pad(duration % 60, 2) + “mins”

  308. Pete.

    I’m getting out of my depth here. My last stab at programming was Fortran way back when. I don’t really know what ‘ if (msg.state.toLowerCase().indexOf(“stopped”)==-1) return msg; ‘ should do, but all I get is a response message saying ‘ TypeError: Cannot read property ‘toLowerCase’ of undefined ‘.

    What I have done is put a function node in parallel with Big Timer containing ‘ if (msg.payload = “stop”) { msg.payload = “0”} return msg; ‘, and it has solved my problem.

    Thanks all the same.

    1. John

      If you’re going to mess with Node-Red I STRONGLY recommend getting a beginner’s book on Javascript (nothing old) otherwise you are going to hit this time and time again and eventually give up. I cannot imagine Fortran knowledge being helpful here. The good news is that Javascript is interpretive so you can mess around without compiling stuff.

      The function nodes take in a message – which is an object. It has things like msg.payload and msg.topic – but you can add more – like msg.fred=1; for example. In this case, the message (msg) from BigTimer (SECOND OUTPUT) contains msg.state which is simply a character string which might contain for example “OFF Stopped”. As I don’t want to start worrying about uppercase and lowercase, I added the METHOD to turn the whole lot into lower case… ie msg.state.toLowerCase

      I then want to search for a string within a string – ie the lower case word “stopped”… that is done by adding indexOF at the end.. if it can’t find anything it returns -1 – hence the line I gage you only returns a message if “stopped” isn’t in there… otherwise the function merely ends without returning anything.

  309. If you want connect two big timer to one output, here is OR function node which do OR over two incoming messages. This works best with checked Repeat output and Output at startup in bigtimer settings.

    var msgCount = context.get(‘count’)||0;
    var msgGlobal = context.get(‘msg’)||0;

    msgCount++;
    msgGlobal = msgGlobal || ((msg.payload == “1”) ? 1 : 0);

    if (msgCount == 2) {
    msg.payload = msgGlobal;

    if (msgGlobal == 1) {
    node.status({fill:”green”, shape:”dot”, text:”ON”});
    } else {
    node.status({fill:”blue”, shape:”dot”, text:”OFF”});
    }

    context.set(‘count’, 0);
    context.set(‘msg’, 0);

    return msg;
    }

    context.set(‘count’, msgCount);
    context.set(‘msg’, msgGlobal);
    return null;

    1. Great solution!
      I wonder though, if anyone else but me think it would be great with two sets of timers i one node, so you don’t have to add a second node? What do you think, Pete?

  310. I much appreciate your quick response.

    It seems I had not understood the specifics of the ‘stop’ input and the output nodes – I was connected to the second one.

    I was sending a text ‘stop’ as payload input. Connecting to the first output node it does indeed stop everything. However, I wanted a ‘0’ output from Big Timer to stop all other activities downstream – this would have been ideal.

    I am somewhat curious to know why a ‘1’ message is given from the second node when Big Timer is stopped. A ‘0’ output would have been more logical (and useful for me).

    OK, I will have to find a workaround to bypass Big Timer and get the rest downstream to stop working.

    Thanks for your time.

    Regards.

    1. Probably the reason you’re seeing a ‘1’ on the second output is because the unit is not set to state 0… it is just stopped – two completely different things. The simple solution is not to use the second output. The primary output is the first one.

      However, on the second output if you look at msg.state you will find that it says something like “OFF Auto” normally but when the unit is stopped it will say “OFF Stopped”…. so really all you need to do is stick a function node containing the following, on the second output:

      if (msg.state.toLowerCase().indexOf(“stopped”)==-1) return msg;

      Easy solution.

  311. Hi Pete.

    Firstly, Big Timer is excellent. However, I’m new to pi’s, arduinos, and therefore Big Timer, etc., etc.. In my retirement I chose to pursue something new instead of good old relay logic. I loved ’em !!! Therefore, please accept my naivety.

    So now, my problem. I’ve been using inputs that form a ‘master switch’ control into Big Timer, but found that I was getting unexpected results. So, I experimented and discovered that by simply placing Big Timer between an inject node and a debug node, and setting the inject node to send a “stop” message, Big Timer shows itself to have ‘STOPPED’ but continues to send a ‘1’ message at the first node. If I send an “off” message, it then sends a ‘0’ but does not shut down completely. I need the system to fully shut down.

    Note: Within Big Timer, I have set up the input message to ‘1’ and the output to ‘0’, and there are no ‘text’ messages and no ‘topic’ set. ‘On Time’, ‘Off Time’, ‘Lat’ and ‘Long’ are all set.

    If I’m doing something wrong, please HELP. Otherwise, I may be back to my relays!

    Regards, John.

    1. If you send the message “stop” as a string from, say, an inject node… i.e. a msg.payload of “stop” – then nothing more will come out of the FIRST output of BigTimer. I’m sitting looking at it here and have been for the last 5 minutes. If you then send the message “auto” it will start up again.

      Are you sure you are sending “stop” in the payload and not the topic… and are you sure you are looking at the topmost output from BigTimer…

      You say that within node-red you have set the input message. There is no input message. I assume you meant the on and off messages.

    2. on and off are not the same as stop and auto of course – on and off are simple manual overrides affecting the state of the output. STOP actually stops all output form the top most (first) output of BigTimer.

  312. G’day Pete
    just thought I would share my work in progress with you. Its a greenhouse sensor/automation system which BigTimer is an important part of. I’ve also used the LCD screen you featured on an earier post to preview the programs on the screen. Start time, end time, duration, state etc. Now onto making timer adjustments within the UI which I’ve noticed some mention in your blog.
    Thanks again for all your hard work, BigTimer and sharing your knowledge.

    Regards. Mike

    1. (Newbie here)

      Those dashboards…..

      Love ’em.

      Which (forgotten the term) “library” (?) do they use?

  313. Hi Peter,

    Something is stumping me.
    Currently I use BigTimer to switch a light on (20:00) and off (00:30). Easy.
    I also connected a node-red switch in parallel to the timer so I could have manual control.
    However I notice that whenever I use this switch, the initial command (1 or 0) executes but then the Sonoff device that’s connected to it stops responding to the point that I cannot even access it directly over http.

    I have narrowed this down to the timer because if I connect the node-red switch directly to the MQTT output (bypassing the timer), the Sonoff switches states instantly and continuiously as ordered.

    Is this something to do with “timeout”? It is currently set to 720.
    Running BigTimer version 1.7.9

    Paul.

    1. How about removing the link from the output of the timer to the input of the switch and only having the one from the output of the switch to the input of the timer.
      This is how I have an override switch connected

      1. Hi Steve,

        I actually didn’t this originally but soon realised that when the timer went high, the switch still remained in an “off” state.

        Feeding the timer output back into the switch input solves this problem.

        I may play with the new “toggle” ability that Peter has added in the latest update. Maybe this will yield a better result. As soon as I have time that is! 😀

        1. Well, I’ve added toggle now, but it did occur to me that another way would have been a simple function node with a global variable, toggled back and forth each time and outputting “1” or “0” accordingly… hey ho… it is done now…

  314. Hi Peter. Great blog.

    I have an feature request, could we have a ‘toggle’ input which toggles the output state. It should be treated in a samilar way as ‘on’ and ‘off’ e.g. BigTimer should reassert itself after 24hrs or the next scheduled state change.

    I’m a programmer but currently can’t see a way of implementing this in Node-Red with the existing nodes.

    Dave

    1. We aim to please… and as that was a good idea…. version 1.7.9 should appear within hours or less…. “toggle” implemented.

  315. Hi Peter
    As you know I use your script every time I install a Raspberry and I also use node-red a lot.
    Now I have a small problem with Bigtimer. So far, I did not find a solution:
    I control the lamp in my lab only with PIR sensors, because I do not have regular office hours here and because the lab is in the basement and needs light even during the day.
    I use your “timer 900” command which is triggered by the PIR sensors and it works flawlessly. The only thing is, that I have to make sure that the “big clock” is always off because it supersedes the timer function. First I thought, I could suspend the “big clocK” by the tick mark, but then everything is suspended. Now I have set the ON time to 19:00 and the OFF time to 19:15 because this is a time where I am often in my lab but it would be nicer if I could avoid this 15 minutes on-time every day, Do you know a trick?
    Regards
    Andreas

    1. Hi Andreas – sorry – I read that twice and I’m still not entirely sure what you are trying to achieve. Why don’t you email me and let’s see if we can come up with a a solution.

  316. Hi Peter,

    here again, testing stuff and trying to deploy an irrigation system…
    I’m having an issue with BT, and I’m almost sure it’s something I’m not understanding well. Let me explain:

    I want to start the irrigation system 1 hour after dawn and be active for 30 minutes.
    So I set:
    On time = Dawn
    Off time = 30 minutes
    On offset = 60
    Off Offset = 0

    What I see looking at ‘start’ and ‘end’ fields (second output) is that ‘start’ is Dawn+60minutes, and ‘end’ is Dawn+ 30 minutes, while I would expect ‘end’ to be Dawn+offset+off time, i.e. Dawn+90 minutes to allow 30 minutes of operation after start.

    In fact the timer status reflects “On for 11hrs 19mins” right now, and -in my understanding- it should be off…

    Is it working as designed?

    Thank you for your answer, for your blog and your hard work here. I really learn a lot with all the participants here.

    (Environment: Raspi, your script, long and lat Madrid, CET timezone, time correctly adjusted)

    1. According to what you have above the end time is wrong – surely they should both be dawn, the on time offset 60 minutes and the off time offset 90 minutes

      1. Ok Peter, thanks.
        My interpretation was that ‘off time’ (when filling with x minutes) will mean “work for x minutes” after On time + on offset.

        Hasta pronto!

  317. Loving this BigTimer module — saves on a huge amount of logic programming so many thanks for that!

    I have a question about feeding it into MQTT.

    I have my topic msg set to “tele/passage/” and ON Msg set to “POWER ON”, I connect the MQTT node to output 1 of BigTimer but my MQTT server receives “stat/passage/ POWER ON” (note the space before the Msg and double space between POWER and ON.)

    The debug output from your module looks fine — any pointers on where it is going wrong?

    James

  318. Hey Peter,
    For the 1st – Thank you for this awaysome timer.
    For the 2nd – I am newbee in Node-Red and Linux 🙁
    on the search my 10 years old house automation to modernize I am at raspberry and Node-Red landed.
    for the necessary functions I need only a few time-controlled on-off functions. I want to do this with the BigTimer.
    to turn off my radiators after a certain time I use the timeout function. Can I change this time to 3 hours in the UI?
    as first I tried it with the timer, but it is with seconds cumbersome.

    Thanks

    1. But… if you’re going it in the UI, surely you can collect in hours and minutes and send the result of the simple calculation (in a function) to BigTimer. You can do any maths you want inside a function node.

      1. Wow realy fast answer . .
        Maybe you have a example? if I had one I could already adjust it. I do not know this programming language yet
        BR

        1. Hi there – sorry – as stated many times – don’t teach programming 🙂 – Javascript is easy… incoming object items of relevance to a function are generally msg.payload… work on that and output the same… Go to the Node-Red site, look at examples. Go to Google groups Node-Red site – ask Node-Red specific programming examples.

  319. Peter, thanks for an awesome node. I’ve been ‘playing’ with Node-Red & Mosquitto on a RPi with some Sonoff switches for a few weeks. Your Big Timer is exactly what I needed to get a couple of standard lamps to come on at sunset – previously they were on mechanical time switches and I found myself adjusting the on/off times every week at this time of year, where the sunset time is changing most rapidly. Now I can sit back and relax whilst Big Timer takes care of the adjustments automatically! Your work is most appreciated, so thank you for sharing this with the world.

    1. And thank you for your kind comments Steve – I created BigTimer precisely to do what the mechanical timers could not – I got so sick of adjusting outside lighting all year because the timer could not handle sunset – and it has grown from there – and no doubt will continue to grow in the future as long as folk remain interested (or I need something new).

  320. Peter ignore me a bit of googling would have saved me. I updated the timezone in the hosted env 🙁

    Thanks for an awesome tool

      1. In your computer or server – Bigtimer does not concern itself with timezones – only longitude and latitude for dusk and dawn etc.

  321. Peter,

    BigTimer is awesome thanks

    Just started using node red in a hosted environment where I don’t control the clock (USA EAST) while I am Australian East coast. The UTC Offset solves the problem mostly (thanks for that) although a first world problem is that I need to be aware of Daylight saving and changing the offset. An ideal solution (although I am not asking for it would be to change/add the UTC offset to a TimeZone field). I appreciate this is significant work for little return but an ability to pass UTC Offset into BigTimer would be awesome

    Thanks again

  322. Hello Peter!

    First of all THANK YOU on a great great plugin for node red!!!

    I have one question about using “stop” function.
    I have made a UI button with “stop” function and it stops the timer, but every time when I deploy the flow after some changes the timer starts again. Is there any way to make it really suspended with UI button like with suspend thick box in options?

    Thank you!

    1. Ivan I’m sure you could come up with something using the UI to do that. The node itself will obviously reset when changes are made to it – that’s the way Node-Red works.

          1. Yes, that is a problem. Because if I send stop to timer than after reboot the timer is again active, but when I thick susspend box in options the timer is still susspended after reboot and that is ok, but then I need to susspend it from node-red.

            1. That is the intended behaviour – that whatever settings you put in the setup – is there until you change it.

              If there is demand – I’ll put an override in it….

                1. Can I second that.
                  Ability to suspend via a message would be really useful for me. But would also need a matching unsuspend. Running an irrigation system and whilst the off for number of minutes works, for some reason timing values not that reliable on my system. Just a bit suspend and unsuspend would be really useful.

  323. Hi Peter,

    first of all thanks a lot for this awesome tool. It saves me a lot of time.

    I have a question regarding the inputs. Is there a chance to define the weekdays via an input? I have them already in a database and want to use them.

    Thanks in advance

    Best reagrds

    Peer

    1. Give me an example of use as I can’t think of a reason to use weekdays in the input – as they can be set in the normal setup…

      1. I wrote a small web app where I can put in the on and off times for my house lights depending on sunset/sunrise. These times are stored into a database incl. the weekdays when the lights should turn on/off.

        Node Red is running as a backend service so I want to be able to make changes for the weekdays only in the web app and not in the node.

        So I thought it would be of interest also for other users to use the weekdays as a input.

        Best regards

        Peer

  324. Hi Peter,

    I have been using BT in node red for a irrigation timer that I am building. As I want to use the node red dashboard to input start times i have created a flow that takes a dashboard input for 2 different start times and duration’s for each different station. The flow calls the start time and then it goes through to check if the station is enabled and if so it delivers BT the duration as “timer X”. Once the first station has finished it checks the next and starts the next BT and so on and so forth. My only issue is if I want to stop the timers after I have triggered them. I use the “off” from output 3 to start the next timer in the sequence. That works until I issue the stop command to the input. The BT that gets the stop command shuts its output but the timer continues to run and eventually sends the off command after the preset time. This then triggers the next station and it all starts again. Any ides on how I can get around this?

  325. Hi Peter. I have my first BT working many thanks for that. How do we know that we have the latest version installed?

    Also i have been trying to get the TASMOTA nodes installed into Node-Red but have failed at every attempt. Are you able to point me in the right direction.

    I been using NPM i think it was and bricked my pi image so have started over again, much easier to install the second time, though a little knowledge can be dangerous. I could not find any node of that name when searching inside of NodeRed

    I have a sonoff flashed with TASMOTA , i can see the devices webserver and can control it and configure it, but cant get it to work inside Node-red so i am assuming i have to load some TASMOTA nodes in to build up me Flow. Two days of trying and advanced nowhere so far.

    1. The repository always has the latest version – and if I make changes I always mention it here. but you can just do the install in your .node-red folder as normal – and it will overwrite previous versions – there is also an npn outdated command…
      Tasmota nodes – nope – never used them – but then – why would you? That software communicates via mqtt – just use an mqtt node?

      Oh I see you were just assuming – no – you presumably know how to send and receive mqtt commands or you would not be using Tasmota – so just use the mqtt nodes to send and receive. As for actual details – I suggest the Tasmoto site for that – I use my own software most of the time but I have a few using Tasmota.

      1. Peter i have searched youetube on how to install into the node-red folder but have been unable to.

        i am using Andreas Spiess Pizero image and his code that i flashed on to a sonoff and it works, but the manual push button does not as there appears to be not code in the files for that.

        When i saw a video on Tasomta i thought it would be great to use. It took me two days to get it to work on a sonoff, user error.

        I configured it to use the same topic etc as the sonoff that was working but for the life of me could not get it to work.

        I am now just trying to find something that you can flash the software over the air.

        I have tried Andreas Spiess IOTappstory but have failed there also.

        The problem i am find is that in all the videos simple steps are past over, as they except you to know what they are wanting you to do.

        So to just get a Pi zero to work i am in the process of doing a simple blog post, mainly to remind myself what i have done but it may help others

        So back to my question.

        i have foumd what i think is the TASMOTO nodes that need to be added as i think they are different from the standard one

        https://github.com/steffenmllr/node-red-contrib-sonoff-tasmota/blob/master/Readme.md

        and i have been trying to install them into NodeRED, but have not found how to do it.

        If i wanted to install BT (which is already installed by the image that i used) how would i do it if it does not appear in the NodeRed manage palette drop down.

        Sorry if this is a basic question but its driving me mad

        Am i going down the wrong path?

        Andy

        1. Hi Andy

          Well, I can’t help you with Andreas image – you’ll have to ask him – I don’t know why you don’t use “the script” to install everything…

          I’ve never used a Tasmota node – and as I said earlier – I’ve no idea why you’d want to – the point being that Tasmota sends simple MQTT message back and forth – and you have (or should have) MQTT installed in your Node-Red.

          1. Only because you show it in a VM and i have no idea how to do it with a pi. Andreas just had a large image you could down load and flash on to a SD put it in your pi and it works, within 20mins you have a pi up and running with nodered and mqtt.

            Being a none techie it all just very confusing, yes i am willing to learn but when you do not understand stuff and you keep having to leave say your YT to find another YT to explain what you don’t understand it just very messy and confusing.

            1. Hi

              It really is simple – get a pi, get their image (not the noobs version) – run the script on it – as detailed in the blog – reboot – you’re done… it is all there if you take a look. You need an SD card reader and on my Windows PC I use SDFORMATTER and WIN32DISKIMAGER to copy the Raspbian image – Actually, Raspbian already has Node-Red on it if you want to do it the REALLY easy way but the stuff I put in the script provides a much better total environment – it’s a case of pressing a few buttons and going out for lunch while it does the work. As I say for Andreas’s image – talk to Andreas.

  326. Hi Peter,

    May you please help me workout what I am doing wrong?

    I want to use your timer with the “timer Xseconds” input.

    I have a flow setup that triggers the right text for the input but I can’t get anything on any of the 3 outputs using a debug output..

    I have got the suspend schedule ticked as I don’t want the schedule to trigger anything. Any thoughts? I have the text message for on and off set and the MQTT topic and payloads set.

    1. No idea what I was doing wrong.. But it works now., I have put an inject in the switch it off at startup and the use the timer X feature to switch on and off after that 🙂

  327. Awesome, working like a charm 🙂

    Are you thinking in add some dashboard inputs? It would be nice if the user can set ON time/OFF time and the other specs by inserting the parameters in a interactive way.
    Im trying to build a irrigation scheduler, to turn on and off some zones, but every time i want to change the times i need to edit de BigTimer node by hand.

    Cheers and keep the good work Mr. Peter Scargill 🙂

    1. On and off times can be over-ridden by injecting text into the input – therefore using tools such as Node-Red-Dashboard you could add any level of interactivity you wanted….

      1. Can you give some example?
        Like: i want to turn on my sprinklers everyday from 22:00 to 22:15, my problem is, how to set this time without editing directly the BigTimer node.

        Best regards.

        1. Hi again Mr. Pete,

          I solved the on/off override by using the dropdown from dashboard, but now im facing another problem:

          For example:
          On Time: 22:30 | Off Time: 22:45

          on_override 10:30 | off_override: 10:45

          The override works well, but when the off_override finish, it will be back on at 22:30, and i dont want that happen, i wish to set the time to On at 10:30 every day and off at 10:45.

          Best

            1. Thanks for the fast reply Mr. Peter.

              Well, im confused now. I read the last paragraph, and i already understand how overrite on and off. But i dont understand how make it permanent.

              When manual overrite time it’s over, theBigTimer return back to is default On/Off specs, because its not possible to put them no “none” for example. Im not understanding if its possible to ignore forever the default specs, and if it is how?

              In this scheduler inspired by yours: node-red-contrib-schedex,

              It’s possible to set the on_time and off_time manualy because its possible to remove the predifined specs.

              Sorry for so many questions

              1. It isn’t permanent and I think I made that clear. To make such overrides permanent you need to store the results somewhere in a database complete with unique ID for each instance of the timer – and that’s another level. As the source is included with the project of course – anyone is welcome to make a custom version for themselves and hopefully share that back.

                1. There is of course a relatively simple way which you can do yourself. use an inject mode set to run only at startup – there’s a tickbox for that. Get the information for a specific timer and inject that data to the timer – so effectively that info becomes permanent – you can of course get the info from any database or file store of your choice. If you have multiple timers then of course you can set that function to have several outputs – or simply feed the injection node to several functions, each feeding a specific timer.

                  Simples.

  328. Hi Pete,

    Thanks so much for not only Bigtimer, but also your blog & other contributions to the HA community!

    I’m a total n00b at node red/js, and your blog has been incredibly helpful so far 🙂

    Got two small Bigtimer questions for you –

    1) I noticed that you implemented “solarNoon” (visible in second output node messages), but haven’t exposed it as a time that can be used (as opposed to Dawn, Dusk, etc). It would be really great if this could be included in the time dropdowns! Any particular reason it’s not there yet?

    2) I’m trying to implement a “latest of two times / not before” logic — ie “on at dawn + 1 hr, or 07:00, whichever is latest”. I’ve come up with a number of nodered rube-goldberg contraptions, but nothing which feels particularly elegant. Do you have any hints on a good way to do this – or would you be interested in implementing that directly in Big Timer?

    Thanks again!!

    1. Thanks for the kind words. Well, it turns out I DID implement Solar Noon but simply left it off the menu. Accordingly, by the time you read this, version 1.7.7 of Bigtimer will be available with this feature included.

      As for latest of two times, I’m sure if you feed the output of two Bigtimers into a function you can some up with some mechanism…. I’ll leave you to ponder that one.

      Regards

      Pete.

  329. Hi Pete,
    many thanks for contributing this very useful timer node! Much appreciated.

    I might have a little suggestion for a minor but in my opinion useful improvement.
    As far as I understand it, we can currently set the ON message to be repeated automatically. However I have a couple of use-cases where this behavior would also be very advantageous for the OFF message.
    So my suggestion would be to have an independent checkbox for the repetition of the ON and OFF message.
    Could be something for a future version.
    Cheers Frank

    1. Ups, I just realized that ON and OFF msgs are actually repeated. A mistake in my ESP code.
      Sorry for that, I obviously should use the debug node a bit more.
      However,an independent control option might still be a useful add-on.

    1. Actually, just as I was saying that I realised I could simply move the override block to above the special settings. See the definition of manual override here in this blog entry – you can indeed specify dusk and dawn as special numbers – but you’ll need to do another update – 1.7.5 – same again – stop and start Node-Red after you update ( or stop – update – start as you prefer).

      Have fun.

  330. Thanks Peter – I’m testing it now and it appears to be accepting my on_override & off_override, but the calculation and On/Off time does not seem quite right. See attached pic, I sent it an “on_override 09:30” and “off_override 10:30” and it says it will be OFF for 57 minutes (server time was 09:33).

    1. That’s what I get for rushing – next release available in an hour max… I’d replicated the new on_override settings and missed one of variable settings for off. Should be fine now.

  331. I really appreciate the hard work put into this very effective node.

    I’m trying to set the “On Time” and “Off Time” from a dashboard, but can’t seem to get the on_override and off_override to change the On/Off Times. I’ve gotten the On, Off and Auto to work fine.

    Can you give me an example of the string that should be used to set the On Time for say 02:45 and Off Time for 10:30?

    1. Ok, updated – probably will appear in the next hour – 1.7.3

      So now if you use the on_override you should see the effects of your changes immediately – and the little DOT under the node should turn into a RING. You can also use a colon in the time..

      For example:

      on_override 17:45

      use on_override on it’s own or with -1 to go back to default settings… (similarly off_override)

      Enjoy.

  332. Thank you very much for creating this timer! It is extremely useful and should be a default node installed with node red.

    Working with the timer, I noticed that the override “off” with 0 or 1 have to be a string and not be a numeric number for it to set the override correctly. For example;

    Regardless of what the current auto state is of the timer:
    I can send an on override numeric or string of “1” and it will turn ON. If I send a numeric of “0”, it will NOT turn off.

    The only way for it to override off is it a STRING of “0” then it will override to off.

    I didn’t figure this out for at least a couple of hours. So hopefully this will help someone else out. Or if you can correct it for the next update please let me know. Or if you can change this description:

    “The input can be used as an override by simply sending a text or numeric message.”

    to read “The input can be used as an override by simply sending a STRING message.”

    that would fix it.

    Thanks

  333. Hi, very enjoyable blog. My goal is to set up bigtimer to control lights with a weekly schedule, say Monday 9am to 5pm, Tuesday, 9 am to 9pm, etc. etc. but it doesn’t appear bigtimer has that functionality.
    So, I started small trying to get it to turn on the lights at 45 minuted before dusk and off at 10pm. I have “On Time” as Dusk, 22:00 as off time. On offset is “-45”. Latitude as 43.878372, Longitude as -79.16159 which is correct. Real dusk is at about 8:30pm, near Toronto, Canada.
    I made the flow at 1:30pm, and it turned on immediately. It says “On for 04hrs, 32mins” which clearly is wrong. The machine time is right and “Man UTC” is 0. In the bottom of the info windoe for bigtimer, all days and months are checked, Repeat Output and Output at Startup is on, basically default settings. Any idea what I’m doing wrong ?

    1. Hi there – short answer – no – because I can only check my own two timezones – UK and Spain. Bear in mind that Node-Red is getting it’s time from your server – i.e. the place Node-Red is running – so that’s the first thing – and BigTimer has one dependency – a Javascript library that gives it the worldwide offsets. Looking forward to your further investigation with a view to seeing whether or not there are any issues with the JS library.

      1. Thank you. Yes, my mistake, it was the timezone on the raspberry pi that was not set right. Any thoughts about how to go about implementing a weekly schedule like for example, say Monday 9am to 5pm, Tuesday, 9 am to 9pm ? Any other nodes that may be better suited ?

  334. Hi,

    I am not sure what I am missing, but the all the times are wrong for sunset, sunrise, etc.

    I have set the Long & Lat. ( -27.4 , 151.9 ).

    start: 536
    end: 1320
    dusk: 551
    dawn: 1128
    solarNoon: 119
    sunrise: 1153
    sunset: 526
    night: 614
    nightEnd: 1065
    now: 1425

    Any Ideas?

        1. We are within 20km of that.
          ‘https://www.google.com.au/maps/place/27°24’00.0″S+151°54’00.0″E’
          Timezone is +10 GMT.
          The timer works great when using the just time, but the extra stuff needing the lat and long just don’t line up right. It looks totally inverted.
          Injecting a timestamp has epoch time as 1501016981699.
          ( GMT: Tuesday, 25 July 2017 21:09:41.699
          Your time zone: Wednesday, 26 July 2017 07:09:41.699 GMT+10:00)
          Running date on the server has it at “Tue Jul 25 21:11:46 UTC 2017”

          1. You might want to try a slightly different set of coordinates and compensate – no-one has come up with this before so I can’t help.

  335. Hi Peter,
    Just getting started in the home automation venture and am using Node Red with eight of your Big Timers. This is working Great! Got the latest BT with the “timer X” command where X is the number of seconds the output will stay ON. This is working fine. What would it take to add the command “timer Y” where Y is the number of minutes the output will stay ON? Saw your previous post about setting the on time & off time the same and adding 0 offset to the start & 3 offset to the off but I don’t want to change the original on/off times or offsets. The new “timer X” command works GREAT, and I think a “timer Y” addition would be useful with the benefit of not requiring the more frequent 1 second checking. Or is there another way to do this? Thanks again for your great contributions & blog.
    John

  336. hi,

    i tried big timer on my RsPi and now again on aws ec2 instance.
    it did not turn on at 17:30 and it stayed off through out.

    how do i know if the big timer is set to indian time after giving the lat long ?

    pfa the image.

    1. longitude and latitude set only the dusk and dawn times – your server time is used for the actual time and date.

      1. should i set the longitude and latitude to zero or leave it blank ?

        i want to set a custom time on and time off.

        i even tried using on_override and off_override it did not work

        the time on debug is correct which is the server time.

        Only timer 10 works i get a on time of 10 seconds.

        1. Set the longitude and latitude to YOUR longitude and latitude as you would find on Google maps command line when looking at your location.

          I tried timer 1, timer 3, timer 10 and timer 30 – all work accurately.

          1. It is quite clear – you HAVE to put in your longitude and latitude. Make sure your server time is set correctly.

            I’m not sure what you are trying to do here so can’t comment on whether it should be right or not. You seem to have offsets of 43 and 48 minutes on the on and off times…. Also you’ve set the on and off times the same.

            Try setting the off timer 30 minutes later and adding a negative offset if that’s what you want.

            1. When I say server – I mean of course the server that Node-Red is running on. Also I set my time to 11am and 11am – added 0 offset to the start, 3 offset to the end and sure enough it came on at 11am and went off 3 minutes later.

  337. First off I want to say I’m new to node-red and I want to say this Big Timer is an awesome feature.

    Is there a way for this timer to work on ODD or EVEN days?

    1. Sure – just select every other day near the bottom though you will clearly get one pair of adjacent days a week.

      1. I’m trying to setup a timer for my lawn irrigation.
        In my town we are supposed to water according to our house numbers.
        If my house number is even then I can water only on even numbered days.
        If our house number is odd then we can water on odd numbered days.
        Just thought this feature could be added in the future.
        thanks
        David

        1. Hmm, let’s think about this – can’t be day of the week because the start and end are both odd. Can’t be day of the month because on months with 31 days the start and end are the same… so it would I assume be day of the year – but then the start and end of the YEAR are odd.

          Care to elaborate? 🙂

          1. Not sure if your understanding
            I’m an even numbered house
            So I can water the 2,4,6, etc
            Day of each month. I do know that the odd numbered houses may get extra water days certain months of the year but I can only water on the even numbered days.

            1. Hi there David – yes I understood – I was just looking for clarification as to what constituted an “even” day. That you have provided and if you wait an hour or so for it to filter through, you will find version 1.6.8 contains two checkboxes to BAN output on odd and/or even days.

              Hopefully that will do the trick.

              1. Thanks you very very much.
                This is perfect.
                Yeah in our town this is the regulations we have so we can
                reduce water waste and allow everyone proper pressures on
                our streets.
                Thanks again.

              2. I just updated to 1.6.8 and cannot find the BAN ODD/EVEN checkboxes. They are not in the UI and not in info!
                Btw during my search I found this interesting feature: You can put info on the output pins of a node. By clicking on the output pin it changes to orange and the information field shows accordingly. I however cannot find any node with this specific information.

                1. Hi there

                  So two things:

                  Firstly the checkboxes ARE in 1.6.8 – near the end. I’ve just updated an old installation to test that.

                  cd .node-red
                  npm install node-red-contrib-bigtimer
                  node-red-stop
                  node-red-start

                  Secondly you need look no further than node-red-contrib-bigtimer for the information on both the input and output pins. The instant this facility was made available I updated bigtimer.

                  1. I did not stopped and started node-red.I have the latest version of bigtimer. I will look later to it.

  338. Peter,

    I’m a beginner when it comes to using Node-Red. Is there a way to search or approach your posts archive that provides a logical training path for someone starting out on Node-Red ?

    1. Hi Roy – the short answer to that is no. The Node-Red site has good info however… I learned by “playing”. In the .node-red directory you’ll find flows*.json files – back those up and if you screw up – stop node-red – overwrite – start and you’re back in action – so don’t be afraid to experiment.

  339. Just to let you know npm update is not updating past version 1.6.2 for me. It shows the latest version as 1.6.7 which I can obtain by doing an install but npm outdated consistently shows the wanted version as 1.6.2. I’m on npm 3.10.10 and latest version of node-red. I’m not sure if its dependencies in the package.json but everything else updates ok.

    1. I just took a NEO2 which I’d installed just after an aborted update for the timer – so I had to update it..

      I stopped Node-Red and went into my .node-red directory (important) and did (as user PI)…

      npm install node-red-contrib-bigtimer

      I restarted Node-Red and there was the brand new version.

      I ran “npn outdated” and as I expected – nothing showed up – indicating that my installation is fully up to date.

      I hope this is helpful.

      1. just in case, this is the script i run to update EVERYTHING…
        https://gist.github.com/fragolinux/412aa50683eb32bb879a120c73110938

        it updates the packages from apt, then cleans all the caches and removes the unused packages (using deborphan for a more accurate and complete removal), then it cleans the npm caches, updates node-red and at last it updates every installed npm in ~/.node-red and rebuilds the packages… all unattended, just download, save as update.sh and run as user pi with “bash update.sh”

        1. Many thanks for this little script. Simple but effective! However it is not completely unattended. There was one question to be answered. If a log is running along this script I could tell you what it was exactly. Then there still is this thing about wanted/latest versions of node modules, they have not been updated! Big-timer is still 1.6.2. I suppose this must be updated by specifying the version when using the update command. Any idea how to avoid this behavior?

          1. i removed the output suppression switches, so if you rerun now this version, you should see where it halts asking for something… and i added the npm outdated command at the end so you can see if some node is still old… let me know which one, in case you can just use “npm install” with the node name to force reinstall of latest version…

            https://pastebin.com/txE6sYyC

            1. It is not so simple! Second time the script runned unattended. I was not sitting in front of the terminal all the time, but in the beginning I have seen some errors of deprecated packages(i probably don’t use them).
              This I found in my pi directory, most probably from the first run(because of time stamp). It is in the file npm-debug.log
              https://pastebin.com/x0JPFFZH
              Second time npm update with root privileges npm did an update of all modules. I have seen this before and I found out I have an issue with my pi account. I think I do not have root rights. As I am a non linux user it is quite a study to find out why this is. I cannot remotely access my pi3 with WINSCP and that is is not a good sign and very inconvenient.

              1. nothing in that script about root rights… all npm packages are to be installed as user PI in ~/.node-red folder , the only exception is node-red and it has a dedicated line with sudo…

          2. Hi Leo

            What was the question – there should be no questions except at the start and end of the script.

            Latest versions- I’ve given up on the outdated function – it seems to depend on a file in the Node-Red folder which I’ve never gotten to grips with.

            If you move to your .node-red folder and apt-get install node-red-contrib-bigtimer you will get the latest version available… currently 1.6.7 https://flows.nodered.org/node/node-red-contrib-bigtimer

            1. If you look at the node-red documentation it says the nodes will be updated to the latest version. They don’t, at least it does this is on my system (I have an issue with permissions).
              Cannot connect to it with FTP.
              npm outdated is also strange, it tells me one-time I need to update by presenting a list where the are a number of nodes not to the latest version, next time there comes no list at all. However there has not been any update in the mean time.

            2. no, he’s talking about my full update script, not yours 🙂
              i think the only question it can make is for password for sudo, if his user is not in sudoers file… other than that, all the remaing are just standard commands everybody does when updating, 1 by 1…

              1. I investigated in this… Systemd doesn’t start the script in /etc/init.d correctly.

                Solution:
                sudo nano /etc/systemd/system/mosquitto
                Insert following:
                ——————————————————
                [Unit]
                Description=Mosquitto MQTT Broker daemon
                ConditionPathExists=/etc/mosquitto/mosquitto.conf
                After=network.target
                Requires=network.target

                [Service]
                Type=forking
                RemainAfterExit=no
                StartLimitInterval=0
                PIDFile=/var/run/mosquitto.pid
                ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf -d
                ExecReload=/bin/kill -HUP $MAINPID
                Restart=on-failure
                RestartSec=2

                [Install]
                WantedBy=multi-user.target
                ——————————————————

                To enable the script in systemd:
                sudo systemctl enable mosquitto

                After a reboot you can check with:
                sudo service mosquitto status

                1. That is working now! Many many thanks for this. I already noticed in webmin that this service was not srted at bootup, now with this addition the status has changed and confirms mosquitto starts at bootup. One down but still a few to go for a solid home automation server fully unattended at any circumstance.
                  Should Peter do some work in his script?

                2. updated script sent to Peter right now… if mosquitto is installed, in that if i added this, too

                  if [[ $OPSYS == *”RASPBIAN”* ]]; then
                  echo -e “[Unit]\n\
                  Description=Mosquitto MQTT Broker daemon\n\
                  ConditionPathExists=/etc/mosquitto/mosquitto.conf\n\
                  After=network.target\n\
                  Requires=network.target\n\
                  \n\
                  [Service]\n\
                  Type=forking\n\
                  RemainAfterExit=no\n\
                  StartLimitInterval=0\n\
                  PIDFile=/var/run/mosquitto.pid\n\
                  ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf -d\n\
                  ExecReload=/bin/kill -HUP $MAINPID\n\
                  Restart=on-failure\n\
                  RestartSec=2\n\
                  \n\
                  [Install]\n\
                  WantedBy=multi-user.target\n” | sudo tee /lib/systemd/system/mosquitto
                  sudo systemctl start mosquitto 2>&1 | tee -a $LOGFILE
                  sudo systemctl enable mosquitto 2>&1 | tee -a $LOGFILE
                  fi

      2. That is what I ended up doing but when I ran outdated before that it refused to upgrade beyond 1.6.2 just kept saying current 1.6,2, wanted 1.6.2, latest 1.6.7 and then update would ignore it. The documentation says that it may be something in the package.json but I don’t have one in that directory and all other modules upgrade OK. As you say no big thing its just a matter of doing an install and not relying on update

  340. Please note all – updated to Node-Red Timer – I’ve updated to work with latest Node-Red and also added a new seconds timer which I think you’ll like…

    So inject “timer 10” and the output will switch to manual ON for 10 seconds – then revert back to auto after 10 secs – rather handy for watering systems…

  341. Apologies if this is made explicit elsewhere but I looked and couldn’t find it. I was injecting a zero into the timer to turn status to off and it was being ignored. The problem I eventually discovered was that it has to be formatted as a string from the inject node. I only discovered it when I tried a 1 and found that as a number it threw a TypeError but zero must be parsed as a space and therefore does not trigger any error message. Not sure if this can/needs to be addressed in the timer or perhaps a note in the instructions.

    1. Thanks Pete, that’s pretty much what I did, though my function is a lot less elegant (I’m a hardware man).

      if(msg.payload === “toggle”)
      {
      msg.payload = global.get(“lastHallState”);
      if(msg.payload === false)
      {
      global.set(“lastHallState”, true);
      }
      else
      {
      global.set(“lastHallState”, false);
      }
      }
      if(global.get(“lastHallState”)=== true)
      {
      msg.payload = “off”
      }
      else
      {
      msg.payload = “on”
      }
      return msg;

      I realise that the method takes two looks at the global variable and that’s probably unnecessary, but it seems to work.

      I’m still confused about the Sync input on BigTimer – what exactly does it do? I will probably never need it, but stranger things have happened.

  342. if (msg.payload!=”toggle”) return msg;
    if (context.get(“toggler”)===0)
    { context.set(“toggler”,1); msg.payload=”on”; }
    else
    { context.set(“toggler”,0); msg.payload=”off”; }
    return msg;

    1. Thanks for the function.

      Unfortunately, this is unaware of the current auto-state of the timer, since it only caches the state of the manual toggel trigger. It would be much better if I could just send “toggel” to the timer…

  343. BigTimer – Sync?

    Hi Pete

    I need to implement a ‘toggle’ function, reversing the current state of a Sonoff that is ultimately under the control of BigTimer.

    Currently, I can add an inject node (with the message of “toggle”) on the input of the MQTT Output node and handle it within the code of the Sonoff, but it would be much cleaner if I could toggle the current state of BigTimer – is this what the ‘sync’ input command is about, I couldn’t find out much about ‘sync’.

    Obviously, the inject node is just for testing purposes and would be replaced by something coming in from the real world as an MQTT post from the Sonoff – the idea being to use a Sonoff Touch.

    1. Simple put your own function before the input….
      If you say, for the sake of argument “toggle” – use a variable to toggle between sending “on” or “off” – anything else you just pass through – simples.

  344. intput 2: outputs a 1 or 0 every minute when checking (in msg.payload) – you can use that to light up something.

    I can change this value. i need to change 10 sec for information

  345. hi. Im having some issues getting the override to work properly. I’m using your node so that ‘on’ will trigger an event during the day, and ‘off’ will reset the values at midnight so the event can happen again next day. Also I’m using a dashboard where you can manually set the time for the event. However the node wont always set the time I input. It seems it depends upon whether the node is on/off and whether the time of day inserted had already passed, but I can’t really understand it.

    1. So firstly – which version are you using – this is important as I updated the node just a couple of days ago.

    2. When you say “set the time you input” – are you manually inserting time, are you setting it up on the dialog box, what time, under what circumstances… if you give me an exact example of it not doing what you expect- and tell me what you are seeing as against what you expect, then I can replicate your setup to discover if there is an issue.

  346. I have a five function node that send a message (SMS and e-post) to me if a temperature is going high or low. My question is if it’s possible to send the message to difrent e-post an SMS depenig of what mounth it is. Have tryed the Big-Timmer with no luck. Maybe have to do this in the function node.

    Please any solution will be great

    /Stefan

    1. It’s “bigtimer” (node-red-contrib-bigtimer). I don’t see what would be hard about doing the whole thing in a simple function node. I’ve never sent an SMS – as most of the free Gateways are in America where most of us are not. I use emails – and triggering an email based on month is easy.

      So for example in the function node you might put..

      var now=new Date();
      var fred=now.getMonth();
      alert(fred);

      That should give you the current month – and the rest is easy. BUT BEWARE, if the month is MAY – this will return 4 – because months come back 0-11 for reasons that escape me.

      So – you have your input (msg.payload) and you have your month…..

  347. Hi, thank you for awesome timer! I use 1.5.7 version. I have got three bigtimers so I can cover whole week with different settings for various days. Outputs are connected together and I’m receiving sequence of “on” and “off” instead of one message. How can I set the timers which are not “on” to not override with “off” message – to sent empty messages please? Thank you!

    1. Well, I went off and did some tests – and sure enough – on a day when the timer is not active – it keeps sending OFF signals… well, rather, it did.

      Now, after all that, I’ve a little problem that right now it has DISAPPEARED from the node-red flows site – I’ve asked the question – however it is here..

      https://www.npmjs.com/package/node-red-contrib-bigtimer

      Keep an eye out for version 6 appearing where it should be, soon. This should meet your needs – please (and anyone reading this) do test and let me know.

      1. Problem solved, new version working fine! Thank you very much for express update! much appreciate.

  348. Pete,
    I love your BigTimer. I’m using in a node-red controlled hydroponics lab to control various things like fans, pumps, etc. It works great but I can’t seem to figure out how to make a timer come on for 5 minutes (or whatever) then off for 55 minutes and repeat this forever. Is there a way.
    Bruster

    1. Easy Bruce – don’t use BigTimer for that. Set an INJECT node to send something every HOUR – and use my TIMEOUT node on the output of that.

  349. Hi Pete,

    I was getting an error with Big Timer on a couple of overrides because they were coming in as integer 0 and 1 rather than string “0” and “1” and this upsets the toLowerCase function.

    To deal with this for all current and future happenings, I changed line 354 in Big Timer by adding .tostring():

    var theSwitch = inmsg.payload.toString().toLowerCase().split(” “);

    This stops integer inputs throwing an error.

    1. Um, OK, that ‘fix’ borks on zeros! Plan B – force payload to be a string by adding the following line above the start of the override processing section – note, that’s two single quotes and not a double quote:

      // manual override
      inmsg.payload = inmsg.payload+”; // Force payload to be a string
      if (inmsg.payload > “”) {
      var theSwitch = inmsg.payload.toLowerCase().split(” “);

      1. All good except for the line number – it is 346 on mine – you sure you’re using the latest version?? V4.6.1 ??

          1. Good morning Linker3000

            Sorry – yes that is correct… which makes it all the more odd that (although I know what you are getting at) you changed line 357 when the actual line is 346 on my original.

            I have never come across this problem before – however your modification makes perfect sense.

            Incorporating….

            Thanks

            Pete.

  350. Sorry that wasn’t clear. I want to switch on at 6:00 and switch off at sunrise.
    The point is that for a part of the year the sunrise is after 6:00 and for the other part it is before.
    I only want to switch on the lights at 6:00, if the sunrise is after 6:00 (otherwise it is light enough). So if the sunrise is before 6:00 the lights shouldn’t switch on at all.
    I hope now it is more clear.

    1. Ah, so 6am and then off at sunrise… well, that’s a new one… let me see if sunrise is before 6am…. they’ll switch off even though they are not on.. and switch on at 6am and hence stay on all day.

      I have implemented a check for the off time being before the on time – meant to handle on at 10pm, off a 2am but I can’t get my head around whether this will solve your problem.

      Only one way to find out – experiment! Do let us know.

      1. Yes, I did some experiments already. But that didn’t use the sunrise statement (that would take so long to test) but used an ON time later than an OFF time. And then I see what you described. I will test the sunrise statement though.
        Could you perhaps make a setting for this? E.g. a checkbox ‘same day’ that will not check the 10 pm – 2am situation you describe?

        1. So I’ve tested it and the good news is, it was as expected. So it switches off at 6AM and switches back on at 6:49 (sunrise).
          I’ve thought of another way to overcome this. If the node sends the on and off time in its msg, I can check with a function block if the on time is after the off time, and then don’t switch to on.
          Hope you can help here.

          1. Rik

            The centre output of the node…. if you look at msg.start and msg.end you’ll find they are the start and stop times in minutes past midnight – with that you should be able to get what you need. To play with this try putting debug nodes (showing the whole object not just the payload) on the outputs and fire, say “ON” commands into the input to trigger output. There is lots of info there for you.

            1. Thank you again. It appears I was using an old version as the one I had didn’t have this info in the centre output. So this will help.

              Thanks for the support and keep on the nice blogs!

  351. Hello Peter
    Thanks for the great plugin and blogs.

    I would like to switch on lights at sunrise or night end, a value that changes. But I want to switch off at a fixed time, so say 7:00AM. Most of the year that works but there will be a moment where the sunrise is after 7:00 so the light will stay on all day.
    Is it possible to do this with your plugin somehow?

    Regards

    1. Hi there Rik

      To clarify – technically BigTimer is a NODE for Node-Red. Can I assume you meant “sunset or night end” ?? I can’t imagine wanting to switch on lights when it gets lighter?? With BigTimer you can switch lights on at a fixed time or at sunset or a couple of variations on that- and back off at a fixed time or sunrise etc… Not sure if that answers the question or if I’m missing the point.

  352. Awesome work Peter! I love it. I’m curious how does the node calculate the sunset and sunrise times in function of the coordinates. Does it pull these times from a specific website or did you make some sort of calculation of your own to calculate these times?

    1. The calculations come from the one dependency that Node-Red has – an imported Javascript function – so the short answer is no, I didn’t do the calcs for that.

  353. Noted your intentions wrt behaviour of on and off in auto mode, and quite understand your intentions EXCEPT when the repeat thingy is enabled. It’s going to try it’s damnedest to assert the scheduled setting no matter someone’s intention to do otherwise. To follow your reasoning, perhaps it should honour the ON or OFF command and keep repeating the new setting until the next change in schedule – if that makes sense. Kind regards.

    1. And I understand your logic Peter – however I am sitting here with a BigTimer for my office light set to come on only in the evening, but having gotten up early I need it on so I can do my emails – the repeat “thingy” is selected, this is a valid day for the timer which otherwise would read “Auto Off”, I am on manual override and the light is not flickering! Are you using an up to date BigTimer? Let me know if you can repeatedly demonstrate a contradiction to this?

  354. if an off override is automatically reset back to regular automated schedule at some point, would I be right to assume that the “Suspend schedule” feature is more strict than this and it remains off / suspended indefinitely..until node red is restarted at least?

    I’m sort of coming from the angle of where it would be quite nice to have the ability to hard override the timer to off for long periods of time.

    1. Correct – suspend will stay that way until Node-Red is restarted. There are also two ways to handle on and off. If you select “manual” then off” – the off (or on) period is determined by the timeout – which you can of course set – but will NOT be reset by change of auto state – so you have the best of both worlds.

      1. On reflection and a little bit of testing, I think the best way for me to get the long term timer off behaviour that I’m after will be to use the “stop” input value. I believe it does what I need – it’s the implementation of a complete and long term persistent switch off of all timer features with absolutely no automatic re-enablement..which can later be switched back with an “auto” or “on” override input value.

  355. A small issue perhaps, what’s the reasoning for allowing BIGTIMER to respond to On and OFF inputs when its in the AUTO state? My experience is that, while BIGTIMER is AUTO and ON, an OFF input will make the output of BIGTIMER go to OFF until the current per-minute timer expires. Seems to me that if it’s in AUTO mode it should simply follow its schedule. What say you?

    1. No. The purpose of on and off is for override. You may for example have the lights scheduled to go off at midnight and wish to override that. The lights will then go off and at midnight or when the timer runs out – whichever is first, the lights will revert to auto. Similarly you may choose to manually put the lights on earlier than schedule.

  356. I’ve been playing with BigTimer, and love it.
    I do have a question, though.
    Is Output 2 payload not tied to the ON/Off state of the other 2 outputs?
    It looks like it can’t be overridden by the manual input.
    From the code, I see it set as follows:
    outmsg2.payload = (autoState==1)? “1” : “0”;
    Am I misunderstanding the purpose of Output 2?

    Thanks,
    Brent

    1. No Brent, you are understanding it absolutely perfectly.

      Let me just say… version 1.5.4 was released moments ago

      🙂

      It also has a few more useful outputs, for good measure.

    1. Stunning- there’s a bug! If you turn off the DAYS, then the special days will not work. How no-one has spotted this up to now – including me… anyway, 1.5.2 will be released later today with this fixed and some minor amendments to descriptions. Well done.

  357. Hi Peter,
    thanks for providing this timer.
    I use v.1.5.1, I cannot seem to figure out what the special dates do.
    My UC is: I want the timer to ping every Friday at noon (works presumeably, as it worked when testing for tuesday). And furthermore I want it to ping on the last day of each month. To achieve that, I tried the special dates, entered day 28, month 2 for today. no action 🙁 am I misunderstanding the concept?

    1. Special dates… well, special days of the year, as it says on the can – day and month so set the day to 25, month to 1 and things will happen on Xmas day

      Special weekdays – day and week – so 1, 2 means the first day of the second week of the month.

    2. A good example might be today. Set the timer for most of the day including now – but untick February – you’ll find the timer says no action today..

      But make the exception – “special weekdays of the month” – day 3, week 4. That’s today…. and lo – the timer operates… OR (set those back to 0) – select the 28th day of the second month – that’s today – and again – the timer operates…

      1. thanks for the quick response ? awesome.
        It is very cool, and I am using the node already for the fridays task.

        Looks like I did not misunderstand the special concept then.
        I attach a screenshot for your reference of my config. It appears to be no action today, even though it is feb 28.
        I tried it also with a second bigtimer node that /only/ has the special dates, but it did not show action either. Is it maybe a bit buggy, or am I still misunderstanding. Thanks for your support.

  358. I’ve been trying to set up two timers in an OR configuration so that when one timer is active, the other big timer is OFF. I set up two timers with a mode switch but it only locks out the second big timer for one cycle. I am using a dropdown menu to select which big timer I want to be active. I have a “switch” function and a “change” function to send the OFF command to the second timer when the first one gets an AUTO command, and vice-versa. Is there a way to lock it out indefinitely?

    I don’t know how to post my node-red flow diagram.

    1. If you look back through the comments, someone asked this a while ago – and I seem to recall making a change so that if there was no output message, nothing was sent – hence you could OR them.

  359. Hi Peter, I realise this is a bit of an edge case, but is there a way to tell the timer to be on permanently? I tried saying 00:00 for both on and off but that didnt quite work as I hoped. Basically I wanted to turn off any timer functionality (temporarily) while still retaining the option to manually turn things on and off through the input. If I turn off the schedule, the timer doesnt pass any messages through it seems.

    1. You’re right – the way I implemented turning the schedule, I do it by simply putting a condition around the outputs – so the calcs are done but nothing goes out. I’d have to think about how to do that – lets see if anyone else comes up with a similar requirement…

    1. Yes you may ask, Joe 🙂

      No I don’t. When you grab BigTimer, you have a copy of the source. For me, putting it on Bitbucket is just another layer of un-necessary work. If I find a fault – or someone else does, I take my local version in Node-Red – which is always the latest…. I fix the problem on my live Node-Red installation – and publish it. All very simple to do.

      1. Fair enough no problem. There would be a couple of potential advantages for comsumers of this if it were on bitbucket/github and a possible advantage for the code in this project too..but yeah I get I can look at and modify the code locally if I want to.

  360. Hi Peter,
    maybe it is something already discussed…. i was looking a way to configure Bigtimer via HMI, otherwise you always need to make changes at configuration level.

    have you already considered this?
    thx
    M

      1. yes, of course,
        however as a UI user you may not have access to configuration page, (unless i miss something…) and difficult to create a different node for each case….

        you can create one timer for each main mode of operation, but assuming you need to change some configuration data, such as sunset offset you need to go back to configuration mode.
        i think that an IoT system should be fully manageable from UI

        M

        1. Hi there. That is not what BigTimer is intended for. It is intended that you will set the times in the configuration page – and either leave it to run automatically or inject manual override commands.

          However as loading the timer also loads the source, you are welcome to make a different version.

          Making a simple ui controlled timers in a Node-Red function would let you do what you want.

    1. You may now set up manual override of on-off times – see the info panel on the latest version of node-red-contrib-bigtimer.

  361. Peter, wonder about using the Bg Timer with my Wemo Light Switch. I’ve tried the Wemo nodes available, but they don’t recognize the switch. I can ping the switch without any problems and the switch does turn on and off as per the app on a cell phone. I’d like to try and get it under control with Node-RED, if possible.

    Big Timer looks to have everything covered as to how I’m looking after the switch now.

    Any suggestions?

    1. Hi – What you are trying to achieve is basically the opposite of what is covered in https://tech.scargill.net/fauxmo-alexa-delights/. Namely where that talks about imitating a wemo switch and then redirecting messages meant for that switch, you need to discover the address of a real switch and then send messages to it. Belkin have deprecated their API but it is still a uPnP device so either of the following should work. If you want to go the native uPnP approach then https://objectpartners.com/2014/03/25/a-groovy-time-with-upnp-and-wemo/ should work alternatively you should be able to adapt the following solution into a node-red “node compatibilty” node.

      1. Thanks Steve, I don’t quite follow the Alexa post. II had previously read thru that and did not see how it applied to the light switch. As for the second link, I could not get the scripts to build, following the instructions on the Github.

        I just felt there might be a way to use the BigTimer to send a signal to an IP address to tell it to turn on and off. As stated, the actual WeMo nodes are not picking up my switch and seem to be used for the other WeMo products.

  362. Hi Peter,

    in combination with your (great!) BigTimer I needed something to determine whether if its business day at that moment, if its holiday, which weekday it is, regarding energy consumption if its lower or higher tariff etc. So I wrote a function and decided to share it so anyone could use it for its own purposes. The code naturally includes our national (Slovenian) holiday sets. Ofcourse modificaitions are needed for use in any other country which has its own set of holidays and energy consumption tariff rules.

    https://gist.github.com/mrizvic/f8c6b1db1bd815d49d76657cf6977e4a

    Im using it in combination with BigTimer to turn on the light in the morning when its time to get up but only if its business day 🙂 I also pass messages to it from energy meter and then calculate energy consumption in kWh for lower and higher tariff. And water heater is turned off in higher tariff at 20:00 so water is not heated during showering time but gets heated when lower tariff kicks in at 22:00.
    I hope anyone else could benefit using this stuff. Im also open for suggestions and improvements!

    The code is under beerware license 🙂

  363. Hi Peter, I do like the node, but I am having a problem with the timeout. I changed the timeout to 2, and manually injected On. Bigtimer actioned the On command, and in NodeRed the message under the node showed “On Temp Override”. All good. After 2 mins, that status message changed to “Off Temp override”, but the node didn’t do anything else – it didn’t go back to auto status, and it didn’t execute the Off msg, nor the Off Text. This was before sunset, i.e during an Off period. I also tried it with a 10 minute timeout that did the same. Am I missing something in how the Timeout is supposed to work?

    1. Good afternoon Ian. I tried the timeout and you’re right – it doesn’t work correctly. Well spotted. Further, the SYNC function doesn’t – but as I neglected to document that, no-one knows about it. I have fixed this and have released version 1.5.0 which will appear sometime this afternoon – with some additional status output available in the first output msg.

      Manual operations will affect the timeout – so now you can use “sync” to quickly get through the timeout for testing. In the first output – if you look at the whole message, you’ll see msg.timeout so you can monitor it.

            1. Greetings Peter,
              I was struggling with the same thing as Ian so thanks. Now, I send the On command and the message under the node shows “On Temp Override”. After 3 mins (my timeout setting), the status message changes to “No action today” which is correct but the node didn’t send the Off msg. I am certain I have to be doing something wrong (or the node is not supposed to send the Off msg). Sorry to be so dense.
              Gregg

              1. The node is not supposed to send an off message because there is no action today. Let’s say you had an automatic setup and the current status was off. Then, if you manually set the node to ON and your timeout settings ran out then you would reasonably expect the node to default back to the off automatic setting and send and OFF signal.

                If there is no action today and you go to manual then you are on your own.

                Does that make sense.

                1. Thanks Pete – I was trying to use that feature for my sprinkler system which would allow me to manually trigger a 45 minute cycle on a zone. I thought the On command along with the timeout would work. I figured I was wrong about how to use that feature – thank you for confirming.

                  I solved the problem by adding a delay node which then fires a function to deliver “auto” to the bigtimer after that delay. Auto seems to trigger the “off” command.

                  Thanks,
                  Gregg

                  1. If you are using my ESP8266 software, you can put a timeout on any command.. See manual for OUT X

                    It is something like (for, for example GPIO15) {out15,6,x} where x is how long you want the item to stay on.

  364. Hi Peter, ive been playing with your bigtimer for my terrarium automation. Quick question. I have some devices that cant stay in manual for more than a minute. So I figured id set the timeout to 1. But this doesnt seem to work. It remains in manual mode. Or at least, the status claims it’s still in manual/off mode.

    Am I misunderstanding the timeout option?

    Thanks!

    1. Hi there Cor.

      So two things – let’s say the timer is OFF all (auto) and you inject (ON) – the manual status will revert to auto on the next change of auto state – OR X minutes later if that X (timeout) is a sensible value. TWO things however, it was meant for longer periods – and 1 does not work at all well. Also the timing is based on real minutes, not a minute after you press the button – so for very short periods like 2 seconds – the actual period is highly variable – that is because I did not want the overhead of a timer checking every second. So consider the timeout valid for longer periods – 5 minutes or so.

      I could fix the “1” issue easily but would have to ponder what effect that might have on the many people using the timer right now.

      1. Hi Peter, I could probably work something out with a delay node or something and force it back into auto mode after 30s. These are things like misters which you dont want to run for very long.

        It’s actually quite complicated to do this stuff well and not kill your terrarium by accident. I have failsafes for every scenario I can think of. Things like a node-red reload during a delay node, and not receiving the off signal.

        Little bit off topic, but I just want to say I love your site. Tons of overlap with stuff im working on so that saves lots of time. Going to be programming a bunch of sonoffs soon.

  365. Hey Pete,

    First off, hats off to you for Big Timer and all the support you’ve provided this community! I scrolled through a bunch of the messages and came up with a whole bunch more use cases for this…

    Curious, is there a way to set a separate Topic Msg for off events? It’s not a show stopper as I think someone above used a function node to do something similar. But thought I’d throw this out to you.

    Thanks!
    Brad

    1. No but there’s a simple way to do it – simply take the payload, ignore the topic – and put any topic and payload into the payload, separated by a comma – then split them apart in a function block. Simples!

  366. I was disappointed to find the big-timer node not available in FRED. So after I made a request to have it added, I got a reply from sensetecnic this afternoon that it has been added. Now time to play!

  367. Sorry for the question, but super new to this. I am trying to accomplish the following:

    Based on SunriseHour > trigger lights to come on at a certain offset to sunrise. Example IF SunriseHour >= 7, at Sunrise+60, turn on X lights.

    Figured I’d accomplish this by:

    Injecting the global SunriseHour at say 4 am each day > to a switch node checking for payload value > into one of several BigTimers that will fire on the specified sunrise offset…..but seems that would be injecting a value of say “7” into BigTimer…which I cannot do, correct?

    Do I need to place another function in between the switch and BigTimer to basically say if the switch output is “7”, return “on”? Please let me know if I’m on the right track.

    1. As each timer can be programmed to know sunrise via the longitude and latitude I’m not sure why you’re not using that.

      1. well….if sunrisehour is 7 vs 5, I want to start my flow an hour prior to sunrise, otherwise if 5, I want it to start promptly at sunrise….the timer only gives me an output of 1 or 0 at the time specific in the timer…I thought?

        1. You can add an offset – that is one of the boxes and so several timers would all work differently – but not dynamically…

    1. As often the case – VASTLY insufficient data to answer the question. what do you mean by “configure. If you can inject into the input – yes, you can fire stuff in from any node – if you mean set the start and stop times – no – you do that in the normal node setup.

  368. For the BigTimer, how do you specify latt/long correctly?

    My home is at 40.1304° N, 75.5149° W. How do I specify N/S or E/W in the properties of the BigTimer? 40.1304° N, 75.5149° W is different from 40.1304° N, 75.5149° E or 40.1304° S, 75.5149° W or 40.1304° S, 75.5149° E.

  369. Hi Peter great work!
    I’d just like to get a sanity check opinion on the use of a couple of timers in a flow that sort of follows your ‘OR’ example. I have a heating system setup with a timer for the morning schedule and another timer for the evening schedule. What I’m doing is merging the output of the timer schedules into a single function which merges the state of both timers into a single output. I then shove this through a delay node to rate limit outbound mqtt messages.

    The innards of the merge function looks like this:

    context.earlystate = context.earlystate || “0”;
    context.latestate = context.latestate || “0”;

    if (msg.topic === ‘EarlySchedule’) {
    context.earlystate = msg.payload;
    }
    else
    if (msg.topic === ‘LateSchedule’) {
    context.latestate = msg.payload;
    }

    var on = (context.earlystate == “1” || context.latestate == “1”);
    return {“topic”: “heatingState”, “payload”: on ? “1” : “0”};

    I’ve attached a screenshot of the flow.

    This seems to work fine but I’d like to ask if you think this is this the right way to go or am I completely mad with this arrangement?

    Cheers
    Joe

    1. Looks great, I’m at a loss as to why so complicated however.. you seem to be checking the input basically for 1 and 0 – and accordingly returning one or 0 – why do you need anything in that function? I’m probably missing uses for that info elsewhere.

      1. Thanks, good question and well, that’s exactly the thing I’m seeking the sanity check on 🙂

        It’s probably not completely clear what’s going here from what I said previously so I’ll try and add a bit of clarity: the chunk of JS in my last post is the innards of the “StateMerge” function node that can be seen in the screenshot and what it’s doing it taking the resulting output messages from both BigTimers and merging them into a single message so that this single message can be used to send a single and consistent ‘one shot’ rate limited ON or OFF mqtt outbound message to control my heating system.

        If I don’t perform this post-timer “StateMerge” operation and attempt to feed the timer messages directly to mqtt (delay rate limited or not), I saw I can then potentially get two mqtt messages in very near proximity to each other when controlling/overriding the timers via the input on,off,auto override words..which I’ll say is completely expected and by-design behaviour of BigTimer.

        The thing here is that during testing, I found this type of setup can start to go wrong especially when controlling the override input messages to the BigTimers (on, off, auto etc) because one of the 2 outbound messages leaving the BigTimers always “wins” and the outcome of that win depends on the state of timers at that point in time (1st timer ON, 2nd OFF or vice versa).

        This unexpected side effect meant that I either saw a heating ON mqtt signal (1) followed by a heating OFF mqtt signal (0) or vice versa and this behaviour was non-deterministic and totally undesirable.

        The problem is completely solved via introduction of the merge and rate limit mechanism so there’s no problem at all really but I really just wanted to check if I was doing things right by handling/merging the output of 2 BigTimers in this way or if I’d missed a trick somewhere.

        Sorry for rambling on, I hope this makes sense

        Cheers
        Joe

  370. Hello Peter,
    First of all, thanks for ytour hard work, that makes our professional lives much easier.
    I was trying to install bigtimer node on my node-red installation. I followed all the different advices that you give in order to install it (under windows 8.1 and node-red v 0.15.2) The thing is that the module´s directory is actually created in /.node-red/node_modules; and when you go to “manage palette ” section you can see it as installed too. But whenever I run node-red I can see this message on the console:

    [bigtimer] SyntaxError: Invalid or unexpected token

    And Bigtimer is then nowhere to be found.
    Can you give me any hint on this issue?

    This happened with other modules like “Biglib”. By the way, I did manage to install scheduler and it worked ok.

    Best regards,

    Javier

    1. There is indeed an illegal token in there and I have NO IDEA right now how that crept in. The “debugging” doesn’t exactly help as there is no more info. Working on it – but don’t expect miracles today – dentist appointment coming up soon. Anyone out there who wants to take a look – it has to be in one of the files bigtimer.js, bigtimer.hrml or package.json in the /home/pi/.node-red/node_modules/node-red-contrib-bigtimer folder…

      Annoying – the one time I wish I was doing versioning.

      1. GIT!

        Not you that is 😉 rather the git source control system, the heart also of GitHub.

        That does versioning for you and lets you do easy rollbacks and so on, integration with GitHub means much easier contributions from other people, issue tracking, documentation, etc. There are GUI clients for Windows and Linux if, like me, you can’t get your head around the arcane commands.

        1. arcane commands are nerd’s food 🙂
          ever seen a SINGLE hacker using a mouse in movies and tv shows? 🙂
          BTW, Peter uses bitbucket for his sources, so i think it should have github equivalent tools…

          p.s.: git was invented by Linus Torvalds, “inventor” of that other cool little thing called Linux 😉

  371. so If I’m wiring the 1st output into a function node where I want to check the value of that first output…what am I telling it to check for?

    msg.state===”on” or “off” OR msg.state===1 or 0 ?

  372. Hi Peter!

    I’ve just started out with node red and big-timer is one of the first modules I’ve installed, I really appreciate your work behind this module.

    I’m trying to build a DIY irrigation controller, normally this is a very straightforward configuration and a direct use case for the bigtimer module where irrigation zones can be started and stopped at specific times. But I have a different set of requirement. I have a mqtt topic to inform about the water pump running status. Here in India irrigation pumps run erratic time schedules due to state electricity supply schedules, maintenance downtimes and breakdowns which is further complicated by water availability issues. We have dry run protection systems for times when the water runs out. Thus the pump only runs when both electric supply and water are available.

    As discussed in your previous posts, setting start times and stop times via an input is not possible for various reasons. So is it possible that a countdown timer functionality be added and the countdown timer be started, paused and resumed from an input? (just like on, off, auto and manual presently available) Thus making it possible to start countdown timers once the pump is up and running and pause them when the pump stops, resume again when the pump runs again and then automatically stop when countdown ends.

    In short i’m looking at running my irrigation zones 1 and 2 for 2 and 4 hours respectively one after the another per day. The pump usually runs a cumulative total of 8 hrs per day split into multiple unpredictable shifts throughout the day.

    The timers also need to reset at
    1. the end of the day (00.00 am) if they are paused/completed/not started at 00.00 am
    or
    2. the first paused or completed event after the end of the day(00.00 am) (because pump can come on at 10 pm and run till 4 am the next morning. we don’t want the timer to reset in between)

    Countdown timers could be a generic requirement also IMO.

    Regards,
    Indrajit.

    1. Hi Indrajit,

      Did bigtimer work for you in indian time zone.
      i am having no success in doing so.

      Good to know you are working on irrigation solution.
      lets connect send ur contact details sunilsudevan@gmail.com

      regards,
      sunil

      1. I’ve not tried using it in the Indian timezone but I’ve used it in Spain and the UK and there are users using it in the USA and elsewhere. A little more info would be nice.

  373. Hi Peter,

    Love your work. This is perfect for what I want to do. My only question is can we send text strings into BigTimer so we can adjust parameters, ie change start times, on days etc? Can we also have a setting to calculate the finish time based on a duration field? so we want to turn the timer on for 45 mins, on mon-wed at 8pm. Idead behind this is to setup drop down menus/buttons etc in a gui.

    Thanks for all your hard work!

    Ryan

    1. Hi – this is an old question – you can turn the unit into manual – and other features with an injected string – but not set the start and stop times as they would not survive power cycling. There is a duration field – I just updated that yesterday as there was a bug.

  374. I am in the UK and running big timer on node red on top of a DiskStation. I have what looks like a time zone problem.

    Basically the only way I can get to send the on/off messages at the correct times is to specify a UTC offset of 3 (three).
    Background: I only started playing with big timer yesterday and started with version V1.4.85. I just updated to V1.4.86 which also seems to have the same issue. The DiskStation kernel time is correct (UTC) and the DiskStation admin screen shows the correct time.
    I have tried deleting and recreate the big timer node after performing the upgrade since I am pretty sure that is required to load the new code.

    Anyway from what I have seen changing the UTC offset does not have the effect I would expect but perhaps I am miss-understanding the function.

    Also as a feature request could we specify the time offset as time zone name i.e. “BST” rather than a number since to cater for automatic daylight savings time.

    The attached image taken around 9:15pm shows the off time set for 11pm, the time left before the trigger (~1h 45m) and the UTC offset being set to 3 (when it should currently be set to 0)

    1. Erm, are you setting the correct longitude and latitude? Because I’m in the UK and not having any issues with timing at all.

      1. Don’t worry about this I did a simple “input->timestamp” to “debug output” and converted the epoch result manually.

        The result was node-red thinks the time is off by three hours.

        I probably should have undertaken a manual installation of node-red instead of using the synology package manager.

        1. Update:
          This must have been a synology problem. It was resolved when I re-enabled automatic NTP updates.

          I have no Idea why that feature was not enabled by default but I noticed the manual setting for the synology time was showing with the three hour offest (even thought it was set for the correct timezone).

          I guess the system control panel time was corrected by my browser correcting for its local timezone.

          Anyway resyncing with NTP fixed the issue.

          Sorry for the confusion.

  375. Hi Peter

    I’ve installed bigtimer on a new nodejs setup. I have one problem with it. seems to be not running properly when you set the off time to a ‘minutes’ value. for example: set start time to 19:00 and stop time to +10 minutes then deploy. you then get on for around 3h and 45 minutes. the system time is 19:00.

    all parameters have been left to their default original values.

    Any advice would be highly appreciated.

    Thanks

    1. Well, it looks like no-one including me actually has used that up to now – I’d never noticed it but I didn’t put the support code in for that. All fixed, give it maybe an hour and grab the updated version – you can just install as normal.

      1. Got the update. Thanks a lot

        What would it take to increase the resolution of the ‘start’ and ‘end time’ from a 15 minutes interval up to one minute? I presume it may be avoiding to load 1440 values into the combo boxes? if that it the case, may I suggest adding 2 text boxes just below he combo boxes. These 2 new text boxes will get their values from the combo boxes once the user makes a selection. The user may then edit the values in the text boxes to adjust the minute resolution.

        I have started to use the timer to automate things in three locations ( 2 town houses and an apartment)

        Many thanks for the hard work and the quick response… & Merry Xmas!

  376. Hi Pete! (or anyone else reading this)

    I’m controlling a device using OpenHAB2. There’s a switch type item that sends a msg to a given topic (0 or 1) to turn it off or on. Now, since I have a couple of devices running using Bigtimer schedules, and if the device is already on, there’s no problem sending ON (1) from OH2, but if I send OFF (0), the device turns off (ESP subscribed to that topic) but it should return to “Bigtimer control” (scheduled). Any idea on how to implement this? TIA

  377. Doh!

    I’ve updated but this time you’ve put some validation on the Name field that breaks things!

    I have names like: “F Hall (03) Jun-Aug On Sunset-1hrs -> 01:00” and I now get a not properly configured error that I can’t get rid of.

      1. Yes, well it all makes sense when you see them all lined up on a page 🙂

        I like to give things descriptive names and since Node-RED doesn’t allow descriptive text in its nodes, the Name field is the only place you can consistently do that.

        Point is that the name doesn’t really need any restrictions on it as it is only used by the Node-RED admin UI and the debug output.

        1. Ok, well I guess I did put it out there for others to benefit – accordingly – NAME no longer has checking – fire away (but give it half an hour to propagate). v1.4.84

  378. Oh dear, the life of an open source programmer is never easy Peter!

    Thanks for the continuing efforts.

    I sense that my next requests for enhancements should maybe wait until after Christmas 🙂

  379. hi Pete, after many months of working flawlessy of your BigTimer to control my garden lights I decide to upgrade it to the latest version…
    as a results the nodes I was using before become not working no matter what I tried 🙁 (wife was upset as all lights in the garden were off in the evening…!)
    I had to remove all of them and recreate all in NodeRed with same settings and they all seems to work now even thou every time I deploy I get an error for all of them “Node is not configured properly” and if I open any the field “topic” is red-highlighted…
    I never used topic and I have no needs of it, so is it normal this behaviour?

    1. It seems one can’t please everyone. Someone had the bright idea of insulting me because I don’t use proper verification on node inputs (probably someone who insists on CE marking).

      So, being a helpful type I added verification – and the red boxes you see are objecting to the lack of input.

      Clearly however this has opened up a can of worms. As you quite rightly say, for SOME requirements, topic may not actually be needed.

      My thinking for insisting on topic, of course, was based on the assumption of MQTT output which requires both topic and payload. So from that perspective, that is indeed “normal behaviour”.

      If you would care to check in about an hour, version 1.4.8 should be available – and you can now leave the topic blank.

      This however has left me with a discovery – that my knowledge of REGEX which was never startling, may be worse than I thought.

      outtopic: {value:””,validate:RED.validators.regex(/[a-zA-Z123_]*/) },

      What you see above should allow zero or more occurrences of any letter, upper or lower case, any number and optional underscores. In fact, I added an exclamation mark and it lets that through as well – hence kind of defeating the idea of having verification. If any bright REGEX spark looking in would care to tell me what is wrong there, I’ll update the next version with a corrected regex. But the short answer is – you have what you need – blank topics!

      1. Make that 1.4.81 – just had a word with the guys from Node-Red and my Regex was nonsense. Now it accepts A-Z, a-z, 0-9, slashes and underscores – or nothing. Give it an hour max to filter through.

  380. For me Bigtimer works great to turn on lights 30 minutes before dusk. However, regardless of configured off time it turns the lights off around 1:15 AM the next morning. I’m located in the eastern US timezone.

    I noticed my Bigtimer configuration dialog doesn’t look anything like the one shown in this post. It looks like the one in the earlier Bigtimer post so I thought I must have an old version. I have updated node.js, node-red and all nodes (v7.2.1, v0.15.2). Bigtimer still looks the same and still turns off ~1:15AM. As I started working on home control years before discovering this excellent blog I’m running on an Intel Atom miniITX board using Ubuntu 14.04. Yes I know you are not an Ubuntu fan but that where I am.

    Can anyone point me in the right direction to get Bigtimer working?

    John

    1. Hi John

      Well, Ununtu I cannot even begin to help with – it’s taken me all my willpower to persevere with Debian as a lifelong Windows user. Let’s see what I’m running here… on my main machine – I ahve node v 4.6.1, npm 2.15.9 and node-red 0.15.2

      On another I have node 7.2.0 and npm 4.0.3 – all work well with Node-Red-Contrib-Bigtimer which is currently running at version 1.4.7

      And as far as I can tell all is working.

      1. Ubuntu IS Debian – with loads of goodies added and repo’s that move a heck of a lot faster than the risk averse folks maintaining Debian like. But the base is Debian pretty much I think – certainly it used to be anyway.

        1. You may SAY that and you probably have more knowledge on the subject than I do – but as someone coming in fresh to Debian – and being familiar with the PI – and using Debian on other devices as you’ll see in the blog – I’ve come across several commands that seem to be standard in Debian that are simply not there for Ubuntu and there is no way my script runs under Ubuntu – one reason I’m sticking with Debian. I think you may find they’ve diverged a little.

        2. no, it WAS debian… they forked it way long time ago… the filesystem organization, the tools, are the same, but they differ a lot in management and many other things… ubuntu forces you to have good “systemistic” behaviour, as NOT do everything as root, but becoming it only when needed, using sudo… but many pure “penguins” thinks this “stinks”, and want full control…

          1. Fair enough. Though I’d say that Rasbian isn’t Debian either 😉

            In my own limited experience I’ve not found that much difference between Debian and Ubuntu Minimal when managing VPS’s for example. Not that I do a lot of that which may explain it. Perhaps I’m just used to Debian now but I don’t find any great problems with secure configurations on it vs Ubuntu.

            Anyway most of the scripts I’ve written work on both. But that certainly wouldn’t be true of a Rasbian script vs a VPS script. Rasbian is designed to be used by students and makers for IoT and not necessarily for anything secure. Of course, it also has to operate in a very constrained environment. So it is stripped down and simplified in many cases.

            Anyway, we are well off-topic now and should probably get off the airwaves.

            1. Agreed… simple is good – for many of us Linux is an inconvenient truth, not a hobby or job – it is merely a means to an end without using Microsoft – so the simpler the better 🙂

    2. Recall you need to be in your .node-red directory – not PI or whatever – and it is npm install node-red-contrib-bigtimer

      That should net you the latest version. Stop Node-Red and restart it

      1. I have installed Bigtimer from my .node-red directory. I have also run “npm update” from within the .node-red directory. It found the mysql node was out of date but nothing else. I deleted all instances of Bigtimer and deleted it from nod-red using the admin node. I reinstalled it using admin. Then I added a new Bigtimer node. It still looks like the old version. The package.json file in the node-red-contrib-bigtimer directory show the version is 1.4.6. I restarted node-red after each change and have rebooted for other reasons as well.

        Meanwhile I have a workaround to turn the lights off.

        Didn’t mean to start a Debian vs Ubuntu vs ??? discussion. I started with Ubuntu before Raspian came to be and have just stuck with it out of habit I guess. I do have a couple Raspberry Pies but none running node-red (yet).

        John

        1. Hi John – leave bigtimer for tonight – conversation going on in SLACK – I added something for someone else -and it’s taking a couple of revisions – all should be great by the morning. Anyway there’s a new feature to come out of it all and possibly a bug-fix.

    1. I’ve not yet tried this version (tonight). However, one small point that would make life a lot easier with any future parameter changes. I’ve noticed that when you add parameters and I update an existing flow, often I get errors because the new parameters are not pre-filled with defaults.

      Thanks again for the work put into this node.

      Regards, Julian

          1. Well, it may be that someone can help me there – I’m no great whizz at programming nodejs etc…. I’m ok at it – but when it was suggested I add in error checking – the payback for that seems to be that defaults don’t work – which is incredibly annoying as you can SEE the defaults – but unless you put something in, it objects. Anyone want to put me right on that I’ll fix that right away (it’s in the HTML)

    2. Hey Pete, I just found Bigtimer and wanted to use it in my node red setup. However, my mqtt topics have “@” and “.” in them. As soon as I put one of those characters in my topic, it goes red. I believe I can work around this with a function node, but if there is any chance of fixing this in the build, that would be fantastic. I see above that you were able to add underscores and digits, so I figured I would ask 🙂 Thanks!

    1. Hi Julian

      I added authentication – something I’ve not used before so it was odds-on I’d get something wrong, somewhere. Sure enough – lower case letters only… fixed in version 1.4.7 to allow upper, lower and numbers as well as underscores – give it half an hour. Also fixed an issue in the name which can now be uppercase, lowercase, numbers, underscores and spaces.

  381. We have been using your Bigtimer for about a month now. After the latest update, the node seems to have an error while calculating the position of the sun based on our longitude and latitude. For example, we have it set to turn on at Dusk and off at 21:00, but it is showing that it will be on for the next 20 hours. Any help would be greatly appreciated.

    Cheers.

  382. Hello Peter,
    Thanks for your bigtimer. However, I’m wondering, why does the timer on an inactive day still produce output when I send an “auto” (or default) to the input. I can imagen it will override the output when you send an “on” or “off”.

    Is this the behaviour as you designed it or can we expect an update for this? So an inactive day won’t produce an output if it receives an auto.

    The problem is that I will use different time schedules on weekday’s and weekend’s. (I will override them for the same input.)

    1. I’m having difficulty understanding the problem. If this is an inactive day and you turn the unit on manually, then turn back to auto – then you would surely expect the unit, having turned on manually, to go back to the auto state which of course would be off as it’s an inactive day… or am I missing something here.

      1. The problem is that I uses two bigtimers parallel. One timer is for the weekday’s and one is for the weekends. Both has the same input and same output (MQTT). Because of the different time schedules it is posable that the light is on till 10pm on weekday’s and till 11pm in weekend’s. Only one is active based on the day of the week. Sometimes you wish to override the timer. So I send an “on” or “off” which is great. However if you wish to continue the timer schedule function I send an “auto”. The active timer needs to respond. I found that the inactive timer also respond to that event.
        If that is between 10 and 11pm, one timer send a “poweron” and the other a “poweroff”. I any case the light will flash. I didn’t expect that an inactive timer for a day send an event when it falls back to is original state – which is in this case no activity-.

  383. Hi Peter,

    I’ve need using Bigtimer since the first release, in fact I was even using your original scheduler node before that, and must say bigtimer is the most useful node in my tool box. I do have a request. Is it possible to add a feature that will set the start and stop times based on say msg.starttime and msg.stoptime passed in from the input? This would permit setting start and stop times from a web dash board and saved in a database. They can then be passed to bigtimer either at startup or when the setting on the dash board is changed.

    Thank you for everything.

    Mike

    1. Hi there Mike

      I would love to overwrite the values set in the html – but I’m not even sure that is possible. From things I’ve read, not.

      1. Thank you for the quick reply.

        I’m not very familiar with creating nodes, maybe I should learn in order to help contribute. In any case, how would feeding a start/stop time on the input be different that say feeding a topic to the MQTT node as opposed to putting the topic directly in the node? Sorry for my ignorance, and with that in mind, where can I find more information on creating nodes? I looked at the node-red website a while back and it is not very helpful.

        Thank you,

        Mike

        1. After thinking about this a little more I understand what you mean. With the MQTT node you are not setting the topic but instead simply passing the topic through the node. Where as the big timer node the time has to be set as opposed to passed through the node.

          Correct?

  384. Bug or misconfiguration?

    I’ve got several timers in a flow. Whenever they’re defined over an absolute interval, say, 1pm to 3pm, everything works as expected. However if I define start time to sunrise (or sunset) and end time to a relative duration like 60 minutes, the node seems to _always_ evaluate the condition to be TRUE on deploy and come up with some strange duration to wait before turning off again. A clearer example:

    1) I define a BigTimer to run from sunrise for 60 minutes. Let’s say sunrise is at 5am for the sake of simplicity;
    2) I deploy at 10:30am (you’ll see why I’m so specific later); BigTimer fires TRUE (which is contrary to my expectation that it would only fire if within the interval 5am + 60 minutes);
    3) I see beneath the node in the flow “On for 12hrs, 20mins” or something along those lines.

    However, if I change end time from 60 minutes to, for instance, 10:00am (remember the current clock time is 10:30), then BigTimer figures out that endTime < currentTime and the state is FALSE. So it seems to definitely be linked to the relative time offset "60 minutes." Or have I simply misunderstood how this sort of event is supposed to be defined?

    Version according to package.json is node-red-contrib-bigtimer@1.4.1, which I believe is the latest.

    Otherwise it works great. Cheers for the elbow grease

  385. Funny enough – everyone WE’VE talked to has gone out and bought a DOT. I do hope Amazon stay on the ball and keep improving it – this thing about accepting words outside of a selection you make it pants – and we’ve not found a way when talking to it by Node-Red to do multi-part commands without having to keep saying “Alexa – tell computer”…. but other than that – it is marvelous – right now I’ve just told it to alert me in 30 minutes when my chicken pie is ready… it is quiet clear I’m going to need one in every room 🙂

  386. Hi
    just re-installed “the works” on another sd card using your script, as my old one was in a bit of a state from all the playing (but worked). main reason being after seeing your echo dot, i bought one immedietly, and everyone i have shown it to has done the same. anyway wanted a clear canvas to try and tackle https/ssl (really struggling at moment!). So with clean install i put all the esplogon nodes in place then the very important one, Big timer to switch on my electric blanket!
    i have the on time set to 21:00 and off for 22:30 but It switches on at 22:00. It is now 21:56 and at the bottom of the node it says “off for 00hrs 4mins”.
    It is now 22:00 and it has just switched on, it says on for 01hrs 30mins. An hour wrong.
    if i set the off time to 90mins (on time still 21:00), it says on for 3hrs 10mins….. all gone wierd! have you any ideas, or has anyone else had similar problems?
    my old version is about 5-6 months old and always worked flawlessly.
    i have Lat & long set correctly. offsets at 0.
    also, an unrelated problem on my laptop big timer won’t scroll so i cant get to any of the radio buttons below Jun. i have to use ipad in portrait to get to them
    Many Thanks for all your great work.
    Chris

  387. Hi Pete!

    I’ve been doing home controllers with Raspberry Pi’s and my own electronics for a few years now, writing my own apps in Python, learning as I went along. I recently got interested in Node-Red, but before I got around to trying it, I discovered TheThingBox, which runs on top of Node-Red.

    Your Big Timer is exactly what I need – but I can’t see it in TheThingBox – I did npm install node-red-contrib-bigtimer and it returned:

    node-red-contrib-bigtimer@1.2.96 node_modules/node-red-contrib-bigtimer
    └── suncalc@1.7.0

    But after restarting Node-Red, and after rebooting, I still don’t see it. Would you know if it has a problem with TheThingBox? Should I drop TheThingBox and go to pure Node-Red?

    1. I would say there is likely something very wrong with Tbingbix if it will not let you I stall Big-time or other nodes. I use a normal Mode Red and when I do installs I go to the Node Red directory… in my case /home/pi/.node-red

      Once in there I install nodes. I.e

      npm install node-red-contribute-big-time

      And that works every time on pi and other devices.

      1. Hi, Thanks for the fast reply!

        TheThingBox puts nodes in /root/thethingbox/node_modules. When I found it, I did the import again. BigTimer did not appear for a while, but eventually did. I am running on an old Raspberry Pi 1A, so it is probably slower than using a Pi2 or 3, or even a Pi1B, which has more RAM.

        BigTimer is great – exactly what is needed for all those things that need to happen at dawn and dusk. And it is very flexible. Thanks for it!

  388. Hello Pete,
    Your new version is now working fine (as always!) and is now turning off within the minute.
    Just one input from me regarding the thing with offset of seconds. I think it looks like you are starting the timer on deployment, right? If you would be unlucky, like I was, it was started when 58 sec elapsed. So then I was 58 sec late both for on and off actions. My idea was not that you should check every second, the check should only happen right at startup. Myself, I made a similar implementation once in Python and the principle was that I checked the system time at start, calculating number of seconds to next minute change, then waited and finally fired exactly at the minute.

    Kind regards, Walter

  389. I am learning node red and feel I am missing something about timers and triggers. It seems that most timers only allow me to set the time in 15 minute increments. Is it strictly because the widget would get too long if every minute in the day was listed?

    Secondly, I have noticed this in many node-red nodes, why can’t I pass settings either in the payload or as some other attribute? For instance, I wish I could send in a variable delay time or variable start time to bigtimer.

    1. Possobly because not enough people want this to warrant the extra overhead. Node-Red nodes are simply HTML but more importantly in this case – Javascript – if the nodes are not what you want – go to the Javascript and improve them.

      1. Hi Pete

        Tx for all the great work, have been lurking and playing with your stuff for a while now and am looking at making some additions / changes relating to making settings changes to bigtimer externally aka a user and admin mode like blynk has. Basically a scenario where a regular user can make settings changes (start stop times etc) from a UI and/or app.

        I have had an initial look at this and was thinking of modifying bigtimer to add additional inputs to accomplish this.

        Any thoughts on this approach and/or any other ideas to achieve this from your experience are appreciated.

        1. Hi well you can add additional commands – but nodes can only have one input – there’s been plenty of discussions about that and it’s not about to change – but sure – just add more input commands.

  390. So here is additional logged info

    Date & time is from inside the same rpi where node-red runs on. ‘State’ is what bigtimer delivers on 2nd output (0 or 1). Configured to turn on at 7:30 am and off at 7:45 am

    When State === 0 and then turning ON
    2016-09-12 07:28:11 State: 0
    2016-09-12 07:29:11 State: 0
    2016-09-12 07:30:11 State: 1

    When State === 1 and then turning OFF
    2016-09-12 07:44:12 State: 1
    2016-09-12 07:45:12 State: 1
    2016-09-12 07:46:12 State: 0

    You can see that when turning on, it is within the correct minute but 11 sec late. When turning off, there is a whole minute late plus those seconds.

    So I think you are one minute late when turning off. Also, instead of synchronizing the timer with the clock, could it be that you are starting things on deployment? That could eventually explain those seconds…

    Best regards, Walter

    1. Good morning Walter

      Well, you are right – I was checking >=start or <=end. That is now fixed and within an hour or so you should be an updated version available. As for ultimate accuracy - to keep overheads down the code is checked every minute - hence there will always be some inaccuracy in terms of start and end seconds. The only way around that would be to poll every second and given lots of timers I think the overhead might be a bit much.

  391. Pete, regarding turning on, I think the offset is just the seconds, it seems to be more accurate then turning off

  392. Pete,
    I have configured the Bigtimer to turn off 7:15 PM but it is actually turning off at 7:16:36
    More than a minute late. The same for turning on.

    Could you check if there is something to tune in the code?

    Best regards, Walter

  393. Hi Pete,

    Thanks for BigTimer – much appreciated.

    I installed the node (npm install) with no problems on my Pi2 but when I tried installing it on my test box running Ubuntu 16.04 (32-bit as the processor is an Atom N270), I received a few warnings:

    +– node-red-contrib-bigtimer@1.2.95
    +– suncalc@1.7.0

    npm WARN enoent ENOENT: no such file or directory, open ‘/root/.node-red/package.json’
    npm WARN .node-red No description
    npm WARN .node-red No repository field.
    npm WARN .node-red No README data
    npm WARN .node-red No license field.

    I restarted and checked Node-Red, but BigTimer wasn’t listed. The version number of Node-Red on both systems is the same.

    Long story short, I had to do the following to move suncalc into the right place:

    cd node_modules/node-red-contrib-bigtimer/
    mkdir node_modules
    mv ../suncalc/ node_modules/

    After a restart, BigTimer appeared in Node-Red.

    I have only just started working with Node-Red so maybe I missed out something, but I thought I’d mention it in case my fumblings help others.

  394. Hi Pete,

    I’ve been playing with Big Timer for a few days and was wondering about the source of sunrise/sunset/dawn/dusk/night/night-end information.

    Firstly sunrise/sunset – I entered latitude/longitude of a location nearest to me from the Met Office web site. The times Big Timer switches on and off are close enough for what I need but actually a minute or two different from what the Met Office show on their website – curious.

    Secondly dawn/dusk/night/night-end – to be honest I was intrigued by these options as it had never occurred to me what dawn/dusk actually were (they were just terms I’d heard used) or even the actual definition of night. I’ve since looked it up and things got even more confusing – it seems there are several stages. From sunset we then enter a period of civil twilight ending at civil dusk…then nautical twilight ending at nautical dusk…then astronomical twilight ending at astronomical dusk (start of night). Then, of course, we have the reverse for night-end through to sunrise….

    So if I use dusk/dawn, which ones does Big Timer use (civil, nautical, astronomical)? Also night/night-end get a bit tricky for latitudes above 48 degrees (or thereabouts), e.g., the whole of the UK – around the summer solstice the UK never enters night (technically speaking) as the sun is never more than 18 degrees below the horizon, i.e, we only get astronomical twilight. Consequentially we don’t have astronomical dusk/night or night-end/astronomical dawn. Fun isn’t it? 🙂

    I’ve had Big Timer running on my Pi Zero for a few days and set for a dawn switch off – I happened to be up at 4:45am when it triggered (about 45 minutes before sunrise) and there was a reasonable amount of light despite being overcast but I can’t quite work out which dawn it was (astronomical, nautical, civil).

    Anyway, that was a bit of a ramble. It’s for a home lighting project and there’ll be a luminosity sensor connected to an ESP-12F module in the mix as well but I’m curious to know if you can explain further about the various data for sunset/dusk/night etc.

    Cheers,
    Brian

    1. Hi Brian

      The one thing I cannot explain – is the dusk dawn stuff as that’s a library that I found already in use in a node in Node-Red and grabbed accordingly – I’m not aware of a better library for use with Node-Red – the lights here in Spain seem to come on at a reasonable time – and also when I’m in the UK – of course I have no doubt this could be improved. When I compare the times with those in the various online charts they seem near enough.

      1. Hi Pete,

        Well I did what should’ve seemed blinking obvious in the first place and set up a test Node-RED flow with 3 Big Timers (one for sunset/sunrise on/off, another for dusk/dawn on/off and of course finally one for night/night-end on/off). DOH! Why didn’t I think of that before?

        Results…

        Sunset – 20:58 – two minutes later than Met Office but close enough.
        Sunrise – 05:32 – again, two minutes later than Met Office but close enough.

        Dusk – 21:42 – this was 44 minutes after the sunset timer kicked in and during that period there was enough light to carry on ‘outdoor activities’ without artificial light. I’d conclude (in my observation) that in this case, the Big Timer ‘dusk’ setting corresponds to ‘civil dusk’.
        Dawn – 04:50 – as with my previous post there was a good bit of light and I could have gone outside without artificial lighting so I suspect it is ‘civil dawn’.

        Night – 00:11 – this surprised me from an observational point of view. Two and a half hours after the dusk timer kicked in and, in my observation, it had been quite dark since dusk and that was with only a partially cloudy sky.
        Night End – 02:26 – so only 2hrs 15 mins of what was considered night. This tallies with my previous post where I said latitudes above 48 degrees don’t get night at all around the solstice. It’s 6 weeks or so after the solstice now so that period of ‘night’ makes sense. I’ll override the Pi Zero’s clock to set it to June 21st and see what happens just out of curiosity.

        In conclusion, I’m not sure what use I could find for Night/Night-end (who knows, maybe I’ll come up with something). Dusk/Dawn seem to be good trigger points for outdoor security lighting. Sunset/Sunrise possibly best for indoor lighting.

        Just some observations.

        Cheers,
        Brian

  395. Hi Pete,
    firstly thanks very much for your always insightful, very intersting blog; I eagerly await new ‘episodes’ daily!

    I ‘ve been working with Node-RED for a while now and was excited to learn about your BigTimer node which I’ve finally been able to use but I couldn’t get the dawn and dusk events to fire at the correct times.
    After reading this long series of Qs and As and a bit of verification using the TryIt Editor from w3schools.com, I found the problem. A new Date() object is already in local time so there is no need to calculate the timezone offset and apply it to var now in lines 100 & 114 – which I have commented-out.
    I validated this change by using a debug node on output 2 and dumping the whole msg object where you’ve helpfully inserted the current local time in minutes.
    e.g. at 21:54MST GMT-6 where the timer is set to turn the bookcase lights off at 23:00:

    { “payload”: “1”, “reference”: “:Bookcase Lights On:Bookcase Lights Off:1314”, “topic”: “status”, “state”: “on”, “time”: “01hrs 06mins”, “name”: “Bookcase Lights Timer”, “_msgid”: “d5d50b60.2a2af8” }

    Or my dawn/dusk timer that feeds a function to set a global day/night indicator:

    { “payload”: “0”, “reference”: “:dawn:dusk:1314”, “topic”: “status”, “state”: “off”, “time”: “07hrs 22mins”, “name”: “Dawn And Dusk Events”, “_msgid”: “e39d7c14.1c628” }

    Platform: Pi3, Jesse, timezone set to Americas/Denver (MST/MDT)

    I’d like to hear if this works for those in other timezones and on other OSes like Windows.

    All the best, Simon.

  396. I think the following code could do it:

    case “manual off” :
    case “MANUAL OFF” : if ((temporaryManual==0) && permanentManual==0) manualState=autoState;
    change=1; manualState=0; temporaryManual=0; permanentManual=1; break;

    case “manual on” :
    case “MANUAL ON” : if ((temporaryManual==0) && permanentManual==0) manualState=autoState;
    change=1; manualState=1; temporaryManual=0; permanentManual=1; break;

  397. Hello Peter,
    It’s me again 😉 Hope you are doing fine!
    As you might remember we discussed some topics earlier regarding your nice Big Timer node.
    Looking at your new version, I can see that you are now also supporting additional input words like ‘manual’.
    I do have some questions related again due to the specific use cases I am running in my home automation.
    My flows need to be able to switch the big timer modes from manual off -> auto -> manual off again. This is getting a bit complicated since I cannot send just one message when switching mode.
    If possible, it would be very useful if you also could have support for the full input strings ‘manual on’ and ‘manual off’ (the function should be the same as if you would send those words as two separate messages to the input)

    Myself, not very experienced in javascript, I found a very useful on-line tool for checking the syntax of javascripts. It helped me a lot. If you copy & paste bigtimer.js code and run the tool, you will see some warnings coming up.

    http://www.javascriptlint.com/online_lint.php

    Kind regards, Walter

  398. Hi Peter, I’m usign a lot you node so thank you as it smplifies my setup for home automation!
    I small feature I’d like to have is possibility to send to my GUI (actually a mix of contribu-ui and thml webpage) the message that you have in “node status” (so to know when the timer will go ON, OFF or it’s current status).
    I know already the status but only because I trigger it and same time I sent message to my MQTT but would be nice to show in my dashboard something like “Garned lights will go on in 45minutes” or “Garder water system will turn off in 20 minutes” and so on 🙂

    1. Good evening Giovanni

      In this case that’s so useful that your wish is my command.

      http://flows.nodered.org/node/node-red-contrib-bigtimer

      Update to version 1.2.86. In the object sent out by the centre output every minute, you will now find msg.state and msg.time

      The description explains this. The state – on, off or none and the time in hours and minutes as lifted from the node status,

      You’ll note I’ve also updated this blog if you refresh your browser.

  399. Hi Peter,
    I wondered if you could consider a couple of new features?
    1. If there had been a power cut, or the program was just started It would be useful to stagger devices being turned on because of the load. So a delay xx before the timer starts from Pi start or program start would be good.
    2. A time off and a time on perpetually. E.g. xx minutes on then xx minutes off.

    Both would operate within the normal on off times as already defined.
    This is for my fish tank.
    Thanks.
    Paul.

    1. On 2 – I can do {out0:6,3} which is turn on for 3 minutes then turn off…. I do anything more complex than that in Node-Red – which has proven so reliably on the Pi I’ve not seen a need to put that on the actual ESP – but no reason at all why not.

  400. See updates (end of article) – I’ve just realised that when using ImperiHome to override auto – when that override timed out – there was no way to let ImperiHome know that we’d returned to auto. Sorted.

  401. Hey Pete,

    On the negative timezone issue, can you (anyone) test this. I made this change and it still works for me in GMT -5.

    var nowOff = (now.getTime() – now.getTimezoneOffset()) * 60000;

    Thanks,
    Dan

    1. Might be better if someone who is actually in a negative time zone tries it.. – I’m at a loss as to why it should make any difference.

  402. Ok, BIGTIMER version 1.28 – should now have that auto-manual combo issue eliminated.

    If you are ON in auto – then switching to manual should STAY on. If you are OFF in auto, manual should STAY off.

    If you have set a 1 or 0 manually – then the manual button should respect that – whereas auto will reset to whatever auto was doing before you messed with it.

    Any testing on this version would be appreciated..

    My normal way to install – might be different for others is to go into the .node-red folder and..

    npm install node-red-contrib-bigtimer

    Then restart Node-Red and you’re off.

    Right- I’m out for the day – any feedback welcome.

  403. Hi,

    Thank you very much for all your contributions to the iot community. I must say is have used many of your contributions as is and/or modified.

    My purpose for writing today is either a miss understanding of the use of the input side of bigtimer or a bug. My apologies in advance for the long message, I just hope I can explain it so you understand. I have been using bigtimer for quite sometime now and only this weekend I have started to use the input input portion of the node. I also saw you posted an update today, which I downloaded. My understanding is there are 4 possible inputs, which are as follows:

    1/on –> to send the ON msg to the output until the node is set back to auto or at the next timed even.
    0/off –> to send to o OFF msg to the output until the node is set back to auto or at the next timed even.
    auto –> to return the node to is originally intended purpose/state/schedule
    manual –> to over ride the schedule and leave the node in its current state until auto is injected.

    This leads me to an issue or misunderstanding I am having with the “manual” command. I placed a bigtimer node on the work flow and I added two inject nodes, one with the string set to “auto” and the other “manual” and I put a debug node on the first output of the timer node. If the timer is in the ON state and I press the “manual” input node I would have expected the timer status to stay ON, but it changes to OFF and goes to manual mode. I found that the only way to have the timer stay on when pressing “manual” was to first sent ON/1 to the input then press “manual”. when I do that the timer stays ON and goes into manual mode. The issue does not stop here, as expected, after I press the “auto” input node the timer state changes to OFF and goes back to normal scheduled state, however, now if I press “manual” I would expect the timer to go into manual mode an stay off, but it does not, it goes into manual mode and goes on. Much like the other way around this, I have to sent OFF/0 before pressing manual if I want the timer to stay off and go into manual mode.

    The question is, do I in fact have to sent the desired state ON or OFF before sending manual? If that is the case then I will work it into my flows.

    Thank you,

    Mike

    1. Hi – manual means manual – it will NOT allow the schedule to continue. WAY too late at night – but I will study your example in the morning and see if I can replicate what you are suggesting – if I can replicate a problem chances are I can fix it. HOWEVER my understanding is that if the unit is ON (manually) and you switch to MANUAL – it will firstly scrap any ON/OFF and then STOP the automatic features… I’ll check this out and we can ultimately agree on what the various options should be doing…

    2. Ok, no way will I be able to tackle this until the effects of our party tonight wears off but on re-reading it – assuming what you’ve said is correct there has to be an issue there – if it was on auto – and ON – and you switch to manual… bigtimer really should stay ON.

      Meanwhile if anyone wants to look at the .JS file, happy to let someone else spot the “deliberate mistake”.

    3. Remember I did 2 updates – one to correct negative timezones and the other to revert back!!! Negative timezones still need looking at.

    4. You are RIGHT – that is the WRONG behaviour – so if in auto and ON – when you inject “manual” it turns off – it should NOT do that it should stay ON. Bear with me.

      1. Hi Peter,

        Oddly though if you inject ON before you inject “manual” it will remain on and go into manual mode.

        WRT the time zone, I had noticed an odd problem with time zones a few months back. If I put my time zone to ET (-5) and say the timer has less than one hour until the next scheduled state, rather than show ON for <59 minutes, it would show ON for 24+ hours. I'm not sure if that is the time zone problem you are referring to.

        Thank you again

        Mike

  404. Hi – Avid follower of all the stuff you publish. Not sure if this is linked to the recent discussion re negative GMT etc. But I have today installed latest version of BigTimer on a Pi2 which is correctly set to correct time on BST. Any alerts I set incorrectly calculate time. For example at 15:10 BST if I set a timer to come on at 15:15 and go off at 15:30 under the node the message says “Off for 23 hours 5 minutes”. If I change that to on at !5:15 off at 16:30 the message changes to “On for 20 minutes” even though it still has 5 minutes to go. If I advance all times by 1 hour i.e if I want to turn on at 15:15 and go off at 15:30 the I have to set the timer to on at 16:15, off at 16:30 and then all works as expected. Hope this is clear and correct. Latest versions of node-red, raspbian jessie and your timer installed and all clock times set correctly.

    1. It is a long time since I pieced together that code… removing the minus seemed obvious – yet in fact on test it is wrong – so we’ll need to find another solution for those in negative time zones – I have re-introduced the negative offset and at least here in Spain – the timer works perfectly.

      Version 1.27 – you can get this by simply using npm install node-red-contrib-bigtimer from wherever you did it in the first place, then stop and start node-red (or reboot whichever is easier).

      Looks like a different solution is needed for those in negative timezones – the code is in the bigtimer.js file – if anyone in a negative timezone can test this – would be appreciated – i.e. did the MINUS actually make it right??

      1. Hi – Just to confirm that it is all working fine on BST now – although the randomised offsets had me going for a minute or two. Thanks

  405. Dan – you are of course absolutely right – don’t know how that crept in – but I’ve now updated the repository with that amendment and a higher version number. Anyone using Bigtimer can update in the normal way. Thanks.

  406. Hey Pete,

    Been following your blog for a year now,… many thanks!

    …for the life of me I can’t get bigtimer to work correctly. timeswitch works fine for me, however I’m interested in the offsets between each on/off time selection.

    Are the offsets valid +or- only between each selection? What is valid input in the offsets. e.g “-20” , “+30”, “2”, “+2”, “-3” ?

    Also, I can’t make any sense of the subscript “On for 03hrs 21mins”. It doesn’t match-up to what I selected. Have you seen this too?

    Thanks

    1. Hi Dan – the offsets are in minutes and can be applied to both start and end times. Yes, +4, -5 etc. If you have a specific example of an issue, give me details and I’ll try it here.

      To test for an issue, at 7.22 in the morning I set a new bigtimer with on time at 8am and offtime at 9am. It comes up with “Off for 00hrs 38 mins” which is correct. I add 10 mins to the offset and… the display changes to “Off for 00hrs 48 mins”. Changing that “on” offset to -10 does as you’d expect and changes the display to “Off for 00hrs 28 mins”.

      It is now 7.26am – I change the ON time to 7am – leaving the OFF time at 9am. It now says “On for 01hrs 36 mins” which again is correct. Setting the OFF offset to 15 mins adds 15 mins to that time.

      All seems perfectly correct to me.

    2. I guess it is worth asking – have you actually checked to ensure the time on your Pi is CORRECT?? Are you also setting correct longitude and latitude in the dialog box (though that should really only affect things like dawn and dusk etc).

      1. Pete,

        I took a look at the code there seems to be an issue with the code for negative GMT (I’m in -5):
        I changed this:
        //var nowOff = -now.getTimezoneOffset() * 60000; // local offset
        to:
        var nowOff = now.getTimezoneOffset() * 60000; // local offset

        …and results look better. Should be an easy fix for the “negative ” folks. Thanks again!

        1. Dan

          I’m wondering if just perhaps you started with an earlier version of BIGTIMER – because the version I’m using which is the one which SHOULD be available from:

          npm install node-red-contrib-bigtimer

          ALREADY has that line un-commented. Want to check? In my Javascript, line 101 of he JS file has that line active – NOT commented out.

          Indeed here is everything from line 99 and you’ll see I threw away an older version of the code….

          function(inmsg) {
          var now = new Date(); // UTC time – not local time
          var nowOff = -now.getTimezoneOffset() * 60000; // local offset
          var times = SunCalc.getTimes(now, node.lat,node.lon); // get this from UTC, not local time

          var dawn=(times.dawn.getHours()*60) + times.dawn.getMinutes();
          var dusk=(times.dusk.getHours()*60) + times.dusk.getMinutes();

          var solarNoon=(times.solarNoon.getHours()*60) + times.solarNoon.getMinutes();

          var sunrise=(times.sunrise.getHours()*60) + times.sunrise.getMinutes();
          var sunset=(times.sunset.getHours()*60) + times.sunset.getMinutes();

          var night=(times.night.getHours()*60) + times.night.getMinutes();
          var nightEnd=(times.nightEnd.getHours()*60) + times.nightEnd.getMinutes();

          now=new Date(now+nowOff); // from now on we’re working on local time
          var today=(now.getHours()*60) + now.getMinutes();

          /* var nowMillis = Date.UTC(now.getUTCFullYear(), now
          .getUTCMonth(), now.getUTCDate(), now
          .getUTCHours(), now.getUTCMinutes(), 1);
          var midnightMillis = Date.UTC(now.getUTCFullYear(),
          now.getUTCMonth(), now.getUTCDate(), 0, 1);
          var startMillis = Date.UTC(times[node.start]
          .getUTCFullYear(), times[node.start]
          .getUTCMonth(), times[node.start]
          .getUTCDate(), times[node.start]
          .getUTCHours(), times[node.start]
          .getUTCMinutes());
          var endMillis = Date.UTC(times[node.end]
          .getUTCFullYear(), times[node.end]
          .getUTCMonth(), times[node.end]
          .getUTCDate(), times[node.end]
          .getUTCHours(), times[node.end]
          .getUTCMinutes());

          nowMillis += nowOff;
          startMillis += nowOff;
          endMillis += nowOff;

          var dawn = (((startMillis – midnightMillis) / 60000)) % 1440;
          var dusk = (((endMillis – midnightMillis) / 60000)) % 1440;
          var today = (Math
          .round((nowMillis – midnightMillis) / 60000)) % 1440;

          */

          var startTime = parseInt(node.startT, 10);
          var endTime = parseInt(node.endT, 10);

          1. I’m using “_id”: “node-red-contrib-bigtimer@1.2.5”,
            “_shasum”: “309b79e400099880275a3ea47138d7f327d90efc”

            In the code you posted. I removed the minus sign:

            I changed this:
            var nowOff = -now.getTimezoneOffset() * 60000; // local offset
            to:
            var nowOff = now.getTimezoneOffset() * 60000; // local offset

            I hope that clears up the change I made; It works perfectly now in GMT-5.

  407. Pete, I haven’t been able to get BigTimer working on my Raspberry. I installed the node around three days ago. I followed the suggestion of Micheal on 02/06 and removed the node from the flow and then replaced it but so far no good. At present all fields are populated and Repeat and At Startup are NOT checked. I have repeated this test multiple times but the results are the same. Last test the On Time was 20:00 and the Off Time was 20:15. All outputs are connected to Debug and the results for the On Timer can be seen here from the Debug column:

    4/25/2016, 7:59:34 PMe695a194.d8cbd8status : msg.payload : string [1]0
    4/25/2016, 8:00:34 PMe695a194.d8cbd8status : msg.payload : string [1]0
    4/25/2016, 8:01:34 PMe695a194.d8cbd8status : msg.payload : string [1]0
    4/25/2016, 8:02:35 PMe695a194.d8cbd8status : msg.payload : string [1]0

    Suggestions?

    1. Pete, update on 04/26 post, Bigtimer is working big time. I can’t explain why, but it appears that Bigtimer was using UTC time and I am -7 hours US/MST. As you can see in the prior post, Node-Red posted the times in the Debug column as MST thus compounding the confusion. I am still in the process of setting this system up and I did not have the proper configuration for the ntp update, although I did set it as advised in at least one Linux How-to article. Once I reconfigured the ntp server settings and rebooted, Bigtimer was on the same page as the rest of us. Again, I can’t say why exactly, but I can say this appears to be the problem as it has been running a few days now and I can set and verify actions in real time whereas before the 7 hour time delay would not let me see when it fired. Good work and I apologize that I misunderstood the real issue before.

  408. Pete, good work on Bigtimer. A suggestion: it would be helpful if you included a screenshot of the Bigtimer configuration form (web page) in your write up above so new users can see what the controls look like.

  409. Hello,
    Thanks for all the work you’ve done on BigTimer. I’ve recently started using it and was wondering if there was any way to either change the current on/off times over mqtt. I use OpenHAB as my front end and am ‘trying’ to use node red as a rules engine(among many other things). Ideally, it would have two more inputs, the first being for the ‘on’ time and the second for the ‘off’ time. I’ve gotten a few projects up and running (i love my sous vide machine) but am still fairly new to all of this. If you could point me in the right direction to accomplish this or have any advice for me i would be grateful.

    1. Not only will I have to think about that one Stuart – I’ll have to ask the guys at Node-Red – I can’t get my head around whether or not I can programmatically alter a setting set up in the web page… hmmm

  410. Hi Peter

    I want to ask a question. If I want to do something15 minutes before dawn, how can I accomplish this task with your bigtimer?

  411. Hi Peter,

    Excellent work.
    I have discovered an odd issue and welcome your opinion.
    I’m in the Eastern time zone (UTC-5). I was having trouble with evening triggers (7pm-11:45pm).

    From looking at the code I believe there is potential corner case in the formula to calculate “today”. The issue I believe is that during time between midnight UTC and midnight in the “negative UTC” timezones. the “midnight” calculated is actually the next day, the result is a negative “today”. For example if it’s 9pm (UTC-5) – actually 2a UTC next day. the Midnight calculation is for the next day so “today” ends up as -180 instead of 1260.

    My quick and dirty solution to resolve my setup was inserting this line right under the today calculation:-
    if (today < 0) today += 1440;

    There are several other ways to solve, including winding back the original midnight calculation a day since the today formula is % 1440 it doesn't matter which midnight as long as it before "now".

    Let me know what you think?

    Cheers,
    Peter C.

    1. Peter – would you like to do me a little favour – try your mod out on a couple of other time zones and let me know if it is fine – and I’ll update the file accordingly….. I’ve only ever tried it in Spain and the UK.

  412. Hi!
    Thanks for BigTimer!
    But, I have some problems using it. I have the scenario that I want two timers, one in the morning, one in the afternoon. I have configured two BigTimers, sending only the changes, but only one is set to “at startup”, since I got a race condition (one sending “on” and the other “off” at the same time with both checked to “at startup”).
    But, with this configuration, only one timer (the one with “at startup” checked) will actually send an update. The other one will update the node, but not sent any topic.
    This is easy to reproduce by just connecting two BigTimers to debug output, uncheck “at startup” on one of them and set some turn on time in the near future and deploy. One will send an initial state, but the other one will be quiet even when the timer goes on (the node is updated correctly (green dot with text “On for xx hours”) but that’s it).

    1. It is at times like this Thomas that I wish I’d done a huge dropdown with per minute timing.. Sitting polishing my nails waiting nearly 15 minutes for the next trip to prove or disprove your theory.

      However as the 2 timers sit there with OFF status – both of them are showing the TOPIC… so I cannot think of any reason why that would change when they turn to on. I’ll go get coffee while I wait…

      Ok, I’ve started again with REPEAT off… so in 8 minutes I should see both of them come on – the first one (with the startup flag) has already of course sent a message which included the topic.

    2. Thank you Thomas for that – I’ve done some tests – you are absolutely right – and I’ve fixed the issue.

      If you would care to npm install again…. you will find you are on version 1.1.3 which should solve the problem. I’m updating the blog accordingly.

  413. This a great node Peter.

    Would you consider adding other sun events? I use sunset, goldenHour, night etc. Supporting these would allow me to tidy up my flows nicely.

    Luke

      1. I forgot to add, if the code is somewhere public, I’d be happy to submit a Pull Request etc. Happy to help however possible.

        1. I’m not sure how many people realise this – but when you npm install these node – well mine anyway – you have full access to the source – on a Pi, in home/pi/.node-red/node-modules/node-red-contrib-bigtimer there is an html, .js files … that’s it!

          1. Of course, I was only asking in case the actual project was lurking in github or bitbucket and I could do it via more formal means.

          2. Having taken a look at the code, I think I only need to use dusk offset correctly. For golden hour, -90 minutes for the dusk offset should do the trick.

  414. Thank you for the fast reply! As suggested I whipped up a function, which eliminated bigtimer from the equation.

    Here;s the function:
    http://pastebin.com/UKVaARUV

    It’s fed by 4 injectors, the first calls the function every minute, without a payload, just so it will check the time and override states, and send mqtt as directed. The other three injectors are default, on and off like your bigtimer. on/off set override, default clears the override

    A little clunky, but hey nobody’s gotta see it 🙂

  415. Hi Pete,

    Do you have an example of using “bigtimer” to schedule more than one on/off event for a device per day? I have an aquarium lamp I’d like to run from 7am to noon, and 5pm to 10pm. I tried creating two bigtimers, one for the morning and one of the evening, but they fight each other, one constantly sends an ON event, the other an OFF event.

    1. Erm untick the box so they don’t send stuff constantly…. the first output will then only send info when due to turn on – and when due to turn off – that way they won’t conflict.

      Alternatively if you really HAVE to have the message repeated, use different messages for each of them (ie for example bt1_on, bt1_off, bt2_on, bt2_off) – feed those into a function and do a little logic on that before firing out the right message out of the other end.

    2. It would not be THAT big a deal to add another on-off time set to bigtimer – but then someone would want 3 on-off times etc…

      So I think the function is the answer.. will be a little messy set of ifs but do-able.

  416. Hi.

    Thanks for providing Bigtimer. I like it but have stumbled upon a problem or perhaps I am misunderstanding something….?

    At 11pm, if the humidity is above 70% in my lounge, Bigtimer turns on a de-humidifier until either the humidity has dropped or it is 6am. This works well but i also have another Bigtimer session that turns on the de-humidifier between 9am and 3pm as long as no-one is at home (global context variables set by ping).

    I need both instances set to “repeat” because they must check different variables throughout their active time BUT they seem to continue checking even when they should not be active (i.e outside of their ON / OFF cycle). This means that the night time Bigtimers spends all day spewing out a 0 because it’s not night time. The 0 triggers an RF433 signal which sends the off code to the plug socket. BUT then the daytime Bigtimer sees that noone is home and turns it back on etc etc…

    Is there a way to make Bigtimer completely inactive outside of the ON / OFF times but repeat during active duty?

    I hope that makes sense. Regards, Don

    1. Hi there

      Ok the reason I did this – some devices remember their state after a crash or power failure (mine do) but some don’t.. hence I put that in so that they would continue to get a reminder of the state they are supposed to be in – regardless of whether it is on or off.

      Now, I’ll grant you – those devices that are being controlled directly are likely to default to OFF if they don’t have a memory.

      I could therefore change bigtimer – but there is a better way…. and one you can implement immediately.

      So stick a function after bigtimer – if it gets a 1 – pass it on… if it gets 0, only pass it on once then set a flag not to send 0 again until there has been at least one 1.

      If you get my meaning. Simples.

        1. hmmmn. i said simples forgetting that I’m new to this,,,, I have been trying to write a function as you suggested.
          injecting a 1 works fine but injecting a 0 afterwards gives me the “nothing to see here” even though the var “count” should be at 1. do you have a minute to tell me what I’ve done wrong please Peter?

          var count;
          if (msg.payload ==1){
          count =1;
          return {payload:16738315};
          }
          else if ((msg.payload ===0) && count ==1) {
          count ===0;
          return {payload:16738314};
          }
          else {
          return {payload:”nothing to see here”};
          }

          1. I assume you meant count=0; not count===0; which is merely a comparison.

            Hence

            var count;
            if (msg.payload ==1){
            count =1;
            return {payload:16738315};
            }
            else if ((msg.payload ===0) && count ==1) {
            count =0;
            return {payload:16738314};
            }
            else {
            return {payload:”nothing to see here”};
            }

  417. Dear Peter,

    I have a suggestion for improvement. I do not know if you know, since years I have developed a number of so called plugins for EventGhost. One of those is named SunTracker and is in some way comparable with your BigTimer.
    However, there are two features I really think would be valuable to have also in the BigTimer, two more day types. We can call them ‘Vacation’ and ‘Away’ (or ‘Empty house’).
    In SunTracker I can have different settings for those two day types. During ‘Vacation’ I personally have completely different settings for lights and other stuff then during normal weekends (so Saturday and Sunday settings will not work). Also when ‘Away’, I have again different needs.
    Let’s assume you would have settings for those additional day types. To activate them you could have an additional input accepting the values 0, 1, 2 (0 = Don’t bother, 1 = Vacation, 2 = Away).
    In this way you could externally set the mode of your system/house very easily using whatever node signals (like external calendars or home alarm system). You would also be able to manage special holidays (like we just had with Christmas and New Year)

    As I said, just a suggestion,

    Best regards, Walter

    1. Came here to say the same. BigTimer is great, but a ‘vacation mode’ with random on/off periods (with a settable min and max) during the overall ‘on’ period would be awesome. Right now I’m OR-triggering BigTimer with another module for that functionality.

      1. Unless I’m reading this wrong – we’re looking at a duplicate set of settings – and there are a lot in there already, I think the whole interface would get a little unwieldy if I did that. As for random periods – that’s been in there for ages. Tick the random flag and instead of the offsets being fixed – they are randomised. So you could have the lights come on at 10pm – with an offset of 30 mins – tick the random feature then that becomes an offset of UP TO 30 minutes.

        Or’ing 2 Bigtimers gives you your randomised away days…

  418. Hello – I’m playing around with NodeRed since a while for home automation – today I found this promising module – I installed it to my global space with “-g” same as node-red. I can us it in the graphical editor – setup all the parameter – but I’ll never get a message in first or 2nd output -> I only get a “-2” on the last one. I’m using latest node-red version 12.0. Any know issues with that? I also tried you scheduler module – same result- Any idea?

    1. Yeah, I’m seeing the same thing here. Second output gives me this every minute:
      { “payload”: “-2”, “topic”: “status”, “_msgid”: “f7338f4b.08cc7” }

      The other ones gives me nothing.

      Any suggestions where to start looking? I tried npm update to make sure I’m on the latest version.

      Thanks
      Michael

      1. I just tried BIGTIMER on a brand new installation which got all of it’s nodes from NPM. And this time it’s not even a Raspberry Pi, it’s an Orange Pi.

        I pulled in bigtimer (it asked if it could use my current position – I said yes) – I set the on time to 5 minutes from now and the off time to 35 minutes from now. I tied outputs 1 and 2 to a debug.

        I set the ON message to “hello” and the OFF message to “Goodbye”

        I started it – immediatgely in the debug window it said “Goodbye”. A minute later a 0 appeared in the debug – another minute later another 0 appeared in the debug.

        That is absolutely the correct behaviour.

        1. Hi and thanks for your reply,

          Did some more tests… I uninstalled using npm, cleared the cache and reinstalled.
          I then made sure I had all fields populated in the node, however I still got the same results.

          I then tried removing the node completely from my tab and readded it. I’m now seeing messages looking much better every minute from the second output!

          2016-02-06 10:20:12dc2586e1.23da78
          /test : msg : Object
          { “payload”: “0”, “topic”: “/test”, “_msgid”: “601a85b.f9fe57c” }

          2016-02-06 10:20:12dc2586e1.23da78
          status : msg : Object
          { “payload”: “0”, “topic”: “status”, “_msgid”: “601a85b.f9fe57c” }

          2016-02-06 10:21:10dc2586e1.23da78
          status : msg : Object
          { “payload”: “0”, “topic”: “status”, “_msgid”: “570a3aab.a8f5c4” }

          So today I learned that readding nodes to a project is a good thing to do before contacting the developer! 🙂

          Thanks for an inspiring blog!

  419. Thanks for that Jason, will progress this further in the morning – really appreciated – but… the last link – that’s where I started! No joy with that.

  420. Just an idea you can fire up a terminal on the synology I guess that’s how you installed your software. What about adding a cron task to run your BLYNK at startup. I’m sure I have read you can access Cron from the terminal on synology . Cron can also be used to run items on a schedule node-red uses it on the inject. On the pi you type sudo crontab -e should be something similar on synology put an entry in Cron “@reboot” then the path and program you want to run. miss the quotes. Have a google above might help J

    1. Thanks for that but no… as I’ve come to expect from the Diskstation… “ash: crontab not found”.

      It doesn’t have GIT or APT-GET … it’s quite difficult to do anything – but I’m so near with being able to run the thing in the terminal…. (yes I have SSH access).

  421. After install bigtimer, as soon as I open a new node red page and before click on anything, I can see the small bigtimer icons and checkboxes aligned in the left side and bottom of the page. And when I select the bigtimer icon it only shows a box with the option to change it´s name and nothing else… Any ideia of what is wrong?

      1. Ah, excellent – well I’m glad someone is having a good day. Once again my limited knowledge of Linux is getting in the way. I’ve spent the afternoon getting Java 9 running on my diskstation so I can run BLYNK on it – works a TREAT – but can I HELL figure out how to make it run on startup – the Synology Diskstation is VERY different to the PI!

  422. Just to follow up on this I found if I installed packages like this CD into directory

    cd $HOME/.node-red

    And then

    sudo npm install -g package-name

    The packages were then installed in the correct directory
    I followed the official install procedure for the raspberry pi when installing nose red and installed it as a global user so the -g switch puts the nodes in the correct directory

  423. Just moved the modules to node-red/node-modules & most have appeared in the pallet now. Npm still puts files into my home/pi/nodemodules folder but for now it’s not an issue moving afterwards. Thanks for your support and interesting blog Peter.

    1. And thank you for taking an interest. Latest update I’ve moved all my nodes into my own section – again move to .node-red dir and do npm install node-red-contrib-XXXXX where xxxx is bigtimer, scheduler, grove, thermostat, esplogin. Bigtimer the most useful. That command also does for updates…

  424. Hi Pete I have installed several nodes now on my raspberry pi. Including Big Timer

    I’m typing

    cd $HOME/.node-red
    npm install

    They all appear to install correctly but none appear in the left hand pallet on the web page.

    The Npm has loaded them all into a directory in my home directory called nodemodules (from memory) anyone else had issues like this ?

    Much appreciated.

    1. If you are in the .node-red directory and you type for example

      npm install node-red-contrib-scheduler

      They SHOULD end up downloading and installing themselves in .node-red/node-modules

      If that is exactly what you have done – and they’re still not there – try asking the guys at the Google+ Node-Red forum.

      Another way is to move the directories to under .node-red/node-modules – that might do it and if not – having done that go into EACH directory and type npm install
      The latter on it’s own with no arguments assumes you already have the stuff in place.

    2. I have never gotten to the bottom of the general package.json… talk to the guys in the Google Group Node-Red about that. As you say, just install anyway and you’ll get the latest version. I’m very pleased with it and keen to hear any feedback.

    3. under /home/pi the folder is .node-red/node_modules and only install nodes using the MANAGE PALLETTE – INSTALL in Node-Red… tht saves a lot of problems. So for example BigTimer will end up in /home/pi/.node-red/node_modules/node-red-contrib-bigtimer/

      Pete

Leave a Reply

Your email address will not be published. Required fields are marked *

Leave the field below empty!

The maximum upload file size: 512 MB. You can upload: image, audio, video, document, spreadsheet, interactive, text, archive, code, other. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here