Skip to content

Visual Editor for Google Home Scripts. Create complex YAML smart home automations and workflows visually. Support for conditions, starters & actions.

License

Notifications You must be signed in to change notification settings

MoritzMessner/google-home-yaml-editor

Repository files navigation

Google Home Script Editor & YAML Visualizer

A lightweight, visual tool to generate, edit, and understand Google Home automation YAML scripts. Perfect for creating complex smart home routines for the Google Home Script Editor (Public Preview) without writing code from scratch.

🚀 Try it live

What is this?

The Google Home Script Editor unlocks powerful home automation capabilities using YAML scripting. It allows for much more complex logic than the standard Google Home app app routines, including multiple conditions, advanced starters, and precise device control. However, writing YAML syntax manually can be error-prone and unintuitive for many users.

This Visual Editor bridges the gap. It allows you to build your advanced automations using a user-friendly interface—selecting triggers, conditions, and actions from simple forms—while automatically generating the valid YAML code you need in real-time.

Features

  • Visual Editor: Edit automations using intuitive cards and forms
  • Live YAML Preview: See the YAML output update in real-time as you edit
  • Side-by-Side Layout: Visual editor on the left, YAML on the right
  • Import YAML: Paste existing Google Home automation scripts to edit visually
  • Copy to Clipboard: Easily copy the generated YAML for use in the Google Home web interface

Example Workflows

Unlock the full potential of your smart home with these examples. You can find the full YAML files in the examples/ folder of this repository:

How to use with Google Home Script Editor

  1. Design: Build your automation in this visual tool.
  2. Copy: Click the "Copy to Clipboard" button or manually copy the YAML code from the right-hand panel.
  3. Go to Editor: Visit home.google.com/automations and sign in.
  4. Create New: Click + Add new and select Script Editor.
  5. Paste & Save: Paste your generated code into the editor, click Validate, and then Activate (or Save).

Resources & Codelabs

Common Automations

Here are some popular ideas you can build:

  • "Turn on lights when I arrive home": Use a home.state.HomePresence starter.
  • "Dim lights at sunset": Use a time.schedule starter keying off sunset.
  • "Flash lights when doorbell rings": Combine a device starter (Doorbell) with a repeated on/off action.

Referencing Devices

When using devices in your scripts, you must reference them by their exact name as they appear in the Google Home app.

  • Case Sensitivity: Names are case-sensitive. "Living Room Lamp" is different from "living room lamp".
  • Quotes: If your device name contains spaces or special characters, it is best practice to wrap it in quotes in your YAML (e.g., - 'Living Room Light').
  • Uniqueness: Ensure your devices have unique names across your home to avoid ambiguity in the Script Editor.

Supported Components

Triggers (Starters)

  • OK Google Command: Custom voice phrases to start routines.
  • Device State: Trigger when a device turns on/off, changes brightness, etc.
  • Time Schedule: At specific times or relative to sunrise/sunset.

Conditions

  • Time Between: Restrict automations to only run during specific hours (e.g., only at night).
  • Device State: Only run if a device is in a certain state (e.g., "only if the TV is on").

Actions

  • On/Off: Control power state.
  • Brightness: Set absolute brightness (0-100%).
  • Color: Set RGB or Color Temperature (Kelvin).
  • Delay: Pause execution for a set duration.

Getting Started for Developers

Prerequisites

  • Flutter SDK (3.0.0 or higher)

Run Locally

# Get dependencies
flutter pub get

# Run on web
flutter run -d chrome

Build for Production

flutter build web

About

Visual Editor for Google Home Scripts. Create complex YAML smart home automations and workflows visually. Support for conditions, starters & actions.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published