Improve YAML styling for all automation examples (#34932)

This commit is contained in:
Franck Nijhof 2024-09-26 12:39:04 +02:00
parent d118c3e072
commit 8b9ad61e42
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
141 changed files with 1920 additions and 1966 deletions

View File

@ -48,7 +48,7 @@ automation:
- trigger: state - trigger: state
entity_id: sensor.office_motion_sensor entity_id: sensor.office_motion_sensor
to: "on" to: "on"
condition: "{{ state_attr('sun.sun', 'elevation') < 4 }}" conditions: "{{ state_attr('sun.sun', 'elevation') < 4 }}"
actions: actions:
- action: scene.turn_on - action: scene.turn_on
target: target:

View File

@ -219,7 +219,7 @@ automation 2:
- trigger: mqtt - trigger: mqtt
topic: "/notify/+" topic: "/notify/+"
actions: actions:
action: > - action: >
notify.{{ trigger.topic.split('/')[-1] }} notify.{{ trigger.topic.split('/')[-1] }}
data: data:
message: "{{ trigger.payload }}" message: "{{ trigger.payload }}"

View File

@ -277,7 +277,7 @@ actions:
- action: light.turn_on - action: light.turn_on
target: !input light_target target: !input light_target
- wait_for_trigger: - wait_for_trigger:
trigger: state - trigger: state
entity_id: !input motion_entity entity_id: !input motion_entity
from: "on" from: "on"
to: "off" to: "off"

View File

@ -45,11 +45,11 @@ The automation we're going to use in this tutorial controls a light based on a m
```yaml ```yaml
triggers: triggers:
trigger: state - trigger: state
entity_id: binary_sensor.motion_kitchen entity_id: binary_sensor.motion_kitchen
actions: actions:
action: > - action: >
{% if trigger.to_state.state == "on" %} {% if trigger.to_state.state == "on" %}
light.turn_on light.turn_on
{% else %} {% else %}
@ -92,7 +92,7 @@ Configurable parts in blueprints are called [inputs](/docs/blueprint/schema/#blu
```yaml ```yaml
triggers: triggers:
trigger: state - trigger: state
entity_id: !input motion_sensor entity_id: !input motion_sensor
``` ```
@ -104,7 +104,7 @@ Inputs are not limited to strings. They can contain complex objects too. So in t
```yaml ```yaml
actions: actions:
action: > - action: >
{% if trigger.to_state.state == "on" %} {% if trigger.to_state.state == "on" %}
light.turn_on light.turn_on
{% else %} {% else %}

View File

@ -268,20 +268,20 @@ These work recursively. As an example using `!include_dir_list automation`, will
automation: automation:
- alias: "Automation 1" - alias: "Automation 1"
triggers: triggers:
trigger: state - trigger: state
entity_id: device_tracker.iphone entity_id: device_tracker.iphone
to: "home" to: "home"
actions: actions:
action: light.turn_on - action: light.turn_on
target: target:
entity_id: light.entryway entity_id: light.entryway
- alias: "Automation 2" - alias: "Automation 2"
triggers: triggers:
trigger: state - trigger: state
entity_id: device_tracker.iphone entity_id: device_tracker.iphone
from: "home" from: "home"
actions: actions:
action: light.turn_off - action: light.turn_off
target: target:
entity_id: light.entryway entity_id: light.entryway
``` ```
@ -299,11 +299,11 @@ automation: !include_dir_list automation/presence/
```yaml ```yaml
alias: "Automation 1" alias: "Automation 1"
triggers: triggers:
trigger: state - trigger: state
entity_id: device_tracker.iphone entity_id: device_tracker.iphone
to: "home" to: "home"
actions: actions:
action: light.turn_on - action: light.turn_on
target: target:
entity_id: light.entryway entity_id: light.entryway
``` ```
@ -313,11 +313,11 @@ actions:
```yaml ```yaml
alias: "Automation 2" alias: "Automation 2"
triggers: triggers:
trigger: state - trigger: state
entity_id: device_tracker.iphone entity_id: device_tracker.iphone
from: "home" from: "home"
actions: actions:
action: light.turn_off - action: light.turn_off
target: target:
entity_id: light.entryway entity_id: light.entryway
``` ```

View File

@ -58,12 +58,12 @@ Scenes can be activated using the action `scene.turn_on` (there is no 'scene.tur
# Example automation # Example automation
automation: automation:
triggers: triggers:
trigger: state - trigger: state
entity_id: device_tracker.sweetheart entity_id: device_tracker.sweetheart
from: "not_home" from: "not_home"
to: "home" to: "home"
actions: actions:
action: scene.turn_on - action: scene.turn_on
target: target:
entity_id: scene.romantic entity_id: scene.romantic
``` ```
@ -76,12 +76,12 @@ With the `scene.apply` action you are able to apply a scene without first defini
# Example automation # Example automation
automation: automation:
triggers: triggers:
trigger: state - trigger: state
entity_id: device_tracker.sweetheart entity_id: device_tracker.sweetheart
from: "not_home" from: "not_home"
to: "home" to: "home"
actions: actions:
action: scene.apply - action: scene.apply
data: data:
entities: entities:
light.tv_back_light: light.tv_back_light:
@ -90,7 +90,7 @@ automation:
light.ceiling: off light.ceiling: off
media_player.sony_bravia_tv: media_player.sony_bravia_tv:
state: "on" state: "on"
source: HDMI 1 source: "HDMI 1"
``` ```
## Using scene transitions ## Using scene transitions
@ -105,12 +105,12 @@ light will transition to the scene in 2.5 seconds.
# Example automation # Example automation
automation: automation:
triggers: triggers:
trigger: state - trigger: state
entity_id: device_tracker.sweetheart entity_id: device_tracker.sweetheart
from: "not_home" from: "not_home"
to: "home" to: "home"
actions: actions:
action: scene.turn_on - action: scene.turn_on
target: target:
entity_id: scene.romantic entity_id: scene.romantic
data: data:

View File

@ -532,7 +532,6 @@ automation:
- condition: state - condition: state
entity_id: binary_sensor.something entity_id: binary_sensor.something
state: "off" state: "off"
mode: single
actions: actions:
- alias: "Repeat the sequence UNTIL the conditions are true" - alias: "Repeat the sequence UNTIL the conditions are true"
repeat: repeat:

View File

@ -20,7 +20,7 @@ Test multiple conditions in one condition statement. Passes if all embedded cond
```yaml ```yaml
conditions: conditions:
alias: "Paulus home AND temperature below 20" - alias: "Paulus home AND temperature below 20"
condition: and condition: and
conditions: conditions:
- condition: state - condition: state
@ -52,7 +52,7 @@ The AND condition also has a shorthand form. The following configuration works t
```yaml ```yaml
conditions: conditions:
alias: "Paulus home AND temperature below 20" alias: "Paulus home AND temperature below 20"
and: - and:
- condition: state - condition: state
entity_id: "device_tracker.paulus" entity_id: "device_tracker.paulus"
state: "home" state: "home"
@ -67,7 +67,7 @@ Test multiple conditions in one condition statement. Passes if any embedded cond
```yaml ```yaml
conditions: conditions:
alias: "Paulus home OR temperature below 20" - alias: "Paulus home OR temperature below 20"
condition: or condition: or
conditions: conditions:
- condition: state - condition: state
@ -82,7 +82,7 @@ The OR condition also has a shorthand form. The following configuration works th
```yaml ```yaml
conditions: conditions:
alias: "Paulus home OR temperature below 20" - alias: "Paulus home OR temperature below 20"
or: or:
- condition: state - condition: state
entity_id: "device_tracker.paulus" entity_id: "device_tracker.paulus"
@ -99,7 +99,7 @@ This allows you to mix several AND and OR conditions together.
```yaml ```yaml
conditions: conditions:
condition: and - condition: and
conditions: conditions:
- condition: state - condition: state
entity_id: "device_tracker.paulus" entity_id: "device_tracker.paulus"
@ -118,7 +118,7 @@ Or in shorthand form:
```yaml ```yaml
conditions: conditions:
and: - and:
- condition: state - condition: state
entity_id: "device_tracker.paulus" entity_id: "device_tracker.paulus"
state: "home" state: "home"
@ -137,7 +137,7 @@ Test multiple conditions in one condition statement. Passes if all embedded cond
```yaml ```yaml
conditions: conditions:
alias: "Paulus not home AND alarm not disarmed" - alias: "Paulus not home AND alarm not disarmed"
condition: not condition: not
conditions: conditions:
- condition: state - condition: state
@ -145,7 +145,7 @@ conditions:
state: "home" state: "home"
- condition: state - condition: state
entity_id: alarm_control_panel.home_alarm entity_id: alarm_control_panel.home_alarm
state: disarmed state: "disarmed"
``` ```
The NOT condition also has a shorthand form. The following configuration works the same as the one listed above: The NOT condition also has a shorthand form. The following configuration works the same as the one listed above:
@ -170,7 +170,7 @@ If both `below` and `above` are specified, both tests have to pass.
```yaml ```yaml
conditions: conditions:
alias: "Temperature between 17 and 25 degrees" - alias: "Temperature between 17 and 25 degrees"
condition: numeric_state condition: numeric_state
entity_id: sensor.temperature entity_id: sensor.temperature
above: 17 above: 17
@ -183,7 +183,7 @@ You can optionally use a `value_template` to process the value of the state befo
```yaml ```yaml
conditions: conditions:
condition: numeric_state - condition: numeric_state
entity_id: sensor.temperature entity_id: sensor.temperature
above: 17 above: 17
below: 25 below: 25
@ -198,7 +198,7 @@ The condition will pass if **all** entities match the thresholds.
```yaml ```yaml
conditions: conditions:
condition: numeric_state - condition: numeric_state
entity_id: entity_id:
- sensor.kitchen_temperature - sensor.kitchen_temperature
- sensor.living_room_temperature - sensor.living_room_temperature
@ -210,7 +210,7 @@ The condition will pass if the attribute value of the entity matches the thresho
```yaml ```yaml
conditions: conditions:
condition: numeric_state - condition: numeric_state
entity_id: climate.living_room_thermostat entity_id: climate.living_room_thermostat
attribute: temperature attribute: temperature
above: 17 above: 17
@ -223,7 +223,7 @@ options to make the condition more dynamic.
```yaml ```yaml
conditions: conditions:
condition: numeric_state - condition: numeric_state
entity_id: climate.living_room_thermostat entity_id: climate.living_room_thermostat
attribute: temperature attribute: temperature
above: input_number.temperature_threshold_low above: input_number.temperature_threshold_low
@ -236,7 +236,7 @@ Tests if an entity has a specified state.
```yaml ```yaml
conditions: conditions:
alias: "Paulus not home for an hour and a bit" - alias: "Paulus not home for an hour and a bit"
condition: state condition: state
entity_id: device_tracker.paulus entity_id: device_tracker.paulus
state: "not_home" state: "not_home"
@ -252,7 +252,7 @@ The condition will pass if **all** entities match the state.
```yaml ```yaml
conditions: conditions:
condition: state - condition: state
entity_id: entity_id:
- light.kitchen - light.kitchen
- light.living_room - light.living_room
@ -264,7 +264,7 @@ In the following example the condition will pass if **any** entity matches the s
```yaml ```yaml
conditions: conditions:
condition: state - condition: state
entity_id: entity_id:
- binary_sensor.motion_sensor_left - binary_sensor.motion_sensor_left
- binary_sensor.motion_sensor_right - binary_sensor.motion_sensor_right
@ -277,7 +277,7 @@ The condition will pass if the entity matches one of the states given.
```yaml ```yaml
conditions: conditions:
condition: state - condition: state
entity_id: alarm_control_panel.home entity_id: alarm_control_panel.home
state: state:
- "armed_away" - "armed_away"
@ -289,7 +289,7 @@ both media players need to be either paused or playing for the condition to pass
```yaml ```yaml
conditions: conditions:
condition: state - condition: state
entity_id: entity_id:
- media_player.living_room - media_player.living_room
- media_player.kitchen - media_player.kitchen
@ -303,7 +303,7 @@ The condition will pass if the attribute matches the given state.
```yaml ```yaml
conditions: conditions:
condition: state - condition: state
entity_id: climate.living_room_thermostat entity_id: climate.living_room_thermostat
attribute: fan_mode attribute: fan_mode
state: "auto" state: "auto"
@ -315,7 +315,7 @@ of the given helper entity.
```yaml ```yaml
conditions: conditions:
condition: state - condition: state
entity_id: alarm_control_panel.home entity_id: alarm_control_panel.home
state: input_select.guest_mode state: input_select.guest_mode
``` ```
@ -326,7 +326,7 @@ You can also use templates in the `for` option.
```yaml ```yaml
conditions: conditions:
condition: state - condition: state
entity_id: device_tracker.paulus entity_id: device_tracker.paulus
state: "home" state: "home"
for: for:
@ -346,7 +346,7 @@ The sun state can be used to test if the sun has set or risen.
```yaml ```yaml
conditions: conditions:
alias: "Sun up" - alias: "Sun up"
condition: state # 'day' condition: from sunrise until sunset condition: state # 'day' condition: from sunrise until sunset
entity_id: sun.sun entity_id: sun.sun
state: "above_horizon" state: "above_horizon"
@ -354,7 +354,7 @@ conditions:
```yaml ```yaml
conditions: conditions:
alias: "Sun down" - alias: "Sun down"
condition: state # from sunset until sunrise condition: state # from sunset until sunrise
entity_id: sun.sun entity_id: sun.sun
state: "below_horizon" state: "below_horizon"
@ -371,7 +371,7 @@ For an in-depth explanation of sun elevation, see [sun elevation trigger][sun_el
```yaml ```yaml
conditions: conditions:
condition: and # 'twilight' condition: dusk and dawn, in typical locations - condition: and # 'twilight' condition: dusk and dawn, in typical locations
conditions: conditions:
- condition: template - condition: template
value_template: "{{ state_attr('sun.sun', 'elevation') < 0 }}" value_template: "{{ state_attr('sun.sun', 'elevation') < 0 }}"
@ -406,7 +406,7 @@ The sunset/sunrise conditions do not work in locations inside the polar circles,
This is an example of 1 hour offset before sunset: This is an example of 1 hour offset before sunset:
```yaml ```yaml
conditions: conditions:
condition: sun - condition: sun
after: sunset after: sunset
after_offset: "-01:00:00" after_offset: "-01:00:00"
``` ```
@ -441,7 +441,7 @@ The template condition tests if the [given template][template] renders a value e
```yaml ```yaml
conditions: conditions:
alias: "Iphone battery above 50%" - alias: "Iphone battery above 50%"
condition: template condition: template
value_template: "{{ (state_attr('device_tracker.iphone', 'battery_level')|int) > 50 }}" value_template: "{{ (state_attr('device_tracker.iphone', 'battery_level')|int) > 50 }}"
``` ```
@ -488,7 +488,7 @@ and [`not`](#not-condition) conditions:
```yaml ```yaml
conditions: conditions:
condition: or - condition: or
conditions: conditions:
- "{{ is_state('device_tracker.iphone', 'away') }}" - "{{ is_state('device_tracker.iphone', 'away') }}"
- condition: numeric_state - condition: numeric_state
@ -540,7 +540,7 @@ The time condition can test if it is after a specified time, before a specified
```yaml ```yaml
conditions: conditions:
alias: "Time 15~02" - alias: "Time 15~02"
condition: time condition: time
# At least one of the following is required. # At least one of the following is required.
after: "15:00:00" after: "15:00:00"
@ -587,20 +587,20 @@ The trigger condition can test if an automation was triggered by a certain trigg
```yaml ```yaml
conditions: conditions:
condition: trigger - condition: trigger
id: event_trigger id: event_trigger
``` ```
For a trigger identified by its index, both a string and integer is allowed: For a trigger identified by its index, both a string and integer is allowed:
```yaml ```yaml
conditions: conditions:
condition: trigger - condition: trigger
id: "0" id: "0"
``` ```
```yaml ```yaml
conditions: conditions:
condition: trigger - condition: trigger
id: 0 id: 0
``` ```
@ -608,7 +608,7 @@ It is possible to give a list of triggers:
```yaml ```yaml
conditions: conditions:
condition: trigger - condition: trigger
id: id:
- event_1_trigger - event_1_trigger
- event_2_trigger - event_2_trigger
@ -620,7 +620,7 @@ Zone conditions test if an entity is in a certain zone. For zone automation to w
```yaml ```yaml
conditions: conditions:
alias: "Paulus at home" - alias: "Paulus at home"
condition: zone condition: zone
entity_id: device_tracker.paulus entity_id: device_tracker.paulus
zone: zone.home zone: zone.home
@ -631,7 +631,7 @@ The condition will pass if all entities are in the specified zone.
```yaml ```yaml
conditions: conditions:
condition: zone - condition: zone
entity_id: entity_id:
- device_tracker.frenck - device_tracker.frenck
- device_tracker.daphne - device_tracker.daphne
@ -643,7 +643,7 @@ The condition will pass if the entity is in one of the zones.
```yaml ```yaml
conditions: conditions:
condition: zone - condition: zone
entity_id: device_tracker.paulus entity_id: device_tracker.paulus
state: state:
- zone.home - zone.home
@ -701,7 +701,7 @@ For example:
```yaml ```yaml
# This condition will always pass, as it is disabled. # This condition will always pass, as it is disabled.
conditions: conditions:
enabled: false - enabled: false
condition: state condition: state
entity_id: sun.sun entity_id: sun.sun
state: "above_horizon" state: "above_horizon"

View File

@ -19,6 +19,7 @@ Perform the action `homeassistant.turn_on` on the {% term entity %} `group.livin
```yaml ```yaml
action: homeassistant.turn_on action: homeassistant.turn_on
target:
entity_id: group.living_room entity_id: group.living_room
``` ```
@ -51,6 +52,7 @@ You can also specify other parameters beside the entity to target. For example,
```yaml ```yaml
action: light.turn_on action: light.turn_on
target:
entity_id: group.living_room entity_id: group.living_room
data: data:
brightness: 120 brightness: 120

View File

@ -105,7 +105,7 @@ If there is an automation that handles that event, it will be automatically trig
```yaml ```yaml
- alias: "Capture Event" - alias: "Capture Event"
triggers: triggers:
trigger: event - trigger: event
event_type: event_light_state_changed event_type: event_light_state_changed
actions: actions:
- action: notify.notify - action: notify.notify

View File

@ -434,7 +434,7 @@ Using this {% term trigger %} in an {% term automation %} will allow you to dete
```yaml ```yaml
# Example automations.yaml entry # Example automations.yaml entry
alias: Doorbell Pressed alias: "Doorbell Pressed"
description: "Trigger when Amcrest Button Press Event Fires" description: "Trigger when Amcrest Button Press Event Fires"
triggers: triggers:
- trigger: event - trigger: event

View File

@ -147,7 +147,7 @@ In an [action](/getting-started/automation-action/) of your [automation setup](/
```yaml ```yaml
actions: actions:
action: androidtv.adb_command - action: androidtv.adb_command
target: target:
entity_id: media_player.androidtv_tv_living_room entity_id: media_player.androidtv_tv_living_room
data: data:

View File

@ -148,16 +148,16 @@ Using the lock operation sensors, you can detect when a user operates a lock and
alias: "joe_doe_front_door_operate" alias: "joe_doe_front_door_operate"
description: John Doe locks or unlocks the Front Door description: John Doe locks or unlocks the Front Door
triggers: triggers:
- entity_id: sensor.front_door_operator - trigger: state
trigger: state entity_id: sensor.front_door_operator
to: John Doe to: "John Doe"
conditions: conditions:
- condition: template - condition: template
value_template: "{{ not state_attr('sensor.front_door_operator', 'remote') }}" value_template: "{{ not state_attr('sensor.front_door_operator', 'remote') }}"
actions: actions:
- data: {} - action: camera.turn_off
entity_id: camera.inside entity_id: camera.inside
action: camera.turn_off
``` ```
{% endraw %} {% endraw %}

View File

@ -82,10 +82,10 @@ See the example below for how an automation trigger translates to a message on t
automation: automation:
- alias: "Sunset Service Bus message" - alias: "Sunset Service Bus message"
triggers: triggers:
trigger: sun - trigger: sun
event: sunset event: sunset
actions: actions:
action: notify.test_queue - action: notify.test_queue
data: data:
message: "Sun is going down" message: "Sun is going down"
title: "Good evening" title: "Good evening"

View File

@ -52,10 +52,10 @@ at 3 AM:
automation: automation:
- alias: "Backup Home Assistant every night at 3 AM" - alias: "Backup Home Assistant every night at 3 AM"
triggers: triggers:
trigger: time - trigger: time
at: "03:00:00" at: "03:00:00"
actions: actions:
alias: "Create backup now" - alias: "Create backup now"
action: backup.create action: backup.create
``` ```

View File

@ -40,12 +40,12 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
```yaml ```yaml
- alias: "If there is motion and it's dark turn on the gateway light" - alias: "If there is motion and it's dark turn on the gateway light"
triggers: triggers:
trigger: state - trigger: state
entity_id: binary_sensor.motion_sensor_158d000xxxxxc2 entity_id: binary_sensor.motion_sensor_158d000xxxxxc2
from: "off" from: "off"
to: "on" to: "on"
conditions: conditions:
condition: numeric_state - condition: numeric_state
entity_id: sensor.illumination_34ce00xxxx11 entity_id: sensor.illumination_34ce00xxxx11
below: 300 below: 300
actions: actions:
@ -59,7 +59,7 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
entity_id: automation.MOTION_OFF entity_id: automation.MOTION_OFF
- alias: "If there no motion for 5 minutes turn off the gateway light" - alias: "If there no motion for 5 minutes turn off the gateway light"
triggers: triggers:
trigger: state - trigger: state
entity_id: binary_sensor.motion_sensor_158d000xxxxxc2 entity_id: binary_sensor.motion_sensor_158d000xxxxxc2
from: "on" from: "on"
to: "off" to: "off"
@ -79,33 +79,33 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
```yaml ```yaml
- alias: "If the window is open turn off the radiator" - alias: "If the window is open turn off the radiator"
triggers: triggers:
trigger: state - trigger: state
entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2 entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2
from: "off" from: "off"
to: "on" to: "on"
actions: actions:
action: climate.set_operation_mode - action: climate.set_operation_mode
target: target:
entity_id: climate.livingroom entity_id: climate.livingroom
data: data:
operation_mode: "Off" operation_mode: "Off"
- alias: "If the window is closed for 5 minutes turn on the radiator again" - alias: "If the window is closed for 5 minutes turn on the radiator again"
triggers: triggers:
trigger: state - trigger: state
entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2 entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2
from: "on" from: "on"
to: "off" to: "off"
for: for:
minutes: 5 minutes: 5
actions: actions:
action: climate.set_operation_mode - action: climate.set_operation_mode
target: target:
entity_id: climate.livingroom entity_id: climate.livingroom
data: data:
operation_mode: "Smart schedule" operation_mode: "Smart schedule"
- alias: "Notify if door is opened when away" - alias: "Notify if door is opened when away"
triggers: triggers:
trigger: state - trigger: state
entity_id: binary_sensor.door_window_sensor_15xxxxxxc9xx6b entity_id: binary_sensor.door_window_sensor_15xxxxxxc9xx6b
from: "off" from: "off"
to: "on" to: "on"
@ -124,15 +124,15 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
```yaml ```yaml
- alias: "Send notification on fire alarm" - alias: "Send notification on fire alarm"
triggers: triggers:
trigger: state - trigger: state
entity_id: binary_sensor.smoke_sensor_158d0001574899 entity_id: binary_sensor.smoke_sensor_158d0001574899
from: "off" from: "off"
to: "on" to: "on"
actions: actions:
- action: notify.html5 - action: notify.html5
data: data:
title: Fire alarm! title: "Fire alarm!"
message: Fire/Smoke detected! message: "Fire/Smoke detected!"
- action: xiaomi_aqara.play_ringtone - action: xiaomi_aqara.play_ringtone
data: data:
gw_mac: xxxxxxxxxxxx gw_mac: xxxxxxxxxxxx
@ -147,14 +147,14 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
```yaml ```yaml
- alias: "Send notification on gas alarm" - alias: "Send notification on gas alarm"
triggers: triggers:
trigger: state - trigger: state
entity_id: binary_sensor.natgas_sensor_158dxxxxxxxxxx entity_id: binary_sensor.natgas_sensor_158dxxxxxxxxxx
from: "off" from: "off"
to: "on" to: "on"
actions: actions:
- action: notify.html5 - action: notify.html5
data: data:
title: Gas alarm! title: "Gas alarm!"
message: "Gas with a density of {{ state_attr('binary_sensor.natgas_sensor_158dxxxxxxxxxx', 'density') }} detected." message: "Gas with a density of {{ state_attr('binary_sensor.natgas_sensor_158dxxxxxxxxxx', 'density') }} detected."
``` ```
@ -167,35 +167,35 @@ As indicated in the table on top of this page there are 3 versions of the button
```yaml ```yaml
- alias: "Toggle dining light on single press" - alias: "Toggle dining light on single press"
triggers: triggers:
trigger: event - trigger: event
event_type: xiaomi_aqara.click event_type: xiaomi_aqara.click
event_data: event_data:
entity_id: binary_sensor.switch_158d000xxxxxc2 entity_id: binary_sensor.switch_158d000xxxxxc2
click_type: single click_type: single
actions: actions:
action: switch.toggle - action: switch.toggle
target: target:
entity_id: switch.wall_switch_left_158d000xxxxx01 entity_id: switch.wall_switch_left_158d000xxxxx01
- alias: "Toggle couch light on double click" - alias: "Toggle couch light on double click"
triggers: triggers:
trigger: event - trigger: event
event_type: xiaomi_aqara.click event_type: xiaomi_aqara.click
event_data: event_data:
entity_id: binary_sensor.switch_158d000xxxxxc2 entity_id: binary_sensor.switch_158d000xxxxxc2
click_type: double click_type: double
actions: actions:
action: switch.toggle - action: switch.toggle
target: target:
entity_id: switch.wall_switch_right_158d000xxxxx01 entity_id: switch.wall_switch_right_158d000xxxxx01
- alias: "Let a dog bark on long press" - alias: "Let a dog bark on long press"
triggers: triggers:
trigger: event - trigger: event
event_type: xiaomi_aqara.click event_type: xiaomi_aqara.click
event_data: event_data:
entity_id: binary_sensor.switch_158d000xxxxxc2 entity_id: binary_sensor.switch_158d000xxxxxc2
click_type: long_click_press click_type: long_click_press
actions: actions:
action: xiaomi_aqara.play_ringtone - action: xiaomi_aqara.play_ringtone
data: data:
gw_mac: xxxxxxxxxxxx gw_mac: xxxxxxxxxxxx
ringtone_id: 8 ringtone_id: 8
@ -209,7 +209,7 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
```yaml ```yaml
- alias: "Cube event flip90" - alias: "Cube event flip90"
triggers: triggers:
trigger: event - trigger: event
event_type: xiaomi_aqara.cube_action event_type: xiaomi_aqara.cube_action
event_data: event_data:
entity_id: binary_sensor.cube_15xxxxxxxxxxxx entity_id: binary_sensor.cube_15xxxxxxxxxxxx
@ -222,7 +222,7 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
color_name: "springgreen" color_name: "springgreen"
- alias: "Cube event flip180" - alias: "Cube event flip180"
triggers: triggers:
trigger: event - trigger: event
event_type: xiaomi_aqara.cube_action event_type: xiaomi_aqara.cube_action
event_data: event_data:
entity_id: binary_sensor.cube_15xxxxxxxxxxxx entity_id: binary_sensor.cube_15xxxxxxxxxxxx
@ -235,7 +235,7 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
color_name: "darkviolet" color_name: "darkviolet"
- alias: "Cube event move" - alias: "Cube event move"
triggers: triggers:
trigger: event - trigger: event
event_type: xiaomi_aqara.cube_action event_type: xiaomi_aqara.cube_action
event_data: event_data:
entity_id: binary_sensor.cube_15xxxxxxxxxxxx entity_id: binary_sensor.cube_15xxxxxxxxxxxx
@ -248,7 +248,7 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
color_name: "gold" color_name: "gold"
- alias: "Cube event tap_twice" - alias: "Cube event tap_twice"
triggers: triggers:
trigger: event - trigger: event
event_type: xiaomi_aqara.cube_action event_type: xiaomi_aqara.cube_action
event_data: event_data:
entity_id: binary_sensor.cube_15xxxxxxxxxxxx entity_id: binary_sensor.cube_15xxxxxxxxxxxx
@ -261,7 +261,7 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
color_name: "deepskyblue" color_name: "deepskyblue"
- alias: "Cube event shake_air" - alias: "Cube event shake_air"
triggers: triggers:
trigger: event - trigger: event
event_type: xiaomi_aqara.cube_action event_type: xiaomi_aqara.cube_action
event_data: event_data:
entity_id: binary_sensor.cube_15xxxxxxxxxxxx entity_id: binary_sensor.cube_15xxxxxxxxxxxx
@ -283,13 +283,13 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac
```yaml ```yaml
- alias: "Decrease brightness of the gateway light" - alias: "Decrease brightness of the gateway light"
triggers: triggers:
trigger: event - trigger: event
event_type: xiaomi_aqara.click event_type: xiaomi_aqara.click
event_data: event_data:
entity_id: binary_sensor.wall_switch_left_158xxxxxxxxx12 entity_id: binary_sensor.wall_switch_left_158xxxxxxxxx12
click_type: single click_type: single
actions: actions:
action: light.turn_on - action: light.turn_on
target: target:
entity_id: light.gateway_light_34xxxxxxxx13 entity_id: light.gateway_light_34xxxxxxxx13
data: data:
@ -306,13 +306,13 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac
- alias: "Increase brightness of the gateway light" - alias: "Increase brightness of the gateway light"
triggers: triggers:
trigger: event - trigger: event
event_type: xiaomi_aqara.click event_type: xiaomi_aqara.click
event_data: event_data:
entity_id: binary_sensor.wall_switch_right_158xxxxxxxxx12 entity_id: binary_sensor.wall_switch_right_158xxxxxxxxx12
click_type: single click_type: single
actions: actions:
action: light.turn_on - action: light.turn_on
target: target:
entity_id: light.gateway_light_34xxxxxxxx13 entity_id: light.gateway_light_34xxxxxxxx13
data: data:
@ -329,13 +329,13 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac
- alias: "Turn off the gateway light" - alias: "Turn off the gateway light"
triggers: triggers:
trigger: event - trigger: event
event_type: xiaomi_aqara.click event_type: xiaomi_aqara.click
event_data: event_data:
entity_id: binary_sensor.wall_switch_both_158xxxxxxxxx12 entity_id: binary_sensor.wall_switch_both_158xxxxxxxxx12
click_type: both click_type: both
actions: actions:
action: light.turn_off - action: light.turn_off
target: target:
entity_id: light.gateway_light_34xxxxxxxx13 entity_id: light.gateway_light_34xxxxxxxx13
``` ```
@ -349,24 +349,24 @@ This automation toggles the living room lamp on vibration/tilt.
```yaml ```yaml
- alias: "Turn on Living Room Lamp on vibration" - alias: "Turn on Living Room Lamp on vibration"
triggers: triggers:
trigger: event - trigger: event
event_type: xiaomi_aqara.movement event_type: xiaomi_aqara.movement
event_data: event_data:
entity_id: binary_sensor.vibration_xxxx000000 entity_id: binary_sensor.vibration_xxxx000000
movement_type: vibrate movement_type: vibrate
actions: actions:
action: light.toggle - action: light.toggle
target: target:
entity_id: light.living_room_lamp entity_id: light.living_room_lamp
- alias: "Turn on Living Room Lamp on tilt" - alias: "Turn on Living Room Lamp on tilt"
triggers: triggers:
trigger: event - trigger: event
event_type: xiaomi_aqara.movement event_type: xiaomi_aqara.movement
event_data: event_data:
entity_id: binary_sensor.vibration_xxxx000000 entity_id: binary_sensor.vibration_xxxx000000
movement_type: tilt movement_type: tilt
actions: actions:
action: light.toggle - action: light.toggle
target: target:
entity_id: light.living_room_lamp entity_id: light.living_room_lamp
``` ```

View File

@ -133,14 +133,13 @@ This example automation will arm your blink sync module to detect motion on any
Here, this example assumes your blink module is named `My Sync Module` and that you have [device trackers](/integrations/device_tracker) set up for presence detection. Here, this example assumes your blink module is named `My Sync Module` and that you have [device trackers](/integrations/device_tracker) set up for presence detection.
```yaml ```yaml
- id: arm_blink_when_away - alias: "Arm Blink When Away"
alias: "Arm Blink When Away"
triggers: triggers:
trigger: state - trigger: state
entity_id: all entity_id: all
to: "not_home" to: "not_home"
actions: actions:
action: alarm_control_panel.alarm_arm_away - action: alarm_control_panel.alarm_arm_away
target: target:
entity_id: alarm_control_panel.blink_my_sync_module entity_id: alarm_control_panel.blink_my_sync_module
``` ```
@ -150,14 +149,13 @@ Here, this example assumes your blink module is named `My Sync Module` and that
Similar to the previous example, this automation will disarm blink when arriving home. Similar to the previous example, this automation will disarm blink when arriving home.
```yaml ```yaml
- id: disarm_blink_when_home - alias: "Disarm Blink When Home"
alias: "Disarm Blink When Home"
triggers: triggers:
trigger: state - trigger: state
entity_id: all entity_id: all
to: "home" to: "home"
actions: actions:
action: alarm_control_panel.alarm_disarm - action: alarm_control_panel.alarm_disarm
target: target:
entity_id: alarm_control_panel.blink_my_sync_module entity_id: alarm_control_panel.blink_my_sync_module
``` ```
@ -171,10 +169,9 @@ The following example assumes your camera's name (in the Blink app) is `My Camer
{% raw %} {% raw %}
```yaml ```yaml
- id: save_blink_video_on_motion - alias: "Save Blink Video on Motion"
alias: "Save Blink Video on Motion"
triggers: triggers:
trigger: state - trigger: state
entity_id: binary_sensor.blink_my_camera_motion_detected entity_id: binary_sensor.blink_my_camera_motion_detected
to: "on" to: "on"
actions: actions:
@ -200,8 +197,7 @@ The file will be saved to `/tmp/videos/YYYYMMDD_HHmmSS_MyCamera.mp4`.
The file name of the downloaded video file is not configurable. The file name of the downloaded video file is not configurable.
```yaml ```yaml
- id: save_recent_clips_from_my_camera - alias: "Save Recent Clips from My Camera"
alias: "Save Recent Clips from My Camera"
triggers: triggers:
- trigger: time_pattern - trigger: time_pattern
minutes: /3 minutes: /3

View File

@ -80,7 +80,7 @@ The name of the action is `notify.bmw_connected_drive_<your_vehicle>`.
```yaml ```yaml
... ...
actions: actions:
action: notify.bmw_connected_drive_<your_vehicle> - action: notify.bmw_connected_drive_<your_vehicle>
data: data:
message: The name of the POI # this is shown on the iDrive dashboard message: The name of the POI # this is shown on the iDrive dashboard
data: data:

View File

@ -67,7 +67,7 @@ The **Bring** integration offers an action to send push notifications to the Bri
```yaml ```yaml
... ...
actions: actions:
action: bring.send_message - action: bring.send_message
target: target:
entity_id: todo.bring_shoppinglist entity_id: todo.bring_shoppinglist
data: data:
@ -81,7 +81,7 @@ Note that for the notification type `urgent_message` the attribute `item` is **r
```yaml ```yaml
... ...
actions: actions:
action: bring.send_message - action: bring.send_message
target: target:
entity_id: todo.bring_shoppinglist entity_id: todo.bring_shoppinglist
data: data:

View File

@ -98,7 +98,7 @@ This example automation consists of:
{% raw %} {% raw %}
```yaml ```yaml
automation: automation:
- alias: Calendar notification - alias: "Calendar notification"
triggers: triggers:
- trigger: calendar - trigger: calendar
event: start event: start
@ -125,7 +125,7 @@ This example consists of:
{% raw %} {% raw %}
```yaml ```yaml
automation: automation:
- alias: Front Light Schedule - alias: "Front Light Schedule"
triggers: triggers:
- trigger: calendar - trigger: calendar
event: start event: start
@ -141,9 +141,11 @@ automation:
- "{{ trigger.event == 'start' }}" - "{{ trigger.event == 'start' }}"
then: then:
- action: light.turn_on - action: light.turn_on
target:
entity_id: light.front entity_id: light.front
else: else:
- action: light.turn_off - action: light.turn_off
target:
entity_id: light.front entity_id: light.front
``` ```
{% endraw %} {% endraw %}

View File

@ -75,7 +75,7 @@ For example, the following action in an automation would send an `hls` live stre
```yaml ```yaml
actions: actions:
action: camera.play_stream - action: camera.play_stream
target: target:
entity_id: camera.yourcamera entity_id: camera.yourcamera
data: data:
@ -103,7 +103,7 @@ For example, the following action in an automation would take a recording from "
```yaml ```yaml
actions: actions:
action: camera.record - action: camera.record
target: target:
entity_id: camera.yourcamera entity_id: camera.yourcamera
data: data:
@ -129,7 +129,7 @@ For example, the following action in an automation would take a snapshot from "y
```yaml ```yaml
actions: actions:
action: camera.snapshot - action: camera.snapshot
target: target:
entity_id: camera.yourcamera entity_id: camera.yourcamera
data: data:

View File

@ -39,11 +39,11 @@ Home Assistant has its own Cast application to show the Home Assistant UI on any
cast_downstairs_on_kitchen: cast_downstairs_on_kitchen:
alias: "Show Downstairs on kitchen" alias: "Show Downstairs on kitchen"
sequence: sequence:
- data: - action: cast.show_lovelace_view
data:
dashboard_path: lovelace-cast dashboard_path: lovelace-cast
entity_id: media_player.kitchen entity_id: media_player.kitchen
view_path: downstairs view_path: downstairs
action: cast.show_lovelace_view
``` ```
{% important %} {% important %}
@ -242,7 +242,8 @@ Optional:
'cast_bubbleupnp_to_my_chromecast': 'cast_bubbleupnp_to_my_chromecast':
alias: "Cast a video to My Chromecast using BubbleUPNP" alias: "Cast a video to My Chromecast using BubbleUPNP"
sequence: sequence:
- target: - action: media_player.play_media
target:
entity_id: media_player.my_chromecast entity_id: media_player.my_chromecast
data: data:
media_content_type: cast media_content_type: cast
@ -252,7 +253,6 @@ Optional:
"media_id": "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", "media_id": "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
"media_type": "video/mp4" "media_type": "video/mp4"
}' }'
action: media_player.play_media
``` ```
### [NRK Radio](https://radio.nrk.no) ### [NRK Radio](https://radio.nrk.no)
@ -277,7 +277,8 @@ Example values to cast the item at <https://radio.nrk.no/podkast/tazte_priv/l_84
'cast_nrkradio_to_chromecast': 'cast_nrkradio_to_chromecast':
alias: "Cast NRK Radio to Chromecast" alias: "Cast NRK Radio to Chromecast"
sequence: sequence:
- target: - action: media_player.play_media
target:
entity_id: media_player.chromecast entity_id: media_player.chromecast
data: data:
media_content_type: cast media_content_type: cast
@ -286,7 +287,6 @@ Example values to cast the item at <https://radio.nrk.no/podkast/tazte_priv/l_84
"app_name": "nrkradio", "app_name": "nrkradio",
"media_id": "l_8457deb0-4f2c-4ef3-97de-b04f2c6ef314" "media_id": "l_8457deb0-4f2c-4ef3-97de-b04f2c6ef314"
}' }'
action: media_player.play_media
``` ```
### [NRK TV](https://tv.nrk.no) ### [NRK TV](https://tv.nrk.no)
@ -309,7 +309,8 @@ Example values to cast the item at <https://tv.nrk.no/serie/uti-vaar-hage/sesong
'cast_nrktv_to_chromecast': 'cast_nrktv_to_chromecast':
alias: "Cast NRK TV to Chromecast" alias: "Cast NRK TV to Chromecast"
sequence: sequence:
- target: - action: media_player.play_media
target:
entity_id: media_player.chromecast entity_id: media_player.chromecast
data: data:
media_content_type: cast media_content_type: cast
@ -318,7 +319,6 @@ Example values to cast the item at <https://tv.nrk.no/serie/uti-vaar-hage/sesong
"app_name": "nrktv", "app_name": "nrktv",
"media_id": "OUHA43000207" "media_id": "OUHA43000207"
}' }'
action: media_player.play_media
``` ```
### Plex ### Plex
@ -367,7 +367,8 @@ Example values to cast the item at <https://www.supla.fi/audio/3601824>
'cast_supla_to_my_chromecast': 'cast_supla_to_my_chromecast':
alias: "Cast supla to My Chromecast" alias: "Cast supla to My Chromecast"
sequence: sequence:
- target: - action: media_player.play_media
target:
entity_id: media_player.my_chromecast entity_id: media_player.my_chromecast
data: data:
media_content_type: cast media_content_type: cast
@ -376,7 +377,6 @@ Example values to cast the item at <https://www.supla.fi/audio/3601824>
"app_name": "supla", "app_name": "supla",
"media_id": "3601824" "media_id": "3601824"
}' }'
action: media_player.play_media
``` ```
### YouTube ### YouTube
@ -399,7 +399,8 @@ Optional:
'cast_youtube_to_my_chromecast': 'cast_youtube_to_my_chromecast':
alias: "Cast YouTube to My Chromecast" alias: "Cast YouTube to My Chromecast"
sequence: sequence:
- target: - action: media_player.play_media
target:
entity_id: media_player.my_chromecast entity_id: media_player.my_chromecast
data: data:
media_content_type: cast media_content_type: cast
@ -408,7 +409,6 @@ Optional:
"app_name": "youtube", "app_name": "youtube",
"media_id": "dQw4w9WgXcQ" "media_id": "dQw4w9WgXcQ"
}' }'
action: media_player.play_media
``` ```
## Troubleshooting automatic discovery ## Troubleshooting automatic discovery

View File

@ -69,7 +69,7 @@ Here are the automations for the above screenshot:
- trigger: webhook - trigger: webhook
webhook_id: build_failed webhook_id: build_failed
actions: actions:
action: notify.cisco_webex_teams_notify - action: notify.cisco_webex_teams_notify
data: data:
message: "<blockquote class=danger>Build 0.89.5 compile failed." message: "<blockquote class=danger>Build 0.89.5 compile failed."
@ -82,7 +82,7 @@ Here are the automations for the above screenshot:
- trigger: webhook - trigger: webhook
webhook_id: build_unstable webhook_id: build_unstable
actions: actions:
action: notify.cisco_webex_teams_notify - action: notify.cisco_webex_teams_notify
data: data:
title: "<strong>Build 0.89.6 is unstable.</strong>" title: "<strong>Build 0.89.6 is unstable.</strong>"
message: "<blockquote class=warning>Version 0.89.6 failed verifications. message: "<blockquote class=warning>Version 0.89.6 failed verifications.
@ -105,7 +105,7 @@ Here are the automations for the above screenshot:
- trigger: webhook - trigger: webhook
webhook_id: build_passed webhook_id: build_passed
actions: actions:
action: notify.cisco_webex_teams_notify - action: notify.cisco_webex_teams_notify
data: data:
title: "<strong>✅ Version 0.89.7 passed all tests and deployed to production!</strong>" title: "<strong>✅ Version 0.89.7 passed all tests and deployed to production!</strong>"
message: "<blockquote class=info>Version 0.89.7 passed all verifications. message: "<blockquote class=info>Version 0.89.7 passed all verifications.

View File

@ -53,7 +53,7 @@ Turn auxiliary heater on/off for climate device
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: climate.set_aux_heat - action: climate.set_aux_heat
@ -79,7 +79,7 @@ reflecting a situation where the climate device is set to save energy. For examp
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: climate.set_preset_mode - action: climate.set_preset_mode
@ -107,7 +107,7 @@ Set target temperature of climate device
### Set temperature to 24 in heat mode ### Set temperature to 24 in heat mode
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: climate.set_temperature - action: climate.set_temperature
@ -122,7 +122,7 @@ automation:
### Set temperature range to 20 to 24 in heat_cool mode ### Set temperature range to 20 to 24 in heat_cool mode
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: climate.set_temperature - action: climate.set_temperature
@ -148,7 +148,7 @@ Set target humidity of climate device
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: climate.set_humidity - action: climate.set_humidity
@ -172,7 +172,7 @@ Set fan operation for climate device
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: climate.set_fan_mode - action: climate.set_fan_mode
@ -196,7 +196,7 @@ Set climate device's HVAC mode
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: climate.set_hvac_mode - action: climate.set_hvac_mode
@ -220,7 +220,7 @@ Set swing operation mode for climate device
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: climate.set_swing_mode - action: climate.set_swing_mode

View File

@ -147,15 +147,14 @@ system_log:
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
automation: automation:
- id: 'errorcounterautomation' - alias: "Error Counting Automation"
alias: "Error Counting Automation"
triggers: triggers:
trigger: event - trigger: event
event_type: system_log_event event_type: system_log_event
event_data: event_data:
level: ERROR level: ERROR
actions: actions:
action: counter.increment - action: counter.increment
target: target:
entity_id: counter.error_counter entity_id: counter.error_counter

View File

@ -76,7 +76,7 @@ Available actions: `cover.open_cover`, `cover.close_cover`, `cover.stop_cover`,
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: cover.open_cover - action: cover.open_cover
@ -98,7 +98,7 @@ Set cover position of one or multiple covers.
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: cover.set_cover_position - action: cover.set_cover_position
@ -122,7 +122,7 @@ Set cover tilt position of one or multiple covers.
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: cover.set_cover_tilt_position - action: cover.set_cover_tilt_position

View File

@ -287,7 +287,6 @@ Note: Requires `on: true` to change color while the Philips Hue bulb is off. If
```yaml ```yaml
automation: automation:
- alias: "Flash Hue Bulb with Doorbell Motion" - alias: "Flash Hue Bulb with Doorbell Motion"
mode: single
triggers: triggers:
- trigger: state - trigger: state
entity_id: binary_sensor.doorbell_motion entity_id: binary_sensor.doorbell_motion

View File

@ -20,8 +20,7 @@ Device automations are meant to be configured via the UI.
Example: Example:
```yaml ```yaml
- id: "123456789" - alias: "Light turns off"
alias: "Light turns off"
triggers: triggers:
- trigger: device - trigger: device
device_id: 7a92d5ee74014a0b86903fc669b0bcd6 device_id: 7a92d5ee74014a0b86903fc669b0bcd6

View File

@ -44,14 +44,14 @@ If you have a sensor session running, and once you have enabled the Dexcom integ
## Example automation ## Example automation
```yaml ```yaml
- id: '1234567890123' - alias: "Overnight low kitchen lights"
alias: "overnight_low_kitchen_lights" description: "Turn on the lights in the kitchen if my blood sugar drops low overnight"
description: Turn on the lights in the kitchen if my blood sugar drops low overnight
triggers: triggers:
- below: '65' - trigger: numeric_state
entity_id: sensor.dexcom_YOUR_USERNAME_glucose_value entity_id: sensor.dexcom_YOUR_USERNAME_glucose_value
trigger: numeric_state below: 65
condition: time conditions:
- condition: time
after: "22:00:00" after: "22:00:00"
before: "06:00:00" before: "06:00:00"
actions: actions:

View File

@ -105,10 +105,10 @@ The example automation below shows how to turn on a light when somebody presses
```yaml ```yaml
- alias: "Doorbird Ring" - alias: "Doorbird Ring"
triggers: triggers:
trigger: event - trigger: event
event_type: doorbird_driveway_gate_somebody_pressed_the_button event_type: doorbird_driveway_gate_somebody_pressed_the_button
actions: actions:
action: light.turn_on - action: light.turn_on
target: target:
entity_id: light.side_entry_porch entity_id: light.side_entry_porch
``` ```

View File

@ -77,10 +77,10 @@ This is a notify platform and thus can be controlled by calling the notify actio
automation: automation:
- alias: "The sun has set" - alias: "The sun has set"
triggers: triggers:
trigger: sun - trigger: sun
event: sunset event: sunset
actions: actions:
action: notify.dovado - action: notify.dovado
data: data:
message: "The sun has set" message: "The sun has set"
target: "+14151234567" target: "+14151234567"

View File

@ -52,10 +52,10 @@ Along with the event the following payload parameters are available:
```yaml ```yaml
- alias: "Download Failed Notification" - alias: "Download Failed Notification"
triggers: triggers:
trigger: event - trigger: event
event_type: downloader_download_failed event_type: downloader_download_failed
actions: actions:
action: persistent_notification.create - action: persistent_notification.create
data: data:
message: "{{trigger.event.data.filename}} download failed" message: "{{trigger.event.data.filename}} download failed"
title: "Download Failed" title: "Download Failed"

View File

@ -81,7 +81,7 @@ Example automation, in YAML format, that triggers a visual notification when
a binary sensor (a doorbell) is triggered: a binary sensor (a doorbell) is triggered:
```yaml ```yaml
- alias: Visual doorbell notification example - alias: "Visual doorbell notification example"
triggers: triggers:
- trigger: state - trigger: state
entity_id: binary_sensor.doorbell entity_id: binary_sensor.doorbell

View File

@ -112,13 +112,13 @@ Sample automation to switch lights on and off:
automation: automation:
- alias: "Hall light switches" - alias: "Hall light switches"
triggers: triggers:
trigger: event - trigger: event
event_type: button_pressed event_type: button_pressed
event_data: event_data:
id: [0xYY, 0xYY, 0xYY, 0xYY] id: [0xYY, 0xYY, 0xYY, 0xYY]
pushed: 0 pushed: 0
actions: actions:
action: "{% if trigger.event.data.onoff %} light.turn_on {% else %} light.turn_off {%endif %}" - action: "{% if trigger.event.data.onoff %} light.turn_on {% else %} light.turn_off {%endif %}"
target: target:
entity_id: "{% if trigger.event.data.which == 1 %} light.hall_left {% else %} light.hall_right {%endif %}" entity_id: "{% if trigger.event.data.which == 1 %} light.hall_left {% else %} light.hall_right {%endif %}"
``` ```

View File

@ -49,10 +49,10 @@ The phone number used in **target** should be registered with Facebook messenger
automation: automation:
- alias: "Evening Greeting" - alias: "Evening Greeting"
triggers: triggers:
trigger: sun - trigger: sun
event: sunset event: sunset
actions: actions:
action: notify.facebook - action: notify.facebook
data: data:
message: "Good Evening" message: "Good Evening"
target: target:

View File

@ -51,7 +51,7 @@ Sets the speed percentage for fan device.
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: fan.set_percentage - action: fan.set_percentage
@ -75,7 +75,7 @@ Sets a preset mode for the fan device. Available preset modes are defined by the
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: fan.set_preset_mode - action: fan.set_preset_mode
@ -99,7 +99,7 @@ Sets the rotation for fan device.
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: fan.set_direction - action: fan.set_direction
@ -123,7 +123,7 @@ Sets the oscillation for fan device.
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: fan.oscillate - action: fan.oscillate
@ -157,7 +157,7 @@ Turn fan device off. This is only supported if the fan device supports being tur
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: "07:15:00" at: "07:15:00"
actions: actions:
- action: fan.turn_off - action: fan.turn_off

View File

@ -30,10 +30,10 @@ Feedreader events can be used out of the box to trigger automation actions, e.g.
automation: automation:
- alias: "Trigger action when new element(s) in RSS feed" - alias: "Trigger action when new element(s) in RSS feed"
triggers: triggers:
trigger: event - trigger: event
event_type: feedreader event_type: feedreader
actions: actions:
action: script.turn_on - action: script.turn_on
target: target:
entity_id: script.my_action entity_id: script.my_action
``` ```
@ -44,12 +44,12 @@ automation:
automation: automation:
- alias: "Send notification of RSS feed title when updated" - alias: "Send notification of RSS feed title when updated"
triggers: triggers:
trigger: event - trigger: event
event_type: feedreader event_type: feedreader
event_data: event_data:
feed_url: "https://hasspodcast.io/feed/podcast" feed_url: "https://hasspodcast.io/feed/podcast"
actions: actions:
action: persistent_notification.create - action: persistent_notification.create
data: data:
title: "New HA Podcast available" title: "New HA Podcast available"
message: "New Podcast available - {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}" message: "New Podcast available - {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}"

View File

@ -118,16 +118,16 @@ These are documented below.
automation: automation:
- alias: "Switch on a light when incident is received" - alias: "Switch on a light when incident is received"
triggers: triggers:
trigger: state - trigger: state
entity_id: sensor.incidents entity_id: sensor.incidents
actions: actions:
action: light.turn_on - action: light.turn_on
target: target:
entity_id: light.bedroom entity_id: light.bedroom
- alias: "Play TTS incident details when incident is received" - alias: "Play TTS incident details when incident is received"
triggers: triggers:
trigger: state - trigger: state
entity_id: sensor.incidents entity_id: sensor.incidents
attribute: message_to_speech_url attribute: message_to_speech_url
conditions: conditions:
@ -139,7 +139,7 @@ automation:
state: None state: None
actions: actions:
- action: media_player.play_media - action: media_player.play_media
data_template: data:
entity_id: media_player.nest_hub_bedroom entity_id: media_player.nest_hub_bedroom
media_content_id: > media_content_id: >
{{ state_attr('sensor.incidents','message_to_speech_url') }} {{ state_attr('sensor.incidents','message_to_speech_url') }}
@ -147,19 +147,19 @@ automation:
- alias: "Send response acknowledgement when a button is pressed" - alias: "Send response acknowledgement when a button is pressed"
triggers: triggers:
trigger: state - trigger: state
entity_id: switch.response_button entity_id: switch.response_button
actions: actions:
action: homeassistant.turn_on - action: homeassistant.turn_on
target: target:
entity_id: switch.incident_response entity_id: switch.incident_response
- alias: "Cast FireServiceRota dashboard to Nest Hub" - alias: "Cast FireServiceRota dashboard to Nest Hub"
trigger: triggers:
trigger: homeassistant - trigger: homeassistant
event: start event: start
actions: actions:
action: cast.show_lovelace_view - action: cast.show_lovelace_view
data: data:
entity_id: media_player.nest_hub_bedroom entity_id: media_player.nest_hub_bedroom
view_path: fsr view_path: fsr

View File

@ -79,13 +79,13 @@ The flic integration fires `flic_click` events on the bus. You can capture the e
automation: automation:
- alias: "Turn on lights in the living room when flic is pressed once" - alias: "Turn on lights in the living room when flic is pressed once"
triggers: triggers:
trigger: event - trigger: event
event_type: flic_click event_type: flic_click
event_data: event_data:
button_name: flic_81e4ac74b6d2 button_name: flic_81e4ac74b6d2
click_type: single click_type: single
actions: actions:
action: homeassistant.turn_on - action: homeassistant.turn_on
target: target:
entity_id: group.lights_livingroom entity_id: group.lights_livingroom
``` ```
@ -105,7 +105,7 @@ To help detect and debug flic button clicks, you can use this automation that se
automation: automation:
- alias: "FLIC Html5 notify on every click" - alias: "FLIC Html5 notify on every click"
triggers: triggers:
trigger: event - trigger: event
event_type: flic_click event_type: flic_click
actions: actions:
- action: notify.html5 - action: notify.html5

View File

@ -54,15 +54,15 @@ Automations can be triggered on file system events data using a template. The fo
automation: automation:
 alias: "New file alert"  alias: "New file alert"
triggers: triggers:
  trigger: state - trigger: state
entity_id: event.created entity_id: event.created
actions: actions:
  action: notify.notify - action: notify.notify
  data: data:
    title: New image captured! title: New image captured!
    message: "Created {{ trigger.to_state.attributes.file }} in {{ trigger.to_state.attributes.folder }}" message: "Created {{ trigger.to_state.attributes.file }} in {{ trigger.to_state.attributes.folder }}"
    data: data:
      file: "{{ trigger.to_state.attributes.file }}" file: "{{ trigger.to_state.attributes.file }}"
``` ```
{% endraw %} {% endraw %}

View File

@ -59,10 +59,10 @@ Foursquare check-in events can be used out of the box to trigger automation acti
automation: automation:
- alias: "Trigger action when you check into a venue." - alias: "Trigger action when you check into a venue."
triggers: triggers:
trigger: event - trigger: event
event_type: foursquare.push event_type: foursquare.push
actions: actions:
action: script.turn_on - action: script.turn_on
target: target:
entity_id: script.my_action entity_id: script.my_action
``` ```

View File

@ -50,12 +50,12 @@ In case your device (friendly name) is called *badezimmer*, an example automatio
# Example configuration.yaml automation # Example configuration.yaml automation
alias: "Bathroom Motion Detected" alias: "Bathroom Motion Detected"
triggers: triggers:
trigger: state - trigger: state
entity_id: binary_sensor.motion_sensor_166d0001171111 entity_id: binary_sensor.motion_sensor_166d0001171111
from: "off" from: "off"
to: "on" to: "on"
actions: actions:
action: media_player.turn_on - action: media_player.turn_on
target: target:
entity_id: "media_player.badezimmer" entity_id: "media_player.badezimmer"
``` ```

View File

@ -92,7 +92,7 @@ Each such entity has a state attribute that will contain a list of any such issu
```yaml ```yaml
- alias: "GeniusHub Error Alerts" - alias: "GeniusHub Error Alerts"
triggers: triggers:
trigger: numeric_state - trigger: numeric_state
entity_id: sensor.geniushub_errors entity_id: sensor.geniushub_errors
above: 0 above: 0
actions: actions:
@ -113,7 +113,7 @@ This alert may be useful to see if the CH is being turned on whilst you're on a
```yaml ```yaml
- alias: "GeniusHub CH State Change Alert" - alias: "GeniusHub CH State Change Alert"
triggers: triggers:
trigger: state - trigger: state
entity_id: binary_sensor.dual_channel_receiver_2_1 entity_id: binary_sensor.dual_channel_receiver_2_1
actions: actions:
- action: notify.pushbullet_notifier - action: notify.pushbullet_notifier

View File

@ -57,12 +57,12 @@ zone:
automation: automation:
- alias: "Bush Fire Alert" - alias: "Bush Fire Alert"
triggers: triggers:
trigger: geo_location - trigger: geo_location
source: nsw_rural_fire_service_feed source: nsw_rural_fire_service_feed
zone: zone.bush_fire_alert_zone zone: zone.bush_fire_alert_zone
event: enter event: enter
conditions: conditions:
condition: template - condition: template
value_template: "{{ trigger.to_state.attributes.type == 'Bush Fire' }}" value_template: "{{ trigger.to_state.attributes.type == 'Bush Fire' }}"
actions: actions:
- action: persistent_notification.create - action: persistent_notification.create

View File

@ -67,8 +67,7 @@ Using automatic polling can lead to calls that exceed your API limit, especially
You can use the `homeassistant.update_entity` action to update the sensor on-demand. For example, if you want to update `sensor.morning_commute` every 2 minutes on weekday mornings, you can use the following automation: You can use the `homeassistant.update_entity` action to update the sensor on-demand. For example, if you want to update `sensor.morning_commute` every 2 minutes on weekday mornings, you can use the following automation:
```yaml ```yaml
- id: update_morning_commute_sensor - alias: "Commute - Update morning commute sensor"
alias: "Commute - Update morning commute sensor"
initial_state: "on" initial_state: "on"
triggers: triggers:
- trigger: time_pattern - trigger: time_pattern

View File

@ -206,24 +206,24 @@ The example below shows how to control an `input_boolean` switch using the Harmo
automation: automation:
- alias: "Watch TV started from harmony hub" - alias: "Watch TV started from harmony hub"
triggers: triggers:
trigger: state - trigger: state
entity_id: remote.family_room entity_id: remote.family_room
conditions: conditions:
condition: template - condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Kodi" }}' value_template: '{{ trigger.to_state.attributes.current_activity == "Kodi" }}'
actions: actions:
action: input_boolean.turn_on - action: input_boolean.turn_on
target: target:
entity_id: input_boolean.notify entity_id: input_boolean.notify
- alias: "PowerOff started from harmony hub" - alias: "PowerOff started from harmony hub"
triggers: triggers:
trigger: state - trigger: state
entity_id: remote.family_room entity_id: remote.family_room
conditions: conditions:
condition: template - condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "PowerOff" }}' value_template: '{{ trigger.to_state.attributes.current_activity == "PowerOff" }}'
actions: actions:
action: input_boolean.turn_off - action: input_boolean.turn_off
target: target:
entity_id: input_boolean.notify entity_id: input_boolean.notify
``` ```

View File

@ -171,7 +171,7 @@ So an Automation action using the example above would look something like this.
```yaml ```yaml
actions: actions:
action: hdmi_cec.select_device - action: hdmi_cec.select_device
data: data:
device: Chromecast device: Chromecast
``` ```
@ -184,7 +184,7 @@ An Automation action using the example above would look something like this.
```yaml ```yaml
actions: actions:
action: hdmi_cec.power_on - action: hdmi_cec.power_on
``` ```
### Standby ### Standby
@ -195,7 +195,7 @@ An Automation action using the example above would look something like this.
```yaml ```yaml
actions: actions:
action: hdmi_cec.standby - action: hdmi_cec.standby
``` ```
### Change volume level ### Change volume level

View File

@ -68,8 +68,7 @@ You can also use the `homeassistant.update_entity` action to update the sensor o
```yaml ```yaml
automation: automation:
- id: update_morning_commute_sensor - alias: "Commute - Update morning commute sensor"
alias: "Commute - Update morning commute sensor"
initial_state: "on" initial_state: "on"
triggers: triggers:
- trigger: time_pattern - trigger: time_pattern

View File

@ -314,7 +314,7 @@ Update the location of the Home Assistant default zone (usually "Home").
```yaml ```yaml
actions: actions:
action: homeassistant.set_location - action: homeassistant.set_location
data: data:
latitude: 32.87336 latitude: 32.87336
longitude: 117.22743 longitude: 117.22743
@ -336,7 +336,7 @@ for example, a light and a switch can be toggled in a single action.
```yaml ```yaml
actions: actions:
action: homeassistant.toggle - action: homeassistant.toggle
target: target:
entity_id: entity_id:
- light.living_room - light.living_room
@ -358,7 +358,7 @@ for example, a light and a switch can be turned on in a single action.
```yaml ```yaml
actions: actions:
action: homeassistant.turn_on - action: homeassistant.turn_on
target: target:
entity_id: entity_id:
- light.living_room - light.living_room
@ -380,7 +380,7 @@ for example, a light and a switch can be turned off in a single action.
```yaml ```yaml
actions: actions:
action: homeassistant.turn_off - action: homeassistant.turn_off
target: target:
entity_id: entity_id:
- light.living_room - light.living_room
@ -399,7 +399,7 @@ Force one or more entities to update its data rather than wait for the next sche
```yaml ```yaml
actions: actions:
action: homeassistant.update_entity - action: homeassistant.update_entity
target: target:
entity_id: entity_id:
- light.living_room - light.living_room

View File

@ -455,14 +455,14 @@ The key name will be available in the event data in the `key_name` field. Exampl
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: event - trigger: event
event_type: homekit_tv_remote_key_pressed event_type: homekit_tv_remote_key_pressed
event_data: event_data:
key_name: arrow_right key_name: arrow_right
# Send the arrow right key via a broadlink IR blaster # Send the arrow right key via a broadlink IR blaster
actions: actions:
action: broadlink.send - action: broadlink.send
host: 192.168.1.55 host: 192.168.1.55
packet: XXXXXXXX packet: XXXXXXXX
``` ```

View File

@ -253,14 +253,14 @@ Here's an example of how to use these events for automations:
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: event - trigger: event
event_type: homematic.keypress event_type: homematic.keypress
event_data: event_data:
name: "Kitchen Switch" name: "Kitchen Switch"
channel: 1 channel: 1
param: PRESS_SHORT param: PRESS_SHORT
actions: actions:
action: switch.turn_on - action: switch.turn_on
target: target:
entity_id: switch.Kitchen_Ambience entity_id: switch.Kitchen_Ambience
``` ```
@ -307,7 +307,7 @@ Simulate a button being pressed:
```yaml ```yaml
... ...
actions: actions:
action: homematic.virtualkey - action: homematic.virtualkey
data: data:
address: "BidCoS-RF" address: "BidCoS-RF"
channel: 1 channel: 1
@ -319,7 +319,7 @@ Open KeyMatic:
```yaml ```yaml
... ...
actions: actions:
action: homematic.virtualkey - action: homematic.virtualkey
data: data:
address: "LEQ1234567" address: "LEQ1234567"
channel: 1 channel: 1
@ -331,7 +331,7 @@ Set boolean variable to true:
```yaml ```yaml
... ...
actions: actions:
action: homematic.set_variable_value - action: homematic.set_variable_value
target: target:
entity_id: homematic.ccu2 entity_id: homematic.ccu2
data: data:
@ -349,7 +349,7 @@ Manually turn on a switch actor:
```yaml ```yaml
... ...
actions: actions:
action: homematic.set_device_value - action: homematic.set_device_value
data: data:
address: "LEQ1234567" address: "LEQ1234567"
channel: 1 channel: 1
@ -362,7 +362,7 @@ Manually set temperature on thermostat:
```yaml ```yaml
... ...
actions: actions:
action: homematic.set_device_value - action: homematic.set_device_value
data: data:
address: "LEQ1234567" address: "LEQ1234567"
channel: 4 channel: 4
@ -375,7 +375,7 @@ Manually set the active profile on thermostat:
```yaml ```yaml
... ...
actions: actions:
action: homematic.set_device_value - action: homematic.set_device_value
data: data:
address: "LEQ1234567" address: "LEQ1234567"
channel: 1 channel: 1
@ -389,7 +389,7 @@ Set the week program of a wall thermostat:
```yaml ```yaml
... ...
actions: actions:
action: homematic.put_paramset - action: homematic.put_paramset
data: data:
interface: wireless interface: wireless
address: "LEQ1234567" address: "LEQ1234567"
@ -403,7 +403,7 @@ Set the week program of a wall thermostat with explicit `rx_mode` (BidCos-RF onl
```yaml ```yaml
... ...
actions: actions:
action: homematic.put_paramset - action: homematic.put_paramset
data: data:
interface: wireless interface: wireless
address: "LEQ1234567" address: "LEQ1234567"
@ -424,7 +424,7 @@ Manually set lock on KeyMatic devices:
```yaml ```yaml
... ...
actions: actions:
action: lock.lock - action: lock.lock
target: target:
entity_id: lock.leq1234567 entity_id: lock.leq1234567
``` ```
@ -434,7 +434,7 @@ Manually set unlock on KeyMatic devices:
```yaml ```yaml
... ...
actions: actions:
action: lock.unlock - action: lock.unlock
target: target:
entity_id: lock.leq1234567 entity_id: lock.leq1234567
``` ```
@ -489,12 +489,12 @@ template:
automation: automation:
- alias: "Homematic Reconnect" - alias: "Homematic Reconnect"
triggers: triggers:
trigger: state - trigger: state
entity_id: binary_sensor.homematic_is_sending_updates entity_id: binary_sensor.homematic_is_sending_updates
to: "off" to: "off"
actions: actions:
# Reconnect, if sensor has not been updated for over 10 minutes # Reconnect, if sensor has not been updated for over 10 minutes
action: homematic.reconnect - action: homematic.reconnect
``` ```
{% endraw %} {% endraw %}
@ -535,10 +535,10 @@ automation:
automation: automation:
- alias: "Homematic CCU Reboot" - alias: "Homematic CCU Reboot"
triggers: triggers:
trigger: state - trigger: state
entity_id: sensor.v_last_reboot entity_id: sensor.v_last_reboot
actions: actions:
action: homematic.reconnect - action: homematic.reconnect
``` ```
## Notifications ## Notifications

View File

@ -235,7 +235,7 @@ Activate eco mode with duration.
```yaml ```yaml
... ...
actions: actions:
action: homematicip_cloud.activate_eco_mode_with_duration - action: homematicip_cloud.activate_eco_mode_with_duration
data: data:
duration: 60 duration: 60
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx
@ -246,7 +246,7 @@ Activate eco mode with period.
```yaml ```yaml
... ...
actions: actions:
action: homematicip_cloud.activate_eco_mode_with_period - action: homematicip_cloud.activate_eco_mode_with_period
data: data:
endtime: 2019-09-17 18:00 endtime: 2019-09-17 18:00
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx
@ -257,7 +257,7 @@ Activates the vacation mode until the given time.
```yaml ```yaml
... ...
actions: actions:
action: homematicip_cloud.activate_vacation - action: homematicip_cloud.activate_vacation
data: data:
endtime: 2019-09-17 18:00 endtime: 2019-09-17 18:00
temperature: 18.5 temperature: 18.5
@ -269,7 +269,7 @@ Deactivates the eco mode immediately.
```yaml ```yaml
... ...
actions: actions:
action: homematicip_cloud.deactivate_eco_mode - action: homematicip_cloud.deactivate_eco_mode
data: data:
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx
``` ```
@ -279,7 +279,7 @@ Deactivates the vacation mode immediately.
```yaml ```yaml
... ...
actions: actions:
action: homematicip_cloud.deactivate_vacation - action: homematicip_cloud.deactivate_vacation
data: data:
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx
``` ```
@ -292,7 +292,7 @@ You can get the required index from the native Homematic IP App.
```yaml ```yaml
... ...
actions: actions:
action: homematicip_cloud.set_active_climate_profile - action: homematicip_cloud.set_active_climate_profile
target: target:
entity_id: climate.livingroom entity_id: climate.livingroom
data: data:
@ -304,7 +304,7 @@ Dump the configuration of the Homematic IP Access Point(s).
```yaml ```yaml
... ...
actions: actions:
action: homematicip_cloud.dump_hap_config - action: homematicip_cloud.dump_hap_config
data: data:
anonymize: True anonymize: True
``` ```
@ -314,7 +314,7 @@ Reset energy counter of measuring actuators.
```yaml ```yaml
... ...
actions: actions:
action: homematicip_cloud.reset_energy_counter - action: homematicip_cloud.reset_energy_counter
target: target:
entity_id: switch.livingroom entity_id: switch.livingroom
``` ```
@ -324,7 +324,7 @@ Enable (or disable) Cooling mode for the entire home. Disabling Cooling mode wil
```yaml ```yaml
... ...
actions: actions:
action: homematicip_cloud.set_home_cooling_mode - action: homematicip_cloud.set_home_cooling_mode
data: data:
cooling: True cooling: True
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx

View File

@ -113,7 +113,7 @@ Example of adding a tag to your notification. This won't create new notification
- trigger: state - trigger: state
entity_id: sensor.sensor entity_id: sensor.sensor
actions: actions:
action: notify.html5 - action: notify.html5
data: data:
message: "Last known sensor state is {{ states('sensor.sensor') }}." message: "Last known sensor state is {{ states('sensor.sensor') }}."
data: data:
@ -210,7 +210,7 @@ notification is received on the device.
```yaml ```yaml
- alias: "HTML5 push notification received and displayed on device" - alias: "HTML5 push notification received and displayed on device"
triggers: triggers:
trigger: event - trigger: event
event_type: html5_notification.received event_type: html5_notification.received
``` ```
@ -221,7 +221,7 @@ You will receive an event named `html5_notification.clicked` when the notificati
```yaml ```yaml
- alias: "HTML5 push notification clicked" - alias: "HTML5 push notification clicked"
triggers: triggers:
trigger: event - trigger: event
event_type: html5_notification.clicked event_type: html5_notification.clicked
``` ```
@ -230,7 +230,7 @@ or
```yaml ```yaml
- alias: "HTML5 push notification action button clicked" - alias: "HTML5 push notification action button clicked"
triggers: triggers:
trigger: event - trigger: event
event_type: html5_notification.clicked event_type: html5_notification.clicked
event_data: event_data:
action: open_door action: open_door
@ -243,7 +243,7 @@ You will receive an event named `html5_notification.closed` when the notificatio
```yaml ```yaml
- alias: "HTML5 push notification clicked" - alias: "HTML5 push notification clicked"
triggers: triggers:
trigger: event - trigger: event
event_type: html5_notification.closed event_type: html5_notification.closed
``` ```

View File

@ -225,7 +225,7 @@ Velocity controls the speed of the shade. The default speed from Hunter Douglas
``` yaml ``` yaml
alias: "Blinds closed at night" alias: "Blinds closed at night"
triggers: triggers:
trigger: time - trigger: time
at: "18:00:00" at: "18:00:00"
actions: actions:
- action: scene.turn_on - action: scene.turn_on
@ -238,12 +238,11 @@ actions:
This automation is not recommended for battery-powered shades. This automation is not recommended for battery-powered shades.
``` yaml ``` yaml
alias: Force Update alias: "Force Update"
description: 'Update the position of defined shades' description: "Update the position of defined shades"
mode: single
triggers: triggers:
- trigger: time_pattern - trigger: time_pattern
hours: '1' hours: 1
actions: actions:
- action: homeassistant.update_entity - action: homeassistant.update_entity
target: target:

View File

@ -111,8 +111,7 @@ To start Hyperion with an effect, use the following automation:
```yaml ```yaml
automation: automation:
- id: one - alias: "Turn Hyperion effect on when light goes on"
alias: "Turn Hyperion effect on when light goes on"
triggers: triggers:
- trigger: state - trigger: state
entity_id: light.hyperion entity_id: light.hyperion

View File

@ -91,7 +91,6 @@ To get the Estimated distance sensor to work, in most cases, it has to be calibr
```yaml ```yaml
alias: "The black trash can has left the building" alias: "The black trash can has left the building"
mode: single
triggers: triggers:
- trigger: state - trigger: state
entity_id: sensor.black_trash_bin_estimated_distance entity_id: sensor.black_trash_bin_estimated_distance

View File

@ -36,14 +36,12 @@ You then need to consume that incoming information with the following automation
```yaml ```yaml
automation: automation:
- id: this_is_the_automation_id - alias: "The optional automation alias"
alias: "The optional automation alias"
triggers: triggers:
- trigger: event - trigger: event
event_type: ifttt_webhook_received event_type: ifttt_webhook_received
event_data: event_data:
action: call_service # the same action 'name' you used in the Body section of the IFTTT recipe action: call_service # the same action 'name' you used in the Body section of the IFTTT recipe
conditions:
actions: actions:
- action: '{{ trigger.event.data.service }}' - action: '{{ trigger.event.data.service }}'
target: target:
@ -144,10 +142,10 @@ Add the *Then That* action. The below example sends a notification to the IFTTT
automation: automation:
alias: "Startup Notification" alias: "Startup Notification"
triggers: triggers:
trigger: homeassistant - trigger: homeassistant
event: start event: start
actions: actions:
action: ifttt.trigger - action: ifttt.trigger
data: {"event":"TestHA_Trigger", "value1":"Hello World!"} data: {"event":"TestHA_Trigger", "value1":"Hello World!"}
``` ```
@ -162,10 +160,10 @@ IFTTT can also be used in scripts and with templates. Here is the above automati
automation: automation:
alias: "Startup Notification" alias: "Startup Notification"
triggers: triggers:
trigger: homeassistant - trigger: homeassistant
event: start event: start
actions: actions:
action: script.ifttt_notify - action: script.ifttt_notify
data: data:
value1: "HA Status:" value1: "HA Status:"
value2: "{{ trigger.event.data.entity_id.split('_')[1] }} is " value2: "{{ trigger.event.data.entity_id.split('_')[1] }} is "

View File

@ -35,7 +35,7 @@ The `found_plate` event is triggered after OpenALPR has found a new license plat
automation: automation:
- alias: "Open garage door" - alias: "Open garage door"
triggers: triggers:
trigger: event - trigger: event
event_type: image_processing.found_plate event_type: image_processing.found_plate
event_data: event_data:
entity_id: openalpr.camera_garage_1 entity_id: openalpr.camera_garage_1
@ -56,7 +56,7 @@ The `detect_face` event is triggered after a Face entity has found a face.
automation: automation:
- alias: "Known person in front of my door" - alias: "Known person in front of my door"
triggers: triggers:
trigger: event - trigger: event
event_type: image_processing.detect_face event_type: image_processing.detect_face
event_data: event_data:
entity_id: image_processing.door entity_id: image_processing.door

View File

@ -194,8 +194,8 @@ The example below filters the event trigger by `entry_id`, fetches the message a
{% raw %} {% raw %}
```yaml ```yaml
alias: imap fetch and seen example alias: "imap fetch and seen example"
description: Fetch and mark an incoming message as seen description: "Fetch and mark an incoming message as seen"
triggers: triggers:
- trigger: event - trigger: event
event_type: imap_content event_type: imap_content
@ -215,10 +215,8 @@ actions:
entry: 91fadb3617c5a3ea692aeb62d92aa869 entry: 91fadb3617c5a3ea692aeb62d92aa869
uid: "{{ trigger.event.data['uid'] }}" uid: "{{ trigger.event.data['uid'] }}"
- action: persistent_notification.create - action: persistent_notification.create
metadata: {}
data: data:
message: "{{ message_text['subject'] }}" message: "{{ message_text['subject'] }}"
mode: single
``` ```
{% endraw %} {% endraw %}

View File

@ -49,7 +49,7 @@ To send an alert if the CV pressure is too low or too high, consider the followi
```yaml ```yaml
- alias: "Low CV Pressure Alert" - alias: "Low CV Pressure Alert"
triggers: triggers:
trigger: numeric_state - trigger: numeric_state
entity_id: sensor.cv_pressure entity_id: sensor.cv_pressure
below: 1.0 below: 1.0
actions: actions:

View File

@ -118,10 +118,10 @@ automation:
# Turns on bedroom light at the time specified. # Turns on bedroom light at the time specified.
automation: automation:
triggers: triggers:
trigger: time - trigger: time
at: input_datetime.bedroom_alarm_clock_time at: input_datetime.bedroom_alarm_clock_time
actions: actions:
action: light.turn_on - action: light.turn_on
target: target:
entity_id: light.bedroom entity_id: light.bedroom
``` ```

View File

@ -125,10 +125,11 @@ input_number:
min: 0 min: 0
max: 254 max: 254
step: 1 step: 1
automation: automation:
- alias: "Bedroom Light - Adjust Brightness" - alias: "Bedroom Light - Adjust Brightness"
triggers: triggers:
trigger: state - trigger: state
entity_id: input_number.bedroom_brightness entity_id: input_number.bedroom_brightness
actions: actions:
- action: light.turn_on - action: light.turn_on
@ -157,6 +158,7 @@ input_select:
- Relax - Relax
- 'OFF' - 'OFF'
initial: "Select" initial: "Select"
input_number: input_number:
bedroom_brightness: bedroom_brightness:
name: Brightness name: Brightness
@ -164,12 +166,13 @@ input_number:
min: 0 min: 0
max: 254 max: 254
step: 1 step: 1
automation: automation:
- alias: "Bedroom Light - Custom" - alias: "Bedroom Light - Custom"
triggers: triggers:
trigger: state - trigger: state
entity_id: input_select.scene_bedroom entity_id: input_select.scene_bedroom
to: CUSTOM to: "CUSTOM"
actions: actions:
- action: light.turn_on - action: light.turn_on
target: target:
@ -200,10 +203,10 @@ input_number:
automation: automation:
- alias: "Set temp slider" - alias: "Set temp slider"
triggers: triggers:
trigger: mqtt - trigger: mqtt
topic: "setTemperature" topic: "setTemperature"
actions: actions:
action: input_number.set_value - action: input_number.set_value
target: target:
entity_id: input_number.target_temp entity_id: input_number.target_temp
data: data:
@ -213,10 +216,10 @@ automation:
# It publishes its value to the same MQTT topic it is also subscribed to. # It publishes its value to the same MQTT topic it is also subscribed to.
- alias: "Temp slider moved" - alias: "Temp slider moved"
triggers: triggers:
trigger: state - trigger: state
entity_id: input_number.target_temp entity_id: input_number.target_temp
actions: actions:
action: mqtt.publish - action: mqtt.publish
data: data:
topic: "setTemperature" topic: "setTemperature"
retain: true retain: true
@ -251,7 +254,7 @@ input_number:
automation: automation:
- alias: "turn something off after x time after turning it on" - alias: "turn something off after x time after turning it on"
triggers: triggers:
trigger: state - trigger: state
entity_id: switch.something entity_id: switch.something
to: "on" to: "on"
actions: actions:

View File

@ -136,14 +136,14 @@ The following example shows the usage of the `input_select.select_option` action
automation: automation:
- alias: "example automation" - alias: "example automation"
triggers: triggers:
trigger: event - trigger: event
event_type: MY_CUSTOM_EVENT event_type: MY_CUSTOM_EVENT
actions: actions:
- action: input_select.select_option - action: input_select.select_option
target: target:
entity_id: input_select.who_cooks entity_id: input_select.who_cooks
data: data:
option: Paulus option: "Paulus"
``` ```
To dynamically set the `input_select` options you can call `input_select.set_options` in an automation: To dynamically set the `input_select` options you can call `input_select.set_options` in an automation:
@ -153,7 +153,7 @@ To dynamically set the `input_select` options you can call `input_select.set_opt
automation: automation:
- alias: "example automation" - alias: "example automation"
triggers: triggers:
trigger: event - trigger: event
event_type: MY_CUSTOM_EVENT event_type: MY_CUSTOM_EVENT
actions: actions:
- action: input_select.set_options - action: input_select.set_options
@ -186,11 +186,11 @@ input_select:
# It sets the value selector on the GUI. This selector also had its own automation when the value is changed. # It sets the value selector on the GUI. This selector also had its own automation when the value is changed.
- alias: "Set Thermostat Mode Selector" - alias: "Set Thermostat Mode Selector"
triggers: triggers:
trigger: mqtt - trigger: mqtt
topic: "thermostatMode" topic: "thermostatMode"
# entity_id: input_select.thermostat_mode # entity_id: input_select.thermostat_mode
actions: actions:
action: input_select.select_option - action: input_select.select_option
target: target:
entity_id: input_select.thermostat_mode entity_id: input_select.thermostat_mode
data: data:
@ -200,10 +200,10 @@ input_select:
# It publishes its value to the same MQTT topic it is also subscribed to. # It publishes its value to the same MQTT topic it is also subscribed to.
- alias: "Set Thermostat Mode" - alias: "Set Thermostat Mode"
triggers: triggers:
trigger: state - trigger: state
entity_id: input_select.thermostat_mode entity_id: input_select.thermostat_mode
actions: actions:
action: mqtt.publish - action: mqtt.publish
data: data:
topic: "thermostatMode" topic: "thermostatMode"
retain: true retain: true

View File

@ -130,7 +130,7 @@ input_text:
automation: automation:
- alias: "Bedroom Light - Custom" - alias: "Bedroom Light - Custom"
triggers: triggers:
trigger: state - trigger: state
entity_id: input_select.scene_bedroom entity_id: input_select.scene_bedroom
actions: actions:
- action: input_text.set_value - action: input_text.set_value

View File

@ -132,8 +132,7 @@ Triggering an Insteon scene on or off is done via automations. Two actions are p
```yaml ```yaml
automation: automation:
# Trigger an Insteon scene 25 # Trigger an Insteon scene 25
- id: trigger_scene_25_on - alias: "Turn on scene 25"
alias: "Turn on scene 25"
actions: actions:
- action: insteon.scene_on - action: insteon.scene_on
group: 25 group: 25
@ -155,8 +154,7 @@ This allows the mini-remotes to be configured as triggers for automations. Here
```yaml ```yaml
automation: automation:
# 4 or 8 button remote with button c pressed # 4 or 8 button remote with button c pressed
- id: light_on - alias: "Turn a light on"
alias: "Turn a light on"
triggers: triggers:
- trigger: event - trigger: event
event_type: insteon.button_on event_type: insteon.button_on
@ -173,8 +171,7 @@ automation:
entity_id: light.some_light entity_id: light.some_light
# single button remote # single button remote
- id: light_off - alias: "Turn a light off"
alias: "Turn a light off"
triggers: triggers:
- trigger: event - trigger: event
event_type: insteon.button_on event_type: insteon.button_on

View File

@ -93,7 +93,7 @@ A Home Assistant `isy994_control` event is emitted for every "control" event in
automation: automation:
- alias: "turn off living room on double tap lightswitch" - alias: "turn off living room on double tap lightswitch"
triggers: triggers:
trigger: event - trigger: event
event_type: isy994_control event_type: isy994_control
event_data: event_data:
entity_id: light.lr_track_lights_front entity_id: light.lr_track_lights_front
@ -103,7 +103,7 @@ automation:
uom: "100" uom: "100"
prec: "0" prec: "0"
actions: actions:
action: light.turn_off - action: light.turn_off
target: target:
entity_id: light.lr_track_lights_rear entity_id: light.lr_track_lights_rear
``` ```

View File

@ -228,7 +228,7 @@ Additional details about the values provided by the sensors can be found in Kale
A typical automation might look like the example below, which turns up the lights when the _media_location_ sensor leaves the _content_ state. A typical automation might look like the example below, which turns up the lights when the _media_location_ sensor leaves the _content_ state.
```yaml ```yaml
- alias: kaleidescape_theater_lights_up - alias: "Kaleidescape theater lights up"
triggers: triggers:
- trigger: state - trigger: state
entity_id: sensor.kaleidescape_theater_media_location entity_id: sensor.kaleidescape_theater_media_location

View File

@ -94,7 +94,7 @@ And an automation rule to breathe life into it:
automation: automation:
alias: "Keyboard all lights on" alias: "Keyboard all lights on"
triggers: triggers:
trigger: event - trigger: event
event_type: keyboard_remote_command_received event_type: keyboard_remote_command_received
event_data: event_data:
device_descriptor: "/dev/input/event0" device_descriptor: "/dev/input/event0"
@ -102,7 +102,7 @@ automation:
type: key_down # only trigger on key_down events (optional) type: key_down # only trigger on key_down events (optional)
actions: actions:
action: light.turn_on - action: light.turn_on
target: target:
entity_id: light.all entity_id: light.all
``` ```
@ -125,7 +125,7 @@ Here's an automation example that plays a sound through a media player whenever
automation: automation:
- alias: "Keyboard Connected" - alias: "Keyboard Connected"
triggers: triggers:
trigger: event - trigger: event
event_type: keyboard_remote_connected event_type: keyboard_remote_connected
actions: actions:
- action: media_player.play_media - action: media_player.play_media
@ -137,7 +137,7 @@ automation:
- alias: "Bluetooth Keyboard Disconnected" - alias: "Bluetooth Keyboard Disconnected"
triggers: triggers:
trigger: event - trigger: event
event_type: keyboard_remote_disconnected event_type: keyboard_remote_disconnected
event_data: event_data:
device_name: "00:58:56:4C:C0:91" device_name: "00:58:56:4C:C0:91"

View File

@ -208,27 +208,24 @@ Example automation using these IR codes to toggle a Sonoff plug.
```yaml ```yaml
# Example kira_sensor # Example kira_sensor
- id: "1583339338363" - alias: "Panasonic on"
alias: "Panasonic On" description: "Turn on sonoff s20 relay"
description: Turn on sonoff s20 relay
triggers: triggers:
- entity_id: sensor.kira_wireless - trigger: state
trigger: state entity_id: sensor.kira_wireless
to: PanaOne to: "PanaOne"
conditions: []
actions: actions:
- device_id: 3628b4f34df943b3b721ead954cf3ca7 - device_id: 3628b4f34df943b3b721ead954cf3ca7
domain: switch domain: switch
entity_id: switch.plug2_relay entity_id: switch.plug2_relay
type: turn_on type: turn_on
- id: "1584035716024"
alias: "Panaxonic Off " - alias: "Panaxonic off"
description: Turn off sonoff s20 relay description: "Turn off sonoff s20 relay"
triggers: triggers:
- entity_id: sensor.kira_wireless - trigger: state
trigger: state entity_id: sensor.kira_wireless
to: PanaTwo to: "PanaTwo"
conditions: []
actions: actions:
- device_id: 3628b4f34df943b3b721ead954cf3ca7 - device_id: 3628b4f34df943b3b721ead954cf3ca7
domain: switch domain: switch

View File

@ -241,16 +241,14 @@ Example automation configuration
{% raw %} {% raw %}
```yaml ```yaml
- alias: Single group address trigger - alias: "Single group address trigger"
description: ''
triggers: triggers:
- trigger: knx.telegram - trigger: knx.telegram
destination: 1/2/3 destination: 1/2/3
group_value_read: false group_value_read: false
outgoing: false outgoing: false
conditions: "{{ trigger.value == 0 }}" conditions: "{{ trigger.value == 0 }}"
action: [] actions: []
mode: single
``` ```
{% endraw %} {% endraw %}
@ -352,7 +350,7 @@ response:
```yaml ```yaml
# Example script to send a fixed value and the state of an entity # Example script to send a fixed value and the state of an entity
alias: My Script alias: "My Script"
sequence: sequence:
- action: knx.send - action: knx.send
data: data:
@ -623,7 +621,7 @@ Let's pretend you have a binary sensor with the name `Livingroom.Switch` and you
# Example automation.yaml entry # Example automation.yaml entry
automation: automation:
- triggers: - triggers:
trigger: numeric_state - trigger: numeric_state
entity_id: binary_sensor.livingroom_switch entity_id: binary_sensor.livingroom_switch
attribute: counter attribute: counter
above: 0 above: 0
@ -633,10 +631,11 @@ automation:
entity_id: binary_sensor.cover_abstell entity_id: binary_sensor.cover_abstell
state: "on" state: "on"
actions: actions:
- entity_id: light.hue_color_lamp_1 - action: light.turn_on
action: light.turn_on entity_id: light.hue_color_lamp_1
- triggers: - triggers:
trigger: numeric_state - trigger: numeric_state
entity_id: binary_sensor.livingroom_switch entity_id: binary_sensor.livingroom_switch
attribute: counter attribute: counter
above: 1 above: 1
@ -646,10 +645,12 @@ automation:
entity_id: binary_sensor.cover_abstell entity_id: binary_sensor.cover_abstell
state: "on" state: "on"
actions: actions:
- entity_id: light.hue_bloom_1 - action: light.turn_on
action: homeassistant.turn_on target:
- entity_id: light.hue_bloom_2 entity_id:
action: homeassistant.turn_on - light.hue_bloom_1
- light.hue_bloom_2
``` ```
{% configuration %} {% configuration %}

View File

@ -43,8 +43,7 @@ These automations can be configured through the UI (see [device triggers](/docs/
```yaml ```yaml
automation: automation:
- id: kodi_turn_on - alias: "Kodi: turn on"
alias: "Kodi: turn on"
triggers: triggers:
- trigger: device - trigger: device
device_id: !secret kodi_device_id device_id: !secret kodi_device_id
@ -54,8 +53,7 @@ automation:
actions: actions:
- action: script.kodi_turn_on - action: script.kodi_turn_on
- id: kodi_turn_off - alias: "Kodi: turn off"
alias: "Kodi: turn off"
triggers: triggers:
- trigger: device - trigger: device
device_id: !secret kodi_device_id device_id: !secret kodi_device_id

View File

@ -165,12 +165,12 @@ To add a notification sound, icon, cycles, or priority override,
```yaml ```yaml
- alias: "Send notification on arrival at school" - alias: "Send notification on arrival at school"
triggers: triggers:
trigger: state - trigger: state
entity_id: device_tracker.tom_mobile entity_id: device_tracker.tom_mobile
from: "not_home" from: "not_home"
to: "school" to: "school"
actions: actions:
action: notify.my_lametric - action: notify.my_lametric
data: data:
message: "Tom has arrived at school!" message: "Tom has arrived at school!"
data: data:

View File

@ -165,7 +165,7 @@ automation:
triggers: triggers:
- trigger: event - trigger: event
event_type: lcn_transponder event_type: lcn_transponder
condition: "{{ trigger.event.data.code in ['aabbcc', 'ddeeff', '112233'] }}" conditions: "{{ trigger.event.data.code in ['aabbcc', 'ddeeff', '112233'] }}"
actions: actions:
... ...
``` ```

View File

@ -77,8 +77,7 @@ In order to apply attributes to an entity, you will need to add `data:` to the c
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
automation: automation:
- id: one - alias: "Turn on light when motion is detected"
alias: "Turn on light when motion is detected"
triggers: triggers:
- trigger: state - trigger: state
entity_id: binary_sensor.motion_1 entity_id: binary_sensor.motion_1
@ -93,11 +92,10 @@ automation:
``` ```
```yaml ```yaml
# Ledlist morning on, red # Ledlist morning on, red
- id: llmor - alias: "Stair morning on"
alias: "Stair morning on"
triggers: triggers:
- at: '05:00' - trigger: time
trigger: time at: '05:00'
actions: actions:
- action: light.turn_on - action: light.turn_on
target: target:

View File

@ -85,12 +85,12 @@ The LIRC integration fires `ir_command_received` events on the bus. You can capt
automation: automation:
- alias: "Off on Remote" - alias: "Off on Remote"
triggers: triggers:
trigger: event - trigger: event
event_type: ir_command_received event_type: ir_command_received
event_data: event_data:
button_name: KEY_0 button_name: KEY_0
actions: actions:
action: homeassistant.turn_off - action: homeassistant.turn_off
target: target:
entity_id: group.a_lights entity_id: group.a_lights
``` ```

View File

@ -54,12 +54,12 @@ You can then consume that information with the following automation:
```yaml ```yaml
automation: automation:
triggers: triggers:
trigger: event - trigger: event
event_type: mailgun_message_received event_type: mailgun_message_received
event_data: event_data:
action: call_service action: call_service
actions: actions:
action: light.turn_on - action: light.turn_on
target: target:
entity_id: light.office entity_id: light.office
``` ```
@ -103,10 +103,10 @@ The following automation reacts to an event by sending out an email with two att
# Example automation using Mailgun notifications # Example automation using Mailgun notifications
automation: automation:
triggers: triggers:
trigger: event - trigger: event
event_type: SPECIAL_EVENT event_type: SPECIAL_EVENT
actions: actions:
action: notify.mailgun - action: notify.mailgun
data: data:
title: "Something special has happened" title: "Something special has happened"
message: "This a test message from Home Assistant" message: "This a test message from Home Assistant"

View File

@ -194,7 +194,7 @@ automation:
entity_id: alarm_control_panel.home_alarm entity_id: alarm_control_panel.home_alarm
state: armed_away state: armed_away
actions: actions:
action: alarm_control_panel.alarm_trigger - action: alarm_control_panel.alarm_trigger
target: target:
entity_id: alarm_control_panel.home_alarm entity_id: alarm_control_panel.home_alarm
``` ```

View File

@ -128,24 +128,25 @@ notify:
default_room: "#hasstest:matrix.org" default_room: "#hasstest:matrix.org"
automation: automation:
- alias: 'React to !testword' - alias: "React to !testword"
triggers: triggers:
trigger: event - trigger: event
event_type: matrix_command event_type: matrix_command
event_data: event_data:
command: testword command: testword
actions: actions:
action: notify.matrix_notify - action: notify.matrix_notify
data: data:
message: "It looks like you wrote !testword" message: "It looks like you wrote !testword"
- alias: 'React to an introduction'
- alias: "React to an introduction"
triggers: triggers:
trigger: event - trigger: event
event_type: matrix_command event_type: matrix_command
event_data: event_data:
command: introduction command: introduction
actions: actions:
action: notify.matrix_notify - action: notify.matrix_notify
data: data:
message: "Hello {{trigger.event.data.args['name']}}" message: "Hello {{trigger.event.data.args['name']}}"
``` ```
@ -197,7 +198,7 @@ Supported formats are: `text` (default), and `html`.
```yaml ```yaml
# Example of notification as HTML # Example of notification as HTML
actions: actions:
action: notify.matrix_notify - action: notify.matrix_notify
data: data:
message: >- message: >-
<h1>Hello, world!</h1> <h1>Hello, world!</h1>
@ -212,7 +213,7 @@ It is possible to send images with notifications. To do so, add a list of paths
```yaml ```yaml
# Example of notification with images # Example of notification with images
actions: actions:
action: notify.matrix_notify - action: notify.matrix_notify
data: data:
message: "Test with images" message: "Test with images"
data: data:

View File

@ -69,7 +69,7 @@ The `play_media` function can be used in scripts to change channels:
# #
change_channel: change_channel:
sequence: sequence:
action: media_player.play_media - action: media_player.play_media
target: target:
entity_id: media_player.mediaroom_stb entity_id: media_player.mediaroom_stb
data: data:
@ -88,7 +88,7 @@ The `play_media` function can also be used to trigger actions on the set-up-box
# #
press_button: press_button:
sequence: sequence:
action: media_player.play_media - action: media_player.play_media
target: target:
entity_id: media_player.mediaroom_stb entity_id: media_player.mediaroom_stb
data: data:

View File

@ -92,9 +92,9 @@ Example automation
automation: automation:
- alias: "Alert me about weather warnings" - alias: "Alert me about weather warnings"
triggers: triggers:
trigger: state - trigger: state
entity_id: binary_sensor.meteoalarm entity_id: binary_sensor.meteoalarm
from: 'off' from: "off"
actions: actions:
- action: notify.notify - action: notify.notify
data: data:

View File

@ -89,7 +89,7 @@ Automations can be triggered on new files created on the Minio server using the
automation: automation:
- alias: "Upload camera snapshot" - alias: "Upload camera snapshot"
triggers: triggers:
trigger: event - trigger: event
event_type: folder_watcher event_type: folder_watcher
event_data: event_data:
event_type: created event_type: created

View File

@ -39,32 +39,34 @@ An example automation:
```yaml ```yaml
automation: automation:
- alias: Notify CallerID - alias: "Notify CallerID"
triggers: triggers:
trigger: state - trigger: state
entity_id: sensor.phone_modem entity_id: sensor.phone_modem
to: "callerid" to: "callerid"
actions: actions:
action: notify.notify - action: notify.notify
data: data:
message: "Call from {{ state_attr('sensor.phone_modem', 'cid_name') }} at {{ state_attr('sensor.phone_modem', 'cid_number') }} " message: "Call from {{ state_attr('sensor.phone_modem', 'cid_name') }} at {{ state_attr('sensor.phone_modem', 'cid_number') }} "
- alias: Notify CallerID webui
- alias: "Notify CallerID webui"
triggers: triggers:
trigger: state - trigger: state
entity_id: sensor.phone_modem entity_id: sensor.phone_modem
to: "callerid" to: "callerid"
actions: actions:
action: persistent_notification.create - action: persistent_notification.create
data: data:
title: "Call from" title: "Call from"
message: "{{ state_attr('sensor.phone_modem', 'cid_time').strftime("%I:%M %p") }} {{ state_attr('sensor.phone_modem', 'cid_name') }} {{ state_attr('sensor.phone_modem', 'cid_number') }} " message: "{{ state_attr('sensor.phone_modem', 'cid_time').strftime("%I:%M %p") }} {{ state_attr('sensor.phone_modem', 'cid_name') }} {{ state_attr('sensor.phone_modem', 'cid_number') }} "
- alias: Say CallerID
- alias: "Say CallerID"
triggers: triggers:
trigger: state - trigger: state
entity_id: sensor.phone_modem entity_id: sensor.phone_modem
to: "callerid" to: "callerid"
actions: actions:
action: tts.google_say - action: tts.google_say
data: data:
message: "Call from {{ state_attr('sensor.phone_modem', 'cid_name') }}" message: "Call from {{ state_attr('sensor.phone_modem', 'cid_name') }}"
``` ```

View File

@ -212,8 +212,7 @@ You only have to create one automation with only one Motionblinds cover as entit
Example YAML automation for custom polling interval (every minute): Example YAML automation for custom polling interval (every minute):
```yaml ```yaml
alias: Motionblinds polling automation alias: "Motionblinds polling automation"
mode: single
triggers: triggers:
- trigger: time_pattern - trigger: time_pattern
minutes: "/1" minutes: "/1"

View File

@ -61,8 +61,7 @@ Since Motionblinds Bluetooth motors require a Bluetooth connection to control th
This can also be automated using a YAML automation. For instance, the following automation connects to your Motionblind every 24 hours to update its state in Home Assistant: This can also be automated using a YAML automation. For instance, the following automation connects to your Motionblind every 24 hours to update its state in Home Assistant:
```yaml ```yaml
alias: Motionblinds Bluetooth polling automation alias: "Motionblinds Bluetooth polling automation"
mode: single
triggers: triggers:
- trigger: time_pattern - trigger: time_pattern
hours: "/24" hours: "/24"

View File

@ -1063,11 +1063,11 @@ Use as [`script`](/integrations/script/) in automations.
automation: automation:
alias: "Send me a message when I get home" alias: "Send me a message when I get home"
triggers: triggers:
trigger: state - trigger: state
entity_id: device_tracker.me entity_id: device_tracker.me
to: "home" to: "home"
actions: actions:
action: script.notify_mqtt - action: script.notify_mqtt
data: data:
target: "me" target: "me"
message: "I'm home" message: "I'm home"

View File

@ -410,7 +410,6 @@ data:
data: data:
image: "{{ trigger.event.data.attachment.image }}" image: "{{ trigger.event.data.attachment.image }}"
video: "{{ trigger.event.data.attachment.video }}" video: "{{ trigger.event.data.attachment.video }}"
mode: single
``` ```
{% endraw %} {% endraw %}

View File

@ -205,13 +205,11 @@ Example:
- alias: "Netatmo event example" - alias: "Netatmo event example"
description: "Count all events pushed by the Netatmo API" description: "Count all events pushed by the Netatmo API"
triggers: triggers:
- event_data: {} - trigger: event
event_type: netatmo_event event_type: netatmo_event
trigger: event
actions: actions:
- data: {} - action: counter.increment
entity_id: counter.event_counter entity_id: counter.event_counter
action: counter.increment
``` ```
Example: Example:
@ -223,17 +221,17 @@ Example:
- alias: "Motion at home" - alias: "Motion at home"
description: "Motion detected at home" description: "Motion detected at home"
triggers: triggers:
- event_type: netatmo_event - trigger: event
trigger: event event_type: netatmo_event
event_data: event_data:
type: movement type: movement
actions: actions:
- data: - action: persistent_notification.create
data:
message: > message: >
{{ trigger.event.data["data"]["message"] }} {{ trigger.event.data["data"]["message"] }}
at {{ trigger.event.data["data"]["home_name"] }} at {{ trigger.event.data["data"]["home_name"] }}
title: Netatmo event title: "Netatmo event"
action: persistent_notification.create
``` ```
{% endraw %} {% endraw %}
@ -247,17 +245,17 @@ Example:
- alias: "Motion at home" - alias: "Motion at home"
description: "Motion detected at home" description: "Motion detected at home"
triggers: triggers:
- event_type: netatmo_event - trigger: event
trigger: event event_type: netatmo_event
event_data: event_data:
type: human # other possible types: animal, vehicle type: human # other possible types: animal, vehicle
actions: actions:
- data: - action: persistent_notification.create
data:
message: > message: >
{{ trigger.event.data["data"]["message"] }} {{ trigger.event.data["data"]["message"] }}
at {{ trigger.event.data["data"]["home_name"] }} at {{ trigger.event.data["data"]["home_name"] }}
title: Netatmo event title: Netatmo event
action: persistent_notification.create
``` ```
{% endraw %} {% endraw %}
@ -271,24 +269,24 @@ Example:
- alias: "Door or window open or movement" - alias: "Door or window open or movement"
description: "Notifies which door or window is open or was moved" description: "Notifies which door or window is open or was moved"
triggers: triggers:
- event_type: netatmo_event - trigger: event
trigger: event event_type: netatmo_event
event_data: event_data:
type: tag_open type: tag_open
- event_type: netatmo_event - trigger: event
trigger: event event_type: netatmo_event
event_data: event_data:
type: tag_big_move type: tag_big_move
- event_type: netatmo_event - trigger: event
trigger: event event_type: netatmo_event
event_data: event_data:
type: tag_small_move type: tag_small_move
actions: actions:
- data: - action: persistent_notification.create
data:
message: > message: >
{{ trigger.event.data["data"]["message"] }} {{ trigger.event.data["data"]["message"] }}
title: Netatmo event title: "Netatmo event"
action: persistent_notification.create
``` ```
{% endraw %} {% endraw %}

View File

@ -31,8 +31,7 @@ The state is the last reading from Nightscout, and you can see other information
### Example automation ### Example automation
```yaml ```yaml
- id: "1234567890123" - alias: "overnight_low_kitchen_lights"
alias: "overnight_low_kitchen_lights"
description: Turn on the lights in the kitchen if my blood sugar drops low overnight description: Turn on the lights in the kitchen if my blood sugar drops low overnight
triggers: triggers:
- trigger: numeric_state - trigger: numeric_state

View File

@ -127,7 +127,7 @@ The notify integration supports specifying [templates](/docs/configuration/templ
```yaml ```yaml
actions: actions:
action: notify.persistent_notification - action: notify.persistent_notification
data: data:
message: "You have {{ states('todo.shopping_list') }} items on your shopping list." message: "You have {{ states('todo.shopping_list') }} items on your shopping list."
``` ```
@ -138,7 +138,7 @@ actions:
```yaml ```yaml
actions: actions:
action: notify.persistent_notification - action: notify.persistent_notification
data: data:
message: "The sun is {% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}!" message: "The sun is {% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}!"
``` ```

View File

@ -52,12 +52,12 @@ Example automation to send a Telegram message on a completed download:
```yaml ```yaml
- alias: "Completed Torrent" - alias: "Completed Torrent"
triggers: triggers:
trigger: event - trigger: event
event_type: nzbget_download_complete event_type: nzbget_download_complete
- event_data: event_data:
category: tv category: tv
actions: actions:
action: notify.telegram_notifier - action: notify.telegram_notifier
data: data:
title: "Download completed!" title: "Download completed!"
message: "{{trigger.event.data.name}}" message: "{{trigger.event.data.name}}"

View File

@ -149,7 +149,7 @@ automation:
template: template:
- triggers: - triggers:
alias: "Update image when a new weather image is generated" - alias: "Update image when a new weather image is generated"
trigger: event trigger: event
event_type: new_weather_image event_type: new_weather_image
image: image:

View File

@ -60,10 +60,10 @@ To receive notifications of the entering flights using the [Home Assistant Compa
automation: automation:
- alias: "Flight entry notification" - alias: "Flight entry notification"
triggers: triggers:
trigger: event - trigger: event
event_type: opensky_entry event_type: opensky_entry
actions: actions:
action: notify.mobile_app_<device_name> - action: notify.mobile_app_<device_name>
data: data:
message: "Flight entry of {{ trigger.event.data.callsign }}" message: "Flight entry of {{ trigger.event.data.callsign }}"
``` ```
@ -77,16 +77,16 @@ One can also get a direct link to the OpenSky website to see the flight using th
automation: automation:
- alias: "Flight entry notification" - alias: "Flight entry notification"
triggers: triggers:
trigger: event - trigger: event
event_type: opensky_entry event_type: opensky_entry
actions: actions:
action: notify.mobile_app_<device_name> - action: notify.mobile_app_<device_name>
data: data:
message: "Flight entry of {{ trigger.event.data.callsign }}" message: "Flight entry of {{ trigger.event.data.callsign }}"
data: data:
actions: actions:
- action: URI - action: URI
title: Track the flight title: "Track the flight"
uri: >- uri: >-
https://opensky-network.org/aircraft-profile?icao24={{ https://opensky-network.org/aircraft-profile?icao24={{
trigger.event.data.icao24 }} trigger.event.data.icao24 }}

View File

@ -102,15 +102,15 @@ horizon:
automation: automation:
- alias: "Update OpenUV" - alias: "Update OpenUV"
triggers: triggers:
trigger: time_pattern - trigger: time_pattern
minutes: "/20" minutes: "/20"
conditions: conditions:
condition: numeric_state - condition: numeric_state
entity_id: sun.sun entity_id: sun.sun
value_template: "{{ state.attributes.elevation }}" value_template: "{{ state.attributes.elevation }}"
above: 10 above: 10
actions: actions:
action: homeassistant.update_entity - action: homeassistant.update_entity
target: target:
entity_id: sensor.LATITUDE_LONGITUDE_current_uv_index entity_id: sensor.LATITUDE_LONGITUDE_current_uv_index
``` ```
@ -122,10 +122,10 @@ Update the protection window once a day at 12:00pm:
automation: automation:
- alias: "Update OpenUV" - alias: "Update OpenUV"
triggers: triggers:
trigger: time - trigger: time
at: "12:00:00" at: "12:00:00"
actions: actions:
action: homeassistant.update_entity - action: homeassistant.update_entity
target: target:
entity_id: binary_sensor.LATITUDE_LONGITUDE_protection_window entity_id: binary_sensor.LATITUDE_LONGITUDE_protection_window
``` ```
@ -165,7 +165,7 @@ automation:
) >= timedelta(hours = 0, minutes = 40) ) >= timedelta(hours = 0, minutes = 40)
}} }}
actions: actions:
action: homeassistant.update_entity - action: homeassistant.update_entity
target: target:
entity_id: entity_id:
# Update both UV and protection window data: # Update both UV and protection window data:

View File

@ -57,7 +57,7 @@ Here is how an [action](/docs/automation/action) of your [automation setup](/get
```yaml ```yaml
actions: actions:
action: persistent_notification.create - action: persistent_notification.create
data: data:
message: "Your message goes here" message: "Your message goes here"
title: "Custom subject" title: "Custom subject"
@ -69,7 +69,7 @@ If you want to show some runtime information, you have to use [templates](/docs/
```yaml ```yaml
actions: actions:
action: persistent_notification.create - action: persistent_notification.create
data: data:
title: > title: >
Thermostat is {{ state_attr('climate.thermostat', 'hvac_action') }} Thermostat is {{ state_attr('climate.thermostat', 'hvac_action') }}
@ -88,7 +88,7 @@ This action allows you to remove a notifications by script or automation.
```yaml ```yaml
actions: actions:
action: persistent_notification.dismiss - action: persistent_notification.dismiss
data: data:
notification_id: "1234" notification_id: "1234"
``` ```
@ -97,7 +97,7 @@ The `persistent_notification.dismiss_all` action allows you to remove all notifi
```yaml ```yaml
actions: actions:
action: persistent_notification.dismiss_all - action: persistent_notification.dismiss_all
``` ```
### Markdown support ### Markdown support

View File

@ -77,7 +77,7 @@ In addition to the item count, the last added media item (movie, album, or episo
Example automation to use the `last_added_item` attribute on library sensors to notify when new media has been added: Example automation to use the `last_added_item` attribute on library sensors to notify when new media has been added:
```yaml ```yaml
alias: Plex - New media added alias: "Plex - New media added"
triggers: triggers:
- trigger: state - trigger: state
entity_id: sensor.plex_library_movies entity_id: sensor.plex_library_movies

View File

@ -121,7 +121,7 @@ automation:
event_type: point_webhook_received event_type: point_webhook_received
event_data: {} event_data: {}
conditions: conditions:
condition: template - condition: template
value_template: "{{ trigger.event.data.event.type == 'short_button_press' }}" value_template: "{{ trigger.event.data.event.type == 'short_button_press' }}"
actions: actions:
- action: persistent_notification.create - action: persistent_notification.create

View File

@ -86,12 +86,12 @@ To use notifications, please see the [getting started with automation page](/get
```yaml ```yaml
actions: actions:
action: notify.NOTIFIER_NAME - action: notify.NOTIFIER_NAME
data: data:
title: Send URL title: "Send URL"
message: This is an url message: "This is an url"
data: data:
url: google.com url: "google.com"
``` ```
- `url` (*Required*): Page URL to send with Pushbullet. - `url` (*Required*): Page URL to send with Pushbullet.
@ -100,10 +100,10 @@ actions:
```yaml ```yaml
actions: actions:
action: notify.NOTIFIER_NAME - action: notify.NOTIFIER_NAME
data: data:
title: Send file title: "Send file"
message: This is a file message: "This is a file"
data: data:
file: /path/to/my/file file: /path/to/my/file
``` ```
@ -114,10 +114,10 @@ actions:
```yaml ```yaml
actions: actions:
action: notify.NOTIFIER_NAME - action: notify.NOTIFIER_NAME
data: data:
title: Send file title: "Send file"
message: This is a file URL message: "This is a file URL"
data: data:
file_url: https://cdn.pixabay.com/photo/2014/06/03/19/38/test-361512_960_720.jpg file_url: https://cdn.pixabay.com/photo/2014/06/03/19/38/test-361512_960_720.jpg
``` ```
@ -128,7 +128,7 @@ actions:
```yaml ```yaml
actions: actions:
action: notify.NOTIFIER_NAME - action: notify.NOTIFIER_NAME
data: data:
title: "Send to one device" title: "Send to one device"
message: "This only goes to one specific device" message: "This only goes to one specific device"

View File

@ -47,7 +47,7 @@ Message to two devices with formatted text.
```yaml ```yaml
actions: actions:
action: notify.notify - action: notify.notify
data: data:
title: "Test to 2 devices" title: "Test to 2 devices"
message: "Attention [b]bold[/b] text[br][url=https://www.pushsafer.com]Link to Pushsafer[/url]" message: "Attention [b]bold[/b] text[br][url=https://www.pushsafer.com]Link to Pushsafer[/url]"
@ -65,7 +65,7 @@ Message to one device with formatted text and image from an external URL.
```yaml ```yaml
actions: actions:
action: notify.notify - action: notify.notify
data: data:
title: "Test to 1 device with image from an url" title: "Test to 1 device with image from an url"
message: "Attention [i]italic[/i] Text[br][url=https://www.home-assistant.io/]Testlink[/url]" message: "Attention [i]italic[/i] Text[br][url=https://www.home-assistant.io/]Testlink[/url]"
@ -85,7 +85,7 @@ Message to two devices and one device group with formatted text and local image.
```yaml ```yaml
actions: actions:
action: notify.notify - action: notify.notify
data: data:
title: "Test to 3 devices with local image" title: "Test to 3 devices with local image"
message: "Attention [i]italic[/i] Text[br][url=https://www.home-assistant.io/]Testlink[/url]" message: "Attention [i]italic[/i] Text[br][url=https://www.home-assistant.io/]Testlink[/url]"

View File

@ -109,7 +109,7 @@ QwikSwitch devices (i.e., transmitter buttons) will fire events on the Home Assi
automation: automation:
- alias: "Action - Respond to A button press" - alias: "Action - Respond to A button press"
triggers: triggers:
trigger: event - trigger: event
event_type: qwikswitch.button.@12df34 event_type: qwikswitch.button.@12df34
``` ```

View File

@ -243,7 +243,6 @@ actions:
data: data:
keep_days: 5 keep_days: 5
entity_id: sensor.power_sensor_0 entity_id: sensor.power_sensor_0
mode: single
``` ```
### Action `disable` ### Action `disable`

Some files were not shown because too many files have changed in this diff Show More