Scripts


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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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
          # Optional
          entity_id: device_tracker.paulus
          domain: light
      - alias: Bedroom lights on
        execute_service: light.turn_on
        service_data:
          entity_id: group.bedroom
      - delay:
          # supports seconds, milliseconds, minutes, hours, etc.
          minutes: 1
      - alias: Living room lights on
        execute_service: light.turn_on
        service_data:
          entity_id: group.living_room