google home script editor web help me script

Rita El Khoury / Android Authority

TL;DR

  • Google Home’s web script editor is getting a new “Help me script” feature.
  • The generative AI feature creates all the code for you from scratch when you tell it what routine you want.
  • It’s currently rolling out as an experimental feature in Public Preview on Google Home web.

The Google Home script editor has been out for a few months now, but I haven’t dared touch it with a ten-foot pole despite my love of smart home automations and routines. The extent of my coding abilities can be resumed in “I understand a bit of HTML” so you can imagine that I’ve been reticent to mess with YAML, ruin my existing smart home setup, and interfere with existing automations from my Philips Hue lights, Tado thermostats, and other smart home devices.

But during its Pixel fall event, Google also announced a bunch of new generative AI capabilities coming to its services, including a new “Help me script” feature to help semi-nerdy people like me write script code from scratch. This is now beginning to roll out and I went hands-on with it.

How to get “Help me script” in Google Home

google home web script editor help me script 4

Rita El Khoury / Android Authority

After a month’s wait, Google says that “Help me script” is rolling out starting today, November 7, as a “limited-time experimental feature in Public Preview” in the web interface for Google Home. All the automations you create with it will still be accessible in the mobile app but as view-only.

To enable it, you should go to home.google.com and log in with your Google account. Click the blue + Add new button on the bottom right, and then Try it below the Help me script column on the right. Read the terms and conditions then click I agree (and optionally agree to let Google use your interactions to improve its AI models), and you’re good.

From now on, each time the script editor is open, the script helper will show up in the rightmost column, ready to answer your prompts with all the necessary code.

Script help is a great start if you don’t know what you’re doing

I’ve had access to the generative AI script helper in Google Home for a couple of days now. In my experience, it can get you 80% of the way to a functioning script, but it still makes mistakes and messes up simple commands or device names. In a way, it’s quite reminiscent of Google Bard: the answers look absolutely perfect until you really look at them and discover some obvious cracks. But this is still an experimental feature, so we’ve all already been warned. Just don’t go in expecting perfect code and you’ll be good.

When I’m away, remind me that I should vacuum

The first command I asked for is something I’ve wanted to automate for years now. I have a Roborock S7 MaxV Ultra vacuum ($1399 at Amazon) that I often want to start when I’m away from home but I always forget to do it. Like 19 times out of 20. Then I come back home and I’m annoyed at the dirty floors. Since I work from home and don’t have a preset away schedule, scheduling a routine is pretty challenging. Really, I just want a notification that reminds me, “Hey, you’re away, do you want to vacuum?” The default Google Home mobile app’s Away routine can’t control anything besides lights — no vacuum, no notification — so scripts it is.

google home web script editor help me script 5

Rita El Khoury / Android Authority

I told the script generator what I wanted and it gave me the code in an instant. A quick glance, though, reveals that it chose the action of starting the vacuum (which isn’t something I want to do every time I’m away) instead of sending me a notification to ask if I wanted that. I had no idea if the script generator supports notifications, so I reformulated it with a less confusing notification request.

google home web script editor help me script 7

Rita El Khoury / Android Authority

This time, it got the notification code right. So all I had to do was edit some of the text to make it work for me. I renamed the script, clarified the description, picked the exact notification text I wanted, and added myself as the recipient of the notification. I tested it out and voilà! Now, each time Google Home detects that the apartment is empty, it’ll surface a notification to remind me about starting the vacuum. Ideally, I’d want a button that opens the Roborock app so I can pick the mop or vacuum mode (something I can’t do with Google Home), but for now, this solves 90% of my forgetfulness problem.

google home script notification vacuum away mode

Rita El Khoury / Android Authority

The code wasn’t foolproof, but it got me 80% there without me knowing how to write the script, which parameters were required, and even whether or not I could send notifications or expand the home/away functionality. I didn’t have to read the documentation to get those parts right.

Turn on the ambiance lights when I watch sports on my TV

Whenever I open the RMC Sports app on my Xiaomi TV, it means that I’m watching sports — usually football (the real one). I want my Hue Play lights to turn on behind the TV and my living room’s Nanoleaf Canvas on as well, with the regular light dimmed out. But again, since there’s no automation, I often get lazy and don’t do it. A perfect waste of smart lights.

Sometimes, you have to use multiple prompts and piece the code together.

It took a bit of trial and error to get the right code for this automation, but it finally worked. I had to rephrase my request a few times and piece together the bits of code it got right each time (condition, opening the right app on the TV, different lights dimmed versus on), but here’s the result.

google home web script editor help me script 13

Rita El Khoury / Android Authority

Beware of the wrong commands and device names

As I was testing out different scripts and commands, I came across several instances where the generated code had errors, and ones that Google should’ve honestly gotten right. When you try to Validate the code (bottom left), before saving it, you’ll see all the errors and will have to troubleshoot your way through them.

Mistaken command codes

google home web script editor help me script 8

Rita El Khoury / Android Authority

In this first instance above, I asked the script writer to write me a command that plays music on a Nest speaker (i.e. issue a Google Assistant “play some music” command) when I turn on the lights during a specific time interval. It got almost everything right, except the command type: device.command.OkGoogle. After reading the interminable error pop-up, I realized the available correct type is assistant.command.OkGoogle. Switching to that fixed the error.

google home web script editor help me script 9

Rita El Khoury / Android Authority

Mistaken device names and attributes

google home web script editor help me script 10

Rita El Khoury / Android Authority

In this other example, the script generator gave me an invalid device name. After looking at it for a while, I realized it had doubled up the name of the device Levoit Levoit Air Purifier instead of Levoit Air Purifier. Since Google knows my devices’ names (as evidenced by the pop-up), it shouldn’t put the wrong ones in the code it generates.

google home web script editor help me script 11

Rita El Khoury / Android Authority

The same goes for the air purifier’s speed. I’d specified I wanted it set to 3 in my prompt, but the code decided it’ll set it to speed_high, which is not supported. The error pop-up told me three is a valid choice, so I just replaced it. And ta-da! The automation works!

google home web script editor help me script 14

Rita El Khoury / Android Authority

“Help me script” is the gateway to Google’s powerful smart home script editor

google home web script editor new

Rita El Khoury / Android Authority

Look, I’m under no illusion that this script generator is perfect in its current experimental phase. A couple of days of tinkering have already revealed to me many of its shortcomings, but I still consider that as a net positive because I did spend a couple of days tinkering with it.

The script generator is a net positive. I spent hours tinkering with automations I never would’ve tried on my own.

Without the script generator, I don’t think I would’ve ever “wasted” hours trying to understand how to write commands in YAML and learning all the capabilities of the feature. I was just an excellent gateway for me to get into script writing and start discovering all the powerful things I can set up. Features and conditions that are nowhere near accessible in the regular Routines feature of the Google Home app suddenly become an open playground.

I now know I can set up much more powerful home and away modes, notifications when things happen, intricate and/or/not conditions for each trigger, multiple actions with delays, and automations between devices from different brands that normally don’t speak to each other. That’s much more than I thought was possible, and it’s all a couple of prompts away.

Just make it better, Google, before releasing it to the public, and skip all these erroneous device names and commands.

Source link