How to use Webcore to automate your smart home

The free SmartThings add-on gives you the control you crave

How to become a Webcore pro

As good as Samsung SmartThings is at putting all of your smart home devices into one control system, when you get down to automating your home there are still plenty of restrictions, making it harder to program the more in-depth ways of automatically managing your home.

That’s where Webcore comes in. A free add-on for SmartThings, this powerful system gives you a complete scripting language that lets you control your home exactly the way you want.

Explained: The best smart home ecosystems

Webcore can be a little intimidating for first-time users, but once you get your head around the basics, it’s surprisingly easy to build quite complex automations. In this guide, we’ll help get you started.

How to install Webcore

Webcore isn’t straightforward to install and requires you to access the online Samsung SmartThings IDE backend. From here you can install the main Webcore SmartApp. We recommend following the official Webcore installation instructions, following the GitHub Installation method.

Read the installation instructions carefully, as you need to follow each step. When you get to the section that tells you to use the SmartThings app on your phone, make sure that you’re using the SmartThings Classic app, not the new app. Once Webcore is installed you can use either version of the app, but the installation only works in Classic.

You’ll also be prompted to enter a password for your Webcore system, so make sure you pick something secure and that you make a note of it.

How to use Webcore to automate your smart home

Connecting to your Webcore installation

The easiest way to program Webcore is through a web browser on your computer. Before you can do this, you need some information from the SmartThings app.

For the new app, go to the main menu and select Automations, then tap Webcore. For the SmartThings Classic app, tap Automation at the bottom of the app, then tap Webcore. For both apps, select Register a browser. This will display a four-digit code, which is valid for three minutes.

On a computer, go to dashboard.webcore.co and enter the four-digit code from your app, then click the > symbol. When prompted, enter the password that you created when installing Webcore and you’ll be connected to your system.

Creating your first Webcore Piston

Webcore calls automations Pistons. Each Piston is a set of instructions that tells your smart devices how to operate. We’ll start by creating a very simple Piston that simply turns on a light. Click New Piston, then select Create a blank piston. Enter a name for your Piston that describes what it does, such as ‘Turn on a light’, then click Create.

You’ll see a blank page with two elements written in purple: 'execute' and 'end execute'. The list of instructions that you want to perform go between these two elements. You can see three options. An 'If' block lets you control devices based on the conditions that you set (the if part). An 'Action' block lets you control devices. A 'Timer' block lets you run commands at regular intervals.

We’ll start by controlling a device, so select Add an action. You can now use the device picker to select the devices that you want to control – you can pick as many or as few as you want. For this demonstration, we’re choosing a single Philips Hue bulb, so choose something similar (a smart light or smart plug are both good choices). Click outside the list to remove it from view, then click Add a task, which is a method of control.

How to use Webcore to automate your home

You can select any of the options that start with the word ‘device’. For our Hue colour bulb, the commands include 'Turn off', 'Turn on', 'Set hue', 'Set level', 'Set saturation', 'Set color' and 'Set color temperature'. To keep things simple, we’ve just gone with 'Turn on'. Click outside the list of commands to hide it from view, then click Add. You now have a very simple Piston that will just turn on your lights. Click Save to keep the changes and go to the Piston overview.

How to use Webcore to automate your home

The Piston won’t do anything until it’s run, so click the orange test button. Your light (or other device) should turn on automatically, showing that your Piston is working.

Run a Webcore Piston automatically

So far, we’ve just created a very basic Piston that doesn’t do much unless run manually. The next step is to make a Piston run automatically. Typically, you want a Piston to run when something else happens.

For example, if you’ve got a SmartThings Multipurpose Sensor, you could have a light turn on automatically when it’s opened, or you can use a Timer to have a light turn on automatically at night.

Read this: How to set up and use your Hue lights

We’ll show you how to modify the Piston that you created above. Open it up and click the Edit button, then click add a new statement and choose Add an if. Next, you need to select Add a condition, which specifies when you will run a command. Select the physical device that you want to check – we’ve selected our multipurpose sensor.

Next to the device, you have to use the drop-down menu to select the option that you want. In our case, we’ve selected contact, but the multipurpose sensor can also measure acceleration, orientation and temperature alongside some more complicated options that we won’t go into here.

Next, select the kind of comparison that you want. For this simple Piston, we’re going with the ‘is’ option under Conditions. Then, make sure that you select Value and open under the Compare to heading. This rule says, ‘Check if the multipurpose sensor’s contact sensor is open’. Click Add when you’re done.

We need to select what happens next, which is the ‘then’ section of our 'If' block. In this case, we want the 'Action' that we already chose (turning on the Hue light), although this is currently in the wrong place at the top of the Piston. To move a block around, click the up/down arrow icon at the top of the screen: if you hover over the icon, you’ll see the text, “Allow moving of items by drag & drop.”

Click and hold to the up/down arrows next to the word ‘with’ in the script (this should be line 12) and drag down under the word ‘then’. When you let go, your action will have been moved.

The Piston is now complete and you’ll see that there’s an 'If' part (when the sensor is open), and a 'then' part (turn on the Hue light).

How to use Webcore to automate your home

Click Save, then you can test your Piston by opening your multipurpose sensor (or controlling the device that will trigger the automation to run if you selected a different device).

Taking things further with Webcore Pistons

If you look back at our last Piston, the script has an ‘else’ option. The ‘else’ section runs if the first check fails, and doesn’t require any validation. So, ‘if the multipurpose sensor is open then turn on the Hue light, else turn the Hue light red’. In this case, opening the sensor turns on the light; closing it (or leaving it closed) makes the light turn red.

You can nest 'If' statements, too, giving you multiple checks. For example, ‘If the multipurpose sensor is open, then if the multipurpose sensor’s acceleration is active, turn your Hue light on’. This will only turn on the light if the sensor is open and moving.

If blocks don’t have to use physical devices and you can use system 'Variables' to check for other conditions. For example, you may want to only turn a light on between sunset and sunrise when it’s dark when your multipurpose sensor is open. To do this comparison, you need a second 'If' block in the then section of the first one, where you check the current time to see if you’re after sunset and before sunrise.

To check the time, select the 'What' to compare element as a Virtual device and select Time. Then select the comparison as 'is between' and select 'Variable' then '$sunset', and then select the next option (…and…) as a 'Variable' and choose '$sunrise'.

How to use Webcore to automate your home

The action you want (turning on the light) needs to be moved from the first then section to the then section of your new time comparison 'If' block, so drag and drop it and you should have a script that looks like ours below. Now, save the changes, and the Hue light will now only turn on if the multipurpose sensor is open and the time is after sunset and before sunrise.

How to use Webcore to automate your home

So far, we’ve shown you how the building blocks work, but it’s worth looking at a more complicated Piston, which we use in a garden office that’s fitted with a Yale Conexis Lock, Hue lights (inside and in the garden) and a smart plug that controls power to a Ring Stick Up Cam.

When the smart lock is locked, the Piston automatically turns the lights off in the office, turns the power on to the Ring camera and, if it’s after sunset and before sunrise, and the garden lights aren’t already on, the garden lights are turned on for ten minutes then turned off automatically.

Essential reading: The best smart locks 2019

As you can see from the script below, the first check is to see if the Yale Conexis Lock changes to 'locked', not 'is locked'. That’s an important statement, as the Piston only runs when the Conexis Locks, not when it is already locked. With the former, it’s a one-off action, with the latter, the Piston runs every time the lock is checked and found to be locked.

In all cases, all of the Hue lights in the office are turned off, regardless of the time of day under the assumption that if the door is locked we want the lights off. As SmartThings can occasionally fail to turn all Hue lights off (sometimes the command seems to get lost and a stray bulb remains on), we’ve changed the action to 'Turn off, Wait 2 seconds, Turn off, Turn off'. Repeatedly sending the 'Turn off' command means that we don’t get a situation where one bulb is left on.

Next, we’ve got a separate action, which turns on the Ring camera power. This flicks on the smart plug and the Stick Up Cam boots up and starts monitoring the office. Next, we’ve got a 'Restriction', which you can see by selecting Options > View restrictions. You can only add a restriction after adding a new 'If' block or 'Action' block. 'Restrictions' let Webcore only run a block if a condition is met. You can use an 'If' statement to do the same thing, but a 'Restriction' makes the script a bit easier to read in some cases.

For us, the 'Restriction' is that the rest of the script can only run when the Hue ambiance spot 1 switch is off. This is a bulb that’s in the garden, and our assumption is that if the light is turned on, somebody wanted the garden lights on already, so we don’t want to disrupt that.

When the garden lights are off already, the next check makes sure that the time is between sunset and sunrise. If it is, we turn on all of the Hue lights in the garden (sending the command twice to make sure they come on). Then, we wait 10 minutes, then we send the off command twice to make sure that we don’t have a stray bulb left on. This gives us enough time to leave the office, get inside and have the garden lights turn off automatically.

How to use Webcore to automate your home

We have another Piston that works in a similar way, only it looks for the Yale lock to unlock. Then, the Ring Stick Up Camera has its power cut (we don’t want to record ourselves working), and the lights are turned on in the office, provided that it’s between sunset and sunrise.

Webcore has some even more complicated options, including waiting a set time after there’s no movement to perform an action, and even querying the TWC Weather Service, so that you can perform actions based on the predicted weather at your home. The main thing is to experiment. Luckily, the Webcore Community Forum has plenty of people that can help, plus example Pistons.

TAGGED   smart home

Recent stories

smart home Xbox One 4K essential guide: How to play 4K movies and games on the console
amazon How to link and use your calendar with Alexa
smart home The Week in Smart Home: Alexa gets game and Eve finds its range

What do you think?

Reply to
Your comment