I am trying to create a new script for IFTTT. I currently have the weather app set to turn on the porch light at sunset with the light color being yellow to avoid bugs. I have another weather app set to turn off the porch light at sunrise. I also have my RING doorbell change the light to white if it detects motion. The problem is there is no way to change it back to yellow.
So basically what I need is some sort of wait command. This way when RING detects someone with its motion sensor it would trigger:
If during the hours of sunset and sunrise change the porch light to white
You could use setTimeout() to call a function later. Waiting 10 minutes will be problematic though, as Glitch projects sleep after 5 minutes of inactivity, but it sounds like it might be alright to reduce it in the use-case.
e.g.
function waitFunction() {
// all the stuff you want to happen after that pause
console.log('this should 3 seconds later');
}
// called after 3 seconds
setTimeout(waitFunction, 3000);
Also, it looks like you’re working with our IFTTT example projects. The code you’re using isn’t likely to have the effect I think you want it to - all you’re doing is setting the triggerEvent value to a different one after x seconds, not actually running the trigger. So the updated value won’t been used until another POST request is received. If you’re trying to run additional events after a delay, you want to instead call checkForTrigger with the event ID you want in setTimeout.
Hi, I’m a beginner in glich and just got my first project to work triggering multiple ifttt triggers. I tried to get this to work but failed. Can you or someone else help a bit more specific on where and how to implement this wait? Maybe you have a full project as example?