How to Allow IFTTT Applets Only to Run at Certain Times

If you are like me, then you have been wondering how to allow IFTTT applets to only run at a certain time.

For example: turn on lights with a motion sensor, but only when it’s at night. It is possible to do this and I will show you how.

First, head over to the IFTTT Platform at this link: Here you can create applets with extra functionality.

In this article, I will show you how to turn on a light bulb with a Wyze Sense motion sensor, but only between 8 pm and 5 am. Of course, you can change out the devices and times for whatever you are looking to do.

To get started, click on the New Applet button.


Type in the service you want to use. In my case, I’m going to use Wyze and then I will select the Motion Sensor detects motion.

Next, it will show you a section for selecting the device. You won’t be able to select the device until you activate this applet so just move on to the next part.

Click on Add action which you will search for the service just like the trigger part. For my example, I am going to use the Smart Life service to turn on an inexpensive bulb. The next dropdown I changed it to Turn on since I’m turning on the light when it detects motion.

After adding the action, you can now turn on the filter button. Click on Add filter code to open up the area where you will be able to add the code. This will make the applet only run between 8 pm and 5 am.

Paste in the code below and I will let you know what to modify.

var currentHour = Meta.currentUserTime.hour()

if (currentHour >= 20 || currentHour < 5 ) {

// Run the applet

} else {

// Skip the action



There are only a few things you would need to change. First is the last line Smartlife.turnOn.skip() and you can find out what to replace it with on the right side under Actions.

Whatever service you are using will have a different name under Actions for you to copy and paste.

The other thing you may want to adjust is the time when you don’t want the applet to run. This is based on the 24-hour clock. 20 is 8 pm and 5 is 5 am, so if you wanted to have it run between 6 pm and 7 am you would change it to “if (currentHour >= 18 || currentHour < 7 ) {”

After you have adjusted the code, you will need to add the Applet title and description. Then click Save down at the bottom.

Once you have clicked Save you will see a link Enable it on IFTTT and click on that.

Change the slider to On. This will show the familiar screen of adding the devices to the Applet. Choose the devices and click Save.


Now it’s all set up! Enjoy your new automation that only runs at the time you want it to.


  1. Ann

    Could you show me in detail how to set up the Wyze sense with Merkury Smart Wi-Fi Plug running with geeni App? I want the motion sensor trigger the Wi-Fi Plug, so that I can plug in a Siren. Whenever a motion is detected by the motion sensor the Wi-Fi Plug will be on and supply the power to the Siren. I do not know how to set up. DO I need the IFTTT ?

    1. Reed Kleinman

      Hi Ann, it doesn’t look like Merkury Smart devices work with IFTTT right now. Since it does work with Alexa then you should be able to get the Wyze Sense to work with it through that in the future. Right now Wyze Sense doesn’t connect to Google Assistant or Alexa so we will have to wait till that is available. There are plenty of inexpensive smart outlets that work with IFTTT though if you want it to work right away.

  2. Fabian Lamaestra

    Are you able to connect these sensors to any IFTTT recipe? Like are you able to connect one of the door sensors to a cookie jar so that when you lift the lid it sends an SMS message to a specific phone number?

    1. Reed Kleinman

      Fabian yes you can connect to any IFTTT recipe. So you can get an SMS message if someone opens the cookie jar!

  3. Adrian

    Is there any way for the action to trigger only if the motion has been clear for a certain time period? For example, lights turn off if motion has been clear for 10 minutes.

    1. Reed Kleinman

      Set the service to be Arlo and select detects motion. Then for the second service choose Phone Call. Here is the filter code you can use.

      var currentHour = Meta.currentUserTime.hour()

      if (currentHour >= 1 || currentHour < 6 ) { // Run the applet } else { // Skip the action PhoneCall.callMyPhone.skip() }

Leave a Reply

Your email address will not be published. Required fields are marked *

Smart Home Solver Twitter Smart Home Solver Pinterest Smart Home Solver Facebook Smart Home Solver Flipboard share