Limiting IFTTT applets to run every hour

Sometimes you want an IFTTT applet to only run once every hour, but this can be tricky when there’s only one condition available in the applet. Paired with SEQUEmatic, you can limit your IFTTT to run only once per hour (or day or any other frequency you’d like)!

We’ve built a shared sequence to help get you started, so click this link and import it into your account. Then, we’ll take a look below at what this sequence does as well as the settings you need in IFTTT to make it work.

How the sequence works

Let’s run through the sequence step by step:

This sequence will limit an IFTTT applet to run only once in an hour
  1. The sequence is triggered by the IFTTT webhook service (you’ll need the URL from this trigger when setting up the IFTTT applet futher below)
  2. It checks the variable ran_within_hour and only continues if it is false (ie it didn’t run in the last hour)
  3. It then makes a call back to IFTTT via a webhook to trigger the rest of the IFTTT applet
  4. The variable ran_within_hour is set to true so that the condition in step 2 will fail if the applet fires again in the next hour
  5. It will pause for 1 hour (you can adjust this to any other duration you wish)
  6. Finally ran_within_hour is reset to false so that if the applet is triggered again the sequence can run

To get this running, you will need to create two IFTTT applets which are described below.

The IFTTT applets

You probably already have a working IFTTT applet and this is what you’re wanting to limit to once an hour. We’re going to break that applet into two separate applets, with the SEQUEmatic sequence in between.

SEQUEmatic can be added in between two IFTTT applets to limit it to run once in an hour

The IF THIS applet

Your IF THIS applet can have any type of trigger. In this example we’re going to use the location applet when I enter a certain area. The important part here is the THEN THAT component which will use the webhook service to make a web request. When setting up the web request you only need to provide the URL. This should be copied from the trigger step in your SEQUEmatic sequence. Leave everything else with the default settings. You can view the full applet here.

Use the webhook service for the THEN THAT component

The THEN THAT applet

You will need to create a second applet to take care of the THEN THAT component. Here the trigger should be the webhook service when it receives a web request. The event name should match the event name in step 3 of the sequence. In our example this was trigger_event. You can use any meaningful name here, as long as it matches in both IFTTT and SEQUEmatic.

For the action you can use any other IFTTT service – this would be the THEN THAT step from your original applet. I’m going to have it turn on my Philips Hue balcony light. You can view the full applet here.

Finishing up

That’s just about it. Be sure to enable both your IFTTT applets as well as the SEQUEmatic sequence. If you haven’t used IFTTT with your SEQUEmatic account before then you’ll also need to set up your IFTTT key in your account settings. You can read more about this here.

Finally, if you want to use this for multiple IFTTT applets, you will need to use a different variable name otherwise the sequences will interfere with one another. You can just duplicate your sequence, or import the template again, and modify the variable ran_within_hour in steps 2, 4 and 6 to any other variable name.

If you have any questions, post in the Q&A forum, leave a message in the comments below or contact me directly. Happy automating!

Limit IFTTT applet to a certain time of day

Limit IFTTT applet to a certain time of day

IFTTT applets can be really powerful in automating your home, but sometimes you want them to run only during a certain time of day. Yes, you could enable and disable the applet throughout the day, but that seems to defeat the purpose of automation. Using SEQUEmatic, you can limit the time that your IFTTT applet runs so it only triggers during a certain timeframe or perhaps only at night or during the day. Read on to learn how.

The sequence itself is quite straightforward, and to help get you started you can import this shared sequence into your SEQUEmatic account. Here’s a screenshot of what it looks like.

Breaking this down, here’s what the sequence does:

  • First, it’s triggered by an IFTTT webhook call. Take note of the URL provided here as you will need this when setting up your IFTTT applet.
  • Then, it checks if the time is between 6pm and 10pm on any day of the week. You could modify this to a particular day, and also any time during that day. Or, maybe you want it to run only after dark or if it’s during daylight.
  • If this condition is met, then it makes a call back to IFTTT to trigger your device. You even have the option of adding multiple steps here so that more than one device can fire.

Let’s go through what is required in IFTTT to make this work. In this example, I want my Philips Hue lights to turn on when I arrive home but only between 6pm and 10pm.

The IFTTT trigger

To trigger the sequence, I need to create an IFTTT applet which is triggered by location and then uses the webhook service to run my SEQUEmatic sequence.

In the IF THIS component, select the location service and set the location you need to enter.

Set up a location trigger when you enter an area

In the THEN THAT component you select the webhook service and populate the URL field with the URL provided in the trigger step of your SEQUEmatic sequence. Apart from the URL, you can leave the other settings with their default values.

The action will be a call via the IFTTT webhooks service

That’s all there is to the IFTTT trigger applet. You can view the full applet here.

The IFTTT applet to control your devices

The final piece you need in IFTTT is an applet which will control your device. SEQUEmatic will trigger this applet if the time conditions are met.

In the IF THIS component, select the webhook service to receive a webhook request. The event name should match the name provided in your SEQUEmatic sequence. In this example it was named trigger_device.

Etner the event name you used in your SEQUEmatic sequence

In the THEN THAT component, select whatever service you want to run. In my example I want my Philips Hue lights to be turned on as you can see in the screenshot below.

My applet will turn on the balcony lights

And that is all you need. Your applet here might look quite different depending on which service you trigger, however if you’d like to look at the full applet you can find it here.

Wrap-up

In summary, what you’ve now created is:

  • An IFTTT applet to trigger a SEQUEmatic sequence when a particular event occurs (eg entering an area)
  • A SEQEUmatic sequence which checks the time of day
  • Another IFTTT applet which is triggered by SEQUEmatic if the time conditions are met

Hopefully this has been helpful in getting you started, and you can now modify and expand on this set up for your own scenario.

As always, if you have any questions post in the Q&A forum, leave a message in the comments below or contact me directly. Also, if you’ve found this helpful share your use case in the comments!

How to connect IFTTT to Tuya Smart Life

How to connect IFTTT to Tuya Smart Life

With the recent shutdown of the Tuya Smart Life service on IFTTT, many people are left wondering how to integrate their Tuya Smart Life devices with other smart devices around the home.

SEQUEmatic now supports direct integration with Tuya Smart Life. Combined with the IFTTT webhook service, SEQUEmatic can bridge that gap! Read on to learn how.

Link your Tuya account

First, you need to link your SEQUEmatic account to Tuya. Navigate to your settings page and click the Linked Services button.

Next, click Link account next to the description of the Tuya Smart Life service.

You will be redirected to the secure Tuya Smart Life login page, where you should login with your Tuya credentials.

Tuya will explain what it means to link your account, then you will need to click Confirm authorization to complete linking.

Once linking is complete, you will be redirected back to the Linked services page. You’ll notice the link which previous read Link account now reads Unlink account, confirming your account was successfully linked.

If you ever wish to disconnect your Tuya account from SEQUEmatic, you should return to this page and click the Unlink account link.

Create your sequence

If all you want to do is hook a service from IFTTT into your Tuya Smart Life device, then the SEQUEmatic sequence is very simple. However, if you’re new to SEQUEmatic I’d encourage you to explore the other step types and see what else you can achieve. Sequences can be very powerful and you might be able to create an even better home automation than you had before!

Anyway, the sequence you need will look like this. You can also view this here in the shared sequence library.

Let’s go through this step by step. First you should select the IFTTT webhook trigger. Enter anything for the event name, as long as it’s meaningful to you. Leave all the parameter fields blank. Here’s what I used in the sample sequence:

Then, you just need one other step which is the Tuya Smart Life step. I’ve chosen a single device, but you could also use a device group or scene. Select the action you want to perform or the property to modify as well as the new value, and that’s it! Here’s the step I created in the sample sequence.

While you’re here, if you want multiple Tuya Smart Life devices to be triggered, you can add any number of Tuya Smart Life steps to the sequence.

The IFTTT applet

Next head to IFTTT and create a new applet. The trigger, or if this component, should be the other smart device which should cause your Tuya Smart Life device to be triggered. In this example I’m using an eWeLink plug. Set up the trigger as you need, and then click next to create your action.

The action, or then that component, will use the webhooks service. There’s only one action available in this service, the make a web request action.

The only field you need to set in this action is the URL field. Head back to the SEQUEmatic sequence, and copy the URL provide in the trigger. Once copied, paste it into IFTTT.

Copy the URL highlighted here
Then paste it into this part of the IFTTT webhook service

Click through to save the applet, and your finished product should look something like this.

Now, when the other device (in this example the eWeLink plug called water feature) fires, it will make a webhook call to SEQUEmatic and trigger the sequence. The SEQUEmatic sequence will then control your Tuya Smart Life device!

If you have any questions getting set up, head over to the Q&A forums, post in the comments below or contact me here.

Incorporating the weather in your sequences

UPDATE: Weather has now been built directly into SEQUEmatic, so there is no need to make use of an external service any more. You can use it as a condition or a trigger. It is recommended you use the built in weather functionality rather than following this guide.

A couple of weeks ago we added a new option in the variable value condition which allows you to check if a variable contains a particular value. This can be useful if you have variables which hold a string of text and there’s something in particular you’re looking for in that text, without it needing to be an exact match.

One example a user came up with for this was to use the Weather Underground service at IFTTT to pull the current weather into their sequences. The set up is quite simple, and can allow you to add some handy conditions to your sequences.

Accessing parameters from a webhook call

Let’s get started by setting up the sequence in SEQUEmatic. There’s a handy feature which allows you to access values from webhook parameters directly in your sequence. All you have to do is enclose the parameter names in curly brackets like this – {weather_conditions}.

Firstly, add the IFTTT webhook trigger to your sequence. For any parameters you want to access in your sequence, you should specify their names in the step. In the example below we will be passing the current weather condition in the first parameter and the current temperature in the second parameter.

With this configuration, you can access the value of those two parameters when updating a variable or checking a condition by referencing them as {weather_condition} or {temperature}. Note that these values are only available for the current sequence, so to use them in other sequences you should store them in one of your SEQUEmatic variables.

You can do this easily using the change variable step as follows. Add a step to change a variable. Set a name for your variable, such as temp, and then set the change to ={temperature}. If we break this down, the = sign tells SEQUEmatic to set the value of the variable and {temperature} will take the value passed in the second parameter from IFTTT.

You can add another step to capture the weather conditions as well. Overall your sequence should look something like this.

With the weather conditions now stored safely in your variables, you can reference them in any other sequence using the variable names! Here’s an example of what you might see in your variable page after the sequence has run:

Setting up the IFTTT applet

The final step to get this working is to put the correct URL in the IFTTT applet. Firstly, take the URL provided in the first step of your sequence. In our example this is:

http://sequematic.com/trigger-ifttt-webhook/ABCDEFGHIJK/12345/forecast

And now you need to add IFTTT ingredients for the two parameters. Parameters should be added on the end of the URL, separated by a forward slash / . So, to pass the current conditions and current temperature, your URL would look like this:

http://sequematic.com/trigger-ifttt-webhook/ABCDEFGHIJK/12345/forecast/{{CurrentCondition}}/ {{CurrentTempCelsius}}

You can view the full IFTTT applet below. Just click the thumbnail to view the full image.

Using the contains condition

Now you have this set up, how can you build the weather into your sequences?

An example of a comparison might be that if it’s cloudy then you want to open your blinds. There are many different weather conditions which can come from the Weather Underground service, so it may not always be cloudy, but instead something like partly cloudy. Using the contains feature we mentioned at the start of this post you can cover all the different cloudy variations. Here’s what your sequence might look like:

Every day at sunrise this sequence will check if it’s cloudy and then either open or close the blinds

If you have any questions setting up the sequence and IFTTT applet, or some ideas on how to use it differently, please post in the comments below!

The SEQUEmatic bot is still new and learning. If you don't get the answer you need, just ask to speak with Derek and your chat will be transferred.