# Scripting Custom Google Home Routines

**URL:** <https://forums.rwusers.com/t/scripting-custom-google-home-routines/898>\
**Category:** General\
**Created:** [June 8, 2024, 3:24am UTC](https://forums.rwusers.com/t/scripting-custom-google-home-routines/898 "2024-06-08T03:24:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![southpaw](https://forums.rwusers.com/user_avatar/forums.rwusers.com/southpaw/32/6_2.png) [@southpaw](https://forums.rwusers.com/u/southpaw)\
**Post date:** [June 8, 2024, 3:24am UTC](https://forums.rwusers.com/t/scripting-custom-google-home-routines/898/1 "2024-06-08T03:24:47Z")

</div>

Continuing the discussion from [Hey, Google… When I come home after dark, turn on the flood lights](https://forums.rwusers.com/t/hey-google-when-i-come-home-after-dark-turn-on-the-flood-lights/99):

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](https://support.google.com/googlenest/answer/13460475)  
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](http://home.google.com/), while signed into the Google account you have associated with your Google Home.
2. Click `Automations` on the left  
 ![image](https://forums.rwusers.com/uploads/default/original/1X/dc1e42d7cbb50ac6512bc43817feaa2d91435339.png)
3. You’ll see a list of your current automation. Click `Add new` in the lower right-hand corner.  
 ![image](https://forums.rwusers.com/uploads/default/original/1X/cf3d3ae6839034384c6f0b4fa581089216d40e2b.png)  
(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_](https://forums.rwusers.com/t/hey-google-when-i-come-home-after-dark-turn-on-the-flood-lights/99/23). 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”.

```auto
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

```

---

<div class="post-metadata">

**Author:** ![cbwahlstrom](https://forums.rwusers.com/user_avatar/forums.rwusers.com/cbwahlstrom/32/241_2.png) [@cbwahlstrom](https://forums.rwusers.com/u/cbwahlstrom)\
**Post date:** [June 11, 2024, 2:59pm UTC](https://forums.rwusers.com/t/scripting-custom-google-home-routines/898/2 "2024-06-11T14:59:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Clint](https://forums.rwusers.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@Clint](https://forums.rwusers.com/u/Clint)\
**Post date:** [June 11, 2024, 9:16pm UTC](https://forums.rwusers.com/t/scripting-custom-google-home-routines/898/3 "2024-06-11T21:16:51Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dbrew826](https://forums.rwusers.com/user_avatar/forums.rwusers.com/dbrew826/32/325_2.png) [@dbrew826](https://forums.rwusers.com/u/dbrew826)\
**Post date:** [June 14, 2024, 4:15pm UTC](https://forums.rwusers.com/t/scripting-custom-google-home-routines/898/4 "2024-06-14T16:15:25Z")

</div>

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](https://www.home-assistant.io/green/)

---

<div class="post-metadata">

**Author:** ![dbrew826](https://forums.rwusers.com/user_avatar/forums.rwusers.com/dbrew826/32/325_2.png) [@dbrew826](https://forums.rwusers.com/u/dbrew826)\
**Post date:** [June 14, 2024, 4:32pm UTC](https://forums.rwusers.com/t/scripting-custom-google-home-routines/898/5 "2024-06-14T16:32:18Z")

</div>

Here is a screenshot of the Star Trek themed interface posted on github: [Star Trek LCARS Theme - Themes - Home Assistant Community](https://community.home-assistant.io/t/star-trek-lcars-theme/511391)

---

<div class="post-metadata">

**Author:** ![jBen](https://forums.rwusers.com/user_avatar/forums.rwusers.com/jben/32/248_2.png) [@jBen](https://forums.rwusers.com/u/jBen)\
**Post date:** [June 14, 2024, 6:22pm UTC](https://forums.rwusers.com/t/scripting-custom-google-home-routines/898/6 "2024-06-14T18:22:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![southpaw](https://forums.rwusers.com/user_avatar/forums.rwusers.com/southpaw/32/6_2.png) [@southpaw](https://forums.rwusers.com/u/southpaw)\
**Post date:** [June 17, 2024, 6:14pm UTC](https://forums.rwusers.com/t/scripting-custom-google-home-routines/898/7 "2024-06-17T18:14:25Z")

</div>

> [@jBen](#):
>
> Perhaps @rolandh could consider adding a new Category ie _‘Home Automation’_ where the subject could be discussed

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](https://blog.discourse.org/2017/10/its-time-we-talked-about-tags/))
