node-red-contrib-vacation-timer 2.1.2

A node-red node that simulates a house being occupied, by turning something on and off in a natural way. A new schedule can be generated each day, and at the scheduled times, a payload of either `on` or `off` will be sent.

npm install node-red-contrib-vacation-timer

Vacation Timer for node-red

Changes in v2.1.2

Quick bug fix for an issue that broke the Minimum and Maximum time dropdowns from working correctly in v2.1.1


With more and more people getting into Home Automation, node-red is becoming a more integral part of automation systems. But there is one question people tend to overlook in the automation of their home! What do you do when you go on vacation? Obviously you can have an alarm system that alerts you AFTER someone has broken into your house, but what can you do to help prevent the break-in from occurring in the first place?

Well... Simple... don't let them think you ever left!

This is a node that simulates someone being home in order to turn a device on and off at a semi-random, yet seemingly normal schedule. For instance, if you usually go to the Family Room and watch TV after work between 6 and 6:30 in the evening, and you go to bed anywhere from 11:30pm to Midnight, well, then you can automate the Family Room light to come on randomly between 6 and 6:30pm, and stay on for a random length of time, such as 5 1/2 to 6 hours, and then go off, while shortly there after the bedroom light goes on, as well as the master bathroom light a few moments later, all mimicking a person making there way to bed after an evening in front of the TV.

Now, using the same ratios, the Vacation Timer can generate a different on/off schedule each day, so although the specs are the same (6 - 6:30pm, 5 1/2 - 6 hours) it will be a random time within those specs, so it will always appear as if human interaction is taking place. Now again, imagine having several nodes setup for a handful of lights in different rooms in your home, all with different, semi-random schedules. That is the Vacation Timer. It is simple, yet effective.

Unlike similar vacation scheduling systems, there is no set Off Time, but rather you select a minimum and maximum length of time you want the device to run for, and the Off Time is generated based on the randomization of the On Time delay and the random running time you have chosen.


Initially Suspended:

When this is checked, the schedule will only be activated when the node receives a msg with a positive payload of start, on, 1 or true. If you uncheck this box, the schedule will be activated immediately upon Deploying. You can manually enable Suspend Mode at any time by sending a msg with a negative payload of stop, off, 0 or false. This option is checked by default, as the recommended way of activating and deactivating the schedule is to send the node a msg.

Reschedule After Completion:

When checked, a new randomized schedule will automatically be generated for the next active day, otherwise it will be Suspended once the current schedule completes. It then must be re-activated with an incoming msg containing a positive payload of start, on, 1 or true.

Latitude and Longitude:

Your latitude and longitude for use with Dusk, Dawn, Sunrise or Sunset from the Time On dropdown.

Days of the Week:

Here you can select which days of the week the schedule will be run.

Issue Off Command on non-scheduled days

If the scheduled Time On is before Midnight on a scheduled day, the device will always turn on, however, if the following day is a non-scheduled day, and the Time Off of the same schedule is after Midnight, thus falling on the non-scheduled day, the device will NOT be turned off unless this option is checked. The assumption is that if you do not want the normal schedule to take place on a specific day, you may also not want the Off command to be activated on that day either. If this option is not checked, you will have to either setup an additional Vacation Timer node or some other node-red timer to take care of shutting off those devices that were not turned off.

Time On:

This is the earliest time of day that you want the device to be turned on.

Max Delay:

This is the maximum number of random minutes you want tagged onto your chosen Time On. If you choose 7:30 PM as your Time On with a Max Delay of 30 minutes, your device will turn on between 7:30 PM and 8:00 PM.

Minimum Time On:

The minimum hours and minutes you want the device to be on.

Maximum Time On:

The maximum hours and minutes you want the device to be on.

Disable Maximum Time On:

If this is checked, the Maximum Time On will be ignored and the device will be turned off after the exact hours and minutes selected in Minimum Time On.

Payload and Topic:

Set the Payload and Topic values for both the On and Off commands.

At the scheduled times, the node will output a payload of either on or off.


Quick bug fix for an issue that broke the Minimum and Maximum time dropdowns from working correctly in v2.1.1

Fixed issues with the Minimum and Maximum hours/minutes dropdown selectors that would allow you to set a Maximum time that was before the Minimum time.

You can now set the Payload and Topic values for the schedules On and Off commands.
The Payload can use the String, Number and Boolean type inputs.

COMPLETE REWRITE: There were a LOT of errors and problems with the previous versions of Vacation Timer, to the point it was practically unusable, therefore, this version was completely rewritten from scratch with a new scheduling algorithm. It should not break any of your existing nodes and should run correctly now. Instead of rescheduling every night at midnight, each node will reschedule for the following active day at the end of each current schedule. This removes the need for an additional internal timer that was being fired at midnight, and more accurately handles schedules that span across midnight, as well as ensuring inactive days are honored correctly. The node status will also clearly show the next schedule date and times, and you can now disable the Maximum Time On fields if you wish to have the device turned off after a set number of hours and minutes.

Breaking Change: Added the ability to disable rescheduling at Midnight. Any Vacation Timer nodes you already have set-up will need to have this feature enabled in the settings panel if you want them to continue working in their current manner.

Reworked the fix from 1.3.2 to be more consistent with expected results.

Ensure the pairing of Start and Stop schedules. Some rare situations could end up with an On schedule without an associated Off schedule.
Bringing versioning to a more standard, incremental format.

0.0.10 (1.3.1)
Further fix for the multiple msg sending bug.

0.0.9 (1.3.0)
Significant Bug Fix: all msg payloads (on/off) were being sent every second, for a full minute, for a total of 60 msgs.
New Feature: Added a choice of whether or not to issue an Off command for a schedule that spans Midnight onto a non-scheduled day.

0.0.8 (1.2.2)
Changed the Visual On/Off times displayed in the node status from 24hr clock to 12hr clock

0.0.7 (1.2.1)
Removed the need for the cron-parser dependency.

0.0.6 (1.2.0)
Significant Bug Fix: a major bug with the scheduling could have allowed the hours and minutes to be misinterpreted.
New Feature: Added days of the week, so you can set the schedule to only run on certain days.

0.0.5 (1.1.2)
Fixed alignment in configuration panel

0.0.4 (1.1.1)
Fixed typos in the

0.0.3 (1.1.0)
For consistency, when the node is Suspended, a positive payload of start, on, 1 or true is required to active the schedule.
Also, we changed the negative payloads to Suspend the node to include stop, off, 0 or false.

0.0.2 (1.0.1)
Quick fix for incorrect times listed in the Time On dropdown.

0.0.1 (1.0.0)
Initial Release

Node Info

Version: 2.1.2
Updated 8 hours ago
License: Apache-2.0


in the last day
in the last week
in the last month


  • vacation-timer


  • cron
  • vacation
  • schedule
  • occupancy
  • timer
  • node-red
  • node


  • jbardi