May 2020 updates

I’m pleased to let you know of a number of enhancements which were made to SEQUEmatic this month. These include:

  • Improved performance on the sequences page, reducing the page load time from several seconds to under one second
  • New features on the sequence log page allowing you to view all sequence log entries, as well as filter and sort
  • Updates to the toggle variable webhook to also recognise yes/no and on/off
  • Enhancements to the custom webhook trigger allowing you to access variables at any level of the JSON structure
  • Improved UI on the edit sequence page, collapsing the action buttons under a mini menu

More to come!

And there are further enhancements planned throughout the month of June including additional log details for custom webhook triggers and a number of UI enhancements to make it even easier to create and edit your sequences.

As always, if you have any feedback please comment below, post in the Q&A forum or contact me here.

Shared sequences

Have you created an amazingly useful sequence that you want to share with others? Well now you can!

Simply navigate to the edit sequence page and scroll down to the share sequence button at the bottom of the page.

Shared sequences are then available to others in the shared sequences page.

If you want to import a sequence into your account, browse the shared sequences and once you’ve found one you like click the import sequence button at the bottom of the page to copy it into your account.

Do you need help creating a particular sequence? Post in the comments below or in the Q&A Forum and I’ll create a shared sequence to help get you started.

Incorporating the weather in your sequences

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!

Custom webhook trigger

Based on user feedback, we recently introduced a new trigger – the custom webhook trigger.

The request

The initial question we were asked was whether it is possible to use SEQUEmatic to control lights based on playback status of the Emby media server. When a video is started or stopped on the Emby media server there is an option to trigger a webhook call. Unfortunately the existing IFTTT webhook trigger couldn’t support the data coming from Emby, and so we embarked on creating a new custom webhook trigger.

How does it work?

The new custom webhook trigger currently supports 3 schemas, or data structures. The first is the same as the existing IFTTT webhook trigger and can receive up to 4 parameters in the URL.

The second handles a data passed in a JSON POST request. This means you could send data such as the following:

{
  "Name":"Harry",
  "School":"Hogwarts",
  "House":"Gryffindor"
}

As with the existing webhook trigger, you can access the value of these parameters in your sequence by enclosing the parameter name in curly brackets. For example, using {School} in a change variable step would return the value Hogwarts.

The third schema is similar to this, however it expects the JSON payload to be passed as a field named data in an HTTP POST request. It is this format which is specific to Emby.

How can my media server control my lights?

To achieve this, you need to use custom webhook Schema 3, and add the URL of the custom webhook trigger in your Emby media server set up.

When the playback status of the media server changes, for example is stopped, it triggers a call to the webhook and passes data in the following format:

{
  "Event":"playback.stop",
  .....
  .....
}

There is additional data in the request, however it is the Event which is useful here. You can simply add a condition to check if {Event} = playback.stop and then within that condition add any other steps you require, such as an IFTTT webhook call to control your lights.

Eric, who requested the feature, has posted a more detailed write up here on the Emby forums.

If you have any question, just post here in the comments or in the Q&A forums. And if you have set up something similar yourself, let me know how you’re using it in the comments below!

Update to display of If…Else…End if

Based on your feedback, I’ve recently updated the way conditions are presented in the UI. Gone are the days of trying to work out which IF that ELSE belonged to!

Condition blocks are now shaded and colour coded so you can easily identify where each condition ends. In the example below you can see the ppl_at_home > 0 condition is shaded in light purple. It’s quite easy to see that the last end of condition belongs with this condition.

The IF statement relating to ppl_at_home = 0 is a darker shade of purple so it’s clear the darker purple else and end of condition belong with it.

For those of you who are building more complex sequences, hopefully this makes it easier to follow through the logic.

As always, if you have any other feedback or suggestions for improvements just leave a comment here, post in the Q&A forum or contact me here.

Welcome

Welcome to the SEQUEmatic blog. I’ll be using this blog to share news and updates to SEQUEmatic and also walkthrough some examples of how you get use SEQUEmatic to get the most out of your home automation.

The blog is still under construction, but will be up and running shortly with more content so please check back soon!

If there’s something you’d like to learn about, just leave a question in the comments below or contact me and I’ll do my best to address your question in a future post.