Script
Stay organized with collections
Save and categorize content based on your preferences.
Description
The top-level script.
Fields
Key
Type
Description
metadata
Metadata
Provides the metadata of the script, like name and description.
Required
automations
[Automation ]
Specifies a list of automations.
Required
Examples
Simple script to control a light with a switch
metadata :
name : Turn on light with switch
description : Basic example of turning on a light with another switch.
automations :
starters :
type : device.state.OnOff
device : Office Switch - Office
state : on
is : true
actions :
- type : device.command.OnOff
devices :
- Christmas lights - Living Room
on : true
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-05 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-09-05 UTC."}