Google Home Script Editor

June 13, 2023
197 views

As it continues to bolster its smart home experience, the Google Home app is adding support for a “Script Editor” that supports more advanced automation routines. The functionality is rolling out this week, and we’ve had an early chance to try it out.

Google Home automations are getting supercharged

As it stands today, Google Home automations, also called “routines,” can do a lot. You can set voice commands to perform a series of actions or even use a sensor or device to trigger actions on another device.

There’s a lot you can already do, but in theory, there’s potential for much more. That’s the point of the Script Editor for Google Home, which starts rolling out today.

The Script Editor allows users to create custom automations that are built using guided code. You can create automations that use starters, conditions, and actions, and the possibilities here are huge. Google suggests a few use cases, including:

Scheduling lighting to turn on at multiple times of day

Flash lights when a sensor detects carbon monoxide

Turn on an air purifier at maximum fan speed when poor air quality is detected by a sensor

Turn on a light when a door is unlocked but only at night

The difference between what the Script Editor can do versus traditional Google Home routines is the use of additional context. You can set conditions to ensure the routine only works in certain scenarios. Further, you can use more than one starter for the same routine. Really, this just lets you be far more specific with what the entire automation can do.

How the Google Home Script Editor works

To create a new automation on the Google Home Script Editor, you’ll first need access – Google is rolling this out soon, as mentioned, but only on the web at first. The mobile app will get support starting June 14, but only in Public Preview.

Once you have access, adding a new routine will trigger the interface seen below. There, Google offers an explanation of what you need to do, but here’s the short version.

Set a title and description for your automation

Pick a starter device or event – This can include virtually any device or a Google Assistant command.

Set a condition – This can include the time of day, the status of another device, and more.

Pick an action – This is ultimately what you want the automation to do (i.e., turn on a light).

This is what the Script Editor looks like when you first use it.

The Script Editor will automatically fill in possible starters, conditions, and actions based on devices in your home. These aren’t named in a particularly user-friendly way, but you can typically get the context. The only note I really have is that there’s no clear explanation for some things. For instance, in the example below, I wasn’t sure if I should use relative or absolute brightness, and there was no explanation available.

One of the first examples I tried was an automation that could turn on the light strip behind my living room TV automatically when it gets dark in that room and the TV is in use.

To do this, I set up a script that uses the state of my Philips Hue Sync Box (connected to my TV) as the starter. If any of my TV devices (Chromecast, Switch, etc.) turn on, the light strip will turn on. However, it will only do so if the time of day is before sunrise or a few hours before sunset. Since my house’s position leaves my living room a bit starved of natural light a few hours before sunset, I left a 3-hour window, and by tying that to the sunset, this should work year-round as the days get longer or shorter.

You can clean up the code to remove Google’s memos – grey text is safe to remove.

Simply put, nothing like this is remotely possible in the Google Home app’s existing automation editor. I would have a single starter and no conditions. Don’t get me wrong, you can do some impressive things in existing automations, but the Script Editor takes that to the next level.

But, at the same time, it took much longer to create this automation than anything I’ve ever done in the Home app. That’s the trade-off: more flexibility and functionality for more complexity. Notably, too, you can edit these automations from the mobile app if you need to, but it’s certainly way easier on the web. Google also has a “validate” button that will let you ensure that the code actually works.

To assist users in getting started and show what this system is capable of, Google has a list of examples that you can try in its developer center. You can simply copy and paste the pre-built automations into the Script Editor and tweak them to fit your needs.

Google could also really build on this with time. The ability to send alerts to your phone or a Nest Hub, to use Familiar Faces as starters for personalized automations, etc. The possibilities are truly endless, and I’m excited – and overwhelmed – about what this will open up with time and more experimenting.

More on Google Home:

Source: 9to5Google