mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-05-05 02:28:56 +00:00
42 lines
1.1 KiB
Markdown
42 lines
1.1 KiB
Markdown
---
|
|
layout: page
|
|
title: "Scripts"
|
|
description: "Instructions how to setup scripts within Home Assistant."
|
|
date: 2015-03-23 19:59
|
|
sidebar: true
|
|
comments: false
|
|
sharing: true
|
|
footer: true
|
|
logo: home-assistant.png
|
|
ha_category: Automation
|
|
---
|
|
|
|
The script component allows users to create a sequence of service calls and delays. Scripts can be started using the service `script/turn_on` and interrupted using the service `script/turn_off`.
|
|
|
|
```yaml
|
|
# Example configuration.yaml entry
|
|
script:
|
|
# Turns on the bedroom lights and then the living room lights 1 minute later
|
|
wakeup:
|
|
alias: Wake Up
|
|
sequence:
|
|
- event: LOGBOOK_ENTRY
|
|
event_data:
|
|
name: Paulus
|
|
message: is waking up
|
|
entity_id: device_tracker.paulus
|
|
domain: light
|
|
- alias: Bedroom lights on
|
|
service: light.turn_on
|
|
data:
|
|
entity_id: group.bedroom
|
|
brightness: 100
|
|
- delay:
|
|
# supports seconds, milliseconds, minutes, hours, etc.
|
|
minutes: 1
|
|
- alias: Living room lights on
|
|
service: light.turn_on
|
|
data:
|
|
entity_id: group.living_room
|
|
```
|