mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 01:06:52 +00:00
Improve YAML styling for all automation examples (#34932)
This commit is contained in:
parent
d118c3e072
commit
8b9ad61e42
@ -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:
|
||||
|
@ -219,7 +219,7 @@ automation 2:
|
||||
- trigger: mqtt
|
||||
topic: "/notify/+"
|
||||
actions:
|
||||
action: >
|
||||
- action: >
|
||||
notify.{{ trigger.topic.split('/')[-1] }}
|
||||
data:
|
||||
message: "{{ trigger.payload }}"
|
||||
|
@ -277,7 +277,7 @@ actions:
|
||||
- action: light.turn_on
|
||||
target: !input light_target
|
||||
- wait_for_trigger:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: !input motion_entity
|
||||
from: "on"
|
||||
to: "off"
|
||||
|
@ -45,11 +45,11 @@ The automation we're going to use in this tutorial controls a light based on a m
|
||||
|
||||
```yaml
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: binary_sensor.motion_kitchen
|
||||
|
||||
actions:
|
||||
action: >
|
||||
- action: >
|
||||
{% if trigger.to_state.state == "on" %}
|
||||
light.turn_on
|
||||
{% else %}
|
||||
@ -92,7 +92,7 @@ Configurable parts in blueprints are called [inputs](/docs/blueprint/schema/#blu
|
||||
|
||||
```yaml
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: !input motion_sensor
|
||||
```
|
||||
|
||||
@ -104,7 +104,7 @@ Inputs are not limited to strings. They can contain complex objects too. So in t
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: >
|
||||
- action: >
|
||||
{% if trigger.to_state.state == "on" %}
|
||||
light.turn_on
|
||||
{% else %}
|
||||
|
@ -268,20 +268,20 @@ These work recursively. As an example using `!include_dir_list automation`, will
|
||||
automation:
|
||||
- alias: "Automation 1"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: device_tracker.iphone
|
||||
to: "home"
|
||||
actions:
|
||||
action: light.turn_on
|
||||
- action: light.turn_on
|
||||
target:
|
||||
entity_id: light.entryway
|
||||
- alias: "Automation 2"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: device_tracker.iphone
|
||||
from: "home"
|
||||
actions:
|
||||
action: light.turn_off
|
||||
- action: light.turn_off
|
||||
target:
|
||||
entity_id: light.entryway
|
||||
```
|
||||
@ -299,11 +299,11 @@ automation: !include_dir_list automation/presence/
|
||||
```yaml
|
||||
alias: "Automation 1"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: device_tracker.iphone
|
||||
to: "home"
|
||||
actions:
|
||||
action: light.turn_on
|
||||
- action: light.turn_on
|
||||
target:
|
||||
entity_id: light.entryway
|
||||
```
|
||||
@ -313,11 +313,11 @@ actions:
|
||||
```yaml
|
||||
alias: "Automation 2"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: device_tracker.iphone
|
||||
from: "home"
|
||||
actions:
|
||||
action: light.turn_off
|
||||
- action: light.turn_off
|
||||
target:
|
||||
entity_id: light.entryway
|
||||
```
|
||||
|
@ -58,12 +58,12 @@ Scenes can be activated using the action `scene.turn_on` (there is no 'scene.tur
|
||||
# Example automation
|
||||
automation:
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: device_tracker.sweetheart
|
||||
from: "not_home"
|
||||
to: "home"
|
||||
actions:
|
||||
action: scene.turn_on
|
||||
- action: scene.turn_on
|
||||
target:
|
||||
entity_id: scene.romantic
|
||||
```
|
||||
@ -76,12 +76,12 @@ With the `scene.apply` action you are able to apply a scene without first defini
|
||||
# Example automation
|
||||
automation:
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: device_tracker.sweetheart
|
||||
from: "not_home"
|
||||
to: "home"
|
||||
actions:
|
||||
action: scene.apply
|
||||
- action: scene.apply
|
||||
data:
|
||||
entities:
|
||||
light.tv_back_light:
|
||||
@ -90,7 +90,7 @@ automation:
|
||||
light.ceiling: off
|
||||
media_player.sony_bravia_tv:
|
||||
state: "on"
|
||||
source: HDMI 1
|
||||
source: "HDMI 1"
|
||||
```
|
||||
|
||||
## Using scene transitions
|
||||
@ -105,12 +105,12 @@ light will transition to the scene in 2.5 seconds.
|
||||
# Example automation
|
||||
automation:
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: device_tracker.sweetheart
|
||||
from: "not_home"
|
||||
to: "home"
|
||||
actions:
|
||||
action: scene.turn_on
|
||||
- action: scene.turn_on
|
||||
target:
|
||||
entity_id: scene.romantic
|
||||
data:
|
||||
|
@ -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:
|
||||
|
@ -20,7 +20,7 @@ Test multiple conditions in one condition statement. Passes if all embedded cond
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
alias: "Paulus home AND temperature below 20"
|
||||
- alias: "Paulus home AND temperature below 20"
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
@ -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,7 +67,7 @@ Test multiple conditions in one condition statement. Passes if any embedded cond
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
alias: "Paulus home OR temperature below 20"
|
||||
- alias: "Paulus home OR temperature below 20"
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
@ -82,7 +82,7 @@ The OR condition also has a shorthand form. The following configuration works th
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
alias: "Paulus home OR temperature below 20"
|
||||
- alias: "Paulus home OR temperature below 20"
|
||||
or:
|
||||
- condition: state
|
||||
entity_id: "device_tracker.paulus"
|
||||
@ -99,7 +99,7 @@ This allows you to mix several AND and OR conditions together.
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: and
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: "device_tracker.paulus"
|
||||
@ -118,7 +118,7 @@ Or in shorthand form:
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
and:
|
||||
- and:
|
||||
- condition: state
|
||||
entity_id: "device_tracker.paulus"
|
||||
state: "home"
|
||||
@ -137,7 +137,7 @@ Test multiple conditions in one condition statement. Passes if all embedded cond
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
alias: "Paulus not home AND alarm not disarmed"
|
||||
- alias: "Paulus not home AND alarm not disarmed"
|
||||
condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
@ -145,7 +145,7 @@ conditions:
|
||||
state: "home"
|
||||
- condition: state
|
||||
entity_id: alarm_control_panel.home_alarm
|
||||
state: disarmed
|
||||
state: "disarmed"
|
||||
```
|
||||
|
||||
The NOT condition also has a shorthand form. The following configuration works the same as the one listed above:
|
||||
@ -170,7 +170,7 @@ If both `below` and `above` are specified, both tests have to pass.
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
alias: "Temperature between 17 and 25 degrees"
|
||||
- alias: "Temperature between 17 and 25 degrees"
|
||||
condition: numeric_state
|
||||
entity_id: sensor.temperature
|
||||
above: 17
|
||||
@ -183,7 +183,7 @@ You can optionally use a `value_template` to process the value of the state befo
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: numeric_state
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.temperature
|
||||
above: 17
|
||||
below: 25
|
||||
@ -198,7 +198,7 @@ The condition will pass if **all** entities match the thresholds.
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: numeric_state
|
||||
- condition: numeric_state
|
||||
entity_id:
|
||||
- sensor.kitchen_temperature
|
||||
- sensor.living_room_temperature
|
||||
@ -210,7 +210,7 @@ The condition will pass if the attribute value of the entity matches the thresho
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: numeric_state
|
||||
- condition: numeric_state
|
||||
entity_id: climate.living_room_thermostat
|
||||
attribute: temperature
|
||||
above: 17
|
||||
@ -223,7 +223,7 @@ options to make the condition more dynamic.
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: numeric_state
|
||||
- condition: numeric_state
|
||||
entity_id: climate.living_room_thermostat
|
||||
attribute: temperature
|
||||
above: input_number.temperature_threshold_low
|
||||
@ -236,7 +236,7 @@ Tests if an entity has a specified state.
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
alias: "Paulus not home for an hour and a bit"
|
||||
- alias: "Paulus not home for an hour and a bit"
|
||||
condition: state
|
||||
entity_id: device_tracker.paulus
|
||||
state: "not_home"
|
||||
@ -252,7 +252,7 @@ The condition will pass if **all** entities match the state.
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: state
|
||||
- condition: state
|
||||
entity_id:
|
||||
- light.kitchen
|
||||
- light.living_room
|
||||
@ -264,7 +264,7 @@ In the following example the condition will pass if **any** entity matches the s
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: state
|
||||
- condition: state
|
||||
entity_id:
|
||||
- binary_sensor.motion_sensor_left
|
||||
- binary_sensor.motion_sensor_right
|
||||
@ -277,7 +277,7 @@ The condition will pass if the entity matches one of the states given.
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: state
|
||||
- condition: state
|
||||
entity_id: alarm_control_panel.home
|
||||
state:
|
||||
- "armed_away"
|
||||
@ -289,7 +289,7 @@ both media players need to be either paused or playing for the condition to pass
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: state
|
||||
- condition: state
|
||||
entity_id:
|
||||
- media_player.living_room
|
||||
- media_player.kitchen
|
||||
@ -303,7 +303,7 @@ The condition will pass if the attribute matches the given state.
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: state
|
||||
- condition: state
|
||||
entity_id: climate.living_room_thermostat
|
||||
attribute: fan_mode
|
||||
state: "auto"
|
||||
@ -315,7 +315,7 @@ of the given helper entity.
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: state
|
||||
- condition: state
|
||||
entity_id: alarm_control_panel.home
|
||||
state: input_select.guest_mode
|
||||
```
|
||||
@ -326,7 +326,7 @@ You can also use templates in the `for` option.
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: state
|
||||
- condition: state
|
||||
entity_id: device_tracker.paulus
|
||||
state: "home"
|
||||
for:
|
||||
@ -346,7 +346,7 @@ The sun state can be used to test if the sun has set or risen.
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
alias: "Sun up"
|
||||
- alias: "Sun up"
|
||||
condition: state # 'day' condition: from sunrise until sunset
|
||||
entity_id: sun.sun
|
||||
state: "above_horizon"
|
||||
@ -354,7 +354,7 @@ conditions:
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
alias: "Sun down"
|
||||
- alias: "Sun down"
|
||||
condition: state # from sunset until sunrise
|
||||
entity_id: sun.sun
|
||||
state: "below_horizon"
|
||||
@ -371,7 +371,7 @@ 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
|
||||
- condition: and # 'twilight' condition: dusk and dawn, in typical locations
|
||||
conditions:
|
||||
- condition: template
|
||||
value_template: "{{ state_attr('sun.sun', 'elevation') < 0 }}"
|
||||
@ -406,7 +406,7 @@ The sunset/sunrise conditions do not work in locations inside the polar circles,
|
||||
This is an example of 1 hour offset before sunset:
|
||||
```yaml
|
||||
conditions:
|
||||
condition: sun
|
||||
- condition: sun
|
||||
after: sunset
|
||||
after_offset: "-01:00:00"
|
||||
```
|
||||
@ -441,7 +441,7 @@ The template condition tests if the [given template][template] renders a value e
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
alias: "Iphone battery above 50%"
|
||||
- alias: "Iphone battery above 50%"
|
||||
condition: template
|
||||
value_template: "{{ (state_attr('device_tracker.iphone', 'battery_level')|int) > 50 }}"
|
||||
```
|
||||
@ -488,7 +488,7 @@ and [`not`](#not-condition) conditions:
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: or
|
||||
- condition: or
|
||||
conditions:
|
||||
- "{{ is_state('device_tracker.iphone', 'away') }}"
|
||||
- condition: numeric_state
|
||||
@ -540,7 +540,7 @@ The time condition can test if it is after a specified time, before a specified
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
alias: "Time 15~02"
|
||||
- alias: "Time 15~02"
|
||||
condition: time
|
||||
# At least one of the following is required.
|
||||
after: "15:00:00"
|
||||
@ -587,20 +587,20 @@ The trigger condition can test if an automation was triggered by a certain trigg
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: trigger
|
||||
- condition: trigger
|
||||
id: event_trigger
|
||||
```
|
||||
|
||||
For a trigger identified by its index, both a string and integer is allowed:
|
||||
```yaml
|
||||
conditions:
|
||||
condition: trigger
|
||||
- condition: trigger
|
||||
id: "0"
|
||||
```
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: trigger
|
||||
- condition: trigger
|
||||
id: 0
|
||||
```
|
||||
|
||||
@ -608,7 +608,7 @@ It is possible to give a list of triggers:
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: trigger
|
||||
- condition: trigger
|
||||
id:
|
||||
- event_1_trigger
|
||||
- event_2_trigger
|
||||
@ -620,7 +620,7 @@ Zone conditions test if an entity is in a certain zone. For zone automation to w
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
alias: "Paulus at home"
|
||||
- alias: "Paulus at home"
|
||||
condition: zone
|
||||
entity_id: device_tracker.paulus
|
||||
zone: zone.home
|
||||
@ -631,7 +631,7 @@ The condition will pass if all entities are in the specified zone.
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: zone
|
||||
- condition: zone
|
||||
entity_id:
|
||||
- device_tracker.frenck
|
||||
- device_tracker.daphne
|
||||
@ -643,7 +643,7 @@ The condition will pass if the entity is in one of the zones.
|
||||
|
||||
```yaml
|
||||
conditions:
|
||||
condition: zone
|
||||
- condition: zone
|
||||
entity_id: device_tracker.paulus
|
||||
state:
|
||||
- zone.home
|
||||
@ -701,7 +701,7 @@ For example:
|
||||
```yaml
|
||||
# This condition will always pass, as it is disabled.
|
||||
conditions:
|
||||
enabled: false
|
||||
- enabled: false
|
||||
condition: state
|
||||
entity_id: sun.sun
|
||||
state: "above_horizon"
|
||||
|
@ -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]
|
||||
|
@ -105,7 +105,7 @@ If there is an automation that handles that event, it will be automatically trig
|
||||
```yaml
|
||||
- alias: "Capture Event"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: event_light_state_changed
|
||||
actions:
|
||||
- action: notify.notify
|
||||
|
@ -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
|
||||
|
@ -147,7 +147,7 @@ In an [action](/getting-started/automation-action/) of your [automation setup](/
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: androidtv.adb_command
|
||||
- action: androidtv.adb_command
|
||||
target:
|
||||
entity_id: media_player.androidtv_tv_living_room
|
||||
data:
|
||||
|
@ -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 %}
|
||||
|
@ -82,10 +82,10 @@ See the example below for how an automation trigger translates to a message on t
|
||||
automation:
|
||||
- alias: "Sunset Service Bus message"
|
||||
triggers:
|
||||
trigger: sun
|
||||
- trigger: sun
|
||||
event: sunset
|
||||
actions:
|
||||
action: notify.test_queue
|
||||
- action: notify.test_queue
|
||||
data:
|
||||
message: "Sun is going down"
|
||||
title: "Good evening"
|
||||
|
@ -52,10 +52,10 @@ at 3 AM:
|
||||
automation:
|
||||
- alias: "Backup Home Assistant every night at 3 AM"
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "03:00:00"
|
||||
actions:
|
||||
alias: "Create backup now"
|
||||
- alias: "Create backup now"
|
||||
action: backup.create
|
||||
```
|
||||
|
||||
|
@ -40,12 +40,12 @@ 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
|
||||
- trigger: state
|
||||
entity_id: binary_sensor.motion_sensor_158d000xxxxxc2
|
||||
from: "off"
|
||||
to: "on"
|
||||
conditions:
|
||||
condition: numeric_state
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.illumination_34ce00xxxx11
|
||||
below: 300
|
||||
actions:
|
||||
@ -59,7 +59,7 @@ 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
|
||||
- trigger: state
|
||||
entity_id: binary_sensor.motion_sensor_158d000xxxxxc2
|
||||
from: "on"
|
||||
to: "off"
|
||||
@ -79,33 +79,33 @@ 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
|
||||
- trigger: state
|
||||
entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2
|
||||
from: "off"
|
||||
to: "on"
|
||||
actions:
|
||||
action: climate.set_operation_mode
|
||||
- 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
|
||||
- trigger: state
|
||||
entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2
|
||||
from: "on"
|
||||
to: "off"
|
||||
for:
|
||||
minutes: 5
|
||||
actions:
|
||||
action: climate.set_operation_mode
|
||||
- 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
|
||||
- trigger: state
|
||||
entity_id: binary_sensor.door_window_sensor_15xxxxxxc9xx6b
|
||||
from: "off"
|
||||
to: "on"
|
||||
@ -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
|
||||
- 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
|
||||
- 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,35 +167,35 @@ 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
|
||||
- trigger: event
|
||||
event_type: xiaomi_aqara.click
|
||||
event_data:
|
||||
entity_id: binary_sensor.switch_158d000xxxxxc2
|
||||
click_type: single
|
||||
actions:
|
||||
action: switch.toggle
|
||||
- action: switch.toggle
|
||||
target:
|
||||
entity_id: switch.wall_switch_left_158d000xxxxx01
|
||||
- alias: "Toggle couch light on double click"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: xiaomi_aqara.click
|
||||
event_data:
|
||||
entity_id: binary_sensor.switch_158d000xxxxxc2
|
||||
click_type: double
|
||||
actions:
|
||||
action: switch.toggle
|
||||
- action: switch.toggle
|
||||
target:
|
||||
entity_id: switch.wall_switch_right_158d000xxxxx01
|
||||
- alias: "Let a dog bark on long press"
|
||||
triggers:
|
||||
trigger: event
|
||||
- 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
|
||||
- action: xiaomi_aqara.play_ringtone
|
||||
data:
|
||||
gw_mac: xxxxxxxxxxxx
|
||||
ringtone_id: 8
|
||||
@ -209,7 +209,7 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
|
||||
```yaml
|
||||
- alias: "Cube event flip90"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: xiaomi_aqara.cube_action
|
||||
event_data:
|
||||
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
||||
@ -222,7 +222,7 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
|
||||
color_name: "springgreen"
|
||||
- alias: "Cube event flip180"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: xiaomi_aqara.cube_action
|
||||
event_data:
|
||||
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
||||
@ -235,7 +235,7 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
|
||||
color_name: "darkviolet"
|
||||
- alias: "Cube event move"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: xiaomi_aqara.cube_action
|
||||
event_data:
|
||||
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
||||
@ -248,7 +248,7 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
|
||||
color_name: "gold"
|
||||
- alias: "Cube event tap_twice"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: xiaomi_aqara.cube_action
|
||||
event_data:
|
||||
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
||||
@ -261,7 +261,7 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
|
||||
color_name: "deepskyblue"
|
||||
- alias: "Cube event shake_air"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: xiaomi_aqara.cube_action
|
||||
event_data:
|
||||
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
||||
@ -283,13 +283,13 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac
|
||||
```yaml
|
||||
- alias: "Decrease brightness of the gateway light"
|
||||
triggers:
|
||||
trigger: event
|
||||
- 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
|
||||
- action: light.turn_on
|
||||
target:
|
||||
entity_id: light.gateway_light_34xxxxxxxx13
|
||||
data:
|
||||
@ -306,13 +306,13 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac
|
||||
|
||||
- alias: "Increase brightness of the gateway light"
|
||||
triggers:
|
||||
trigger: event
|
||||
- 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
|
||||
- action: light.turn_on
|
||||
target:
|
||||
entity_id: light.gateway_light_34xxxxxxxx13
|
||||
data:
|
||||
@ -329,13 +329,13 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac
|
||||
|
||||
- alias: "Turn off the gateway light"
|
||||
triggers:
|
||||
trigger: event
|
||||
- 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
|
||||
- action: light.turn_off
|
||||
target:
|
||||
entity_id: light.gateway_light_34xxxxxxxx13
|
||||
```
|
||||
@ -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
|
||||
- trigger: event
|
||||
event_type: xiaomi_aqara.movement
|
||||
event_data:
|
||||
entity_id: binary_sensor.vibration_xxxx000000
|
||||
movement_type: vibrate
|
||||
actions:
|
||||
action: light.toggle
|
||||
- action: light.toggle
|
||||
target:
|
||||
entity_id: light.living_room_lamp
|
||||
- alias: "Turn on Living Room Lamp on tilt"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: xiaomi_aqara.movement
|
||||
event_data:
|
||||
entity_id: binary_sensor.vibration_xxxx000000
|
||||
movement_type: tilt
|
||||
actions:
|
||||
action: light.toggle
|
||||
- action: light.toggle
|
||||
target:
|
||||
entity_id: light.living_room_lamp
|
||||
```
|
||||
|
@ -133,14 +133,13 @@ This example automation will arm your blink sync module to detect motion on any
|
||||
Here, this example assumes your blink module is named `My Sync Module` and that you have [device trackers](/integrations/device_tracker) set up for presence detection.
|
||||
|
||||
```yaml
|
||||
- id: arm_blink_when_away
|
||||
alias: "Arm Blink When Away"
|
||||
- alias: "Arm Blink When Away"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: all
|
||||
to: "not_home"
|
||||
actions:
|
||||
action: alarm_control_panel.alarm_arm_away
|
||||
- action: alarm_control_panel.alarm_arm_away
|
||||
target:
|
||||
entity_id: alarm_control_panel.blink_my_sync_module
|
||||
```
|
||||
@ -150,14 +149,13 @@ Here, this example assumes your blink module is named `My Sync Module` and that
|
||||
Similar to the previous example, this automation will disarm blink when arriving home.
|
||||
|
||||
```yaml
|
||||
- id: disarm_blink_when_home
|
||||
alias: "Disarm Blink When Home"
|
||||
- alias: "Disarm Blink When Home"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: all
|
||||
to: "home"
|
||||
actions:
|
||||
action: alarm_control_panel.alarm_disarm
|
||||
- action: alarm_control_panel.alarm_disarm
|
||||
target:
|
||||
entity_id: alarm_control_panel.blink_my_sync_module
|
||||
```
|
||||
@ -171,10 +169,9 @@ The following example assumes your camera's name (in the Blink app) is `My Camer
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
- id: save_blink_video_on_motion
|
||||
alias: "Save Blink Video on Motion"
|
||||
- alias: "Save Blink Video on Motion"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: binary_sensor.blink_my_camera_motion_detected
|
||||
to: "on"
|
||||
actions:
|
||||
@ -200,8 +197,7 @@ The file will be saved to `/tmp/videos/YYYYMMDD_HHmmSS_MyCamera.mp4`.
|
||||
The file name of the downloaded video file is not configurable.
|
||||
|
||||
```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
|
||||
|
@ -80,7 +80,7 @@ The name of the action is `notify.bmw_connected_drive_<your_vehicle>`.
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: notify.bmw_connected_drive_<your_vehicle>
|
||||
- action: notify.bmw_connected_drive_<your_vehicle>
|
||||
data:
|
||||
message: The name of the POI # this is shown on the iDrive dashboard
|
||||
data:
|
||||
|
@ -67,7 +67,7 @@ The **Bring** integration offers an action to send push notifications to the Bri
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: bring.send_message
|
||||
- action: bring.send_message
|
||||
target:
|
||||
entity_id: todo.bring_shoppinglist
|
||||
data:
|
||||
@ -81,7 +81,7 @@ Note that for the notification type `urgent_message` the attribute `item` is **r
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: bring.send_message
|
||||
- action: bring.send_message
|
||||
target:
|
||||
entity_id: todo.bring_shoppinglist
|
||||
data:
|
||||
|
@ -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,9 +141,11 @@ automation:
|
||||
- "{{ trigger.event == 'start' }}"
|
||||
then:
|
||||
- action: light.turn_on
|
||||
target:
|
||||
entity_id: light.front
|
||||
else:
|
||||
- action: light.turn_off
|
||||
target:
|
||||
entity_id: light.front
|
||||
```
|
||||
{% endraw %}
|
||||
|
@ -75,7 +75,7 @@ For example, the following action in an automation would send an `hls` live stre
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: camera.play_stream
|
||||
- action: camera.play_stream
|
||||
target:
|
||||
entity_id: camera.yourcamera
|
||||
data:
|
||||
@ -103,7 +103,7 @@ For example, the following action in an automation would take a recording from "
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: camera.record
|
||||
- action: camera.record
|
||||
target:
|
||||
entity_id: camera.yourcamera
|
||||
data:
|
||||
@ -129,7 +129,7 @@ For example, the following action in an automation would take a snapshot from "y
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: camera.snapshot
|
||||
- action: camera.snapshot
|
||||
target:
|
||||
entity_id: camera.yourcamera
|
||||
data:
|
||||
|
@ -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
|
||||
|
@ -69,7 +69,7 @@ Here are the automations for the above screenshot:
|
||||
- trigger: webhook
|
||||
webhook_id: build_failed
|
||||
actions:
|
||||
action: notify.cisco_webex_teams_notify
|
||||
- action: notify.cisco_webex_teams_notify
|
||||
data:
|
||||
message: "<blockquote class=danger>Build 0.89.5 compile failed."
|
||||
|
||||
@ -82,7 +82,7 @@ Here are the automations for the above screenshot:
|
||||
- trigger: webhook
|
||||
webhook_id: build_unstable
|
||||
actions:
|
||||
action: notify.cisco_webex_teams_notify
|
||||
- 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.
|
||||
@ -105,7 +105,7 @@ Here are the automations for the above screenshot:
|
||||
- trigger: webhook
|
||||
webhook_id: build_passed
|
||||
actions:
|
||||
action: notify.cisco_webex_teams_notify
|
||||
- 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.
|
||||
|
@ -53,7 +53,7 @@ Turn auxiliary heater on/off for climate device
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: climate.set_aux_heat
|
||||
@ -79,7 +79,7 @@ reflecting a situation where the climate device is set to save energy. For examp
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: climate.set_preset_mode
|
||||
@ -107,7 +107,7 @@ Set target temperature of climate device
|
||||
### Set temperature to 24 in heat mode
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: climate.set_temperature
|
||||
@ -122,7 +122,7 @@ automation:
|
||||
### Set temperature range to 20 to 24 in heat_cool mode
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: climate.set_temperature
|
||||
@ -148,7 +148,7 @@ Set target humidity of climate device
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: climate.set_humidity
|
||||
@ -172,7 +172,7 @@ Set fan operation for climate device
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: climate.set_fan_mode
|
||||
@ -196,7 +196,7 @@ Set climate device's HVAC mode
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: climate.set_hvac_mode
|
||||
@ -220,7 +220,7 @@ Set swing operation mode for climate device
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: climate.set_swing_mode
|
||||
|
@ -147,15 +147,14 @@ system_log:
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
automation:
|
||||
- id: 'errorcounterautomation'
|
||||
alias: "Error Counting Automation"
|
||||
- alias: "Error Counting Automation"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: system_log_event
|
||||
event_data:
|
||||
level: ERROR
|
||||
actions:
|
||||
action: counter.increment
|
||||
- action: counter.increment
|
||||
target:
|
||||
entity_id: counter.error_counter
|
||||
|
||||
|
@ -76,7 +76,7 @@ Available actions: `cover.open_cover`, `cover.close_cover`, `cover.stop_cover`,
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: cover.open_cover
|
||||
@ -98,7 +98,7 @@ Set cover position of one or multiple covers.
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: cover.set_cover_position
|
||||
@ -122,7 +122,7 @@ Set cover tilt position of one or multiple covers.
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: cover.set_cover_tilt_position
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -44,14 +44,14 @@ 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'
|
||||
- trigger: numeric_state
|
||||
entity_id: sensor.dexcom_YOUR_USERNAME_glucose_value
|
||||
trigger: numeric_state
|
||||
condition: time
|
||||
below: 65
|
||||
conditions:
|
||||
- condition: time
|
||||
after: "22:00:00"
|
||||
before: "06:00:00"
|
||||
actions:
|
||||
|
@ -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
|
||||
- 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
|
||||
```
|
||||
|
@ -77,10 +77,10 @@ This is a notify platform and thus can be controlled by calling the notify actio
|
||||
automation:
|
||||
- alias: "The sun has set"
|
||||
triggers:
|
||||
trigger: sun
|
||||
- trigger: sun
|
||||
event: sunset
|
||||
actions:
|
||||
action: notify.dovado
|
||||
- action: notify.dovado
|
||||
data:
|
||||
message: "The sun has set"
|
||||
target: "+14151234567"
|
||||
|
@ -52,10 +52,10 @@ Along with the event the following payload parameters are available:
|
||||
```yaml
|
||||
- alias: "Download Failed Notification"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: downloader_download_failed
|
||||
actions:
|
||||
action: persistent_notification.create
|
||||
- action: persistent_notification.create
|
||||
data:
|
||||
message: "{{trigger.event.data.filename}} download failed"
|
||||
title: "Download Failed"
|
||||
|
@ -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
|
||||
|
@ -112,13 +112,13 @@ Sample automation to switch lights on and off:
|
||||
automation:
|
||||
- alias: "Hall light switches"
|
||||
triggers:
|
||||
trigger: event
|
||||
- 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 %}"
|
||||
- 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 %}"
|
||||
```
|
||||
|
@ -49,10 +49,10 @@ The phone number used in **target** should be registered with Facebook messenger
|
||||
automation:
|
||||
- alias: "Evening Greeting"
|
||||
triggers:
|
||||
trigger: sun
|
||||
- trigger: sun
|
||||
event: sunset
|
||||
actions:
|
||||
action: notify.facebook
|
||||
- action: notify.facebook
|
||||
data:
|
||||
message: "Good Evening"
|
||||
target:
|
||||
|
@ -51,7 +51,7 @@ Sets the speed percentage for fan device.
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: fan.set_percentage
|
||||
@ -75,7 +75,7 @@ Sets a preset mode for the fan device. Available preset modes are defined by the
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: fan.set_preset_mode
|
||||
@ -99,7 +99,7 @@ Sets the rotation for fan device.
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: fan.set_direction
|
||||
@ -123,7 +123,7 @@ Sets the oscillation for fan device.
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: fan.oscillate
|
||||
@ -157,7 +157,7 @@ Turn fan device off. This is only supported if the fan device supports being tur
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "07:15:00"
|
||||
actions:
|
||||
- action: fan.turn_off
|
||||
|
@ -30,10 +30,10 @@ 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
|
||||
- trigger: event
|
||||
event_type: feedreader
|
||||
actions:
|
||||
action: script.turn_on
|
||||
- action: script.turn_on
|
||||
target:
|
||||
entity_id: script.my_action
|
||||
```
|
||||
@ -44,12 +44,12 @@ automation:
|
||||
automation:
|
||||
- alias: "Send notification of RSS feed title when updated"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: feedreader
|
||||
event_data:
|
||||
feed_url: "https://hasspodcast.io/feed/podcast"
|
||||
actions:
|
||||
action: persistent_notification.create
|
||||
- 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) }}"
|
||||
|
@ -118,16 +118,16 @@ These are documented below.
|
||||
automation:
|
||||
- alias: "Switch on a light when incident is received"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: sensor.incidents
|
||||
actions:
|
||||
action: light.turn_on
|
||||
- action: light.turn_on
|
||||
target:
|
||||
entity_id: light.bedroom
|
||||
|
||||
- alias: "Play TTS incident details when incident is received"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: sensor.incidents
|
||||
attribute: message_to_speech_url
|
||||
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,19 +147,19 @@ automation:
|
||||
|
||||
- alias: "Send response acknowledgement when a button is pressed"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: switch.response_button
|
||||
actions:
|
||||
action: homeassistant.turn_on
|
||||
- action: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: switch.incident_response
|
||||
|
||||
- alias: "Cast FireServiceRota dashboard to Nest Hub"
|
||||
trigger:
|
||||
trigger: homeassistant
|
||||
triggers:
|
||||
- trigger: homeassistant
|
||||
event: start
|
||||
actions:
|
||||
action: cast.show_lovelace_view
|
||||
- action: cast.show_lovelace_view
|
||||
data:
|
||||
entity_id: media_player.nest_hub_bedroom
|
||||
view_path: fsr
|
||||
|
@ -79,13 +79,13 @@ 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
|
||||
- trigger: event
|
||||
event_type: flic_click
|
||||
event_data:
|
||||
button_name: flic_81e4ac74b6d2
|
||||
click_type: single
|
||||
actions:
|
||||
action: homeassistant.turn_on
|
||||
- action: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: group.lights_livingroom
|
||||
```
|
||||
@ -105,7 +105,7 @@ To help detect and debug flic button clicks, you can use this automation that se
|
||||
automation:
|
||||
- alias: "FLIC Html5 notify on every click"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: flic_click
|
||||
actions:
|
||||
- action: notify.html5
|
||||
|
@ -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
|
||||
- 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 %}
|
||||
|
@ -59,10 +59,10 @@ 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
|
||||
- trigger: event
|
||||
event_type: foursquare.push
|
||||
actions:
|
||||
action: script.turn_on
|
||||
- action: script.turn_on
|
||||
target:
|
||||
entity_id: script.my_action
|
||||
```
|
||||
|
@ -50,12 +50,12 @@ In case your device (friendly name) is called *badezimmer*, an example automatio
|
||||
# Example configuration.yaml automation
|
||||
alias: "Bathroom Motion Detected"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: binary_sensor.motion_sensor_166d0001171111
|
||||
from: "off"
|
||||
to: "on"
|
||||
actions:
|
||||
action: media_player.turn_on
|
||||
- action: media_player.turn_on
|
||||
target:
|
||||
entity_id: "media_player.badezimmer"
|
||||
```
|
||||
|
@ -92,7 +92,7 @@ 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
|
||||
- trigger: numeric_state
|
||||
entity_id: sensor.geniushub_errors
|
||||
above: 0
|
||||
actions:
|
||||
@ -113,7 +113,7 @@ This alert may be useful to see if the CH is being turned on whilst you're on a
|
||||
```yaml
|
||||
- alias: "GeniusHub CH State Change Alert"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: binary_sensor.dual_channel_receiver_2_1
|
||||
actions:
|
||||
- action: notify.pushbullet_notifier
|
||||
|
@ -57,12 +57,12 @@ zone:
|
||||
automation:
|
||||
- alias: "Bush Fire Alert"
|
||||
triggers:
|
||||
trigger: geo_location
|
||||
- trigger: geo_location
|
||||
source: nsw_rural_fire_service_feed
|
||||
zone: zone.bush_fire_alert_zone
|
||||
event: enter
|
||||
conditions:
|
||||
condition: template
|
||||
- condition: template
|
||||
value_template: "{{ trigger.to_state.attributes.type == 'Bush Fire' }}"
|
||||
actions:
|
||||
- action: persistent_notification.create
|
||||
|
@ -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
|
||||
|
@ -206,24 +206,24 @@ 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
|
||||
- trigger: state
|
||||
entity_id: remote.family_room
|
||||
conditions:
|
||||
condition: template
|
||||
- condition: template
|
||||
value_template: '{{ trigger.to_state.attributes.current_activity == "Kodi" }}'
|
||||
actions:
|
||||
action: input_boolean.turn_on
|
||||
- action: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.notify
|
||||
- alias: "PowerOff started from harmony hub"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: remote.family_room
|
||||
conditions:
|
||||
condition: template
|
||||
- condition: template
|
||||
value_template: '{{ trigger.to_state.attributes.current_activity == "PowerOff" }}'
|
||||
actions:
|
||||
action: input_boolean.turn_off
|
||||
- action: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.notify
|
||||
```
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -314,7 +314,7 @@ Update the location of the Home Assistant default zone (usually "Home").
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: homeassistant.set_location
|
||||
- action: homeassistant.set_location
|
||||
data:
|
||||
latitude: 32.87336
|
||||
longitude: 117.22743
|
||||
@ -336,7 +336,7 @@ for example, a light and a switch can be toggled in a single action.
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: homeassistant.toggle
|
||||
- action: homeassistant.toggle
|
||||
target:
|
||||
entity_id:
|
||||
- light.living_room
|
||||
@ -358,7 +358,7 @@ for example, a light and a switch can be turned on in a single action.
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: homeassistant.turn_on
|
||||
- action: homeassistant.turn_on
|
||||
target:
|
||||
entity_id:
|
||||
- light.living_room
|
||||
@ -380,7 +380,7 @@ for example, a light and a switch can be turned off in a single action.
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: homeassistant.turn_off
|
||||
- action: homeassistant.turn_off
|
||||
target:
|
||||
entity_id:
|
||||
- light.living_room
|
||||
@ -399,7 +399,7 @@ Force one or more entities to update its data rather than wait for the next sche
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: homeassistant.update_entity
|
||||
- action: homeassistant.update_entity
|
||||
target:
|
||||
entity_id:
|
||||
- light.living_room
|
||||
|
@ -455,14 +455,14 @@ The key name will be available in the event data in the `key_name` field. Exampl
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: event
|
||||
- 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
|
||||
- action: broadlink.send
|
||||
host: 192.168.1.55
|
||||
packet: XXXXXXXX
|
||||
```
|
||||
|
@ -253,14 +253,14 @@ Here's an example of how to use these events for automations:
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: homematic.keypress
|
||||
event_data:
|
||||
name: "Kitchen Switch"
|
||||
channel: 1
|
||||
param: PRESS_SHORT
|
||||
actions:
|
||||
action: switch.turn_on
|
||||
- action: switch.turn_on
|
||||
target:
|
||||
entity_id: switch.Kitchen_Ambience
|
||||
```
|
||||
@ -307,7 +307,7 @@ Simulate a button being pressed:
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematic.virtualkey
|
||||
- action: homematic.virtualkey
|
||||
data:
|
||||
address: "BidCoS-RF"
|
||||
channel: 1
|
||||
@ -319,7 +319,7 @@ Open KeyMatic:
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematic.virtualkey
|
||||
- action: homematic.virtualkey
|
||||
data:
|
||||
address: "LEQ1234567"
|
||||
channel: 1
|
||||
@ -331,7 +331,7 @@ Set boolean variable to true:
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematic.set_variable_value
|
||||
- action: homematic.set_variable_value
|
||||
target:
|
||||
entity_id: homematic.ccu2
|
||||
data:
|
||||
@ -349,7 +349,7 @@ Manually turn on a switch actor:
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematic.set_device_value
|
||||
- action: homematic.set_device_value
|
||||
data:
|
||||
address: "LEQ1234567"
|
||||
channel: 1
|
||||
@ -362,7 +362,7 @@ Manually set temperature on thermostat:
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematic.set_device_value
|
||||
- action: homematic.set_device_value
|
||||
data:
|
||||
address: "LEQ1234567"
|
||||
channel: 4
|
||||
@ -375,7 +375,7 @@ Manually set the active profile on thermostat:
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematic.set_device_value
|
||||
- action: homematic.set_device_value
|
||||
data:
|
||||
address: "LEQ1234567"
|
||||
channel: 1
|
||||
@ -389,7 +389,7 @@ Set the week program of a wall thermostat:
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematic.put_paramset
|
||||
- action: homematic.put_paramset
|
||||
data:
|
||||
interface: wireless
|
||||
address: "LEQ1234567"
|
||||
@ -403,7 +403,7 @@ Set the week program of a wall thermostat with explicit `rx_mode` (BidCos-RF onl
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematic.put_paramset
|
||||
- action: homematic.put_paramset
|
||||
data:
|
||||
interface: wireless
|
||||
address: "LEQ1234567"
|
||||
@ -424,7 +424,7 @@ Manually set lock on KeyMatic devices:
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: lock.lock
|
||||
- action: lock.lock
|
||||
target:
|
||||
entity_id: lock.leq1234567
|
||||
```
|
||||
@ -434,7 +434,7 @@ Manually set unlock on KeyMatic devices:
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: lock.unlock
|
||||
- action: lock.unlock
|
||||
target:
|
||||
entity_id: lock.leq1234567
|
||||
```
|
||||
@ -489,12 +489,12 @@ template:
|
||||
automation:
|
||||
- alias: "Homematic Reconnect"
|
||||
triggers:
|
||||
trigger: state
|
||||
- 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
|
||||
- trigger: state
|
||||
entity_id: sensor.v_last_reboot
|
||||
actions:
|
||||
action: homematic.reconnect
|
||||
- action: homematic.reconnect
|
||||
```
|
||||
|
||||
## Notifications
|
||||
|
@ -235,7 +235,7 @@ Activate eco mode with duration.
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematicip_cloud.activate_eco_mode_with_duration
|
||||
- action: homematicip_cloud.activate_eco_mode_with_duration
|
||||
data:
|
||||
duration: 60
|
||||
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx
|
||||
@ -246,7 +246,7 @@ Activate eco mode with period.
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematicip_cloud.activate_eco_mode_with_period
|
||||
- action: homematicip_cloud.activate_eco_mode_with_period
|
||||
data:
|
||||
endtime: 2019-09-17 18:00
|
||||
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx
|
||||
@ -257,7 +257,7 @@ Activates the vacation mode until the given time.
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematicip_cloud.activate_vacation
|
||||
- action: homematicip_cloud.activate_vacation
|
||||
data:
|
||||
endtime: 2019-09-17 18:00
|
||||
temperature: 18.5
|
||||
@ -269,7 +269,7 @@ Deactivates the eco mode immediately.
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematicip_cloud.deactivate_eco_mode
|
||||
- action: homematicip_cloud.deactivate_eco_mode
|
||||
data:
|
||||
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
@ -279,7 +279,7 @@ Deactivates the vacation mode immediately.
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematicip_cloud.deactivate_vacation
|
||||
- action: homematicip_cloud.deactivate_vacation
|
||||
data:
|
||||
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
@ -292,7 +292,7 @@ You can get the required index from the native Homematic IP App.
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematicip_cloud.set_active_climate_profile
|
||||
- action: homematicip_cloud.set_active_climate_profile
|
||||
target:
|
||||
entity_id: climate.livingroom
|
||||
data:
|
||||
@ -304,7 +304,7 @@ Dump the configuration of the Homematic IP Access Point(s).
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematicip_cloud.dump_hap_config
|
||||
- action: homematicip_cloud.dump_hap_config
|
||||
data:
|
||||
anonymize: True
|
||||
```
|
||||
@ -314,7 +314,7 @@ Reset energy counter of measuring actuators.
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematicip_cloud.reset_energy_counter
|
||||
- action: homematicip_cloud.reset_energy_counter
|
||||
target:
|
||||
entity_id: switch.livingroom
|
||||
```
|
||||
@ -324,7 +324,7 @@ Enable (or disable) Cooling mode for the entire home. Disabling Cooling mode wil
|
||||
```yaml
|
||||
...
|
||||
actions:
|
||||
action: homematicip_cloud.set_home_cooling_mode
|
||||
- action: homematicip_cloud.set_home_cooling_mode
|
||||
data:
|
||||
cooling: True
|
||||
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx
|
||||
|
@ -113,7 +113,7 @@ Example of adding a tag to your notification. This won't create new notification
|
||||
- trigger: state
|
||||
entity_id: sensor.sensor
|
||||
actions:
|
||||
action: notify.html5
|
||||
- action: notify.html5
|
||||
data:
|
||||
message: "Last known sensor state is {{ states('sensor.sensor') }}."
|
||||
data:
|
||||
@ -210,7 +210,7 @@ notification is received on the device.
|
||||
```yaml
|
||||
- alias: "HTML5 push notification received and displayed on device"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: html5_notification.received
|
||||
```
|
||||
|
||||
@ -221,7 +221,7 @@ You will receive an event named `html5_notification.clicked` when the notificati
|
||||
```yaml
|
||||
- alias: "HTML5 push notification clicked"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: html5_notification.clicked
|
||||
```
|
||||
|
||||
@ -230,7 +230,7 @@ or
|
||||
```yaml
|
||||
- alias: "HTML5 push notification action button clicked"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: html5_notification.clicked
|
||||
event_data:
|
||||
action: open_door
|
||||
@ -243,7 +243,7 @@ You will receive an event named `html5_notification.closed` when the notificatio
|
||||
```yaml
|
||||
- alias: "HTML5 push notification clicked"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: html5_notification.closed
|
||||
```
|
||||
|
||||
|
@ -225,7 +225,7 @@ Velocity controls the speed of the shade. The default speed from Hunter Douglas
|
||||
``` yaml
|
||||
alias: "Blinds closed at night"
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "18:00:00"
|
||||
actions:
|
||||
- action: scene.turn_on
|
||||
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -36,14 +36,12 @@ 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:
|
||||
actions:
|
||||
- action: '{{ trigger.event.data.service }}'
|
||||
target:
|
||||
@ -144,10 +142,10 @@ Add the *Then That* action. The below example sends a notification to the IFTTT
|
||||
automation:
|
||||
alias: "Startup Notification"
|
||||
triggers:
|
||||
trigger: homeassistant
|
||||
- trigger: homeassistant
|
||||
event: start
|
||||
actions:
|
||||
action: ifttt.trigger
|
||||
- action: ifttt.trigger
|
||||
data: {"event":"TestHA_Trigger", "value1":"Hello World!"}
|
||||
```
|
||||
|
||||
@ -162,10 +160,10 @@ IFTTT can also be used in scripts and with templates. Here is the above automati
|
||||
automation:
|
||||
alias: "Startup Notification"
|
||||
triggers:
|
||||
trigger: homeassistant
|
||||
- trigger: homeassistant
|
||||
event: start
|
||||
actions:
|
||||
action: script.ifttt_notify
|
||||
- action: script.ifttt_notify
|
||||
data:
|
||||
value1: "HA Status:"
|
||||
value2: "{{ trigger.event.data.entity_id.split('_')[1] }} is "
|
||||
|
@ -35,7 +35,7 @@ The `found_plate` event is triggered after OpenALPR has found a new license plat
|
||||
automation:
|
||||
- alias: "Open garage door"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: image_processing.found_plate
|
||||
event_data:
|
||||
entity_id: openalpr.camera_garage_1
|
||||
@ -56,7 +56,7 @@ The `detect_face` event is triggered after a Face entity has found a face.
|
||||
automation:
|
||||
- alias: "Known person in front of my door"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: image_processing.detect_face
|
||||
event_data:
|
||||
entity_id: image_processing.door
|
||||
|
@ -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 %}
|
||||
|
@ -49,7 +49,7 @@ 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
|
||||
- trigger: numeric_state
|
||||
entity_id: sensor.cv_pressure
|
||||
below: 1.0
|
||||
actions:
|
||||
|
@ -118,10 +118,10 @@ automation:
|
||||
# Turns on bedroom light at the time specified.
|
||||
automation:
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: input_datetime.bedroom_alarm_clock_time
|
||||
actions:
|
||||
action: light.turn_on
|
||||
- action: light.turn_on
|
||||
target:
|
||||
entity_id: light.bedroom
|
||||
```
|
||||
|
@ -125,10 +125,11 @@ input_number:
|
||||
min: 0
|
||||
max: 254
|
||||
step: 1
|
||||
|
||||
automation:
|
||||
- alias: "Bedroom Light - Adjust Brightness"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: input_number.bedroom_brightness
|
||||
actions:
|
||||
- action: light.turn_on
|
||||
@ -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
|
||||
- trigger: state
|
||||
entity_id: input_select.scene_bedroom
|
||||
to: CUSTOM
|
||||
to: "CUSTOM"
|
||||
actions:
|
||||
- action: light.turn_on
|
||||
target:
|
||||
@ -200,10 +203,10 @@ input_number:
|
||||
automation:
|
||||
- alias: "Set temp slider"
|
||||
triggers:
|
||||
trigger: mqtt
|
||||
- trigger: mqtt
|
||||
topic: "setTemperature"
|
||||
actions:
|
||||
action: input_number.set_value
|
||||
- action: input_number.set_value
|
||||
target:
|
||||
entity_id: input_number.target_temp
|
||||
data:
|
||||
@ -213,10 +216,10 @@ automation:
|
||||
# It publishes its value to the same MQTT topic it is also subscribed to.
|
||||
- alias: "Temp slider moved"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: input_number.target_temp
|
||||
actions:
|
||||
action: mqtt.publish
|
||||
- action: mqtt.publish
|
||||
data:
|
||||
topic: "setTemperature"
|
||||
retain: true
|
||||
@ -251,7 +254,7 @@ input_number:
|
||||
automation:
|
||||
- alias: "turn something off after x time after turning it on"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: switch.something
|
||||
to: "on"
|
||||
actions:
|
||||
|
@ -136,14 +136,14 @@ The following example shows the usage of the `input_select.select_option` action
|
||||
automation:
|
||||
- alias: "example automation"
|
||||
triggers:
|
||||
trigger: 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,7 +153,7 @@ To dynamically set the `input_select` options you can call `input_select.set_opt
|
||||
automation:
|
||||
- alias: "example automation"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: MY_CUSTOM_EVENT
|
||||
actions:
|
||||
- action: input_select.set_options
|
||||
@ -186,11 +186,11 @@ input_select:
|
||||
# It sets the value selector on the GUI. This selector also had its own automation when the value is changed.
|
||||
- alias: "Set Thermostat Mode Selector"
|
||||
triggers:
|
||||
trigger: mqtt
|
||||
- trigger: mqtt
|
||||
topic: "thermostatMode"
|
||||
# entity_id: input_select.thermostat_mode
|
||||
actions:
|
||||
action: input_select.select_option
|
||||
- action: input_select.select_option
|
||||
target:
|
||||
entity_id: input_select.thermostat_mode
|
||||
data:
|
||||
@ -200,10 +200,10 @@ input_select:
|
||||
# It publishes its value to the same MQTT topic it is also subscribed to.
|
||||
- alias: "Set Thermostat Mode"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: input_select.thermostat_mode
|
||||
actions:
|
||||
action: mqtt.publish
|
||||
- action: mqtt.publish
|
||||
data:
|
||||
topic: "thermostatMode"
|
||||
retain: true
|
||||
|
@ -130,7 +130,7 @@ input_text:
|
||||
automation:
|
||||
- alias: "Bedroom Light - Custom"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: input_select.scene_bedroom
|
||||
actions:
|
||||
- action: input_text.set_value
|
||||
|
@ -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
|
||||
|
@ -93,7 +93,7 @@ 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
|
||||
- trigger: event
|
||||
event_type: isy994_control
|
||||
event_data:
|
||||
entity_id: light.lr_track_lights_front
|
||||
@ -103,7 +103,7 @@ automation:
|
||||
uom: "100"
|
||||
prec: "0"
|
||||
actions:
|
||||
action: light.turn_off
|
||||
- action: light.turn_off
|
||||
target:
|
||||
entity_id: light.lr_track_lights_rear
|
||||
```
|
||||
|
@ -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
|
||||
|
@ -94,7 +94,7 @@ And an automation rule to breathe life into it:
|
||||
automation:
|
||||
alias: "Keyboard all lights on"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: keyboard_remote_command_received
|
||||
event_data:
|
||||
device_descriptor: "/dev/input/event0"
|
||||
@ -102,7 +102,7 @@ automation:
|
||||
type: key_down # only trigger on key_down events (optional)
|
||||
|
||||
actions:
|
||||
action: light.turn_on
|
||||
- action: light.turn_on
|
||||
target:
|
||||
entity_id: light.all
|
||||
```
|
||||
@ -125,7 +125,7 @@ Here's an automation example that plays a sound through a media player whenever
|
||||
automation:
|
||||
- alias: "Keyboard Connected"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: keyboard_remote_connected
|
||||
actions:
|
||||
- action: media_player.play_media
|
||||
@ -137,7 +137,7 @@ automation:
|
||||
|
||||
- alias: "Bluetooth Keyboard Disconnected"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: keyboard_remote_disconnected
|
||||
event_data:
|
||||
device_name: "00:58:56:4C:C0:91"
|
||||
|
@ -208,27 +208,24 @@ 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
|
||||
|
||||
- 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
|
||||
|
@ -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
|
||||
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,7 +621,7 @@ Let's pretend you have a binary sensor with the name `Livingroom.Switch` and you
|
||||
# Example automation.yaml entry
|
||||
automation:
|
||||
- triggers:
|
||||
trigger: numeric_state
|
||||
- trigger: numeric_state
|
||||
entity_id: binary_sensor.livingroom_switch
|
||||
attribute: counter
|
||||
above: 0
|
||||
@ -633,10 +631,11 @@ automation:
|
||||
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
|
||||
- trigger: numeric_state
|
||||
entity_id: binary_sensor.livingroom_switch
|
||||
attribute: counter
|
||||
above: 1
|
||||
@ -646,10 +645,12 @@ automation:
|
||||
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 %}
|
||||
|
@ -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
|
||||
|
@ -165,12 +165,12 @@ To add a notification sound, icon, cycles, or priority override,
|
||||
```yaml
|
||||
- alias: "Send notification on arrival at school"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: device_tracker.tom_mobile
|
||||
from: "not_home"
|
||||
to: "school"
|
||||
actions:
|
||||
action: notify.my_lametric
|
||||
- action: notify.my_lametric
|
||||
data:
|
||||
message: "Tom has arrived at school!"
|
||||
data:
|
||||
|
@ -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:
|
||||
...
|
||||
```
|
||||
|
@ -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:
|
||||
|
@ -85,12 +85,12 @@ The LIRC integration fires `ir_command_received` events on the bus. You can capt
|
||||
automation:
|
||||
- alias: "Off on Remote"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: ir_command_received
|
||||
event_data:
|
||||
button_name: KEY_0
|
||||
actions:
|
||||
action: homeassistant.turn_off
|
||||
- action: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: group.a_lights
|
||||
```
|
||||
|
@ -54,12 +54,12 @@ You can then consume that information with the following automation:
|
||||
```yaml
|
||||
automation:
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: mailgun_message_received
|
||||
event_data:
|
||||
action: call_service
|
||||
actions:
|
||||
action: light.turn_on
|
||||
- action: light.turn_on
|
||||
target:
|
||||
entity_id: light.office
|
||||
```
|
||||
@ -103,10 +103,10 @@ The following automation reacts to an event by sending out an email with two att
|
||||
# Example automation using Mailgun notifications
|
||||
automation:
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: SPECIAL_EVENT
|
||||
actions:
|
||||
action: notify.mailgun
|
||||
- action: notify.mailgun
|
||||
data:
|
||||
title: "Something special has happened"
|
||||
message: "This a test message from Home Assistant"
|
||||
|
@ -194,7 +194,7 @@ automation:
|
||||
entity_id: alarm_control_panel.home_alarm
|
||||
state: armed_away
|
||||
actions:
|
||||
action: alarm_control_panel.alarm_trigger
|
||||
- action: alarm_control_panel.alarm_trigger
|
||||
target:
|
||||
entity_id: alarm_control_panel.home_alarm
|
||||
```
|
||||
|
@ -128,24 +128,25 @@ notify:
|
||||
default_room: "#hasstest:matrix.org"
|
||||
|
||||
automation:
|
||||
- alias: 'React to !testword'
|
||||
- alias: "React to !testword"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: matrix_command
|
||||
event_data:
|
||||
command: testword
|
||||
actions:
|
||||
action: notify.matrix_notify
|
||||
- action: notify.matrix_notify
|
||||
data:
|
||||
message: "It looks like you wrote !testword"
|
||||
- alias: 'React to an introduction'
|
||||
|
||||
- alias: "React to an introduction"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: matrix_command
|
||||
event_data:
|
||||
command: introduction
|
||||
actions:
|
||||
action: notify.matrix_notify
|
||||
- action: notify.matrix_notify
|
||||
data:
|
||||
message: "Hello {{trigger.event.data.args['name']}}"
|
||||
```
|
||||
@ -197,7 +198,7 @@ Supported formats are: `text` (default), and `html`.
|
||||
```yaml
|
||||
# Example of notification as HTML
|
||||
actions:
|
||||
action: notify.matrix_notify
|
||||
- action: notify.matrix_notify
|
||||
data:
|
||||
message: >-
|
||||
<h1>Hello, world!</h1>
|
||||
@ -212,7 +213,7 @@ It is possible to send images with notifications. To do so, add a list of paths
|
||||
```yaml
|
||||
# Example of notification with images
|
||||
actions:
|
||||
action: notify.matrix_notify
|
||||
- action: notify.matrix_notify
|
||||
data:
|
||||
message: "Test with images"
|
||||
data:
|
||||
|
@ -69,7 +69,7 @@ The `play_media` function can be used in scripts to change channels:
|
||||
#
|
||||
change_channel:
|
||||
sequence:
|
||||
action: media_player.play_media
|
||||
- action: media_player.play_media
|
||||
target:
|
||||
entity_id: media_player.mediaroom_stb
|
||||
data:
|
||||
@ -88,7 +88,7 @@ The `play_media` function can also be used to trigger actions on the set-up-box
|
||||
#
|
||||
press_button:
|
||||
sequence:
|
||||
action: media_player.play_media
|
||||
- action: media_player.play_media
|
||||
target:
|
||||
entity_id: media_player.mediaroom_stb
|
||||
data:
|
||||
|
@ -92,9 +92,9 @@ Example automation
|
||||
automation:
|
||||
- alias: "Alert me about weather warnings"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: binary_sensor.meteoalarm
|
||||
from: 'off'
|
||||
from: "off"
|
||||
actions:
|
||||
- action: notify.notify
|
||||
data:
|
||||
|
@ -89,7 +89,7 @@ Automations can be triggered on new files created on the Minio server using the
|
||||
automation:
|
||||
- alias: "Upload camera snapshot"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: folder_watcher
|
||||
event_data:
|
||||
event_type: created
|
||||
|
@ -39,32 +39,34 @@ An example automation:
|
||||
|
||||
```yaml
|
||||
automation:
|
||||
- alias: Notify CallerID
|
||||
- alias: "Notify CallerID"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: sensor.phone_modem
|
||||
to: "callerid"
|
||||
actions:
|
||||
action: notify.notify
|
||||
- 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
|
||||
|
||||
- alias: "Notify CallerID webui"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: sensor.phone_modem
|
||||
to: "callerid"
|
||||
actions:
|
||||
action: persistent_notification.create
|
||||
- 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
|
||||
|
||||
- alias: "Say CallerID"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: sensor.phone_modem
|
||||
to: "callerid"
|
||||
actions:
|
||||
action: tts.google_say
|
||||
- action: tts.google_say
|
||||
data:
|
||||
message: "Call from {{ state_attr('sensor.phone_modem', 'cid_name') }}"
|
||||
```
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -1063,11 +1063,11 @@ Use as [`script`](/integrations/script/) in automations.
|
||||
automation:
|
||||
alias: "Send me a message when I get home"
|
||||
triggers:
|
||||
trigger: state
|
||||
- trigger: state
|
||||
entity_id: device_tracker.me
|
||||
to: "home"
|
||||
actions:
|
||||
action: script.notify_mqtt
|
||||
- action: script.notify_mqtt
|
||||
data:
|
||||
target: "me"
|
||||
message: "I'm home"
|
||||
|
@ -410,7 +410,6 @@ data:
|
||||
data:
|
||||
image: "{{ trigger.event.data.attachment.image }}"
|
||||
video: "{{ trigger.event.data.attachment.video }}"
|
||||
mode: single
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
@ -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 %}
|
||||
|
@ -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
|
||||
|
@ -127,7 +127,7 @@ The notify integration supports specifying [templates](/docs/configuration/templ
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: notify.persistent_notification
|
||||
- action: notify.persistent_notification
|
||||
data:
|
||||
message: "You have {{ states('todo.shopping_list') }} items on your shopping list."
|
||||
```
|
||||
@ -138,7 +138,7 @@ actions:
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: notify.persistent_notification
|
||||
- action: notify.persistent_notification
|
||||
data:
|
||||
message: "The sun is {% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}!"
|
||||
```
|
||||
|
@ -52,12 +52,12 @@ Example automation to send a Telegram message on a completed download:
|
||||
```yaml
|
||||
- alias: "Completed Torrent"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: nzbget_download_complete
|
||||
- event_data:
|
||||
event_data:
|
||||
category: tv
|
||||
actions:
|
||||
action: notify.telegram_notifier
|
||||
- action: notify.telegram_notifier
|
||||
data:
|
||||
title: "Download completed!"
|
||||
message: "{{trigger.event.data.name}}"
|
||||
|
@ -149,7 +149,7 @@ automation:
|
||||
|
||||
template:
|
||||
- triggers:
|
||||
alias: "Update image when a new weather image is generated"
|
||||
- alias: "Update image when a new weather image is generated"
|
||||
trigger: event
|
||||
event_type: new_weather_image
|
||||
image:
|
||||
|
@ -60,10 +60,10 @@ To receive notifications of the entering flights using the [Home Assistant Compa
|
||||
automation:
|
||||
- alias: "Flight entry notification"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: opensky_entry
|
||||
actions:
|
||||
action: notify.mobile_app_<device_name>
|
||||
- action: notify.mobile_app_<device_name>
|
||||
data:
|
||||
message: "Flight entry of {{ trigger.event.data.callsign }}"
|
||||
```
|
||||
@ -77,16 +77,16 @@ One can also get a direct link to the OpenSky website to see the flight using th
|
||||
automation:
|
||||
- alias: "Flight entry notification"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: opensky_entry
|
||||
actions:
|
||||
action: notify.mobile_app_<device_name>
|
||||
- action: notify.mobile_app_<device_name>
|
||||
data:
|
||||
message: "Flight entry of {{ trigger.event.data.callsign }}"
|
||||
data:
|
||||
actions:
|
||||
- action: URI
|
||||
title: Track the flight
|
||||
title: "Track the flight"
|
||||
uri: >-
|
||||
https://opensky-network.org/aircraft-profile?icao24={{
|
||||
trigger.event.data.icao24 }}
|
||||
|
@ -102,15 +102,15 @@ horizon:
|
||||
automation:
|
||||
- alias: "Update OpenUV"
|
||||
triggers:
|
||||
trigger: time_pattern
|
||||
- trigger: time_pattern
|
||||
minutes: "/20"
|
||||
conditions:
|
||||
condition: numeric_state
|
||||
- condition: numeric_state
|
||||
entity_id: sun.sun
|
||||
value_template: "{{ state.attributes.elevation }}"
|
||||
above: 10
|
||||
actions:
|
||||
action: homeassistant.update_entity
|
||||
- action: homeassistant.update_entity
|
||||
target:
|
||||
entity_id: sensor.LATITUDE_LONGITUDE_current_uv_index
|
||||
```
|
||||
@ -122,10 +122,10 @@ Update the protection window once a day at 12:00pm:
|
||||
automation:
|
||||
- alias: "Update OpenUV"
|
||||
triggers:
|
||||
trigger: time
|
||||
- trigger: time
|
||||
at: "12:00:00"
|
||||
actions:
|
||||
action: homeassistant.update_entity
|
||||
- action: homeassistant.update_entity
|
||||
target:
|
||||
entity_id: binary_sensor.LATITUDE_LONGITUDE_protection_window
|
||||
```
|
||||
@ -165,7 +165,7 @@ automation:
|
||||
) >= timedelta(hours = 0, minutes = 40)
|
||||
}}
|
||||
actions:
|
||||
action: homeassistant.update_entity
|
||||
- action: homeassistant.update_entity
|
||||
target:
|
||||
entity_id:
|
||||
# Update both UV and protection window data:
|
||||
|
@ -57,7 +57,7 @@ Here is how an [action](/docs/automation/action) of your [automation setup](/get
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: persistent_notification.create
|
||||
- action: persistent_notification.create
|
||||
data:
|
||||
message: "Your message goes here"
|
||||
title: "Custom subject"
|
||||
@ -69,7 +69,7 @@ If you want to show some runtime information, you have to use [templates](/docs/
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: persistent_notification.create
|
||||
- action: persistent_notification.create
|
||||
data:
|
||||
title: >
|
||||
Thermostat is {{ state_attr('climate.thermostat', 'hvac_action') }}
|
||||
@ -88,7 +88,7 @@ This action allows you to remove a notifications by script or automation.
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: persistent_notification.dismiss
|
||||
- action: persistent_notification.dismiss
|
||||
data:
|
||||
notification_id: "1234"
|
||||
```
|
||||
@ -97,7 +97,7 @@ The `persistent_notification.dismiss_all` action allows you to remove all notifi
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: persistent_notification.dismiss_all
|
||||
- action: persistent_notification.dismiss_all
|
||||
```
|
||||
|
||||
### Markdown support
|
||||
|
@ -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
|
||||
|
@ -121,7 +121,7 @@ automation:
|
||||
event_type: point_webhook_received
|
||||
event_data: {}
|
||||
conditions:
|
||||
condition: template
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.event.type == 'short_button_press' }}"
|
||||
actions:
|
||||
- action: persistent_notification.create
|
||||
|
@ -86,12 +86,12 @@ To use notifications, please see the [getting started with automation page](/get
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: notify.NOTIFIER_NAME
|
||||
- action: notify.NOTIFIER_NAME
|
||||
data:
|
||||
title: Send URL
|
||||
message: This is an url
|
||||
title: "Send URL"
|
||||
message: "This is an url"
|
||||
data:
|
||||
url: google.com
|
||||
url: "google.com"
|
||||
```
|
||||
|
||||
- `url` (*Required*): Page URL to send with Pushbullet.
|
||||
@ -100,10 +100,10 @@ actions:
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: notify.NOTIFIER_NAME
|
||||
- action: notify.NOTIFIER_NAME
|
||||
data:
|
||||
title: Send file
|
||||
message: This is a file
|
||||
title: "Send file"
|
||||
message: "This is a file"
|
||||
data:
|
||||
file: /path/to/my/file
|
||||
```
|
||||
@ -114,10 +114,10 @@ actions:
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: notify.NOTIFIER_NAME
|
||||
- action: notify.NOTIFIER_NAME
|
||||
data:
|
||||
title: Send file
|
||||
message: This is a file URL
|
||||
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
|
||||
```
|
||||
@ -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"
|
||||
|
@ -47,7 +47,7 @@ Message to two devices with formatted text.
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: notify.notify
|
||||
- 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]"
|
||||
@ -65,7 +65,7 @@ Message to one device with formatted text and image from an external URL.
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: notify.notify
|
||||
- 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]"
|
||||
@ -85,7 +85,7 @@ Message to two devices and one device group with formatted text and local image.
|
||||
|
||||
```yaml
|
||||
actions:
|
||||
action: notify.notify
|
||||
- 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]"
|
||||
|
@ -109,7 +109,7 @@ QwikSwitch devices (i.e., transmitter buttons) will fire events on the Home Assi
|
||||
automation:
|
||||
- alias: "Action - Respond to A button press"
|
||||
triggers:
|
||||
trigger: event
|
||||
- trigger: event
|
||||
event_type: qwikswitch.button.@12df34
|
||||
```
|
||||
|
||||
|
@ -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
Loading…
x
Reference in New Issue
Block a user