Google Home’s new script editor will let users create powerful custom automations

A new way to customize automations in your home if you’ve got some coding skills.

Google Home settings, devices, and menu system

Source: Google

Today, Google announced a new script editor for Google Home on web and also the Google Home Public Preview app. As far as what this means, users will now be able to harness the power of a scripting tool to bring powerful automations to smart home projects.

The new script editor will require some basic coding skills, but those that can take advantage will be able to construct and roll out advanced automation that will be able to control devices in their home, office, or other locations. The script editor will provide close to 100 starters and actions, giving users some ideas to build on. Google provides an example of a custom automation, like being able to play a particular song whenever motion is detected by a specific sensor or having the lights turn if you arrive home at a certain time.

The Google Home Public Preview went live late last year, and since then, many new additions have found their way into the app. Perhaps one of the most important things about the app is its new layout, featuring five new tabs: Favorites, Devices, Automations, Activity, and Settings, giving users easier access to some of the app’s most important features. Since its revamp, Google has been receiving feedback from users and has made changes like giving users the ability to reorder favorites while also improving the speed and performance of cameras shown in the app.

Google recently showed off the app during Google I/O 2023, finally releasing the new interpretation to the public. The company also showed off some improvements coming to the Google Home app on wearables, delivering more information at a glance. If interested, you can now download the updated Google Home app. But if you want to get an early look at some upcoming features and changes, like the new script editor, you’ll need to enroll in the Public Preview.

How Google Home’s Script Editor works

google-home-script-editor-light

This section is written by XDA’s Lead Technical Editor Adam Conway.

If you’re writing scripts in Google Home’s script editor, it helps to have some kind of previous programming experience. It makes use of YAML (“Yet Another Markup Language”, or “YAML Ain’t Markup Language”, depending on who you ask) which is conventionally used as a data serialization format. In the above example I have shown, I combine device presence (captured from my Google Home Hub and my smartphone) to turn on my bedroom light and a lava lamp when I return home between sunset and sunrise. It’s a great way to boost the ambient computing capabilities of your smart home.

When writing a script, you’ll need to think of what devices you want to automate, what event should occur to trigger your automation, what actions need to be performed, and if there are any edge cases. There are a lot of things that you can do with the script editor, and it will try to help you along as much as possible. For example, it will give you device names when you’re filling fields that take them, and it will warn you of any potential snags you may run into. The included “Validate” function will also try to tell you if your script will work or not.

YAML has often been used for writing configuration files, making it an interesting choice to use as a scripting language. In a sense, it’s essentially a configuration file defining conditions and actions for smart devices in your home. Always try to be careful of the scripts you write though, as you’ll need to make sure that you account for edge cases when working with certain devices. For example, automation with a lava lamp could go awry and turn it on when you’re not looking, so always try to test for edge cases and know what you’re doing.

Sign up for the Google Home script editor preview

You can sign up for the Preview by heading to the app’s settings menu and selecting the Public Preview option. Once accepted, you’ll receive a notification, and from here, you should see an icon that looks like a flask. For more details, you can follow the detailed instructions here.