Create or update script
ha_set_scriptCreate or update a Home Assistant script by ID to reuse a sequence of actions across multiple automations. Requires write access.
Instructions
Create or update a script by id. 'config' is the script body ({ alias, sequence, fields, mode, ... }); Home Assistant reloads scripts after saving. Use it for a step several automations share, then call it from each with action 'script.'. Requires HA_ALLOW_WRITE=true and HA_ALLOW_CONFIG_WRITE=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| config | Yes | Script config object: { alias, sequence, fields, mode, ... }. | |
| script_id | Yes | Script id: the key in scripts.yaml and the object id of script.<id>, e.g. 'raise_heat'. 'script.raise_heat' also works. | |
| instance_id | No | Optional: the instance you mean (as listed by vomehome_list_instances). When given, the call is refused if this session is targeting a different home, instead of answering from it. |