How to create scripts to control your smart devices

Google Home has a new script editor that unlocks the full power of automation.Google Home was the name of Google’s smart speaker until they began to be called Google Nest , by which time the name has stuck to the Google app that controls all compatible smart devices .

The Google Home app is available for Android phones and tablets, for iPhone , on Wear OS and we’ll probably see it soon on Android Auto . It also recently released a web version in tests that is improving little by little. The last addition is very interesting: a script editor .

Google Home also lives on the web

Google wants us to use its home automation ecosystem and to make sure it needs the app with which it is managed, Google Home, to be accessible everywhere. The final frontier is the web version of Google Home , which can be accessed via the home.google.com website .

The Google Home website is officially in public beta , which means it’s still getting better little by little. At its launch it only let us see the cameras of the Nest brand and little else, but now we can already consult the personal routines and launch them.

This means that, although we are not yet going to find a list with our devices and their buttons to interact with them, we can indirectly interact through a routine . We can’t turn on the bulb, but we can reproduce a routine that turns the bulb on.

What’s more, from the outset what we are going to see on the Google Home website is a list with the routines that we create on the mobile . These routines cannot be edited from the web -you will have to do it with your mobile- and they are shown separately from the new routines -or scripts- that we are going to create next.

The Google Home Script Editor

The best thing about having a smart home is that it is smart, or at least that some tasks are automated in some way. At the moment the way to do this in Google Home is through routines that can be created in the application , but it is neither very easy nor powerful.

11 little-known tricks to get the most out of your Google Home speaker

That is, be prepared to do a lot of button presses, menus, and submenus to do something simple, even though it’s something that could surely be described in a few lines in a script if only Google would let us. And luckily, he leaves us.

The creation of routines on the mobile needs a lot of patience

This is where the new Google Home web script editor comes in, with which we can also create routines, but without pressing a single button: writing a script . This way of doing it will attract some and scare others, but the latter should not worry too much: it is easier and more intuitive than it seems.

We can create a new scripted routine by clicking Add New , which will open a text editor with a template ready for us to adapt to configure our script. The vast majority of the template are comments, and the fact is that the essential lines of our routine are just a few.

The template comments are enough to create a simple routine, but feel free to consult the official documentation for a list of all supported triggers, conditions, and actions, as well as the parameters for each. Of course, first you will need to know what each thing is :

  • Metadata:here you will have to indicate the name of the routine you are creating (in name ) and its description (in description ). You can write whatever you want, these descriptions are for yourself.
  • Triggers:These are the triggers that trigger the routine to start. For example, it may be that it is a certain time or when we say something to the Google Assistant.
  • Conditions:This is optional and serves as constraints to determine if the action is executed or not. For example, a condition might be that the routine does not run on weekends or when we are away from home.
  • Actions:It is the most important part, since it is the action itself that is carried out, such as turning on the TV, playing a song or having the Assistant answer us, to name a few.

With this in mind, the only thing left to do is add the text in the script editor and, optionally, delete the comments. Best of all, the script editor gives us a hand with an autocompletion every time we place the typing cursor next to a type: , which is something like the component involved.

For example, to make the routine run when we say “Hello” to the Google Assistant , we have to go to the starters part and choose assistant.event.OkGoogle in the type dropdown list (you can also write it). This adds its parameters to the editor, which in this case are “eventData” (query) and “is”, which is the value of the question. That is where we have to write the “Hello”. We would be like this:

A simple script with a custom Wizard response

Since our routine is simple, it has no conditions, but it obviously does require an action . Since we are looking for the Assistant to respond to us, we have chosen the assistant.command.Broadcast type action , which is what makes the Assistant repeat the text that we give it. It has two parameters: message is the text we want it to say, and devices indicates where we want it, like on our Google Home speaker.

By pressing Save , the routine is saved and activated and although we will not see it -for now, at least- in the mobile app, it will appear mentioned if we say the magic word that is its trigger by speaking to the Google Assistant on the mobile . In our case, “Hello, Google.”

With our simple script, seconds later the smart home speaker responds to us with the text that we wrote in the script and it is considered complete. The routine we have created is very simple, but being able to create and modify it as a script is much more powerful and somewhat quicker than having to fight through the routine creation menus in the app.

Both the scripting and the web version of Google Home are in beta . We hope the experiment goes well and Google takes it seriously to make it the ultimate smart home automation tool we deserve.

 

 

by Abdullah Sam
I’m a teacher, researcher and writer. I write about study subjects to improve the learning of college and university students. I write top Quality study notes Mostly, Tech, Games, Education, And Solutions/Tips and Tricks. I am a person who helps students to acquire knowledge, competence or virtue.

Leave a Comment