Scripting Custom Google Home Routines

Continuing the discussion from Hey, Google… When I come home after dark, turn on the flood lights:

I’d love to know if anyone else has tried their hand at writing Google Home Routine scripts, and if so, what you’ve come up with.

Just for reference, Google’s Documentation is at this link: Write scripted automations with the script editor - Google Nest Help
Here are the steps again that I used to get started with these custom routines and get some help from their AI Script Writer Assistant:

  1. On a computer, go to home.google.com , while signed into the Google account you have associated with your Google Home.
  2. Click Automations on the left
    image
  3. You’ll see a list of your current automation. Click Add new in the lower right-hand corner.
    image
    (You may be prompted to join Public Preview)
  4. On the right-hand side, enter a prompt for AI to turn into a script. Just type what you want Google Assistant to do, using natural language.

I shared my first example as a solution to my wish for my floodlights to come on any time I came home after dark. That one has been serving me well.

Here’s my latest problem-solving routine:
Problem: When I charge my Google Nest Camera, it doesn’t indicate the charging status. I have no way to know when the battery is full, except to walk outside and either stare at the camera to try to determine if the charging light is still blinking, or unplug the camera from the charger, and check the app.

Solution: Write a custom routine that notifies me when the camera battery status is “Full”.

metadata:
  name: Camera Charged
  description: Notifies when the driveway camera's battery is charged
automations:
  - starters:
      - type: device.state.EnergyStorage # The state of an energy storage device such as a battery, including the amount of energy it is storing, whether or not it is charging, and whether or not it is plugged in.
        device: Driveway camera - Driveway
        state: descriptiveCapacityRemaining
        is: FULL
    actions:
      - type: home.command.Notification
        title: Battery is full
        body: Camera battery is full
1 Like

I gave it a try, but I still am unable to turn the lights on after dusk for five minutes when the camera detects a person in zone 1. It’s getting closer, but still a ways to go.

Thank you, @southpaw, for starting this topic and asking the scripting question. Despite my inclination to appreciate tech stuff, our house has yet to significantly benefit from the new “Smart” gadgets. A grand total of one device, chosen mainly to monitor electricity consumption of our little hot tub.

But once a few other household Projects get done (or shelved) adding more switches, dimmers, monitors, things will certainly happen. One excuse for procrastination is wishing for more availability compatible with Mater. Should happen soon, right?

My son works in corporate cybersecurity, so was therefore interested when he started automating his home. He chose Home Assistant Green: Home Assistant Green - Home Assistant

1 Like

Here is a screenshot of the Star Trek themed interface posted on github: Star Trek LCARS Theme - Themes - Home Assistant Community

Good to see someone else using Home Assistant (HA) … this is what my wife, the current technology expert in my life chose and is using. In an attempt to keep up with her I dug into the available doc … I was very impressed. She implemented ours before HA team came out with thier own server.

  • Perhaps @rolandh could consider adding a new Category ie ‘Home Automation’ where the subject could be discussed
2 Likes

Interesting idea… would we then want a category for Telecom, as well?

For now, feel free to discuss in General, and as we start to see trends, perhaps we can think about new categories. Or perhaps tags (which can also be “followed”). (Related)

1 Like