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
entity_id: sensor.office_motion_sensor
to: "on"
condition: "{{ state_attr('sun.sun', 'elevation') < 4 }}"
conditions: "{{ state_attr('sun.sun', 'elevation') < 4 }}"
actions:
- action: scene.turn_on
target:

View File

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

View File

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

View File

@ -45,18 +45,18 @@ The automation we're going to use in this tutorial controls a light based on a m
```yaml
triggers:
trigger: state
entity_id: binary_sensor.motion_kitchen
- trigger: state
entity_id: binary_sensor.motion_kitchen
actions:
action: >
{% if trigger.to_state.state == "on" %}
light.turn_on
{% else %}
light.turn_off
{% endif %}
target:
entity_id: light.kitchen
- action: >
{% if trigger.to_state.state == "on" %}
light.turn_on
{% else %}
light.turn_off
{% endif %}
target:
entity_id: light.kitchen
```
{% endraw %}
@ -92,8 +92,8 @@ Configurable parts in blueprints are called [inputs](/docs/blueprint/schema/#blu
```yaml
triggers:
trigger: state
entity_id: !input motion_sensor
- trigger: state
entity_id: !input motion_sensor
```
For the light, we can offer some more flexibility. We want to allow the user to be able to define any device or area as the target. The `target` property in the action can contain references to areas, devices, and/or entities, so that's what we will use.
@ -104,13 +104,13 @@ Inputs are not limited to strings. They can contain complex objects too. So in t
```yaml
actions:
action: >
{% if trigger.to_state.state == "on" %}
light.turn_on
{% else %}
light.turn_off
{% endif %}
target: !input target_light
- action: >
{% if trigger.to_state.state == "on" %}
light.turn_on
{% else %}
light.turn_off
{% endif %}
target: !input target_light
```
{% endraw %}

View File

@ -268,22 +268,22 @@ These work recursively. As an example using `!include_dir_list automation`, will
automation:
- alias: "Automation 1"
triggers:
trigger: state
entity_id: device_tracker.iphone
to: "home"
- trigger: state
entity_id: device_tracker.iphone
to: "home"
actions:
action: light.turn_on
target:
entity_id: light.entryway
- action: light.turn_on
target:
entity_id: light.entryway
- alias: "Automation 2"
triggers:
trigger: state
entity_id: device_tracker.iphone
from: "home"
- trigger: state
entity_id: device_tracker.iphone
from: "home"
actions:
action: light.turn_off
target:
entity_id: light.entryway
- action: light.turn_off
target:
entity_id: light.entryway
```
can be turned into:
@ -299,13 +299,13 @@ automation: !include_dir_list automation/presence/
```yaml
alias: "Automation 1"
triggers:
trigger: state
entity_id: device_tracker.iphone
to: "home"
- trigger: state
entity_id: device_tracker.iphone
to: "home"
actions:
action: light.turn_on
target:
entity_id: light.entryway
- action: light.turn_on
target:
entity_id: light.entryway
```
`automation/presence/automation2.yaml`
@ -313,13 +313,13 @@ actions:
```yaml
alias: "Automation 2"
triggers:
trigger: state
entity_id: device_tracker.iphone
from: "home"
- trigger: state
entity_id: device_tracker.iphone
from: "home"
actions:
action: light.turn_off
target:
entity_id: light.entryway
- action: light.turn_off
target:
entity_id: light.entryway
```
It is important to note that each file must contain only **one** entry when using `!include_dir_list`.

View File

@ -58,14 +58,14 @@ Scenes can be activated using the action `scene.turn_on` (there is no 'scene.tur
# Example automation
automation:
triggers:
trigger: state
entity_id: device_tracker.sweetheart
from: "not_home"
to: "home"
- trigger: state
entity_id: device_tracker.sweetheart
from: "not_home"
to: "home"
actions:
action: scene.turn_on
target:
entity_id: scene.romantic
- action: scene.turn_on
target:
entity_id: scene.romantic
```
## Applying a scene without defining it
@ -76,21 +76,21 @@ With the `scene.apply` action you are able to apply a scene without first defini
# Example automation
automation:
triggers:
trigger: state
entity_id: device_tracker.sweetheart
from: "not_home"
to: "home"
- trigger: state
entity_id: device_tracker.sweetheart
from: "not_home"
to: "home"
actions:
action: scene.apply
data:
entities:
light.tv_back_light:
state: "on"
brightness: 100
light.ceiling: off
media_player.sony_bravia_tv:
state: "on"
source: HDMI 1
- action: scene.apply
data:
entities:
light.tv_back_light:
state: "on"
brightness: 100
light.ceiling: off
media_player.sony_bravia_tv:
state: "on"
source: "HDMI 1"
```
## Using scene transitions
@ -105,16 +105,16 @@ light will transition to the scene in 2.5 seconds.
# Example automation
automation:
triggers:
trigger: state
entity_id: device_tracker.sweetheart
from: "not_home"
to: "home"
- trigger: state
entity_id: device_tracker.sweetheart
from: "not_home"
to: "home"
actions:
action: scene.turn_on
target:
entity_id: scene.romantic
data:
transition: 2.5
- action: scene.turn_on
target:
entity_id: scene.romantic
data:
transition: 2.5
```
Transitions are currently only support by lights, which in their turn, have

View File

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

View File

@ -20,15 +20,15 @@ Test multiple conditions in one condition statement. Passes if all embedded cond
```yaml
conditions:
alias: "Paulus home AND temperature below 20"
condition: and
conditions:
- condition: state
entity_id: "device_tracker.paulus"
state: "home"
- condition: numeric_state
entity_id: "sensor.temperature"
below: 20
- alias: "Paulus home AND temperature below 20"
condition: and
conditions:
- condition: state
entity_id: "device_tracker.paulus"
state: "home"
- condition: numeric_state
entity_id: "sensor.temperature"
below: 20
```
If you do not want to combine AND and OR conditions, you can list them sequentially.
@ -52,7 +52,7 @@ The AND condition also has a shorthand form. The following configuration works t
```yaml
conditions:
alias: "Paulus home AND temperature below 20"
and:
- and:
- condition: state
entity_id: "device_tracker.paulus"
state: "home"
@ -67,29 +67,29 @@ Test multiple conditions in one condition statement. Passes if any embedded cond
```yaml
conditions:
alias: "Paulus home OR temperature below 20"
condition: or
conditions:
- condition: state
entity_id: "device_tracker.paulus"
state: "home"
- condition: numeric_state
entity_id: "sensor.temperature"
below: 20
- alias: "Paulus home OR temperature below 20"
condition: or
conditions:
- condition: state
entity_id: "device_tracker.paulus"
state: "home"
- condition: numeric_state
entity_id: "sensor.temperature"
below: 20
```
The OR condition also has a shorthand form. The following configuration works the same as the one listed above:
```yaml
conditions:
alias: "Paulus home OR temperature below 20"
or:
- condition: state
entity_id: "device_tracker.paulus"
state: "home"
- condition: numeric_state
entity_id: "sensor.temperature"
below: 20
- alias: "Paulus home OR temperature below 20"
or:
- condition: state
entity_id: "device_tracker.paulus"
state: "home"
- condition: numeric_state
entity_id: "sensor.temperature"
below: 20
```
### Mixed AND and OR conditions
@ -99,26 +99,26 @@ This allows you to mix several AND and OR conditions together.
```yaml
conditions:
condition: and
conditions:
- condition: state
entity_id: "device_tracker.paulus"
state: "home"
- condition: or
conditions:
- condition: state
entity_id: sensor.weather_precip
state: "rain"
- condition: numeric_state
entity_id: "sensor.temperature"
below: 20
- condition: and
conditions:
- condition: state
entity_id: "device_tracker.paulus"
state: "home"
- condition: or
conditions:
- condition: state
entity_id: sensor.weather_precip
state: "rain"
- condition: numeric_state
entity_id: "sensor.temperature"
below: 20
```
Or in shorthand form:
```yaml
conditions:
and:
- and:
- condition: state
entity_id: "device_tracker.paulus"
state: "home"
@ -137,15 +137,15 @@ Test multiple conditions in one condition statement. Passes if all embedded cond
```yaml
conditions:
alias: "Paulus not home AND alarm not disarmed"
condition: not
conditions:
- condition: state
entity_id: device_tracker.paulus
state: "home"
- condition: state
entity_id: alarm_control_panel.home_alarm
state: disarmed
- alias: "Paulus not home AND alarm not disarmed"
condition: not
conditions:
- condition: state
entity_id: device_tracker.paulus
state: "home"
- condition: state
entity_id: alarm_control_panel.home_alarm
state: "disarmed"
```
The NOT condition also has a shorthand form. The following configuration works the same as the one listed above:
@ -170,11 +170,11 @@ If both `below` and `above` are specified, both tests have to pass.
```yaml
conditions:
alias: "Temperature between 17 and 25 degrees"
condition: numeric_state
entity_id: sensor.temperature
above: 17
below: 25
- alias: "Temperature between 17 and 25 degrees"
condition: numeric_state
entity_id: sensor.temperature
above: 17
below: 25
```
You can optionally use a `value_template` to process the value of the state before testing it.
@ -183,12 +183,12 @@ You can optionally use a `value_template` to process the value of the state befo
```yaml
conditions:
condition: numeric_state
entity_id: sensor.temperature
above: 17
below: 25
# If your sensor value needs to be adjusted
value_template: "{{ float(state.state) + 2 }}"
- condition: numeric_state
entity_id: sensor.temperature
above: 17
below: 25
# If your sensor value needs to be adjusted
value_template: "{{ float(state.state) + 2 }}"
```
{% endraw %}
@ -198,11 +198,11 @@ The condition will pass if **all** entities match the thresholds.
```yaml
conditions:
condition: numeric_state
entity_id:
- sensor.kitchen_temperature
- sensor.living_room_temperature
below: 18
- condition: numeric_state
entity_id:
- sensor.kitchen_temperature
- sensor.living_room_temperature
below: 18
```
Alternatively, the condition can test against a state attribute.
@ -210,11 +210,11 @@ The condition will pass if the attribute value of the entity matches the thresho
```yaml
conditions:
condition: numeric_state
entity_id: climate.living_room_thermostat
attribute: temperature
above: 17
below: 25
- condition: numeric_state
entity_id: climate.living_room_thermostat
attribute: temperature
above: 17
below: 25
```
Number helpers (`input_number` entities), `number`, `sensor`, and `zone` entities
@ -223,11 +223,11 @@ options to make the condition more dynamic.
```yaml
conditions:
condition: numeric_state
entity_id: climate.living_room_thermostat
attribute: temperature
above: input_number.temperature_threshold_low
below: input_number.temperature_threshold_high
- condition: numeric_state
entity_id: climate.living_room_thermostat
attribute: temperature
above: input_number.temperature_threshold_low
below: input_number.temperature_threshold_high
```
## State condition
@ -236,15 +236,15 @@ Tests if an entity has a specified state.
```yaml
conditions:
alias: "Paulus not home for an hour and a bit"
condition: state
entity_id: device_tracker.paulus
state: "not_home"
# optional: Evaluates to true only if state was this for last X time.
for:
hours: 1
minutes: 10
seconds: 5
- alias: "Paulus not home for an hour and a bit"
condition: state
entity_id: device_tracker.paulus
state: "not_home"
# optional: Evaluates to true only if state was this for last X time.
for:
hours: 1
minutes: 10
seconds: 5
```
It is also possible to test the condition against multiple entities at once.
@ -252,11 +252,11 @@ The condition will pass if **all** entities match the state.
```yaml
conditions:
condition: state
entity_id:
- light.kitchen
- light.living_room
state: "on"
- condition: state
entity_id:
- light.kitchen
- light.living_room
state: "on"
```
Instead of matching all, it is also possible if one of the entities matches.
@ -264,12 +264,12 @@ In the following example the condition will pass if **any** entity matches the s
```yaml
conditions:
condition: state
entity_id:
- binary_sensor.motion_sensor_left
- binary_sensor.motion_sensor_right
match: any
state: "on"
- condition: state
entity_id:
- binary_sensor.motion_sensor_left
- binary_sensor.motion_sensor_right
match: any
state: "on"
```
Testing if an entity is matching a set of possible conditions;
@ -277,11 +277,11 @@ The condition will pass if the entity matches one of the states given.
```yaml
conditions:
condition: state
entity_id: alarm_control_panel.home
state:
- "armed_away"
- "armed_home"
- condition: state
entity_id: alarm_control_panel.home
state:
- "armed_away"
- "armed_home"
```
Or, combine multiple entities with multiple states. In the following example,
@ -289,13 +289,13 @@ both media players need to be either paused or playing for the condition to pass
```yaml
conditions:
condition: state
entity_id:
- media_player.living_room
- media_player.kitchen
state:
- "playing"
- "paused"
- condition: state
entity_id:
- media_player.living_room
- media_player.kitchen
state:
- "playing"
- "paused"
```
Alternatively, the condition can test against a state attribute.
@ -303,10 +303,10 @@ The condition will pass if the attribute matches the given state.
```yaml
conditions:
condition: state
entity_id: climate.living_room_thermostat
attribute: fan_mode
state: "auto"
- condition: state
entity_id: climate.living_room_thermostat
attribute: fan_mode
state: "auto"
```
Finally, the `state` option accepts helper entities (also known as `input_*`
@ -315,9 +315,9 @@ of the given helper entity.
```yaml
conditions:
condition: state
entity_id: alarm_control_panel.home
state: input_select.guest_mode
- condition: state
entity_id: alarm_control_panel.home
state: input_select.guest_mode
```
You can also use templates in the `for` option.
@ -326,12 +326,12 @@ You can also use templates in the `for` option.
```yaml
conditions:
condition: state
entity_id: device_tracker.paulus
state: "home"
for:
minutes: "{{ states('input_number.lock_min')|int }}"
seconds: "{{ states('input_number.lock_sec')|int }}"
- condition: state
entity_id: device_tracker.paulus
state: "home"
for:
minutes: "{{ states('input_number.lock_min')|int }}"
seconds: "{{ states('input_number.lock_sec')|int }}"
```
{% endraw %}
@ -346,18 +346,18 @@ The sun state can be used to test if the sun has set or risen.
```yaml
conditions:
alias: "Sun up"
condition: state # 'day' condition: from sunrise until sunset
entity_id: sun.sun
state: "above_horizon"
- alias: "Sun up"
condition: state # 'day' condition: from sunrise until sunset
entity_id: sun.sun
state: "above_horizon"
```
```yaml
conditions:
alias: "Sun down"
condition: state # from sunset until sunrise
entity_id: sun.sun
state: "below_horizon"
- alias: "Sun down"
condition: state # from sunset until sunrise
entity_id: sun.sun
state: "below_horizon"
```
### Sun elevation condition
@ -371,12 +371,12 @@ For an in-depth explanation of sun elevation, see [sun elevation trigger][sun_el
```yaml
conditions:
condition: and # 'twilight' condition: dusk and dawn, in typical locations
conditions:
- condition: template
value_template: "{{ state_attr('sun.sun', 'elevation') < 0 }}"
- condition: template
value_template: "{{ state_attr('sun.sun', 'elevation') > -6 }}"
- condition: and # 'twilight' condition: dusk and dawn, in typical locations
conditions:
- condition: template
value_template: "{{ state_attr('sun.sun', 'elevation') < 0 }}"
- condition: template
value_template: "{{ state_attr('sun.sun', 'elevation') > -6 }}"
```
{% endraw %}
@ -406,9 +406,9 @@ The sunset/sunrise conditions do not work in locations inside the polar circles,
This is an example of 1 hour offset before sunset:
```yaml
conditions:
condition: sun
after: sunset
after_offset: "-01:00:00"
- condition: sun
after: sunset
after_offset: "-01:00:00"
```
This is 'when dark' - equivalent to a state condition on `sun.sun` of `below_horizon`:
@ -441,9 +441,9 @@ The template condition tests if the [given template][template] renders a value e
```yaml
conditions:
alias: "Iphone battery above 50%"
condition: template
value_template: "{{ (state_attr('device_tracker.iphone', 'battery_level')|int) > 50 }}"
- alias: "Iphone battery above 50%"
condition: template
value_template: "{{ (state_attr('device_tracker.iphone', 'battery_level')|int) > 50 }}"
```
{% endraw %}
@ -488,12 +488,12 @@ and [`not`](#not-condition) conditions:
```yaml
conditions:
condition: or
conditions:
- "{{ is_state('device_tracker.iphone', 'away') }}"
- condition: numeric_state
entity_id: "sensor.temperature"
below: 20
- condition: or
conditions:
- "{{ is_state('device_tracker.iphone', 'away') }}"
- condition: numeric_state
entity_id: "sensor.temperature"
below: 20
```
{% endraw %}
@ -540,15 +540,15 @@ The time condition can test if it is after a specified time, before a specified
```yaml
conditions:
alias: "Time 15~02"
condition: time
# At least one of the following is required.
after: "15:00:00"
before: "02:00:00"
weekday:
- mon
- wed
- fri
- alias: "Time 15~02"
condition: time
# At least one of the following is required.
after: "15:00:00"
before: "02:00:00"
weekday:
- mon
- wed
- fri
```
Valid values for `weekday` are `mon`, `tue`, `wed`, `thu`, `fri`, `sat`, `sun`.
@ -587,31 +587,31 @@ The trigger condition can test if an automation was triggered by a certain trigg
```yaml
conditions:
condition: trigger
id: event_trigger
- condition: trigger
id: event_trigger
```
For a trigger identified by its index, both a string and integer is allowed:
```yaml
conditions:
condition: trigger
id: "0"
- condition: trigger
id: "0"
```
```yaml
conditions:
condition: trigger
id: 0
- condition: trigger
id: 0
```
It is possible to give a list of triggers:
```yaml
conditions:
condition: trigger
id:
- event_1_trigger
- event_2_trigger
- condition: trigger
id:
- event_1_trigger
- event_2_trigger
```
## Zone condition
@ -620,10 +620,10 @@ Zone conditions test if an entity is in a certain zone. For zone automation to w
```yaml
conditions:
alias: "Paulus at home"
condition: zone
entity_id: device_tracker.paulus
zone: zone.home
- alias: "Paulus at home"
condition: zone
entity_id: device_tracker.paulus
zone: zone.home
```
It is also possible to test the condition against multiple entities at once.
@ -631,11 +631,11 @@ The condition will pass if all entities are in the specified zone.
```yaml
conditions:
condition: zone
entity_id:
- device_tracker.frenck
- device_tracker.daphne
zone: zone.home
- condition: zone
entity_id:
- device_tracker.frenck
- device_tracker.daphne
zone: zone.home
```
Testing if an entity is matching a set of possible zones;
@ -643,11 +643,11 @@ The condition will pass if the entity is in one of the zones.
```yaml
conditions:
condition: zone
entity_id: device_tracker.paulus
state:
- zone.home
- zone.work
- condition: zone
entity_id: device_tracker.paulus
state:
- zone.home
- zone.work
```
Or, combine multiple entities with multiple zones. In the following example,
@ -701,10 +701,10 @@ For example:
```yaml
# This condition will always pass, as it is disabled.
conditions:
enabled: false
condition: state
entity_id: sun.sun
state: "above_horizon"
- enabled: false
condition: state
entity_id: sun.sun
state: "above_horizon"
```
Conditions can also be disabled based on limited templates or blueprint inputs.

View File

@ -19,7 +19,8 @@ Perform the action `homeassistant.turn_on` on the {% term entity %} `group.livin
```yaml
action: homeassistant.turn_on
entity_id: group.living_room
target:
entity_id: group.living_room
```
### Targeting areas and devices
@ -51,7 +52,8 @@ You can also specify other parameters beside the entity to target. For example,
```yaml
action: light.turn_on
entity_id: group.living_room
target:
entity_id: group.living_room
data:
brightness: 120
rgb_color: [255, 0, 0]

View File

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

View File

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

View File

@ -147,11 +147,11 @@ In an [action](/getting-started/automation-action/) of your [automation setup](/
```yaml
actions:
action: androidtv.adb_command
target:
entity_id: media_player.androidtv_tv_living_room
data:
command: "HOME"
- action: androidtv.adb_command
target:
entity_id: media_player.androidtv_tv_living_room
data:
command: "HOME"
```
Available key commands include:

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"
description: John Doe locks or unlocks the Front Door
triggers:
- entity_id: sensor.front_door_operator
trigger: state
to: John Doe
- trigger: state
entity_id: sensor.front_door_operator
to: "John Doe"
conditions:
- condition: template
value_template: "{{ not state_attr('sensor.front_door_operator', 'remote') }}"
actions:
- data: {}
- action: camera.turn_off
entity_id: camera.inside
action: camera.turn_off
```
{% endraw %}

View File

@ -82,19 +82,19 @@ See the example below for how an automation trigger translates to a message on t
automation:
- alias: "Sunset Service Bus message"
triggers:
trigger: sun
event: sunset
- trigger: sun
event: sunset
actions:
action: notify.test_queue
data:
message: "Sun is going down"
title: "Good evening"
- action: notify.test_queue
data:
sun_direction: "Down"
custom_field: 123
custom_object:
trigger_more: true
explain: "It's starting to get dark"
message: "Sun is going down"
title: "Good evening"
data:
sun_direction: "Down"
custom_field: 123
custom_object:
trigger_more: true
explain: "It's starting to get dark"
```
The message that can be retrieved from a queue or topic subscription:

View File

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

View File

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

View File

@ -133,16 +133,15 @@ 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.
```yaml
- id: arm_blink_when_away
alias: "Arm Blink When Away"
- alias: "Arm Blink When Away"
triggers:
trigger: state
entity_id: all
to: "not_home"
- trigger: state
entity_id: all
to: "not_home"
actions:
action: alarm_control_panel.alarm_arm_away
target:
entity_id: alarm_control_panel.blink_my_sync_module
- action: alarm_control_panel.alarm_arm_away
target:
entity_id: alarm_control_panel.blink_my_sync_module
```
### Disarm Blink when home
@ -150,16 +149,15 @@ 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.
```yaml
- id: disarm_blink_when_home
alias: "Disarm Blink When Home"
- alias: "Disarm Blink When Home"
triggers:
trigger: state
entity_id: all
to: "home"
- trigger: state
entity_id: all
to: "home"
actions:
action: alarm_control_panel.alarm_disarm
target:
entity_id: alarm_control_panel.blink_my_sync_module
- action: alarm_control_panel.alarm_disarm
target:
entity_id: alarm_control_panel.blink_my_sync_module
```
### Save most recent video locally when motion detected
@ -171,12 +169,11 @@ The following example assumes your camera's name (in the Blink app) is `My Camer
{% raw %}
```yaml
- id: save_blink_video_on_motion
alias: "Save Blink Video on Motion"
- alias: "Save Blink Video on Motion"
triggers:
trigger: state
entity_id: binary_sensor.blink_my_camera_motion_detected
to: "on"
- trigger: state
entity_id: binary_sensor.blink_my_camera_motion_detected
to: "on"
actions:
- action: blink.save_video
target:
@ -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.
```yaml
- id: save_recent_clips_from_my_camera
alias: "Save Recent Clips from My Camera"
- alias: "Save Recent Clips from My Camera"
triggers:
- trigger: time_pattern
minutes: /3

View File

@ -80,16 +80,16 @@ The name of the action is `notify.bmw_connected_drive_<your_vehicle>`.
```yaml
...
actions:
action: notify.bmw_connected_drive_<your_vehicle>
data:
message: The name of the POI # this is shown on the iDrive dashboard
- action: notify.bmw_connected_drive_<your_vehicle>
data:
latitude: 48.177024
longitude: 11.559107
street: Street name # Optional
city: City name # Optional
postal_code: Postal Code # Optional
country: Country # Optional
message: The name of the POI # this is shown on the iDrive dashboard
data:
latitude: 48.177024
longitude: 11.559107
street: Street name # Optional
city: City name # Optional
postal_code: Postal Code # Optional
country: Country # Optional
```
## Lock

View File

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

View File

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

View File

@ -75,11 +75,11 @@ For example, the following action in an automation would send an `hls` live stre
```yaml
actions:
action: camera.play_stream
target:
entity_id: camera.yourcamera
data:
media_player: media_player.chromecast
- action: camera.play_stream
target:
entity_id: camera.yourcamera
data:
media_player: media_player.chromecast
```
### Action `record`
@ -103,11 +103,11 @@ For example, the following action in an automation would take a recording from "
```yaml
actions:
action: camera.record
target:
entity_id: camera.yourcamera
data:
filename: '/tmp/{{ entity_id.name }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4'
- action: camera.record
target:
entity_id: camera.yourcamera
data:
filename: '/tmp/{{ entity_id.name }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4'
```
{% endraw %}
@ -129,11 +129,11 @@ For example, the following action in an automation would take a snapshot from "y
```yaml
actions:
action: camera.snapshot
target:
entity_id: camera.yourcamera
data:
filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
- action: camera.snapshot
target:
entity_id: camera.yourcamera
data:
filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
```
{% endraw %}

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:
alias: "Show Downstairs on kitchen"
sequence:
- data:
- action: cast.show_lovelace_view
data:
dashboard_path: lovelace-cast
entity_id: media_player.kitchen
view_path: downstairs
action: cast.show_lovelace_view
```
{% important %}
@ -242,7 +242,8 @@ Optional:
'cast_bubbleupnp_to_my_chromecast':
alias: "Cast a video to My Chromecast using BubbleUPNP"
sequence:
- target:
- action: media_player.play_media
target:
entity_id: media_player.my_chromecast
data:
media_content_type: cast
@ -252,7 +253,6 @@ Optional:
"media_id": "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
"media_type": "video/mp4"
}'
action: media_player.play_media
```
### [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':
alias: "Cast NRK Radio to Chromecast"
sequence:
- target:
- action: media_player.play_media
target:
entity_id: media_player.chromecast
data:
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",
"media_id": "l_8457deb0-4f2c-4ef3-97de-b04f2c6ef314"
}'
action: media_player.play_media
```
### [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':
alias: "Cast NRK TV to Chromecast"
sequence:
- target:
- action: media_player.play_media
target:
entity_id: media_player.chromecast
data:
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",
"media_id": "OUHA43000207"
}'
action: media_player.play_media
```
### Plex
@ -367,7 +367,8 @@ Example values to cast the item at <https://www.supla.fi/audio/3601824>
'cast_supla_to_my_chromecast':
alias: "Cast supla to My Chromecast"
sequence:
- target:
- action: media_player.play_media
target:
entity_id: media_player.my_chromecast
data:
media_content_type: cast
@ -376,7 +377,6 @@ Example values to cast the item at <https://www.supla.fi/audio/3601824>
"app_name": "supla",
"media_id": "3601824"
}'
action: media_player.play_media
```
### YouTube
@ -399,7 +399,8 @@ Optional:
'cast_youtube_to_my_chromecast':
alias: "Cast YouTube to My Chromecast"
sequence:
- target:
- action: media_player.play_media
target:
entity_id: media_player.my_chromecast
data:
media_content_type: cast
@ -408,7 +409,6 @@ Optional:
"app_name": "youtube",
"media_id": "dQw4w9WgXcQ"
}'
action: media_player.play_media
```
## Troubleshooting automatic discovery

View File

@ -69,9 +69,9 @@ Here are the automations for the above screenshot:
- trigger: webhook
webhook_id: build_failed
actions:
action: notify.cisco_webex_teams_notify
data:
message: "<blockquote class=danger>Build 0.89.5 compile failed."
- action: notify.cisco_webex_teams_notify
data:
message: "<blockquote class=danger>Build 0.89.5 compile failed."
# Rich Text Example 2.
@ -82,20 +82,20 @@ Here are the automations for the above screenshot:
- trigger: webhook
webhook_id: build_unstable
actions:
action: notify.cisco_webex_teams_notify
data:
title: "<strong>Build 0.89.6 is unstable.</strong>"
message: "<blockquote class=warning>Version 0.89.6 failed verifications.
<ul>
<li> test_osx
<li> test_win_lint
- action: notify.cisco_webex_teams_notify
data:
title: "<strong>Build 0.89.6 is unstable.</strong>"
message: "<blockquote class=warning>Version 0.89.6 failed verifications.
<ul>
<li> test_osx
<li> test_win_lint
<li>... and 4 more.
</ul>
<p><@personEmail:sparkbotjeeves@sparkbot.io></p>
<p><small><i>View <a href='https://demo/testReport/'>Test Report</a></i></small><br></p>
"
<li>... and 4 more.
</ul>
<p><@personEmail:sparkbotjeeves@sparkbot.io></p>
<p><small><i>View <a href='https://demo/testReport/'>Test Report</a></i></small><br></p>
"
# Rich Text Example 3.
# Show a title and multi-line message with a blue banner,
@ -105,19 +105,19 @@ Here are the automations for the above screenshot:
- trigger: webhook
webhook_id: build_passed
actions:
action: notify.cisco_webex_teams_notify
data:
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.
<ul>
<li> test_cov
<li> test_osx
<li> test_win
<li> test_linux
<li>... and 45 more.
</ul>
"
- action: notify.cisco_webex_teams_notify
data:
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.
<ul>
<li> test_cov
<li> test_osx
<li> test_win
<li> test_linux
<li>... and 45 more.
</ul>
"
```
The following is a list of the allowed html tags and attributes:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -52,11 +52,11 @@ Along with the event the following payload parameters are available:
```yaml
- alias: "Download Failed Notification"
triggers:
trigger: event
event_type: downloader_download_failed
- trigger: event
event_type: downloader_download_failed
actions:
action: persistent_notification.create
data:
message: "{{trigger.event.data.filename}} download failed"
title: "Download Failed"
- action: persistent_notification.create
data:
message: "{{trigger.event.data.filename}} 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:
```yaml
- alias: Visual doorbell notification example
- alias: "Visual doorbell notification example"
triggers:
- trigger: state
entity_id: binary_sensor.doorbell

View File

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

View File

@ -49,15 +49,15 @@ The phone number used in **target** should be registered with Facebook messenger
automation:
- alias: "Evening Greeting"
triggers:
trigger: sun
event: sunset
- trigger: sun
event: sunset
actions:
action: notify.facebook
data:
message: "Good Evening"
target:
- '+919413017584'
- '+919784516314'
- action: notify.facebook
data:
message: "Good Evening"
target:
- '+919413017584'
- '+919784516314'
```
You can also send messages to users that do not have stored their phone number on Facebook, but this requires a bit more work. The Messenger platform uses page-specific user IDs instead of a global user ID. You will need to enable a webhook for the "messages" event in Facebook's developer console. Once a user writes a message to a page, that webhook will then receive the user's page specific ID as part of the webhook's payload. Below is a simple PHP script that reacts to the message "get my id" and sends a reply containing the user's ID:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -92,16 +92,16 @@ Each such entity has a state attribute that will contain a list of any such issu
```yaml
- alias: "GeniusHub Error Alerts"
triggers:
trigger: numeric_state
entity_id: sensor.geniushub_errors
above: 0
- trigger: numeric_state
entity_id: sensor.geniushub_errors
above: 0
actions:
- action: notify.pushbullet_notifier
data:
title: "Genius Hub has errors"
message: >-
Genius Hub has the following {{ states('sensor.geniushub_errors') }} errors:
{{ state_attr('sensor.geniushub_errors', 'error_list') }}
- action: notify.pushbullet_notifier
data:
title: "Genius Hub has errors"
message: >-
Genius Hub has the following {{ states('sensor.geniushub_errors') }} errors:
{{ state_attr('sensor.geniushub_errors', 'error_list') }}
```
{% endraw %}
@ -113,15 +113,15 @@ This alert may be useful to see if the CH is being turned on whilst you're on a
```yaml
- alias: "GeniusHub CH State Change Alert"
triggers:
trigger: state
entity_id: binary_sensor.dual_channel_receiver_2_1
- trigger: state
entity_id: binary_sensor.dual_channel_receiver_2_1
actions:
- action: notify.pushbullet_notifier
data:
title: "Warning: CH State Change!"
message: >-
{{ trigger.to_state.attributes.friendly_name }} has changed
from {{ trigger.from_state.state }} to {{ trigger.to_state.state }}.
- action: notify.pushbullet_notifier
data:
title: "Warning: CH State Change!"
message: >-
{{ trigger.to_state.attributes.friendly_name }} has changed
from {{ trigger.from_state.state }} to {{ trigger.to_state.state }}.
```
{% endraw %}

View File

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

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:
```yaml
- id: update_morning_commute_sensor
alias: "Commute - Update morning commute sensor"
- alias: "Commute - Update morning commute sensor"
initial_state: "on"
triggers:
- trigger: time_pattern

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -252,17 +252,17 @@ Here's an example of how to use these events for automations:
```yaml
automation:
triggers:
trigger: event
event_type: homematic.keypress
event_data:
name: "Kitchen Switch"
channel: 1
param: PRESS_SHORT
actions:
action: switch.turn_on
target:
entity_id: switch.Kitchen_Ambience
triggers:
- trigger: event
event_type: homematic.keypress
event_data:
name: "Kitchen Switch"
channel: 1
param: PRESS_SHORT
actions:
- action: switch.turn_on
target:
entity_id: switch.Kitchen_Ambience
```
The channel parameter is equal to the channel of the button you are configuring the automation for. You can view the available channels in the UI you use to pair your devices.
@ -307,11 +307,11 @@ Simulate a button being pressed:
```yaml
...
actions:
action: homematic.virtualkey
data:
address: "BidCoS-RF"
channel: 1
param: PRESS_LONG
- action: homematic.virtualkey
data:
address: "BidCoS-RF"
channel: 1
param: PRESS_LONG
```
Open KeyMatic:
@ -319,11 +319,11 @@ Open KeyMatic:
```yaml
...
actions:
action: homematic.virtualkey
data:
address: "LEQ1234567"
channel: 1
param: OPEN
- action: homematic.virtualkey
data:
address: "LEQ1234567"
channel: 1
param: OPEN
```
Set boolean variable to true:
@ -331,12 +331,12 @@ Set boolean variable to true:
```yaml
...
actions:
action: homematic.set_variable_value
target:
entity_id: homematic.ccu2
data:
name: "Variablename"
value: true
- action: homematic.set_variable_value
target:
entity_id: homematic.ccu2
data:
name: "Variablename"
value: true
```
#### Advanced examples
@ -349,12 +349,12 @@ Manually turn on a switch actor:
```yaml
...
actions:
action: homematic.set_device_value
data:
address: "LEQ1234567"
channel: 1
param: STATE
value: true
- action: homematic.set_device_value
data:
address: "LEQ1234567"
channel: 1
param: STATE
value: true
```
Manually set temperature on thermostat:
@ -362,12 +362,12 @@ Manually set temperature on thermostat:
```yaml
...
actions:
action: homematic.set_device_value
data:
address: "LEQ1234567"
channel: 4
param: SET_TEMPERATURE
value: 23.0
- action: homematic.set_device_value
data:
address: "LEQ1234567"
channel: 4
param: SET_TEMPERATURE
value: 23.0
```
Manually set the active profile on thermostat:
@ -375,13 +375,13 @@ Manually set the active profile on thermostat:
```yaml
...
actions:
action: homematic.set_device_value
data:
address: "LEQ1234567"
channel: 1
param: ACTIVE_PROFILE
value: 1
value_type: int
- action: homematic.set_device_value
data:
address: "LEQ1234567"
channel: 1
param: ACTIVE_PROFILE
value: 1
value_type: int
```
Set the week program of a wall thermostat:
@ -389,13 +389,13 @@ Set the week program of a wall thermostat:
```yaml
...
actions:
action: homematic.put_paramset
data:
interface: wireless
address: "LEQ1234567"
paramset_key: MASTER
paramset:
WEEK_PROGRAM_POINTER: 1
- action: homematic.put_paramset
data:
interface: wireless
address: "LEQ1234567"
paramset_key: MASTER
paramset:
WEEK_PROGRAM_POINTER: 1
```
Set the week program of a wall thermostat with explicit `rx_mode` (BidCos-RF only):
@ -403,14 +403,14 @@ Set the week program of a wall thermostat with explicit `rx_mode` (BidCos-RF onl
```yaml
...
actions:
action: homematic.put_paramset
data:
interface: wireless
address: "LEQ1234567"
paramset_key: MASTER
rx_mode: WAKEUP
paramset:
WEEK_PROGRAM_POINTER: 1
- action: homematic.put_paramset
data:
interface: wireless
address: "LEQ1234567"
paramset_key: MASTER
rx_mode: WAKEUP
paramset:
WEEK_PROGRAM_POINTER: 1
```
BidCos-RF devices have an optional parameter for put_paramset which defines the way the configuration data is sent to the device.
@ -424,9 +424,9 @@ Manually set lock on KeyMatic devices:
```yaml
...
actions:
action: lock.lock
target:
entity_id: lock.leq1234567
- action: lock.lock
target:
entity_id: lock.leq1234567
```
Manually set unlock on KeyMatic devices:
@ -434,9 +434,9 @@ Manually set unlock on KeyMatic devices:
```yaml
...
actions:
action: lock.unlock
target:
entity_id: lock.leq1234567
- action: lock.unlock
target:
entity_id: lock.leq1234567
```
@ -489,12 +489,12 @@ template:
automation:
- alias: "Homematic Reconnect"
triggers:
trigger: state
entity_id: binary_sensor.homematic_is_sending_updates
to: "off"
- trigger: state
entity_id: binary_sensor.homematic_is_sending_updates
to: "off"
actions:
# Reconnect, if sensor has not been updated for over 10 minutes
action: homematic.reconnect
- action: homematic.reconnect
```
{% endraw %}
@ -535,10 +535,10 @@ automation:
automation:
- alias: "Homematic CCU Reboot"
triggers:
trigger: state
entity_id: sensor.v_last_reboot
- trigger: state
entity_id: sensor.v_last_reboot
actions:
action: homematic.reconnect
- action: homematic.reconnect
```
## Notifications

View File

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

View File

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

View File

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

View File

@ -111,8 +111,7 @@ To start Hyperion with an effect, use the following automation:
```yaml
automation:
- id: one
alias: "Turn Hyperion effect on when light goes on"
- alias: "Turn Hyperion effect on when light goes on"
triggers:
- trigger: state
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
alias: "The black trash can has left the building"
mode: single
triggers:
- trigger: state
entity_id: sensor.black_trash_bin_estimated_distance

View File

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

View File

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

View File

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

View File

@ -49,16 +49,16 @@ To send an alert if the CV pressure is too low or too high, consider the followi
```yaml
- alias: "Low CV Pressure Alert"
triggers:
trigger: numeric_state
entity_id: sensor.cv_pressure
below: 1.0
- trigger: numeric_state
entity_id: sensor.cv_pressure
below: 1.0
actions:
- action: notify.pushbullet_notifier
data:
title: "Warning: Low CH Pressure"
message: >-
{{ trigger.to_state.attributes.friendly_name }}
is low, {{ trigger.to_state.state }} bar.
- action: notify.pushbullet_notifier
data:
title: "Warning: Low CH Pressure"
message: >-
{{ trigger.to_state.attributes.friendly_name }}
is low, {{ trigger.to_state.state }} bar.
```
{% endraw %}

View File

@ -118,12 +118,12 @@ automation:
# Turns on bedroom light at the time specified.
automation:
triggers:
trigger: time
at: input_datetime.bedroom_alarm_clock_time
- trigger: time
at: input_datetime.bedroom_alarm_clock_time
actions:
action: light.turn_on
target:
entity_id: light.bedroom
- action: light.turn_on
target:
entity_id: light.bedroom
```
To dynamically set the `input_datetime` you can call

View File

@ -125,11 +125,12 @@ input_number:
min: 0
max: 254
step: 1
automation:
- alias: "Bedroom Light - Adjust Brightness"
triggers:
trigger: state
entity_id: input_number.bedroom_brightness
- trigger: state
entity_id: input_number.bedroom_brightness
actions:
- action: light.turn_on
target:
@ -157,6 +158,7 @@ input_select:
- Relax
- 'OFF'
initial: "Select"
input_number:
bedroom_brightness:
name: Brightness
@ -164,12 +166,13 @@ input_number:
min: 0
max: 254
step: 1
automation:
- alias: "Bedroom Light - Custom"
triggers:
trigger: state
entity_id: input_select.scene_bedroom
to: CUSTOM
- trigger: state
entity_id: input_select.scene_bedroom
to: "CUSTOM"
actions:
- action: light.turn_on
target:
@ -200,27 +203,27 @@ input_number:
automation:
- alias: "Set temp slider"
triggers:
trigger: mqtt
topic: "setTemperature"
- trigger: mqtt
topic: "setTemperature"
actions:
action: input_number.set_value
target:
entity_id: input_number.target_temp
data:
value: "{{ trigger.payload }}"
- action: input_number.set_value
target:
entity_id: input_number.target_temp
data:
value: "{{ trigger.payload }}"
# This second automation script runs when the target temperature slider is moved.
# It publishes its value to the same MQTT topic it is also subscribed to.
- alias: "Temp slider moved"
triggers:
trigger: state
entity_id: input_number.target_temp
- trigger: state
entity_id: input_number.target_temp
actions:
action: mqtt.publish
data:
topic: "setTemperature"
retain: true
payload: "{{ states('input_number.target_temp') | int }}"
- action: mqtt.publish
data:
topic: "setTemperature"
retain: true
payload: "{{ states('input_number.target_temp') | int }}"
```
{% endraw %}
@ -249,16 +252,16 @@ input_number:
step: 10
automation:
- alias: "turn something off after x time after turning it on"
triggers:
trigger: state
entity_id: switch.something
to: "on"
actions:
- delay: "00:{{ states('input_number.minutes') | int }}:{{ states('input_number.seconds') | int }}"
- action: switch.turn_off
target:
entity_id: switch.something
- alias: "turn something off after x time after turning it on"
triggers:
- trigger: state
entity_id: switch.something
to: "on"
actions:
- delay: "00:{{ states('input_number.minutes') | int }}:{{ states('input_number.seconds') | int }}"
- action: switch.turn_off
target:
entity_id: switch.something
```
{% endraw %}

View File

@ -136,14 +136,14 @@ The following example shows the usage of the `input_select.select_option` action
automation:
- alias: "example automation"
triggers:
trigger: event
event_type: MY_CUSTOM_EVENT
- trigger: event
event_type: MY_CUSTOM_EVENT
actions:
- action: input_select.select_option
target:
entity_id: input_select.who_cooks
data:
option: Paulus
option: "Paulus"
```
To dynamically set the `input_select` options you can call `input_select.set_options` in an automation:
@ -153,8 +153,8 @@ To dynamically set the `input_select` options you can call `input_select.set_opt
automation:
- alias: "example automation"
triggers:
trigger: event
event_type: MY_CUSTOM_EVENT
- trigger: event
event_type: MY_CUSTOM_EVENT
actions:
- action: input_select.set_options
target:
@ -186,28 +186,28 @@ input_select:
# 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"
triggers:
trigger: mqtt
topic: "thermostatMode"
- trigger: mqtt
topic: "thermostatMode"
# entity_id: input_select.thermostat_mode
actions:
action: input_select.select_option
target:
entity_id: input_select.thermostat_mode
data:
option: "{{ trigger.payload }}"
- action: input_select.select_option
target:
entity_id: input_select.thermostat_mode
data:
option: "{{ trigger.payload }}"
# This automation script runs when the thermostat mode selector is changed.
# It publishes its value to the same MQTT topic it is also subscribed to.
- alias: "Set Thermostat Mode"
triggers:
trigger: state
entity_id: input_select.thermostat_mode
- trigger: state
entity_id: input_select.thermostat_mode
actions:
action: mqtt.publish
data:
topic: "thermostatMode"
retain: true
payload: "{{ states('input_select.thermostat_mode') }}"
- action: mqtt.publish
data:
topic: "thermostatMode"
retain: true
payload: "{{ states('input_select.thermostat_mode') }}"
```
{% endraw %}

View File

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

View File

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

View File

@ -93,19 +93,19 @@ A Home Assistant `isy994_control` event is emitted for every "control" event in
automation:
- alias: "turn off living room on double tap lightswitch"
triggers:
trigger: event
event_type: isy994_control
event_data:
entity_id: light.lr_track_lights_front
control: "DFON"
value: 255
formatted: "On"
uom: "100"
prec: "0"
- trigger: event
event_type: isy994_control
event_data:
entity_id: light.lr_track_lights_front
control: "DFON"
value: 255
formatted: "On"
uom: "100"
prec: "0"
actions:
action: light.turn_off
target:
entity_id: light.lr_track_lights_rear
- action: light.turn_off
target:
entity_id: light.lr_track_lights_rear
```
All `isy994_control` events will have an `entity_id` and `control` parameter in its `event_data`. You'll need to refer to ISY documentation for the list of every possible control type, but the common ones are:

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.
```yaml
- alias: kaleidescape_theater_lights_up
- alias: "Kaleidescape theater lights up"
triggers:
- trigger: state
entity_id: sensor.kaleidescape_theater_media_location

View File

@ -94,17 +94,17 @@ And an automation rule to breathe life into it:
automation:
alias: "Keyboard all lights on"
triggers:
trigger: event
event_type: keyboard_remote_command_received
event_data:
device_descriptor: "/dev/input/event0"
key_code: 107 # inspect log to obtain desired keycode
type: key_down # only trigger on key_down events (optional)
- trigger: event
event_type: keyboard_remote_command_received
event_data:
device_descriptor: "/dev/input/event0"
key_code: 107 # inspect log to obtain desired keycode
type: key_down # only trigger on key_down events (optional)
actions:
action: light.turn_on
target:
entity_id: light.all
- action: light.turn_on
target:
entity_id: light.all
```
`device_descriptor` or `device_name` may be specified in the trigger so the automation will be fired only for that keyboard. This is especially useful if you wish to use several Bluetooth remotes to control different devices. Omit them to ensure the same key triggers the automation for all keyboards/remotes.
@ -125,8 +125,8 @@ Here's an automation example that plays a sound through a media player whenever
automation:
- alias: "Keyboard Connected"
triggers:
trigger: event
event_type: keyboard_remote_connected
- trigger: event
event_type: keyboard_remote_connected
actions:
- action: media_player.play_media
target:
@ -137,10 +137,10 @@ automation:
- alias: "Bluetooth Keyboard Disconnected"
triggers:
trigger: event
event_type: keyboard_remote_disconnected
event_data:
device_name: "00:58:56:4C:C0:91"
- trigger: event
event_type: keyboard_remote_disconnected
event_data:
device_name: "00:58:56:4C:C0:91"
actions:
- action: media_player.play_media
target:

View File

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

View File

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

View File

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

View File

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

View File

@ -165,7 +165,7 @@ automation:
triggers:
- trigger: event
event_type: lcn_transponder
condition: "{{ trigger.event.data.code in ['aabbcc', 'ddeeff', '112233'] }}"
conditions: "{{ trigger.event.data.code in ['aabbcc', 'ddeeff', '112233'] }}"
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
# Example configuration.yaml entry
automation:
- id: one
alias: "Turn on light when motion is detected"
- alias: "Turn on light when motion is detected"
triggers:
- trigger: state
entity_id: binary_sensor.motion_1
@ -93,11 +92,10 @@ automation:
```
```yaml
# Ledlist morning on, red
- id: llmor
alias: "Stair morning on"
- alias: "Stair morning on"
triggers:
- at: '05:00'
trigger: time
- trigger: time
at: '05:00'
actions:
- action: light.turn_on
target:

View File

@ -85,14 +85,14 @@ The LIRC integration fires `ir_command_received` events on the bus. You can capt
automation:
- alias: "Off on Remote"
triggers:
trigger: event
event_type: ir_command_received
event_data:
button_name: KEY_0
- trigger: event
event_type: ir_command_received
event_data:
button_name: KEY_0
actions:
action: homeassistant.turn_off
target:
entity_id: group.a_lights
- action: homeassistant.turn_off
target:
entity_id: group.a_lights
```
The `button_name` data values (e.g., `KEY_0`) are set by you in the `.lircrc` file.

View File

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

View File

@ -194,9 +194,9 @@ automation:
entity_id: alarm_control_panel.home_alarm
state: armed_away
actions:
action: alarm_control_panel.alarm_trigger
target:
entity_id: alarm_control_panel.home_alarm
- action: alarm_control_panel.alarm_trigger
target:
entity_id: alarm_control_panel.home_alarm
```
Sending a notification when the alarm is triggered.

View File

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

View File

@ -69,12 +69,12 @@ The `play_media` function can be used in scripts to change channels:
#
change_channel:
sequence:
action: media_player.play_media
target:
entity_id: media_player.mediaroom_stb
data:
media_content_id: "{{ channel_number }}"
media_content_type: "channel"
- action: media_player.play_media
target:
entity_id: media_player.mediaroom_stb
data:
media_content_id: "{{ channel_number }}"
media_content_type: "channel"
```
{% endraw %}
@ -88,12 +88,12 @@ The `play_media` function can also be used to trigger actions on the set-up-box
#
press_button:
sequence:
action: media_player.play_media
target:
entity_id: media_player.mediaroom_stb
data:
media_content_id: "{{ action }}"
media_content_type: "mediaroom"
- action: media_player.play_media
target:
entity_id: media_player.mediaroom_stb
data:
media_content_id: "{{ action }}"
media_content_type: "mediaroom"
```
{% endraw %}

View File

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

View File

@ -89,10 +89,10 @@ Automations can be triggered on new files created on the Minio server using the
automation:
- alias: "Upload camera snapshot"
triggers:
trigger: event
event_type: folder_watcher
event_data:
event_type: created
- trigger: event
event_type: folder_watcher
event_data:
event_type: created
actions:
- delay: "00:00:01"
- action: minio.put
@ -107,16 +107,16 @@ automation:
- alias: "Download new Minio file"
triggers:
- trigger: event
event_type: minio
- trigger: event
event_type: minio
conditions: []
actions:
- action: minio.get
data:
bucket: "{{trigger.event.data.bucket}}"
key: "{{trigger.event.data.key}}"
file_path: "/tmp/{{ trigger.event.data.file_name }}"
- action: minio.get
data:
bucket: "{{trigger.event.data.bucket}}"
key: "{{trigger.event.data.key}}"
file_path: "/tmp/{{ trigger.event.data.file_name }}"
```
{% endraw %}

View File

@ -39,34 +39,36 @@ An example automation:
```yaml
automation:
- alias: Notify CallerID
- alias: "Notify CallerID"
triggers:
trigger: state
entity_id: sensor.phone_modem
to: "callerid"
- trigger: state
entity_id: sensor.phone_modem
to: "callerid"
actions:
action: notify.notify
data:
message: "Call from {{ state_attr('sensor.phone_modem', 'cid_name') }} at {{ state_attr('sensor.phone_modem', 'cid_number') }} "
- alias: Notify CallerID webui
- action: notify.notify
data:
message: "Call from {{ state_attr('sensor.phone_modem', 'cid_name') }} at {{ state_attr('sensor.phone_modem', 'cid_number') }} "
- alias: "Notify CallerID webui"
triggers:
trigger: state
entity_id: sensor.phone_modem
to: "callerid"
- trigger: state
entity_id: sensor.phone_modem
to: "callerid"
actions:
action: persistent_notification.create
data:
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') }} "
- alias: Say CallerID
- action: persistent_notification.create
data:
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') }} "
- alias: "Say CallerID"
triggers:
trigger: state
entity_id: sensor.phone_modem
to: "callerid"
- trigger: state
entity_id: sensor.phone_modem
to: "callerid"
actions:
action: tts.google_say
data:
message: "Call from {{ state_attr('sensor.phone_modem', 'cid_name') }}"
- action: tts.google_say
data:
message: "Call from {{ state_attr('sensor.phone_modem', 'cid_name') }}"
```
{% endraw %}

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):
```yaml
alias: Motionblinds polling automation
mode: single
alias: "Motionblinds polling automation"
triggers:
- trigger: time_pattern
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:
```yaml
alias: Motionblinds Bluetooth polling automation
mode: single
alias: "Motionblinds Bluetooth polling automation"
triggers:
- trigger: time_pattern
hours: "/24"

View File

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

View File

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

View File

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

View File

@ -31,8 +31,7 @@ The state is the last reading from Nightscout, and you can see other information
### Example automation
```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
triggers:
- trigger: numeric_state

View File

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

View File

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

View File

@ -149,9 +149,9 @@ automation:
template:
- triggers:
alias: "Update image when a new weather image is generated"
trigger: event
event_type: new_weather_image
- alias: "Update image when a new weather image is generated"
trigger: event
event_type: new_weather_image
image:
name: "AI generated image of New York"
url: "{{ trigger.event.data.url }}"

View File

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

View File

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

View File

@ -57,10 +57,10 @@ Here is how an [action](/docs/automation/action) of your [automation setup](/get
```yaml
actions:
action: persistent_notification.create
data:
message: "Your message goes here"
title: "Custom subject"
- action: persistent_notification.create
data:
message: "Your message goes here"
title: "Custom subject"
```
If you want to show some runtime information, you have to use [templates](/docs/configuration/templating/).
@ -69,11 +69,11 @@ If you want to show some runtime information, you have to use [templates](/docs/
```yaml
actions:
action: persistent_notification.create
data:
title: >
Thermostat is {{ state_attr('climate.thermostat', 'hvac_action') }}
message: "Temperature {{ state_attr('climate.thermostat', 'current_temperature') }}"
- action: persistent_notification.create
data:
title: >
Thermostat is {{ state_attr('climate.thermostat', 'hvac_action') }}
message: "Temperature {{ state_attr('climate.thermostat', 'current_temperature') }}"
```
{% endraw %}
@ -88,16 +88,16 @@ This action allows you to remove a notifications by script or automation.
```yaml
actions:
action: persistent_notification.dismiss
data:
notification_id: "1234"
- action: persistent_notification.dismiss
data:
notification_id: "1234"
```
The `persistent_notification.dismiss_all` action allows you to remove all notifications.
```yaml
actions:
action: persistent_notification.dismiss_all
- action: persistent_notification.dismiss_all
```
### 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:
```yaml
alias: Plex - New media added
alias: "Plex - New media added"
triggers:
- trigger: state
entity_id: sensor.plex_library_movies

View File

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

View File

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

View File

@ -47,66 +47,66 @@ Message to two devices with formatted text.
```yaml
actions:
action: notify.notify
data:
title: "Test to 2 devices"
message: "Attention [b]bold[/b] text[br][url=https://www.pushsafer.com]Link to Pushsafer[/url]"
- action: notify.notify
data:
icon: "2"
iconcolor: "#FF0000"
sound: "2"
vibration: "1"
url: "https://www.home-assistant.io/"
urltitle: "Open Home Assistant"
time2live: "0"
title: "Test to 2 devices"
message: "Attention [b]bold[/b] text[br][url=https://www.pushsafer.com]Link to Pushsafer[/url]"
data:
icon: "2"
iconcolor: "#FF0000"
sound: "2"
vibration: "1"
url: "https://www.home-assistant.io/"
urltitle: "Open Home Assistant"
time2live: "0"
```
Message to one device with formatted text and image from an external URL.
```yaml
actions:
action: notify.notify
data:
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]"
- action: notify.notify
data:
icon: "14"
iconcolor: "#FFFF00"
sound: "22"
vibration: "31"
url: "https://www.home-assistant.io/"
urltitle: "Open Home Assistant"
time2live: "60"
picture1:
url: "https://www.home-assistant.io/images/integrations/alexa/alexa-512x512.png"
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]"
data:
icon: "14"
iconcolor: "#FFFF00"
sound: "22"
vibration: "31"
url: "https://www.home-assistant.io/"
urltitle: "Open Home Assistant"
time2live: "60"
picture1:
url: "https://www.home-assistant.io/images/integrations/alexa/alexa-512x512.png"
```
Message to two devices and one device group with formatted text and local image.
```yaml
actions:
action: notify.notify
data:
title: "Test to 3 devices with local image"
message: "Attention [i]italic[/i] Text[br][url=https://www.home-assistant.io/]Testlink[/url]"
target: ["1111","2222","gs3333"],
- action: notify.notify
data:
icon: "20"
iconcolor: "#FF00FF"
sound: "33"
vibration: "0"
url: "https://www.home-assistant.io/"
urltitle: "Open Home Assistant"
time2live: "10"
priority: "2"
retry: "60"
expire: "600"
confirm: "10"
answer: "1"
answeroptions: "yes|no|maybe"
answerforce: "1"
picture1: {
path: "C:\\Users\\Kevin\\AppData\\Roaming\\.homeassistant\\image-760-testimage.jpg"
title: "Test to 3 devices with local image"
message: "Attention [i]italic[/i] Text[br][url=https://www.home-assistant.io/]Testlink[/url]"
target: ["1111","2222","gs3333"],
data:
icon: "20"
iconcolor: "#FF00FF"
sound: "33"
vibration: "0"
url: "https://www.home-assistant.io/"
urltitle: "Open Home Assistant"
time2live: "10"
priority: "2"
retry: "60"
expire: "600"
confirm: "10"
answer: "1"
answeroptions: "yes|no|maybe"
answerforce: "1"
picture1: {
path: "C:\\Users\\Kevin\\AppData\\Roaming\\.homeassistant\\image-760-testimage.jpg"
```
To customize your push-notification you can take a look at the [Pushsafer API description](https://www.pushsafer.com/en/pushapi).

View File

@ -109,8 +109,8 @@ QwikSwitch devices (i.e., transmitter buttons) will fire events on the Home Assi
automation:
- alias: "Action - Respond to A button press"
triggers:
trigger: event
event_type: qwikswitch.button.@12df34
- trigger: event
event_type: qwikswitch.button.@12df34
```
`event_type` names should be in the format **qwikswitch.button.@_QS_id_**. where **@_QS_id_** will be captured in the Home Assistant log when pressing the button. Alternatively, you can also get the device ID from the QS Mobile application or by using the listen API call by browsing to `http://127.0.0.1:2020/&listen` and then pressing the button.

View File

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

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