Node-RED with Big Timer Node: Create Complex Automation Schedules Easily

In this guide, we’ll show you how you can create complex automation schedules easily using Node-RED and the Big Timer node. The Big Timer node provides a huge range of timing facilities that will take your automation to the next level: you can control outputs based on different time conditions: hours, minutes, days of the week, months, include/exclude specific days or months, based on sunset and sunrise time, and much more.

Node-RED with Big Timer Node Create Complex Automation Schedules Easily

After learning how to use the Big Timer node with Node-RED, you can easily use the Big Timer features to create automation schedules to control your ESP32 and ESP8266 boards. Check the tutorials below:

New to Node-RED and Home Automation? Check our Smart Home eBook: Learn Raspberry Pi, ESP32, ESP8266, Node-RED, and InfluxDB.

Table of Contents

In this tutorial, we’ll cover the following topics:

Installing Node-RED

Node-RED logo

Before proceeding you need to have Node-RED installed. You can install Node-RED locally on your computer or on a Raspberry Pi, or on a cloud server. Check one of the following tutorials to install Node-RED:

New to Node-RED and Home Automation? Check our Smart Home eBook: Learn Raspberry Pi, ESP32, ESP8266, Node-RED, and InfluxDB.

Big Timer Node

The Big Timer node for Node-RED provides a huge range of timing facilities that will take your automation to the next level. For example, you don’t want your outside lights to turn on at 6 PM, you want to turn them on when it gets dark. The Big Timer node can use your latitude and longitude to estimate sunset and sunrise times and turn on/off the light accordingly.

The Big Timer Node created by Peter Scargill is a powerful and easy-to-use timing node for Node-RED. We recommend taking a look at the Big Timer page on Peter Scargill’s blog: Big Timer page.

Installing Big Timer Node on Node-RED

To install the Big Timer node, go to the main menu in the top right corner and click on Manage Palette.

Node-RED install new nodes

Then, click on the Install tab and search for node-red-contrib-bigtimer. Install that node.

Installing Big Timer Node-RED

Now, the Big Timer node can be accessed on your palette at the left sidebar under the advanced section.

big timer node node-red

Drag the bigtimer node to the flow. You’ll notice it comes with an input and three outputs.

big timer node in Node-RED flow

The documentation clearly explains what each output consists of.

BigTimer has 3 outputs, the first of which triggers when there is a change of state and presents one of two messages (for, for example, MQTT or other control mechanism), the second output has a topic of “status” and contains a simple 1 or 0 every minute in the payload and also has additional outputs reflecting the status message in msg.state and message time and others. The third output presents a message which could be used for speech or debugging.

The input can be used to override the schedule properties. You can check the valid input commands on the documentation page.

Big Timer Node Features

Double-click on the Big Timer node to explore its properties.

Big Timer Node Properties

Big Timer allows you to set up complex schedules easily based on multiple conditions. For example, you have the option to set two On Time schedules and two Off Time schedules. You can select specific hours, or you can select: day end, dawn, dusk, solarnoon, sunrise, sunset, night, night end, moonrise, and moonset.

Big Timer Node Select On Time and Off Time

You can adjust the time using the Offset fields to set a trigger, for example, 15 minutes before sunrise.

The first output of the big timer can be a message for an MQTT node or for any other purpose. If you’ll output the message for an MQTT node, you can fill the MQTT topic and On Msg and Off Msg fields.

For precise sunrise, sunset, etc, you should include your latitude and longitude location.

There’s also the option to include up to 12 special days of the year (for example, Christmas), and up to 6 special weekdays of the month.

Big Timer node features

Similarly, you can exclude special days of the year and/or exclude special weekdays of the month.

Big Timer Node Include and Exclude Special days

Finally, you also have all these other options to include/exclude specific months or days of the week, exclude even or odd days, etc.

Big Timer Exclude special weekdays

As you can see, there are plenty of options to set up customized and complex schedules easily.

Testing the Big Timer Node: Example Node-RED Flow

Let’s quickly test the Big Timer node on Node-RED to give you an idea of how it works.

Drag a Big Timer node and a debug node to the flow. Wire the Big Timer first output to the debug node input.

Big Timer Node Example Flow debug node

Double-click on the Big Timer Node. Set up an On Time and an Off Time closer to the current time so that you can quickly test it. Define a message that must be sent to the output when it reaches the on time (ON Msg) and another for when it reaches the off time (OFF Msg). We’re setting the messages to 1 and 0, respectively.

Big Timer Node Fill Details

Double-click on the debug node and set the Output to complete msg object so that we can see the complete output of the Big Timer node.

Set debug Node to complete msg object

When you’re ready, Deploy your application.

Node-RED deploy button

Notice that there’s a message under the Big Timer node indicating how much time it will be on or off.

Big Timer Node showing how much time off

Open the Debug window by clicking on the bug icon at the top right corner.

Node-RED Debug Open Window

If you have the Repeat output box ticket on the Big Timer properties (which should be by default), you’ll get the complete output of the Big Timer node on the debug window every minute. Notice that it changes the payload message at the time you specified.

Node-RED debug Big Timer Node

As you can see, with the Big Timer node, we can output different messages for the ON and for the OFF time. Then, you can use that output message to control any device, flow, system, or event that you want.

Wrapping Up

This was just a simple example showing you how to use the Big Timer node on Node-RED to automate events based on time. There are much more features you can use. You can also use the input of the node to override the current on/off state, enable manual/auto mode, and stop the schedule. You’ll find lots of information and use case examples here.

You can use the output of the Big Timer node to send on and off messages to ESP32 and ESP8266 boards to control their outputs at certain times of the day or days of the week. We cover that in the following tutorials:

Do you like home automation, but don’t know how to get started? Take a look at our SMART HOME eBook:

Thanks for reading.



Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »
Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »

Recommended Resources

Build a Home Automation System from Scratch » With Raspberry Pi, ESP8266, Arduino, and Node-RED.

Home Automation using ESP8266 eBook and video course » Build IoT and home automation projects.

Arduino Step-by-Step Projects » Build 25 Arduino projects with our course, even with no prior experience!

What to Read Next…


Enjoyed this project? Stay updated by subscribing our newsletter!

1 thought on “Node-RED with Big Timer Node: Create Complex Automation Schedules Easily”

  1. Hello,
    I see when the debug node Output is set to “complete msg object” the complete “payload”.
    Could you explain how to parse the timestamp “stamp” in a function as I would like to send the result to another node.
    Thanks

    Reply

Leave a Comment

Download Our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.