From 8b9ad61e4236f841a30cdb9ae0f473eb40a3d12a Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 26 Sep 2024 12:39:04 +0200 Subject: [PATCH] Improve YAML styling for all automation examples (#34932) --- source/_docs/automation/condition.markdown | 2 +- source/_docs/automation/templating.markdown | 8 +- source/_docs/blueprint/schema.markdown | 8 +- source/_docs/blueprint/tutorial.markdown | 38 +- .../splitting_configuration.markdown | 48 +-- source/_docs/scene.markdown | 60 +-- source/_docs/scripts.markdown | 1 - source/_docs/scripts/conditions.markdown | 368 +++++++++--------- source/_docs/scripts/perform-actions.markdown | 6 +- source/_docs/tools/dev-tools.markdown | 4 +- source/_integrations/amcrest.markdown | 2 +- source/_integrations/androidtv.markdown | 10 +- source/_integrations/august.markdown | 10 +- .../_integrations/azure_service_bus.markdown | 22 +- source/_integrations/backup.markdown | 8 +- .../binary_sensor.xiaomi_aqara.markdown | 314 +++++++-------- source/_integrations/blink.markdown | 42 +- .../bmw_connected_drive.markdown | 18 +- source/_integrations/bring.markdown | 22 +- source/_integrations/calendar.markdown | 10 +- source/_integrations/camera.markdown | 30 +- source/_integrations/cast.markdown | 24 +- .../_integrations/cisco_webex_teams.markdown | 58 +-- source/_integrations/climate.markdown | 32 +- source/_integrations/counter.markdown | 17 +- source/_integrations/cover.markdown | 12 +- source/_integrations/deconz.markdown | 1 - .../_integrations/device_automation.markdown | 3 +- source/_integrations/dexcom.markdown | 24 +- source/_integrations/doorbird.markdown | 6 +- source/_integrations/dovado.markdown | 12 +- source/_integrations/downloader.markdown | 12 +- source/_integrations/elgato.markdown | 2 +- source/_integrations/enocean.markdown | 16 +- source/_integrations/facebook.markdown | 16 +- source/_integrations/fan.markdown | 20 +- source/_integrations/feedreader.markdown | 28 +- source/_integrations/fireservicerota.markdown | 42 +- source/_integrations/flic.markdown | 20 +- source/_integrations/folder_watcher.markdown | 16 +- source/_integrations/foursquare.markdown | 10 +- .../_integrations/frontier_silicon.markdown | 14 +- source/_integrations/geniushub.markdown | 34 +- source/_integrations/geo_location.markdown | 12 +- .../_integrations/google_travel_time.markdown | 3 +- source/_integrations/harmony.markdown | 28 +- source/_integrations/hdmi_cec.markdown | 6 +- .../_integrations/here_travel_time.markdown | 3 +- source/_integrations/homeassistant.markdown | 50 +-- source/_integrations/homekit.markdown | 14 +- source/_integrations/homematic.markdown | 148 +++---- .../_integrations/homematicip_cloud.markdown | 68 ++-- source/_integrations/html5.markdown | 28 +- .../hunterdouglas_powerview.markdown | 11 +- source/_integrations/hyperion.markdown | 3 +- source/_integrations/ibeacon.markdown | 1 - source/_integrations/ifttt.markdown | 40 +- .../_integrations/image_processing.markdown | 20 +- source/_integrations/imap.markdown | 6 +- source/_integrations/incomfort.markdown | 18 +- source/_integrations/input_datetime.markdown | 10 +- source/_integrations/input_number.markdown | 61 +-- source/_integrations/input_select.markdown | 38 +- source/_integrations/input_text.markdown | 4 +- source/_integrations/insteon.markdown | 9 +- source/_integrations/isy994.markdown | 24 +- source/_integrations/kaleidescape.markdown | 2 +- source/_integrations/keyboard_remote.markdown | 30 +- source/_integrations/kira.markdown | 41 +- source/_integrations/knx.markdown | 53 +-- source/_integrations/kodi.markdown | 6 +- source/_integrations/lametric.markdown | 24 +- source/_integrations/lcn.markdown | 2 +- source/_integrations/light.markdown | 10 +- source/_integrations/lirc.markdown | 14 +- source/_integrations/mailgun.markdown | 32 +- source/_integrations/manual.markdown | 6 +- source/_integrations/matrix.markdown | 53 +-- source/_integrations/mediaroom.markdown | 24 +- source/_integrations/meteoalarm.markdown | 6 +- source/_integrations/minio.markdown | 22 +- source/_integrations/modem_callerid.markdown | 46 +-- source/_integrations/motion_blinds.markdown | 3 +- .../_integrations/motionblinds_ble.markdown | 3 +- source/_integrations/mqtt.markdown | 14 +- source/_integrations/nest.markdown | 1 - source/_integrations/netatmo.markdown | 42 +- source/_integrations/nightscout.markdown | 3 +- source/_integrations/notify.markdown | 12 +- source/_integrations/nzbget.markdown | 16 +- .../openai_conversation.markdown | 6 +- source/_integrations/opensky.markdown | 32 +- source/_integrations/openuv.markdown | 40 +- .../persistent_notification.markdown | 26 +- source/_integrations/plex.markdown | 2 +- source/_integrations/point.markdown | 4 +- source/_integrations/pushbullet.markdown | 34 +- source/_integrations/pushsafer.markdown | 90 ++--- source/_integrations/qwikswitch.markdown | 4 +- source/_integrations/recorder.markdown | 1 - .../_integrations/remember_the_milk.markdown | 18 +- source/_integrations/rest_command.markdown | 8 +- source/_integrations/rfxtrx.markdown | 12 +- source/_integrations/roborock.markdown | 1 - source/_integrations/roon.markdown | 6 +- source/_integrations/satel_integra.markdown | 4 +- source/_integrations/scene.markdown | 92 ++--- source/_integrations/script.markdown | 38 +- source/_integrations/shell_command.markdown | 6 +- source/_integrations/shelly.markdown | 36 +- source/_integrations/sighthound.markdown | 12 +- .../_integrations/signal_messenger.markdown | 36 +- source/_integrations/slack.markdown | 5 +- source/_integrations/sms.markdown | 21 +- source/_integrations/smtp.markdown | 3 - source/_integrations/sonos.markdown | 29 +- source/_integrations/system_log.markdown | 46 +-- source/_integrations/tag.markdown | 8 +- source/_integrations/telegram.markdown | 116 +++--- source/_integrations/telegram_bot.markdown | 90 ++--- .../_integrations/thermoworks_smoke.markdown | 14 +- source/_integrations/tibber.markdown | 22 +- source/_integrations/totalconnect.markdown | 43 +- source/_integrations/twilio.markdown | 22 +- source/_integrations/twilio_call.markdown | 16 +- source/_integrations/twilio_sms.markdown | 20 +- source/_integrations/universal.markdown | 26 +- source/_integrations/upb.markdown | 22 +- source/_integrations/update.markdown | 16 +- source/_integrations/vacuum.mqtt.markdown | 14 +- source/_integrations/valve.markdown | 8 +- source/_integrations/velbus.markdown | 77 ++-- source/_integrations/velux.markdown | 14 +- source/_integrations/vivotek.markdown | 20 +- source/_integrations/water_heater.markdown | 12 +- source/_integrations/webostv.markdown | 14 +- source/_integrations/workday.markdown | 16 +- source/_integrations/xiaomi_aqara.markdown | 52 +-- source/_integrations/xiaomi_miio.markdown | 29 +- source/_integrations/yale.markdown | 19 +- source/_integrations/zwave_js.markdown | 64 +-- 141 files changed, 1920 insertions(+), 1966 deletions(-) diff --git a/source/_docs/automation/condition.markdown b/source/_docs/automation/condition.markdown index 3dc1ad96a71..3b782367fd9 100644 --- a/source/_docs/automation/condition.markdown +++ b/source/_docs/automation/condition.markdown @@ -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: diff --git a/source/_docs/automation/templating.markdown b/source/_docs/automation/templating.markdown index 2e5442c21dd..bd18fa79125 100644 --- a/source/_docs/automation/templating.markdown +++ b/source/_docs/automation/templating.markdown @@ -219,10 +219,10 @@ automation 2: - trigger: mqtt topic: "/notify/+" actions: - action: > - notify.{{ trigger.topic.split('/')[-1] }} - data: - message: "{{ trigger.payload }}" + - action: > + notify.{{ trigger.topic.split('/')[-1] }} + data: + message: "{{ trigger.payload }}" automation 3: triggers: diff --git a/source/_docs/blueprint/schema.markdown b/source/_docs/blueprint/schema.markdown index ed32c9345dd..8c781932163 100644 --- a/source/_docs/blueprint/schema.markdown +++ b/source/_docs/blueprint/schema.markdown @@ -277,10 +277,10 @@ actions: - action: light.turn_on target: !input light_target - wait_for_trigger: - trigger: state - entity_id: !input motion_entity - from: "on" - to: "off" + - trigger: state + entity_id: !input motion_entity + from: "on" + to: "off" - delay: !input no_motion_wait - action: light.turn_off target: !input light_target diff --git a/source/_docs/blueprint/tutorial.markdown b/source/_docs/blueprint/tutorial.markdown index 3483f7b0df5..f949fd135dd 100644 --- a/source/_docs/blueprint/tutorial.markdown +++ b/source/_docs/blueprint/tutorial.markdown @@ -45,18 +45,18 @@ The automation we're going to use in this tutorial controls a light based on a m ```yaml triggers: - trigger: state - entity_id: binary_sensor.motion_kitchen + - trigger: state + entity_id: binary_sensor.motion_kitchen actions: - action: > - {% if trigger.to_state.state == "on" %} - light.turn_on - {% else %} - light.turn_off - {% endif %} - target: - entity_id: light.kitchen + - action: > + {% if trigger.to_state.state == "on" %} + light.turn_on + {% else %} + light.turn_off + {% endif %} + target: + entity_id: light.kitchen ``` {% endraw %} @@ -92,8 +92,8 @@ Configurable parts in blueprints are called [inputs](/docs/blueprint/schema/#blu ```yaml triggers: - trigger: state - entity_id: !input motion_sensor + - trigger: state + entity_id: !input motion_sensor ``` For the light, we can offer some more flexibility. We want to allow the user to be able to define any device or area as the target. The `target` property in the action can contain references to areas, devices, and/or entities, so that's what we will use. @@ -104,13 +104,13 @@ Inputs are not limited to strings. They can contain complex objects too. So in t ```yaml actions: - action: > - {% if trigger.to_state.state == "on" %} - light.turn_on - {% else %} - light.turn_off - {% endif %} - target: !input target_light + - action: > + {% if trigger.to_state.state == "on" %} + light.turn_on + {% else %} + light.turn_off + {% endif %} + target: !input target_light ``` {% endraw %} diff --git a/source/_docs/configuration/splitting_configuration.markdown b/source/_docs/configuration/splitting_configuration.markdown index d6943593710..55ddb8a7aa8 100644 --- a/source/_docs/configuration/splitting_configuration.markdown +++ b/source/_docs/configuration/splitting_configuration.markdown @@ -268,22 +268,22 @@ These work recursively. As an example using `!include_dir_list automation`, will automation: - alias: "Automation 1" triggers: - trigger: state - entity_id: device_tracker.iphone - to: "home" + - trigger: state + entity_id: device_tracker.iphone + to: "home" actions: - action: light.turn_on - target: - entity_id: light.entryway + - action: light.turn_on + target: + entity_id: light.entryway - alias: "Automation 2" triggers: - trigger: state - entity_id: device_tracker.iphone - from: "home" + - trigger: state + entity_id: device_tracker.iphone + from: "home" actions: - action: light.turn_off - target: - entity_id: light.entryway + - action: light.turn_off + target: + entity_id: light.entryway ``` can be turned into: @@ -299,13 +299,13 @@ automation: !include_dir_list automation/presence/ ```yaml alias: "Automation 1" triggers: - trigger: state - entity_id: device_tracker.iphone - to: "home" + - trigger: state + entity_id: device_tracker.iphone + to: "home" actions: - action: light.turn_on - target: - entity_id: light.entryway + - action: light.turn_on + target: + entity_id: light.entryway ``` `automation/presence/automation2.yaml` @@ -313,13 +313,13 @@ actions: ```yaml alias: "Automation 2" triggers: - trigger: state - entity_id: device_tracker.iphone - from: "home" + - trigger: state + entity_id: device_tracker.iphone + from: "home" actions: - action: light.turn_off - target: - entity_id: light.entryway + - action: light.turn_off + target: + entity_id: light.entryway ``` It is important to note that each file must contain only **one** entry when using `!include_dir_list`. diff --git a/source/_docs/scene.markdown b/source/_docs/scene.markdown index 3a03f601a41..013fccac19e 100644 --- a/source/_docs/scene.markdown +++ b/source/_docs/scene.markdown @@ -58,14 +58,14 @@ Scenes can be activated using the action `scene.turn_on` (there is no 'scene.tur # Example automation automation: triggers: - trigger: state - entity_id: device_tracker.sweetheart - from: "not_home" - to: "home" + - trigger: state + entity_id: device_tracker.sweetheart + from: "not_home" + to: "home" actions: - action: scene.turn_on - target: - entity_id: scene.romantic + - action: scene.turn_on + target: + entity_id: scene.romantic ``` ## Applying a scene without defining it @@ -76,21 +76,21 @@ With the `scene.apply` action you are able to apply a scene without first defini # Example automation automation: triggers: - trigger: state - entity_id: device_tracker.sweetheart - from: "not_home" - to: "home" + - trigger: state + entity_id: device_tracker.sweetheart + from: "not_home" + to: "home" actions: - action: scene.apply - data: - entities: - light.tv_back_light: - state: "on" - brightness: 100 - light.ceiling: off - media_player.sony_bravia_tv: - state: "on" - source: HDMI 1 + - action: scene.apply + data: + entities: + light.tv_back_light: + state: "on" + brightness: 100 + light.ceiling: off + media_player.sony_bravia_tv: + state: "on" + source: "HDMI 1" ``` ## Using scene transitions @@ -105,16 +105,16 @@ light will transition to the scene in 2.5 seconds. # Example automation automation: triggers: - trigger: state - entity_id: device_tracker.sweetheart - from: "not_home" - to: "home" + - trigger: state + entity_id: device_tracker.sweetheart + from: "not_home" + to: "home" actions: - action: scene.turn_on - target: - entity_id: scene.romantic - data: - transition: 2.5 + - action: scene.turn_on + target: + entity_id: scene.romantic + data: + transition: 2.5 ``` Transitions are currently only support by lights, which in their turn, have diff --git a/source/_docs/scripts.markdown b/source/_docs/scripts.markdown index d66d28519ef..abbb96ba990 100644 --- a/source/_docs/scripts.markdown +++ b/source/_docs/scripts.markdown @@ -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: diff --git a/source/_docs/scripts/conditions.markdown b/source/_docs/scripts/conditions.markdown index 76b3450253f..f6aa2c19e08 100644 --- a/source/_docs/scripts/conditions.markdown +++ b/source/_docs/scripts/conditions.markdown @@ -20,15 +20,15 @@ Test multiple conditions in one condition statement. Passes if all embedded cond ```yaml conditions: - alias: "Paulus home AND temperature below 20" - condition: and - conditions: - - condition: state - entity_id: "device_tracker.paulus" - state: "home" - - condition: numeric_state - entity_id: "sensor.temperature" - below: 20 + - alias: "Paulus home AND temperature below 20" + condition: and + conditions: + - condition: state + entity_id: "device_tracker.paulus" + state: "home" + - condition: numeric_state + entity_id: "sensor.temperature" + below: 20 ``` If you do not want to combine AND and OR conditions, you can list them sequentially. @@ -52,7 +52,7 @@ The AND condition also has a shorthand form. The following configuration works t ```yaml conditions: alias: "Paulus home AND temperature below 20" - and: + - and: - condition: state entity_id: "device_tracker.paulus" state: "home" @@ -67,29 +67,29 @@ Test multiple conditions in one condition statement. Passes if any embedded cond ```yaml conditions: - alias: "Paulus home OR temperature below 20" - condition: or - conditions: - - condition: state - entity_id: "device_tracker.paulus" - state: "home" - - condition: numeric_state - entity_id: "sensor.temperature" - below: 20 + - alias: "Paulus home OR temperature below 20" + condition: or + conditions: + - condition: state + entity_id: "device_tracker.paulus" + state: "home" + - condition: numeric_state + entity_id: "sensor.temperature" + below: 20 ``` The OR condition also has a shorthand form. The following configuration works the same as the one listed above: ```yaml conditions: - alias: "Paulus home OR temperature below 20" - or: - - condition: state - entity_id: "device_tracker.paulus" - state: "home" - - condition: numeric_state - entity_id: "sensor.temperature" - below: 20 + - alias: "Paulus home OR temperature below 20" + or: + - condition: state + entity_id: "device_tracker.paulus" + state: "home" + - condition: numeric_state + entity_id: "sensor.temperature" + below: 20 ``` ### Mixed AND and OR conditions @@ -99,26 +99,26 @@ This allows you to mix several AND and OR conditions together. ```yaml conditions: - condition: and - conditions: - - condition: state - entity_id: "device_tracker.paulus" - state: "home" - - condition: or - conditions: - - condition: state - entity_id: sensor.weather_precip - state: "rain" - - condition: numeric_state - entity_id: "sensor.temperature" - below: 20 + - condition: and + conditions: + - condition: state + entity_id: "device_tracker.paulus" + state: "home" + - condition: or + conditions: + - condition: state + entity_id: sensor.weather_precip + state: "rain" + - condition: numeric_state + entity_id: "sensor.temperature" + below: 20 ``` Or in shorthand form: ```yaml conditions: - and: + - and: - condition: state entity_id: "device_tracker.paulus" state: "home" @@ -137,15 +137,15 @@ Test multiple conditions in one condition statement. Passes if all embedded cond ```yaml conditions: - alias: "Paulus not home AND alarm not disarmed" - condition: not - conditions: - - condition: state - entity_id: device_tracker.paulus - state: "home" - - condition: state - entity_id: alarm_control_panel.home_alarm - state: disarmed + - alias: "Paulus not home AND alarm not disarmed" + condition: not + conditions: + - condition: state + entity_id: device_tracker.paulus + state: "home" + - condition: state + entity_id: alarm_control_panel.home_alarm + state: "disarmed" ``` The NOT condition also has a shorthand form. The following configuration works the same as the one listed above: @@ -170,11 +170,11 @@ If both `below` and `above` are specified, both tests have to pass. ```yaml conditions: - alias: "Temperature between 17 and 25 degrees" - condition: numeric_state - entity_id: sensor.temperature - above: 17 - below: 25 + - alias: "Temperature between 17 and 25 degrees" + condition: numeric_state + entity_id: sensor.temperature + above: 17 + below: 25 ``` You can optionally use a `value_template` to process the value of the state before testing it. @@ -183,12 +183,12 @@ You can optionally use a `value_template` to process the value of the state befo ```yaml conditions: - condition: numeric_state - entity_id: sensor.temperature - above: 17 - below: 25 - # If your sensor value needs to be adjusted - value_template: "{{ float(state.state) + 2 }}" + - condition: numeric_state + entity_id: sensor.temperature + above: 17 + below: 25 + # If your sensor value needs to be adjusted + value_template: "{{ float(state.state) + 2 }}" ``` {% endraw %} @@ -198,11 +198,11 @@ The condition will pass if **all** entities match the thresholds. ```yaml conditions: - condition: numeric_state - entity_id: - - sensor.kitchen_temperature - - sensor.living_room_temperature - below: 18 + - condition: numeric_state + entity_id: + - sensor.kitchen_temperature + - sensor.living_room_temperature + below: 18 ``` Alternatively, the condition can test against a state attribute. @@ -210,11 +210,11 @@ The condition will pass if the attribute value of the entity matches the thresho ```yaml conditions: - condition: numeric_state - entity_id: climate.living_room_thermostat - attribute: temperature - above: 17 - below: 25 + - condition: numeric_state + entity_id: climate.living_room_thermostat + attribute: temperature + above: 17 + below: 25 ``` Number helpers (`input_number` entities), `number`, `sensor`, and `zone` entities @@ -223,11 +223,11 @@ options to make the condition more dynamic. ```yaml conditions: - condition: numeric_state - entity_id: climate.living_room_thermostat - attribute: temperature - above: input_number.temperature_threshold_low - below: input_number.temperature_threshold_high + - condition: numeric_state + entity_id: climate.living_room_thermostat + attribute: temperature + above: input_number.temperature_threshold_low + below: input_number.temperature_threshold_high ``` ## State condition @@ -236,15 +236,15 @@ Tests if an entity has a specified state. ```yaml conditions: - alias: "Paulus not home for an hour and a bit" - condition: state - entity_id: device_tracker.paulus - state: "not_home" - # optional: Evaluates to true only if state was this for last X time. - for: - hours: 1 - minutes: 10 - seconds: 5 + - alias: "Paulus not home for an hour and a bit" + condition: state + entity_id: device_tracker.paulus + state: "not_home" + # optional: Evaluates to true only if state was this for last X time. + for: + hours: 1 + minutes: 10 + seconds: 5 ``` It is also possible to test the condition against multiple entities at once. @@ -252,11 +252,11 @@ The condition will pass if **all** entities match the state. ```yaml conditions: - condition: state - entity_id: - - light.kitchen - - light.living_room - state: "on" + - condition: state + entity_id: + - light.kitchen + - light.living_room + state: "on" ``` Instead of matching all, it is also possible if one of the entities matches. @@ -264,12 +264,12 @@ In the following example the condition will pass if **any** entity matches the s ```yaml conditions: - condition: state - entity_id: - - binary_sensor.motion_sensor_left - - binary_sensor.motion_sensor_right - match: any - state: "on" + - condition: state + entity_id: + - binary_sensor.motion_sensor_left + - binary_sensor.motion_sensor_right + match: any + state: "on" ``` Testing if an entity is matching a set of possible conditions; @@ -277,11 +277,11 @@ The condition will pass if the entity matches one of the states given. ```yaml conditions: - condition: state - entity_id: alarm_control_panel.home - state: - - "armed_away" - - "armed_home" + - condition: state + entity_id: alarm_control_panel.home + state: + - "armed_away" + - "armed_home" ``` Or, combine multiple entities with multiple states. In the following example, @@ -289,13 +289,13 @@ both media players need to be either paused or playing for the condition to pass ```yaml conditions: - condition: state - entity_id: - - media_player.living_room - - media_player.kitchen - state: - - "playing" - - "paused" + - condition: state + entity_id: + - media_player.living_room + - media_player.kitchen + state: + - "playing" + - "paused" ``` Alternatively, the condition can test against a state attribute. @@ -303,10 +303,10 @@ The condition will pass if the attribute matches the given state. ```yaml conditions: - condition: state - entity_id: climate.living_room_thermostat - attribute: fan_mode - state: "auto" + - condition: state + entity_id: climate.living_room_thermostat + attribute: fan_mode + state: "auto" ``` Finally, the `state` option accepts helper entities (also known as `input_*` @@ -315,9 +315,9 @@ of the given helper entity. ```yaml conditions: - condition: state - entity_id: alarm_control_panel.home - state: input_select.guest_mode + - condition: state + entity_id: alarm_control_panel.home + state: input_select.guest_mode ``` You can also use templates in the `for` option. @@ -326,12 +326,12 @@ You can also use templates in the `for` option. ```yaml conditions: - condition: state - entity_id: device_tracker.paulus - state: "home" - for: - minutes: "{{ states('input_number.lock_min')|int }}" - seconds: "{{ states('input_number.lock_sec')|int }}" + - condition: state + entity_id: device_tracker.paulus + state: "home" + for: + minutes: "{{ states('input_number.lock_min')|int }}" + seconds: "{{ states('input_number.lock_sec')|int }}" ``` {% endraw %} @@ -346,18 +346,18 @@ The sun state can be used to test if the sun has set or risen. ```yaml conditions: - alias: "Sun up" - condition: state # 'day' condition: from sunrise until sunset - entity_id: sun.sun - state: "above_horizon" + - alias: "Sun up" + condition: state # 'day' condition: from sunrise until sunset + entity_id: sun.sun + state: "above_horizon" ``` ```yaml conditions: - alias: "Sun down" - condition: state # from sunset until sunrise - entity_id: sun.sun - state: "below_horizon" + - alias: "Sun down" + condition: state # from sunset until sunrise + entity_id: sun.sun + state: "below_horizon" ``` ### Sun elevation condition @@ -371,12 +371,12 @@ For an in-depth explanation of sun elevation, see [sun elevation trigger][sun_el ```yaml conditions: - condition: and # 'twilight' condition: dusk and dawn, in typical locations - conditions: - - condition: template - value_template: "{{ state_attr('sun.sun', 'elevation') < 0 }}" - - condition: template - value_template: "{{ state_attr('sun.sun', 'elevation') > -6 }}" + - condition: and # 'twilight' condition: dusk and dawn, in typical locations + conditions: + - condition: template + value_template: "{{ state_attr('sun.sun', 'elevation') < 0 }}" + - condition: template + value_template: "{{ state_attr('sun.sun', 'elevation') > -6 }}" ``` {% endraw %} @@ -406,9 +406,9 @@ The sunset/sunrise conditions do not work in locations inside the polar circles, This is an example of 1 hour offset before sunset: ```yaml conditions: - condition: sun - after: sunset - after_offset: "-01:00:00" + - condition: sun + after: sunset + after_offset: "-01:00:00" ``` This is 'when dark' - equivalent to a state condition on `sun.sun` of `below_horizon`: @@ -441,9 +441,9 @@ The template condition tests if the [given template][template] renders a value e ```yaml conditions: - alias: "Iphone battery above 50%" - condition: template - value_template: "{{ (state_attr('device_tracker.iphone', 'battery_level')|int) > 50 }}" + - alias: "Iphone battery above 50%" + condition: template + value_template: "{{ (state_attr('device_tracker.iphone', 'battery_level')|int) > 50 }}" ``` {% endraw %} @@ -488,12 +488,12 @@ and [`not`](#not-condition) conditions: ```yaml conditions: - condition: or - conditions: - - "{{ is_state('device_tracker.iphone', 'away') }}" - - condition: numeric_state - entity_id: "sensor.temperature" - below: 20 + - condition: or + conditions: + - "{{ is_state('device_tracker.iphone', 'away') }}" + - condition: numeric_state + entity_id: "sensor.temperature" + below: 20 ``` {% endraw %} @@ -540,15 +540,15 @@ The time condition can test if it is after a specified time, before a specified ```yaml conditions: - alias: "Time 15~02" - condition: time - # At least one of the following is required. - after: "15:00:00" - before: "02:00:00" - weekday: - - mon - - wed - - fri + - alias: "Time 15~02" + condition: time + # At least one of the following is required. + after: "15:00:00" + before: "02:00:00" + weekday: + - mon + - wed + - fri ``` Valid values for `weekday` are `mon`, `tue`, `wed`, `thu`, `fri`, `sat`, `sun`. @@ -587,31 +587,31 @@ The trigger condition can test if an automation was triggered by a certain trigg ```yaml conditions: - condition: trigger - id: event_trigger + - condition: trigger + id: event_trigger ``` For a trigger identified by its index, both a string and integer is allowed: ```yaml conditions: - condition: trigger - id: "0" + - condition: trigger + id: "0" ``` ```yaml conditions: - condition: trigger - id: 0 + - condition: trigger + id: 0 ``` It is possible to give a list of triggers: ```yaml conditions: - condition: trigger - id: - - event_1_trigger - - event_2_trigger + - condition: trigger + id: + - event_1_trigger + - event_2_trigger ``` ## Zone condition @@ -620,10 +620,10 @@ Zone conditions test if an entity is in a certain zone. For zone automation to w ```yaml conditions: - alias: "Paulus at home" - condition: zone - entity_id: device_tracker.paulus - zone: zone.home + - alias: "Paulus at home" + condition: zone + entity_id: device_tracker.paulus + zone: zone.home ``` It is also possible to test the condition against multiple entities at once. @@ -631,11 +631,11 @@ The condition will pass if all entities are in the specified zone. ```yaml conditions: - condition: zone - entity_id: - - device_tracker.frenck - - device_tracker.daphne - zone: zone.home + - condition: zone + entity_id: + - device_tracker.frenck + - device_tracker.daphne + zone: zone.home ``` Testing if an entity is matching a set of possible zones; @@ -643,11 +643,11 @@ The condition will pass if the entity is in one of the zones. ```yaml conditions: - condition: zone - entity_id: device_tracker.paulus - state: - - zone.home - - zone.work + - condition: zone + entity_id: device_tracker.paulus + state: + - zone.home + - zone.work ``` Or, combine multiple entities with multiple zones. In the following example, @@ -701,10 +701,10 @@ For example: ```yaml # This condition will always pass, as it is disabled. conditions: - enabled: false - condition: state - entity_id: sun.sun - state: "above_horizon" + - enabled: false + condition: state + entity_id: sun.sun + state: "above_horizon" ``` Conditions can also be disabled based on limited templates or blueprint inputs. diff --git a/source/_docs/scripts/perform-actions.markdown b/source/_docs/scripts/perform-actions.markdown index c51c0992416..ce1120cdd5e 100644 --- a/source/_docs/scripts/perform-actions.markdown +++ b/source/_docs/scripts/perform-actions.markdown @@ -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] diff --git a/source/_docs/tools/dev-tools.markdown b/source/_docs/tools/dev-tools.markdown index 96144a1481e..c83eb0534ab 100644 --- a/source/_docs/tools/dev-tools.markdown +++ b/source/_docs/tools/dev-tools.markdown @@ -105,8 +105,8 @@ If there is an automation that handles that event, it will be automatically trig ```yaml - alias: "Capture Event" triggers: - trigger: event - event_type: event_light_state_changed + - trigger: event + event_type: event_light_state_changed actions: - action: notify.notify data: diff --git a/source/_integrations/amcrest.markdown b/source/_integrations/amcrest.markdown index 4e65cf78117..10008bb9b6f 100644 --- a/source/_integrations/amcrest.markdown +++ b/source/_integrations/amcrest.markdown @@ -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 diff --git a/source/_integrations/androidtv.markdown b/source/_integrations/androidtv.markdown index d4f5d13b805..bb6e1aeac1f 100644 --- a/source/_integrations/androidtv.markdown +++ b/source/_integrations/androidtv.markdown @@ -147,11 +147,11 @@ In an [action](/getting-started/automation-action/) of your [automation setup](/ ```yaml actions: - action: androidtv.adb_command - target: - entity_id: media_player.androidtv_tv_living_room - data: - command: "HOME" + - action: androidtv.adb_command + target: + entity_id: media_player.androidtv_tv_living_room + data: + command: "HOME" ``` Available key commands include: diff --git a/source/_integrations/august.markdown b/source/_integrations/august.markdown index 91984d597a1..1b34cfd40bf 100644 --- a/source/_integrations/august.markdown +++ b/source/_integrations/august.markdown @@ -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 %} diff --git a/source/_integrations/azure_service_bus.markdown b/source/_integrations/azure_service_bus.markdown index 5041c74ecfb..4d714089060 100644 --- a/source/_integrations/azure_service_bus.markdown +++ b/source/_integrations/azure_service_bus.markdown @@ -82,19 +82,19 @@ See the example below for how an automation trigger translates to a message on t automation: - alias: "Sunset Service Bus message" triggers: - trigger: sun - event: sunset + - trigger: sun + event: sunset actions: - action: notify.test_queue - data: - message: "Sun is going down" - title: "Good evening" + - action: notify.test_queue data: - sun_direction: "Down" - custom_field: 123 - custom_object: - trigger_more: true - explain: "It's starting to get dark" + message: "Sun is going down" + title: "Good evening" + data: + sun_direction: "Down" + custom_field: 123 + custom_object: + trigger_more: true + explain: "It's starting to get dark" ``` The message that can be retrieved from a queue or topic subscription: diff --git a/source/_integrations/backup.markdown b/source/_integrations/backup.markdown index 38e868723f8..3a4b2acc437 100644 --- a/source/_integrations/backup.markdown +++ b/source/_integrations/backup.markdown @@ -52,11 +52,11 @@ at 3 AM: automation: - alias: "Backup Home Assistant every night at 3 AM" triggers: - trigger: time - at: "03:00:00" + - trigger: time + at: "03:00:00" actions: - alias: "Create backup now" - action: backup.create + - alias: "Create backup now" + action: backup.create ``` ## Restoring a backup diff --git a/source/_integrations/binary_sensor.xiaomi_aqara.markdown b/source/_integrations/binary_sensor.xiaomi_aqara.markdown index 951971e334d..08a9a3547f7 100644 --- a/source/_integrations/binary_sensor.xiaomi_aqara.markdown +++ b/source/_integrations/binary_sensor.xiaomi_aqara.markdown @@ -40,14 +40,14 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra ```yaml - alias: "If there is motion and it's dark turn on the gateway light" triggers: - trigger: state - entity_id: binary_sensor.motion_sensor_158d000xxxxxc2 - from: "off" - to: "on" + - trigger: state + entity_id: binary_sensor.motion_sensor_158d000xxxxxc2 + from: "off" + to: "on" conditions: - condition: numeric_state - entity_id: sensor.illumination_34ce00xxxx11 - below: 300 + - condition: numeric_state + entity_id: sensor.illumination_34ce00xxxx11 + below: 300 actions: - action: light.turn_on target: @@ -59,12 +59,12 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra entity_id: automation.MOTION_OFF - alias: "If there no motion for 5 minutes turn off the gateway light" triggers: - trigger: state - entity_id: binary_sensor.motion_sensor_158d000xxxxxc2 - from: "on" - to: "off" - for: - minutes: 5 + - trigger: state + entity_id: binary_sensor.motion_sensor_158d000xxxxxc2 + from: "on" + to: "off" + for: + minutes: 5 actions: - action: light.turn_off target: @@ -79,36 +79,36 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra ```yaml - alias: "If the window is open turn off the radiator" triggers: - trigger: state - entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2 - from: "off" - to: "on" + - trigger: state + entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2 + from: "off" + to: "on" actions: - action: climate.set_operation_mode - target: - entity_id: climate.livingroom - data: - operation_mode: "Off" + - action: climate.set_operation_mode + target: + entity_id: climate.livingroom + data: + operation_mode: "Off" - alias: "If the window is closed for 5 minutes turn on the radiator again" triggers: - trigger: state - entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2 - from: "on" - to: "off" - for: - minutes: 5 + - trigger: state + entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2 + from: "on" + to: "off" + for: + minutes: 5 actions: - action: climate.set_operation_mode - target: - entity_id: climate.livingroom - data: - operation_mode: "Smart schedule" + - action: climate.set_operation_mode + target: + entity_id: climate.livingroom + data: + operation_mode: "Smart schedule" - alias: "Notify if door is opened when away" triggers: - trigger: state - entity_id: binary_sensor.door_window_sensor_15xxxxxxc9xx6b - from: "off" - to: "on" + - trigger: state + entity_id: binary_sensor.door_window_sensor_15xxxxxxc9xx6b + from: "off" + to: "on" conditions: - condition: state entity_id: group.family @@ -124,15 +124,15 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra ```yaml - alias: "Send notification on fire alarm" triggers: - trigger: state - entity_id: binary_sensor.smoke_sensor_158d0001574899 - from: "off" - to: "on" + - trigger: state + entity_id: binary_sensor.smoke_sensor_158d0001574899 + from: "off" + to: "on" actions: - action: notify.html5 data: - title: Fire alarm! - message: Fire/Smoke detected! + title: "Fire alarm!" + message: "Fire/Smoke detected!" - action: xiaomi_aqara.play_ringtone data: gw_mac: xxxxxxxxxxxx @@ -147,14 +147,14 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra ```yaml - alias: "Send notification on gas alarm" triggers: - trigger: state - entity_id: binary_sensor.natgas_sensor_158dxxxxxxxxxx - from: "off" - to: "on" + - trigger: state + entity_id: binary_sensor.natgas_sensor_158dxxxxxxxxxx + from: "off" + to: "on" actions: - action: notify.html5 data: - title: Gas alarm! + title: "Gas alarm!" message: "Gas with a density of {{ state_attr('binary_sensor.natgas_sensor_158dxxxxxxxxxx', 'density') }} detected." ``` @@ -167,39 +167,39 @@ As indicated in the table on top of this page there are 3 versions of the button ```yaml - alias: "Toggle dining light on single press" triggers: - trigger: event - event_type: xiaomi_aqara.click - event_data: - entity_id: binary_sensor.switch_158d000xxxxxc2 - click_type: single + - trigger: event + event_type: xiaomi_aqara.click + event_data: + entity_id: binary_sensor.switch_158d000xxxxxc2 + click_type: single actions: - action: switch.toggle - target: - entity_id: switch.wall_switch_left_158d000xxxxx01 + - action: switch.toggle + target: + entity_id: switch.wall_switch_left_158d000xxxxx01 - alias: "Toggle couch light on double click" triggers: - trigger: event - event_type: xiaomi_aqara.click - event_data: - entity_id: binary_sensor.switch_158d000xxxxxc2 - click_type: double + - trigger: event + event_type: xiaomi_aqara.click + event_data: + entity_id: binary_sensor.switch_158d000xxxxxc2 + click_type: double actions: - action: switch.toggle - target: - entity_id: switch.wall_switch_right_158d000xxxxx01 + - action: switch.toggle + target: + entity_id: switch.wall_switch_right_158d000xxxxx01 - alias: "Let a dog bark on long press" triggers: - trigger: event - event_type: xiaomi_aqara.click - event_data: - entity_id: binary_sensor.switch_158d000xxxxxc2 - click_type: long_click_press + - trigger: event + event_type: xiaomi_aqara.click + event_data: + entity_id: binary_sensor.switch_158d000xxxxxc2 + click_type: long_click_press actions: - action: xiaomi_aqara.play_ringtone - data: - gw_mac: xxxxxxxxxxxx - ringtone_id: 8 - ringtone_vol: 8 + - action: xiaomi_aqara.play_ringtone + data: + gw_mac: xxxxxxxxxxxx + ringtone_id: 8 + ringtone_vol: 8 ``` #### Xiaomi Cube @@ -209,11 +209,11 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi ```yaml - alias: "Cube event flip90" triggers: - trigger: event - event_type: xiaomi_aqara.cube_action - event_data: - entity_id: binary_sensor.cube_15xxxxxxxxxxxx - action_type: flip90 + - trigger: event + event_type: xiaomi_aqara.cube_action + event_data: + entity_id: binary_sensor.cube_15xxxxxxxxxxxx + action_type: flip90 actions: - action: light.turn_on target: @@ -222,11 +222,11 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi color_name: "springgreen" - alias: "Cube event flip180" triggers: - trigger: event - event_type: xiaomi_aqara.cube_action - event_data: - entity_id: binary_sensor.cube_15xxxxxxxxxxxx - action_type: flip180 + - trigger: event + event_type: xiaomi_aqara.cube_action + event_data: + entity_id: binary_sensor.cube_15xxxxxxxxxxxx + action_type: flip180 actions: - action: light.turn_on target: @@ -235,11 +235,11 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi color_name: "darkviolet" - alias: "Cube event move" triggers: - trigger: event - event_type: xiaomi_aqara.cube_action - event_data: - entity_id: binary_sensor.cube_15xxxxxxxxxxxx - action_type: move + - trigger: event + event_type: xiaomi_aqara.cube_action + event_data: + entity_id: binary_sensor.cube_15xxxxxxxxxxxx + action_type: move actions: - action: light.turn_on target: @@ -248,11 +248,11 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi color_name: "gold" - alias: "Cube event tap_twice" triggers: - trigger: event - event_type: xiaomi_aqara.cube_action - event_data: - entity_id: binary_sensor.cube_15xxxxxxxxxxxx - action_type: tap_twice + - trigger: event + event_type: xiaomi_aqara.cube_action + event_data: + entity_id: binary_sensor.cube_15xxxxxxxxxxxx + action_type: tap_twice actions: - action: light.turn_on target: @@ -261,11 +261,11 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi color_name: "deepskyblue" - alias: "Cube event shake_air" triggers: - trigger: event - event_type: xiaomi_aqara.cube_action - event_data: - entity_id: binary_sensor.cube_15xxxxxxxxxxxx - action_type: shake_air + - trigger: event + event_type: xiaomi_aqara.cube_action + event_data: + entity_id: binary_sensor.cube_15xxxxxxxxxxxx + action_type: shake_air actions: - action: light.turn_on target: @@ -283,61 +283,61 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac ```yaml - alias: "Decrease brightness of the gateway light" triggers: - trigger: event - event_type: xiaomi_aqara.click - event_data: - entity_id: binary_sensor.wall_switch_left_158xxxxxxxxx12 - click_type: single + - trigger: event + event_type: xiaomi_aqara.click + event_data: + entity_id: binary_sensor.wall_switch_left_158xxxxxxxxx12 + click_type: single actions: - action: light.turn_on - target: - entity_id: light.gateway_light_34xxxxxxxx13 - data: - brightness: >- - {% if state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') %} - {% if state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') - 60 >= 10 %} - {{state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') - 60}} + - action: light.turn_on + target: + entity_id: light.gateway_light_34xxxxxxxx13 + data: + brightness: >- + {% if state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') %} + {% if state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') - 60 >= 10 %} + {{state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') - 60}} + {% else %} + {{state_attr('light.gateway_light_34xxxxxxxx13', 'brightness')}} + {% endif %} {% else %} - {{state_attr('light.gateway_light_34xxxxxxxx13', 'brightness')}} + 10 {% endif %} - {% else %} - 10 - {% endif %} - alias: "Increase brightness of the gateway light" triggers: - trigger: event - event_type: xiaomi_aqara.click - event_data: - entity_id: binary_sensor.wall_switch_right_158xxxxxxxxx12 - click_type: single + - trigger: event + event_type: xiaomi_aqara.click + event_data: + entity_id: binary_sensor.wall_switch_right_158xxxxxxxxx12 + click_type: single actions: - action: light.turn_on - target: - entity_id: light.gateway_light_34xxxxxxxx13 - data: - brightness: >- - {% if state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') %} - {% if state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') + 60 <= 255 %} - {{state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') + 60}} + - action: light.turn_on + target: + entity_id: light.gateway_light_34xxxxxxxx13 + data: + brightness: >- + {% if state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') %} + {% if state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') + 60 <= 255 %} + {{state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') + 60}} + {% else %} + {{state_attr('light.gateway_light_34xxxxxxxx13', 'brightness')}} + {% endif %} {% else %} - {{state_attr('light.gateway_light_34xxxxxxxx13', 'brightness')}} + 10 {% endif %} - {% else %} - 10 - {% endif %} - alias: "Turn off the gateway light" triggers: - trigger: event - event_type: xiaomi_aqara.click - event_data: - entity_id: binary_sensor.wall_switch_both_158xxxxxxxxx12 - click_type: both + - trigger: event + event_type: xiaomi_aqara.click + event_data: + entity_id: binary_sensor.wall_switch_both_158xxxxxxxxx12 + click_type: both actions: - action: light.turn_off - target: - entity_id: light.gateway_light_34xxxxxxxx13 + - action: light.turn_off + target: + entity_id: light.gateway_light_34xxxxxxxx13 ``` {% endraw %} @@ -349,24 +349,24 @@ This automation toggles the living room lamp on vibration/tilt. ```yaml - alias: "Turn on Living Room Lamp on vibration" triggers: - trigger: event - event_type: xiaomi_aqara.movement - event_data: - entity_id: binary_sensor.vibration_xxxx000000 - movement_type: vibrate + - trigger: event + event_type: xiaomi_aqara.movement + event_data: + entity_id: binary_sensor.vibration_xxxx000000 + movement_type: vibrate actions: - action: light.toggle - target: - entity_id: light.living_room_lamp + - action: light.toggle + target: + entity_id: light.living_room_lamp - alias: "Turn on Living Room Lamp on tilt" triggers: - trigger: event - event_type: xiaomi_aqara.movement - event_data: - entity_id: binary_sensor.vibration_xxxx000000 - movement_type: tilt + - trigger: event + event_type: xiaomi_aqara.movement + event_data: + entity_id: binary_sensor.vibration_xxxx000000 + movement_type: tilt actions: - action: light.toggle - target: - entity_id: light.living_room_lamp + - action: light.toggle + target: + entity_id: light.living_room_lamp ``` diff --git a/source/_integrations/blink.markdown b/source/_integrations/blink.markdown index d6969dcc31c..ddfe6fc833b 100644 --- a/source/_integrations/blink.markdown +++ b/source/_integrations/blink.markdown @@ -133,16 +133,15 @@ This example automation will arm your blink sync module to detect motion on any Here, this example assumes your blink module is named `My Sync Module` and that you have [device trackers](/integrations/device_tracker) set up for presence detection. ```yaml -- id: arm_blink_when_away - alias: "Arm Blink When Away" +- alias: "Arm Blink When Away" triggers: - trigger: state - entity_id: all - to: "not_home" + - trigger: state + entity_id: all + to: "not_home" actions: - action: alarm_control_panel.alarm_arm_away - target: - entity_id: alarm_control_panel.blink_my_sync_module + - action: alarm_control_panel.alarm_arm_away + target: + entity_id: alarm_control_panel.blink_my_sync_module ``` ### Disarm Blink when home @@ -150,16 +149,15 @@ Here, this example assumes your blink module is named `My Sync Module` and that Similar to the previous example, this automation will disarm blink when arriving home. ```yaml -- id: disarm_blink_when_home - alias: "Disarm Blink When Home" +- alias: "Disarm Blink When Home" triggers: - trigger: state - entity_id: all - to: "home" + - trigger: state + entity_id: all + to: "home" actions: - action: alarm_control_panel.alarm_disarm - target: - entity_id: alarm_control_panel.blink_my_sync_module + - action: alarm_control_panel.alarm_disarm + target: + entity_id: alarm_control_panel.blink_my_sync_module ``` ### Save most recent video locally when motion detected @@ -171,12 +169,11 @@ The following example assumes your camera's name (in the Blink app) is `My Camer {% raw %} ```yaml -- id: save_blink_video_on_motion - alias: "Save Blink Video on Motion" +- alias: "Save Blink Video on Motion" triggers: - trigger: state - entity_id: binary_sensor.blink_my_camera_motion_detected - to: "on" + - trigger: state + entity_id: binary_sensor.blink_my_camera_motion_detected + to: "on" actions: - action: blink.save_video target: @@ -200,8 +197,7 @@ The file will be saved to `/tmp/videos/YYYYMMDD_HHmmSS_MyCamera.mp4`. The file name of the downloaded video file is not configurable. ```yaml -- id: save_recent_clips_from_my_camera - alias: "Save Recent Clips from My Camera" +- alias: "Save Recent Clips from My Camera" triggers: - trigger: time_pattern minutes: /3 diff --git a/source/_integrations/bmw_connected_drive.markdown b/source/_integrations/bmw_connected_drive.markdown index 3230943f4ee..5ab08d0bd65 100644 --- a/source/_integrations/bmw_connected_drive.markdown +++ b/source/_integrations/bmw_connected_drive.markdown @@ -80,16 +80,16 @@ The name of the action is `notify.bmw_connected_drive_`. ```yaml ... actions: - action: notify.bmw_connected_drive_ - data: - message: The name of the POI # this is shown on the iDrive dashboard + - action: notify.bmw_connected_drive_ data: - latitude: 48.177024 - longitude: 11.559107 - street: Street name # Optional - city: City name # Optional - postal_code: Postal Code # Optional - country: Country # Optional + message: The name of the POI # this is shown on the iDrive dashboard + data: + latitude: 48.177024 + longitude: 11.559107 + street: Street name # Optional + city: City name # Optional + postal_code: Postal Code # Optional + country: Country # Optional ``` ## Lock diff --git a/source/_integrations/bring.markdown b/source/_integrations/bring.markdown index 0a22a981ad1..860b9ee60e6 100644 --- a/source/_integrations/bring.markdown +++ b/source/_integrations/bring.markdown @@ -67,11 +67,11 @@ The **Bring** integration offers an action to send push notifications to the Bri ```yaml ... actions: - action: bring.send_message - target: - entity_id: todo.bring_shoppinglist - data: - message: going_shopping + - action: bring.send_message + target: + entity_id: todo.bring_shoppinglist + data: + message: going_shopping ``` ### Sending an urgent message notification @@ -81,10 +81,10 @@ Note that for the notification type `urgent_message` the attribute `item` is **r ```yaml ... actions: - action: bring.send_message - target: - entity_id: todo.bring_shoppinglist - data: - message: urgent_message - item: Cilantro + - action: bring.send_message + target: + entity_id: todo.bring_shoppinglist + data: + message: urgent_message + item: Cilantro ``` diff --git a/source/_integrations/calendar.markdown b/source/_integrations/calendar.markdown index 935e5876e61..3a440c1f457 100644 --- a/source/_integrations/calendar.markdown +++ b/source/_integrations/calendar.markdown @@ -98,7 +98,7 @@ This example automation consists of: {% raw %} ```yaml automation: - - alias: Calendar notification + - alias: "Calendar notification" triggers: - trigger: calendar event: start @@ -125,7 +125,7 @@ This example consists of: {% raw %} ```yaml automation: - - alias: Front Light Schedule + - alias: "Front Light Schedule" triggers: - trigger: calendar event: start @@ -141,10 +141,12 @@ automation: - "{{ trigger.event == 'start' }}" then: - action: light.turn_on - entity_id: light.front + target: + entity_id: light.front else: - action: light.turn_off - entity_id: light.front + target: + entity_id: light.front ``` {% endraw %} diff --git a/source/_integrations/camera.markdown b/source/_integrations/camera.markdown index 2252d9a4312..7467a440339 100644 --- a/source/_integrations/camera.markdown +++ b/source/_integrations/camera.markdown @@ -75,11 +75,11 @@ For example, the following action in an automation would send an `hls` live stre ```yaml actions: - action: camera.play_stream - target: - entity_id: camera.yourcamera - data: - media_player: media_player.chromecast + - action: camera.play_stream + target: + entity_id: camera.yourcamera + data: + media_player: media_player.chromecast ``` ### Action `record` @@ -103,11 +103,11 @@ For example, the following action in an automation would take a recording from " ```yaml actions: - action: camera.record - target: - entity_id: camera.yourcamera - data: - filename: '/tmp/{{ entity_id.name }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4' + - action: camera.record + target: + entity_id: camera.yourcamera + data: + filename: '/tmp/{{ entity_id.name }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4' ``` {% endraw %} @@ -129,11 +129,11 @@ For example, the following action in an automation would take a snapshot from "y ```yaml actions: - action: camera.snapshot - target: - entity_id: camera.yourcamera - data: - filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg' + - action: camera.snapshot + target: + entity_id: camera.yourcamera + data: + filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg' ``` {% endraw %} diff --git a/source/_integrations/cast.markdown b/source/_integrations/cast.markdown index 61e35fc30b0..466ea28004e 100644 --- a/source/_integrations/cast.markdown +++ b/source/_integrations/cast.markdown @@ -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 '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 "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 diff --git a/source/_integrations/cisco_webex_teams.markdown b/source/_integrations/cisco_webex_teams.markdown index c880c561dfa..08f8a50f808 100644 --- a/source/_integrations/cisco_webex_teams.markdown +++ b/source/_integrations/cisco_webex_teams.markdown @@ -69,9 +69,9 @@ Here are the automations for the above screenshot: - trigger: webhook webhook_id: build_failed actions: - action: notify.cisco_webex_teams_notify - data: - message: "
Build 0.89.5 compile failed." + - action: notify.cisco_webex_teams_notify + data: + message: "
Build 0.89.5 compile failed." # Rich Text Example 2. @@ -82,20 +82,20 @@ Here are the automations for the above screenshot: - trigger: webhook webhook_id: build_unstable actions: - action: notify.cisco_webex_teams_notify - data: - title: "Build 0.89.6 is unstable." - message: "
Version 0.89.6 failed verifications. - -
    -
  • test_osx -
  • test_win_lint + - action: notify.cisco_webex_teams_notify + data: + title: "Build 0.89.6 is unstable." + message: "
    Version 0.89.6 failed verifications. + +
      +
    • test_osx +
    • test_win_lint -
    • ... and 4 more. -
    -

    <@personEmail:sparkbotjeeves@sparkbot.io>

    -

    View Test Report

    - " +
  • ... and 4 more. +
+

<@personEmail:sparkbotjeeves@sparkbot.io>

+

View Test Report

+ " # Rich Text Example 3. # Show a title and multi-line message with a blue banner, @@ -105,19 +105,19 @@ Here are the automations for the above screenshot: - trigger: webhook webhook_id: build_passed actions: - action: notify.cisco_webex_teams_notify - data: - title: "✅ Version 0.89.7 passed all tests and deployed to production!" - message: "
Version 0.89.7 passed all verifications. - -
    -
  • test_cov -
  • test_osx -
  • test_win -
  • test_linux -
  • ... and 45 more. -
- " + - action: notify.cisco_webex_teams_notify + data: + title: "✅ Version 0.89.7 passed all tests and deployed to production!" + message: "
Version 0.89.7 passed all verifications. + +
    +
  • test_cov +
  • test_osx +
  • test_win +
  • test_linux +
  • ... and 45 more. +
+ " ``` The following is a list of the allowed html tags and attributes: diff --git a/source/_integrations/climate.markdown b/source/_integrations/climate.markdown index 293ecf8be2f..576a4b7faec 100644 --- a/source/_integrations/climate.markdown +++ b/source/_integrations/climate.markdown @@ -53,8 +53,8 @@ Turn auxiliary heater on/off for climate device ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: climate.set_aux_heat target: @@ -79,8 +79,8 @@ reflecting a situation where the climate device is set to save energy. For examp ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: climate.set_preset_mode target: @@ -107,8 +107,8 @@ Set target temperature of climate device ### Set temperature to 24 in heat mode automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: climate.set_temperature target: @@ -122,8 +122,8 @@ automation: ### Set temperature range to 20 to 24 in heat_cool mode automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: climate.set_temperature target: @@ -148,8 +148,8 @@ Set target humidity of climate device ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: climate.set_humidity target: @@ -172,8 +172,8 @@ Set fan operation for climate device ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: climate.set_fan_mode target: @@ -196,8 +196,8 @@ Set climate device's HVAC mode ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: climate.set_hvac_mode target: @@ -220,8 +220,8 @@ Set swing operation mode for climate device ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: climate.set_swing_mode target: diff --git a/source/_integrations/counter.markdown b/source/_integrations/counter.markdown index b832321de95..72ec128c7f1 100644 --- a/source/_integrations/counter.markdown +++ b/source/_integrations/counter.markdown @@ -147,17 +147,16 @@ system_log: ```yaml # Example configuration.yaml entry automation: -- id: 'errorcounterautomation' - alias: "Error Counting Automation" +- alias: "Error Counting Automation" triggers: - trigger: event - event_type: system_log_event - event_data: - level: ERROR + - trigger: event + event_type: system_log_event + event_data: + level: ERROR actions: - action: counter.increment - target: - entity_id: counter.error_counter + - action: counter.increment + target: + entity_id: counter.error_counter counter: error_counter: diff --git a/source/_integrations/cover.markdown b/source/_integrations/cover.markdown index dceae52f675..b0d8000d221 100644 --- a/source/_integrations/cover.markdown +++ b/source/_integrations/cover.markdown @@ -76,8 +76,8 @@ Available actions: `cover.open_cover`, `cover.close_cover`, `cover.stop_cover`, ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: cover.open_cover target: @@ -98,8 +98,8 @@ Set cover position of one or multiple covers. ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: cover.set_cover_position target: @@ -122,8 +122,8 @@ Set cover tilt position of one or multiple covers. ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: cover.set_cover_tilt_position target: diff --git a/source/_integrations/deconz.markdown b/source/_integrations/deconz.markdown index f4fd897d3ab..44005df3412 100644 --- a/source/_integrations/deconz.markdown +++ b/source/_integrations/deconz.markdown @@ -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 diff --git a/source/_integrations/device_automation.markdown b/source/_integrations/device_automation.markdown index 601b4d86354..708e5b7df7e 100644 --- a/source/_integrations/device_automation.markdown +++ b/source/_integrations/device_automation.markdown @@ -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 diff --git a/source/_integrations/dexcom.markdown b/source/_integrations/dexcom.markdown index c38c08f1129..a31e6d65f25 100644 --- a/source/_integrations/dexcom.markdown +++ b/source/_integrations/dexcom.markdown @@ -44,18 +44,18 @@ If you have a sensor session running, and once you have enabled the Dexcom integ ## Example automation ```yaml -- id: '1234567890123' - alias: "overnight_low_kitchen_lights" - description: Turn on the lights in the kitchen if my blood sugar drops low overnight +- alias: "Overnight low kitchen lights" + description: "Turn on the lights in the kitchen if my blood sugar drops low overnight" triggers: - - below: '65' - entity_id: sensor.dexcom_YOUR_USERNAME_glucose_value - trigger: numeric_state - condition: time - after: "22:00:00" - before: "06:00:00" + - trigger: numeric_state + entity_id: sensor.dexcom_YOUR_USERNAME_glucose_value + below: 65 + conditions: + - condition: time + after: "22:00:00" + before: "06:00:00" actions: - - action: light.turn_on - target: - entity_id: light.kitchen + - action: light.turn_on + target: + entity_id: light.kitchen ``` diff --git a/source/_integrations/doorbird.markdown b/source/_integrations/doorbird.markdown index aa33ee92a49..6d8f769487a 100644 --- a/source/_integrations/doorbird.markdown +++ b/source/_integrations/doorbird.markdown @@ -105,10 +105,10 @@ The example automation below shows how to turn on a light when somebody presses ```yaml - alias: "Doorbird Ring" triggers: - trigger: event - event_type: doorbird_driveway_gate_somebody_pressed_the_button + - trigger: event + event_type: doorbird_driveway_gate_somebody_pressed_the_button actions: - action: light.turn_on + - action: light.turn_on target: entity_id: light.side_entry_porch ``` diff --git a/source/_integrations/dovado.markdown b/source/_integrations/dovado.markdown index 87a06666e09..d26b55fd385 100644 --- a/source/_integrations/dovado.markdown +++ b/source/_integrations/dovado.markdown @@ -77,13 +77,13 @@ This is a notify platform and thus can be controlled by calling the notify actio automation: - alias: "The sun has set" triggers: - trigger: sun - event: sunset + - trigger: sun + event: sunset actions: - action: notify.dovado - data: - message: "The sun has set" - target: "+14151234567" + - action: notify.dovado + data: + message: "The sun has set" + target: "+14151234567" ``` ## Sensor diff --git a/source/_integrations/downloader.markdown b/source/_integrations/downloader.markdown index ee4cc7253f6..2b2639d9f41 100644 --- a/source/_integrations/downloader.markdown +++ b/source/_integrations/downloader.markdown @@ -52,11 +52,11 @@ Along with the event the following payload parameters are available: ```yaml - alias: "Download Failed Notification" triggers: - trigger: event - event_type: downloader_download_failed + - trigger: event + event_type: downloader_download_failed actions: - action: persistent_notification.create - data: - message: "{{trigger.event.data.filename}} download failed" - title: "Download Failed" + - action: persistent_notification.create + data: + message: "{{trigger.event.data.filename}} download failed" + title: "Download Failed" ``` diff --git a/source/_integrations/elgato.markdown b/source/_integrations/elgato.markdown index 7fc57f799af..f3bf6ab82d1 100644 --- a/source/_integrations/elgato.markdown +++ b/source/_integrations/elgato.markdown @@ -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 diff --git a/source/_integrations/enocean.markdown b/source/_integrations/enocean.markdown index b1346305086..16722a07b6d 100644 --- a/source/_integrations/enocean.markdown +++ b/source/_integrations/enocean.markdown @@ -112,15 +112,15 @@ Sample automation to switch lights on and off: automation: - alias: "Hall light switches" triggers: - trigger: event - event_type: button_pressed - event_data: - id: [0xYY, 0xYY, 0xYY, 0xYY] - pushed: 0 + - trigger: event + event_type: button_pressed + event_data: + id: [0xYY, 0xYY, 0xYY, 0xYY] + pushed: 0 actions: - action: "{% if trigger.event.data.onoff %} light.turn_on {% else %} light.turn_off {%endif %}" - target: - entity_id: "{% if trigger.event.data.which == 1 %} light.hall_left {% else %} light.hall_right {%endif %}" + - action: "{% if trigger.event.data.onoff %} light.turn_on {% else %} light.turn_off {%endif %}" + target: + entity_id: "{% if trigger.event.data.which == 1 %} light.hall_left {% else %} light.hall_right {%endif %}" ``` {% endraw %} diff --git a/source/_integrations/facebook.markdown b/source/_integrations/facebook.markdown index b08c5a60e68..a1411180d03 100644 --- a/source/_integrations/facebook.markdown +++ b/source/_integrations/facebook.markdown @@ -49,15 +49,15 @@ The phone number used in **target** should be registered with Facebook messenger automation: - alias: "Evening Greeting" triggers: - trigger: sun - event: sunset + - trigger: sun + event: sunset actions: - action: notify.facebook - data: - message: "Good Evening" - target: - - '+919413017584' - - '+919784516314' + - action: notify.facebook + data: + message: "Good Evening" + target: + - '+919413017584' + - '+919784516314' ``` You can also send messages to users that do not have stored their phone number on Facebook, but this requires a bit more work. The Messenger platform uses page-specific user IDs instead of a global user ID. You will need to enable a webhook for the "messages" event in Facebook's developer console. Once a user writes a message to a page, that webhook will then receive the user's page specific ID as part of the webhook's payload. Below is a simple PHP script that reacts to the message "get my id" and sends a reply containing the user's ID: diff --git a/source/_integrations/fan.markdown b/source/_integrations/fan.markdown index 7f89016b3cb..fdff7b9de41 100644 --- a/source/_integrations/fan.markdown +++ b/source/_integrations/fan.markdown @@ -51,8 +51,8 @@ Sets the speed percentage for fan device. ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: fan.set_percentage target: @@ -75,8 +75,8 @@ Sets a preset mode for the fan device. Available preset modes are defined by the ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: fan.set_preset_mode target: @@ -99,8 +99,8 @@ Sets the rotation for fan device. ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: fan.set_direction target: @@ -123,8 +123,8 @@ Sets the oscillation for fan device. ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: fan.oscillate target: @@ -157,8 +157,8 @@ Turn fan device off. This is only supported if the fan device supports being tur ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: fan.turn_off target: diff --git a/source/_integrations/feedreader.markdown b/source/_integrations/feedreader.markdown index d6c309883b3..ef4cd5504b2 100644 --- a/source/_integrations/feedreader.markdown +++ b/source/_integrations/feedreader.markdown @@ -30,12 +30,12 @@ Feedreader events can be used out of the box to trigger automation actions, e.g. automation: - alias: "Trigger action when new element(s) in RSS feed" triggers: - trigger: event - event_type: feedreader + - trigger: event + event_type: feedreader actions: - action: script.turn_on - target: - entity_id: script.my_action + - action: script.turn_on + target: + entity_id: script.my_action ``` {% raw %} @@ -44,16 +44,16 @@ automation: automation: - alias: "Send notification of RSS feed title when updated" triggers: - trigger: event - event_type: feedreader - event_data: - feed_url: "https://hasspodcast.io/feed/podcast" + - trigger: event + event_type: feedreader + event_data: + feed_url: "https://hasspodcast.io/feed/podcast" actions: - action: persistent_notification.create - data: - title: "New HA Podcast available" - message: "New Podcast available - {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}" - notification_id: "{{ trigger.event.data.title }}" + - action: persistent_notification.create + data: + title: "New HA Podcast available" + message: "New Podcast available - {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}" + notification_id: "{{ trigger.event.data.title }}" ``` {% endraw %} diff --git a/source/_integrations/fireservicerota.markdown b/source/_integrations/fireservicerota.markdown index 3b9e5b31f44..a1166295b7a 100644 --- a/source/_integrations/fireservicerota.markdown +++ b/source/_integrations/fireservicerota.markdown @@ -118,18 +118,18 @@ These are documented below. automation: - alias: "Switch on a light when incident is received" triggers: - trigger: state - entity_id: sensor.incidents + - trigger: state + entity_id: sensor.incidents actions: - action: light.turn_on - target: - entity_id: light.bedroom + - action: light.turn_on + target: + entity_id: light.bedroom - alias: "Play TTS incident details when incident is received" triggers: - trigger: state - entity_id: sensor.incidents - attribute: message_to_speech_url + - trigger: state + entity_id: sensor.incidents + attribute: message_to_speech_url conditions: - condition: not conditions: @@ -139,7 +139,7 @@ automation: state: None actions: - action: media_player.play_media - data_template: + data: entity_id: media_player.nest_hub_bedroom media_content_id: > {{ state_attr('sensor.incidents','message_to_speech_url') }} @@ -147,22 +147,22 @@ automation: - alias: "Send response acknowledgement when a button is pressed" triggers: - trigger: state - entity_id: switch.response_button + - trigger: state + entity_id: switch.response_button actions: - action: homeassistant.turn_on - target: - entity_id: switch.incident_response + - action: homeassistant.turn_on + target: + entity_id: switch.incident_response - alias: "Cast FireServiceRota dashboard to Nest Hub" - trigger: - trigger: homeassistant - event: start + triggers: + - trigger: homeassistant + event: start actions: - action: cast.show_lovelace_view - data: - entity_id: media_player.nest_hub_bedroom - view_path: fsr + - action: cast.show_lovelace_view + data: + entity_id: media_player.nest_hub_bedroom + view_path: fsr ``` diff --git a/source/_integrations/flic.markdown b/source/_integrations/flic.markdown index e1132305ac7..82ff8df1064 100644 --- a/source/_integrations/flic.markdown +++ b/source/_integrations/flic.markdown @@ -79,15 +79,15 @@ The flic integration fires `flic_click` events on the bus. You can capture the e automation: - alias: "Turn on lights in the living room when flic is pressed once" triggers: - trigger: event - event_type: flic_click - event_data: - button_name: flic_81e4ac74b6d2 - click_type: single + - trigger: event + event_type: flic_click + event_data: + button_name: flic_81e4ac74b6d2 + click_type: single actions: - action: homeassistant.turn_on - target: - entity_id: group.lights_livingroom + - action: homeassistant.turn_on + target: + entity_id: group.lights_livingroom ``` Event data: @@ -105,8 +105,8 @@ To help detect and debug flic button clicks, you can use this automation that se automation: - alias: "FLIC Html5 notify on every click" triggers: - trigger: event - event_type: flic_click + - trigger: event + event_type: flic_click actions: - action: notify.html5 data: diff --git a/source/_integrations/folder_watcher.markdown b/source/_integrations/folder_watcher.markdown index e5516b6bc97..7819d53e28a 100644 --- a/source/_integrations/folder_watcher.markdown +++ b/source/_integrations/folder_watcher.markdown @@ -54,15 +54,15 @@ Automations can be triggered on file system events data using a template. The fo automation:  alias: "New file alert" triggers: -   trigger: state - entity_id: event.created + - trigger: state + entity_id: event.created actions: -   action: notify.notify -   data: -     title: New image captured! -     message: "Created {{ trigger.to_state.attributes.file }} in {{ trigger.to_state.attributes.folder }}" -     data: -       file: "{{ trigger.to_state.attributes.file }}" + - action: notify.notify + data: + title: New image captured! + message: "Created {{ trigger.to_state.attributes.file }} in {{ trigger.to_state.attributes.folder }}" + data: + file: "{{ trigger.to_state.attributes.file }}" ``` {% endraw %} diff --git a/source/_integrations/foursquare.markdown b/source/_integrations/foursquare.markdown index 6f7d86e2953..44815abbb94 100644 --- a/source/_integrations/foursquare.markdown +++ b/source/_integrations/foursquare.markdown @@ -59,12 +59,12 @@ Foursquare check-in events can be used out of the box to trigger automation acti automation: - alias: "Trigger action when you check into a venue." triggers: - trigger: event - event_type: foursquare.push + - trigger: event + event_type: foursquare.push actions: - action: script.turn_on - target: - entity_id: script.my_action + - action: script.turn_on + target: + entity_id: script.my_action ``` ### Check ins diff --git a/source/_integrations/frontier_silicon.markdown b/source/_integrations/frontier_silicon.markdown index eddb13e4435..3b1fbbecec7 100644 --- a/source/_integrations/frontier_silicon.markdown +++ b/source/_integrations/frontier_silicon.markdown @@ -50,14 +50,14 @@ In case your device (friendly name) is called *badezimmer*, an example automatio # Example configuration.yaml automation alias: "Bathroom Motion Detected" triggers: - trigger: state - entity_id: binary_sensor.motion_sensor_166d0001171111 - from: "off" - to: "on" + - trigger: state + entity_id: binary_sensor.motion_sensor_166d0001171111 + from: "off" + to: "on" actions: - action: media_player.turn_on - target: - entity_id: "media_player.badezimmer" + - action: media_player.turn_on + target: + entity_id: "media_player.badezimmer" ``` ## Screenshots: diff --git a/source/_integrations/geniushub.markdown b/source/_integrations/geniushub.markdown index 531af459e16..58d1c8413ae 100644 --- a/source/_integrations/geniushub.markdown +++ b/source/_integrations/geniushub.markdown @@ -92,16 +92,16 @@ Each such entity has a state attribute that will contain a list of any such issu ```yaml - alias: "GeniusHub Error Alerts" triggers: - trigger: numeric_state - entity_id: sensor.geniushub_errors - above: 0 + - trigger: numeric_state + entity_id: sensor.geniushub_errors + above: 0 actions: - - action: notify.pushbullet_notifier - data: - title: "Genius Hub has errors" - message: >- - Genius Hub has the following {{ states('sensor.geniushub_errors') }} errors: - {{ state_attr('sensor.geniushub_errors', 'error_list') }} + - action: notify.pushbullet_notifier + data: + title: "Genius Hub has errors" + message: >- + Genius Hub has the following {{ states('sensor.geniushub_errors') }} errors: + {{ state_attr('sensor.geniushub_errors', 'error_list') }} ``` {% endraw %} @@ -113,15 +113,15 @@ This alert may be useful to see if the CH is being turned on whilst you're on a ```yaml - alias: "GeniusHub CH State Change Alert" triggers: - trigger: state - entity_id: binary_sensor.dual_channel_receiver_2_1 + - trigger: state + entity_id: binary_sensor.dual_channel_receiver_2_1 actions: - - action: notify.pushbullet_notifier - data: - title: "Warning: CH State Change!" - message: >- - {{ trigger.to_state.attributes.friendly_name }} has changed - from {{ trigger.from_state.state }} to {{ trigger.to_state.state }}. + - action: notify.pushbullet_notifier + data: + title: "Warning: CH State Change!" + message: >- + {{ trigger.to_state.attributes.friendly_name }} has changed + from {{ trigger.from_state.state }} to {{ trigger.to_state.state }}. ``` {% endraw %} diff --git a/source/_integrations/geo_location.markdown b/source/_integrations/geo_location.markdown index 11fc94c6970..105e8a2aed6 100644 --- a/source/_integrations/geo_location.markdown +++ b/source/_integrations/geo_location.markdown @@ -57,13 +57,13 @@ zone: automation: - alias: "Bush Fire Alert" triggers: - trigger: geo_location - source: nsw_rural_fire_service_feed - zone: zone.bush_fire_alert_zone - event: enter + - trigger: geo_location + source: nsw_rural_fire_service_feed + zone: zone.bush_fire_alert_zone + event: enter conditions: - condition: template - value_template: "{{ trigger.to_state.attributes.type == 'Bush Fire' }}" + - condition: template + value_template: "{{ trigger.to_state.attributes.type == 'Bush Fire' }}" actions: - action: persistent_notification.create data: diff --git a/source/_integrations/google_travel_time.markdown b/source/_integrations/google_travel_time.markdown index b6975b70dc8..0d844ccd1fb 100644 --- a/source/_integrations/google_travel_time.markdown +++ b/source/_integrations/google_travel_time.markdown @@ -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 diff --git a/source/_integrations/harmony.markdown b/source/_integrations/harmony.markdown index 57e696151ca..cb02f63214d 100644 --- a/source/_integrations/harmony.markdown +++ b/source/_integrations/harmony.markdown @@ -206,26 +206,26 @@ The example below shows how to control an `input_boolean` switch using the Harmo automation: - alias: "Watch TV started from harmony hub" triggers: - trigger: state - entity_id: remote.family_room + - trigger: state + entity_id: remote.family_room conditions: - condition: template - value_template: '{{ trigger.to_state.attributes.current_activity == "Kodi" }}' + - condition: template + value_template: '{{ trigger.to_state.attributes.current_activity == "Kodi" }}' actions: - action: input_boolean.turn_on - target: - entity_id: input_boolean.notify + - action: input_boolean.turn_on + target: + entity_id: input_boolean.notify - alias: "PowerOff started from harmony hub" triggers: - trigger: state - entity_id: remote.family_room + - trigger: state + entity_id: remote.family_room conditions: - condition: template - value_template: '{{ trigger.to_state.attributes.current_activity == "PowerOff" }}' + - condition: template + value_template: '{{ trigger.to_state.attributes.current_activity == "PowerOff" }}' actions: - action: input_boolean.turn_off - target: - entity_id: input_boolean.notify + - action: input_boolean.turn_off + target: + entity_id: input_boolean.notify ``` {% endraw %} diff --git a/source/_integrations/hdmi_cec.markdown b/source/_integrations/hdmi_cec.markdown index 9c93c7f45a8..b069195b830 100644 --- a/source/_integrations/hdmi_cec.markdown +++ b/source/_integrations/hdmi_cec.markdown @@ -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 diff --git a/source/_integrations/here_travel_time.markdown b/source/_integrations/here_travel_time.markdown index 24cced670c7..22f420aaa82 100644 --- a/source/_integrations/here_travel_time.markdown +++ b/source/_integrations/here_travel_time.markdown @@ -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 diff --git a/source/_integrations/homeassistant.markdown b/source/_integrations/homeassistant.markdown index 24122d649c9..96260028206 100644 --- a/source/_integrations/homeassistant.markdown +++ b/source/_integrations/homeassistant.markdown @@ -314,11 +314,11 @@ Update the location of the Home Assistant default zone (usually "Home"). ```yaml actions: - action: homeassistant.set_location - data: - latitude: 32.87336 - longitude: 117.22743 - elevation: 120 + - action: homeassistant.set_location + data: + latitude: 32.87336 + longitude: 117.22743 + elevation: 120 ``` ### Action `homeassistant.toggle` @@ -336,11 +336,11 @@ for example, a light and a switch can be toggled in a single action. ```yaml actions: - action: homeassistant.toggle - target: - entity_id: - - light.living_room - - switch.tv + - action: homeassistant.toggle + target: + entity_id: + - light.living_room + - switch.tv ``` ### Action `homeassistant.turn_on` @@ -358,11 +358,11 @@ for example, a light and a switch can be turned on in a single action. ```yaml actions: - action: homeassistant.turn_on - target: - entity_id: - - light.living_room - - switch.tv + - action: homeassistant.turn_on + target: + entity_id: + - light.living_room + - switch.tv ``` ### Action `homeassistant.turn_off` @@ -380,11 +380,11 @@ for example, a light and a switch can be turned off in a single action. ```yaml actions: - action: homeassistant.turn_off - target: - entity_id: - - light.living_room - - switch.tv + - action: homeassistant.turn_off + target: + entity_id: + - light.living_room + - switch.tv ``` ### Action `homeassistant.update_entity` @@ -399,11 +399,11 @@ Force one or more entities to update its data rather than wait for the next sche ```yaml actions: - action: homeassistant.update_entity - target: - entity_id: - - light.living_room - - switch.coffe_pot + - action: homeassistant.update_entity + target: + entity_id: + - light.living_room + - switch.coffe_pot ``` ### Action `homeassistant.save_persistent_states` diff --git a/source/_integrations/homekit.markdown b/source/_integrations/homekit.markdown index fec6b2c8fcb..4551f8e3584 100644 --- a/source/_integrations/homekit.markdown +++ b/source/_integrations/homekit.markdown @@ -455,16 +455,16 @@ The key name will be available in the event data in the `key_name` field. Exampl ```yaml automation: triggers: - trigger: event - event_type: homekit_tv_remote_key_pressed - event_data: - key_name: arrow_right + - trigger: event + event_type: homekit_tv_remote_key_pressed + event_data: + key_name: arrow_right # Send the arrow right key via a broadlink IR blaster actions: - action: broadlink.send - host: 192.168.1.55 - packet: XXXXXXXX + - action: broadlink.send + host: 192.168.1.55 + packet: XXXXXXXX ``` ## Events diff --git a/source/_integrations/homematic.markdown b/source/_integrations/homematic.markdown index 1b090589362..dcbe79985e4 100644 --- a/source/_integrations/homematic.markdown +++ b/source/_integrations/homematic.markdown @@ -252,17 +252,17 @@ Here's an example of how to use these events for automations: ```yaml automation: - triggers: - trigger: event - event_type: homematic.keypress - event_data: - name: "Kitchen Switch" - channel: 1 - param: PRESS_SHORT - actions: - action: switch.turn_on - target: - entity_id: switch.Kitchen_Ambience + triggers: + - trigger: event + event_type: homematic.keypress + event_data: + name: "Kitchen Switch" + channel: 1 + param: PRESS_SHORT + actions: + - action: switch.turn_on + target: + entity_id: switch.Kitchen_Ambience ``` The channel parameter is equal to the channel of the button you are configuring the automation for. You can view the available channels in the UI you use to pair your devices. @@ -307,11 +307,11 @@ Simulate a button being pressed: ```yaml ... actions: - action: homematic.virtualkey - data: - address: "BidCoS-RF" - channel: 1 - param: PRESS_LONG + - action: homematic.virtualkey + data: + address: "BidCoS-RF" + channel: 1 + param: PRESS_LONG ``` Open KeyMatic: @@ -319,11 +319,11 @@ Open KeyMatic: ```yaml ... actions: - action: homematic.virtualkey - data: - address: "LEQ1234567" - channel: 1 - param: OPEN + - action: homematic.virtualkey + data: + address: "LEQ1234567" + channel: 1 + param: OPEN ``` Set boolean variable to true: @@ -331,12 +331,12 @@ Set boolean variable to true: ```yaml ... actions: - action: homematic.set_variable_value - target: - entity_id: homematic.ccu2 - data: - name: "Variablename" - value: true + - action: homematic.set_variable_value + target: + entity_id: homematic.ccu2 + data: + name: "Variablename" + value: true ``` #### Advanced examples @@ -349,12 +349,12 @@ Manually turn on a switch actor: ```yaml ... actions: - action: homematic.set_device_value - data: - address: "LEQ1234567" - channel: 1 - param: STATE - value: true + - action: homematic.set_device_value + data: + address: "LEQ1234567" + channel: 1 + param: STATE + value: true ``` Manually set temperature on thermostat: @@ -362,12 +362,12 @@ Manually set temperature on thermostat: ```yaml ... actions: - action: homematic.set_device_value - data: - address: "LEQ1234567" - channel: 4 - param: SET_TEMPERATURE - value: 23.0 + - action: homematic.set_device_value + data: + address: "LEQ1234567" + channel: 4 + param: SET_TEMPERATURE + value: 23.0 ``` Manually set the active profile on thermostat: @@ -375,13 +375,13 @@ Manually set the active profile on thermostat: ```yaml ... actions: - action: homematic.set_device_value - data: - address: "LEQ1234567" - channel: 1 - param: ACTIVE_PROFILE - value: 1 - value_type: int + - action: homematic.set_device_value + data: + address: "LEQ1234567" + channel: 1 + param: ACTIVE_PROFILE + value: 1 + value_type: int ``` Set the week program of a wall thermostat: @@ -389,13 +389,13 @@ Set the week program of a wall thermostat: ```yaml ... actions: - action: homematic.put_paramset - data: - interface: wireless - address: "LEQ1234567" - paramset_key: MASTER - paramset: - WEEK_PROGRAM_POINTER: 1 + - action: homematic.put_paramset + data: + interface: wireless + address: "LEQ1234567" + paramset_key: MASTER + paramset: + WEEK_PROGRAM_POINTER: 1 ``` Set the week program of a wall thermostat with explicit `rx_mode` (BidCos-RF only): @@ -403,14 +403,14 @@ Set the week program of a wall thermostat with explicit `rx_mode` (BidCos-RF onl ```yaml ... actions: - action: homematic.put_paramset - data: - interface: wireless - address: "LEQ1234567" - paramset_key: MASTER - rx_mode: WAKEUP - paramset: - WEEK_PROGRAM_POINTER: 1 + - action: homematic.put_paramset + data: + interface: wireless + address: "LEQ1234567" + paramset_key: MASTER + rx_mode: WAKEUP + paramset: + WEEK_PROGRAM_POINTER: 1 ``` BidCos-RF devices have an optional parameter for put_paramset which defines the way the configuration data is sent to the device. @@ -424,9 +424,9 @@ Manually set lock on KeyMatic devices: ```yaml ... actions: - action: lock.lock - target: - entity_id: lock.leq1234567 + - action: lock.lock + target: + entity_id: lock.leq1234567 ``` Manually set unlock on KeyMatic devices: @@ -434,9 +434,9 @@ Manually set unlock on KeyMatic devices: ```yaml ... actions: - action: lock.unlock - target: - entity_id: lock.leq1234567 + - action: lock.unlock + target: + entity_id: lock.leq1234567 ``` @@ -489,12 +489,12 @@ template: automation: - alias: "Homematic Reconnect" triggers: - trigger: state - entity_id: binary_sensor.homematic_is_sending_updates - to: "off" + - trigger: state + entity_id: binary_sensor.homematic_is_sending_updates + to: "off" actions: # Reconnect, if sensor has not been updated for over 10 minutes - action: homematic.reconnect + - action: homematic.reconnect ``` {% endraw %} @@ -535,10 +535,10 @@ automation: automation: - alias: "Homematic CCU Reboot" triggers: - trigger: state - entity_id: sensor.v_last_reboot + - trigger: state + entity_id: sensor.v_last_reboot actions: - action: homematic.reconnect + - action: homematic.reconnect ``` ## Notifications diff --git a/source/_integrations/homematicip_cloud.markdown b/source/_integrations/homematicip_cloud.markdown index 034e55c47cb..69251181372 100644 --- a/source/_integrations/homematicip_cloud.markdown +++ b/source/_integrations/homematicip_cloud.markdown @@ -235,10 +235,10 @@ Activate eco mode with duration. ```yaml ... actions: - action: homematicip_cloud.activate_eco_mode_with_duration - data: - duration: 60 - accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx + - action: homematicip_cloud.activate_eco_mode_with_duration + data: + duration: 60 + accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx ``` Activate eco mode with period. @@ -246,10 +246,10 @@ Activate eco mode with period. ```yaml ... actions: - action: homematicip_cloud.activate_eco_mode_with_period - data: - endtime: 2019-09-17 18:00 - accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx + - action: homematicip_cloud.activate_eco_mode_with_period + data: + endtime: 2019-09-17 18:00 + accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx ``` Activates the vacation mode until the given time. @@ -257,11 +257,11 @@ Activates the vacation mode until the given time. ```yaml ... actions: - action: homematicip_cloud.activate_vacation - data: - endtime: 2019-09-17 18:00 - temperature: 18.5 - accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx + - action: homematicip_cloud.activate_vacation + data: + endtime: 2019-09-17 18:00 + temperature: 18.5 + accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx ``` Deactivates the eco mode immediately. @@ -269,9 +269,9 @@ Deactivates the eco mode immediately. ```yaml ... actions: - action: homematicip_cloud.deactivate_eco_mode - data: - accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx + - action: homematicip_cloud.deactivate_eco_mode + data: + accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx ``` Deactivates the vacation mode immediately. @@ -279,9 +279,9 @@ Deactivates the vacation mode immediately. ```yaml ... actions: - action: homematicip_cloud.deactivate_vacation - data: - accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx + - action: homematicip_cloud.deactivate_vacation + data: + accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx ``` Set the active climate profile index. @@ -292,11 +292,11 @@ You can get the required index from the native Homematic IP App. ```yaml ... actions: - action: homematicip_cloud.set_active_climate_profile - target: - entity_id: climate.livingroom - data: - climate_profile_index: 1 + - action: homematicip_cloud.set_active_climate_profile + target: + entity_id: climate.livingroom + data: + climate_profile_index: 1 ``` Dump the configuration of the Homematic IP Access Point(s). @@ -304,9 +304,9 @@ Dump the configuration of the Homematic IP Access Point(s). ```yaml ... actions: - action: homematicip_cloud.dump_hap_config - data: - anonymize: True + - action: homematicip_cloud.dump_hap_config + data: + anonymize: True ``` Reset energy counter of measuring actuators. @@ -314,9 +314,9 @@ Reset energy counter of measuring actuators. ```yaml ... actions: - action: homematicip_cloud.reset_energy_counter - target: - entity_id: switch.livingroom + - action: homematicip_cloud.reset_energy_counter + target: + entity_id: switch.livingroom ``` Enable (or disable) Cooling mode for the entire home. Disabling Cooling mode will revert to Heating. @@ -324,10 +324,10 @@ Enable (or disable) Cooling mode for the entire home. Disabling Cooling mode wil ```yaml ... actions: - action: homematicip_cloud.set_home_cooling_mode - data: - cooling: True - accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx + - action: homematicip_cloud.set_home_cooling_mode + data: + cooling: True + accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx ``` ## Additional info diff --git a/source/_integrations/html5.markdown b/source/_integrations/html5.markdown index 6a033bff793..b1c425cb28e 100644 --- a/source/_integrations/html5.markdown +++ b/source/_integrations/html5.markdown @@ -113,11 +113,11 @@ Example of adding a tag to your notification. This won't create new notification - trigger: state entity_id: sensor.sensor actions: - action: notify.html5 - data: - message: "Last known sensor state is {{ states('sensor.sensor') }}." + - action: notify.html5 data: - tag: "notification-about-sensor" + message: "Last known sensor state is {{ states('sensor.sensor') }}." + data: + tag: "notification-about-sensor" ``` {% endraw %} @@ -210,8 +210,8 @@ notification is received on the device. ```yaml - alias: "HTML5 push notification received and displayed on device" triggers: - trigger: event - event_type: html5_notification.received + - trigger: event + event_type: html5_notification.received ``` #### clicked event @@ -221,8 +221,8 @@ You will receive an event named `html5_notification.clicked` when the notificati ```yaml - alias: "HTML5 push notification clicked" triggers: - trigger: event - event_type: html5_notification.clicked + - trigger: event + event_type: html5_notification.clicked ``` or @@ -230,10 +230,10 @@ or ```yaml - alias: "HTML5 push notification action button clicked" triggers: - trigger: event - event_type: html5_notification.clicked - event_data: - action: open_door + - trigger: event + event_type: html5_notification.clicked + event_data: + action: open_door ``` #### closed event @@ -243,8 +243,8 @@ You will receive an event named `html5_notification.closed` when the notificatio ```yaml - alias: "HTML5 push notification clicked" triggers: - trigger: event - event_type: html5_notification.closed + - trigger: event + event_type: html5_notification.closed ``` ### Making notifications work with NGINX proxy diff --git a/source/_integrations/hunterdouglas_powerview.markdown b/source/_integrations/hunterdouglas_powerview.markdown index 91e10d4e7a0..aed1a853045 100644 --- a/source/_integrations/hunterdouglas_powerview.markdown +++ b/source/_integrations/hunterdouglas_powerview.markdown @@ -225,8 +225,8 @@ Velocity controls the speed of the shade. The default speed from Hunter Douglas ``` yaml alias: "Blinds closed at night" triggers: - trigger: time - at: "18:00:00" + - trigger: time + at: "18:00:00" actions: - action: scene.turn_on target: @@ -238,12 +238,11 @@ actions: This automation is not recommended for battery-powered shades. ``` yaml -alias: Force Update -description: 'Update the position of defined shades' -mode: single +alias: "Force Update" +description: "Update the position of defined shades" triggers: - trigger: time_pattern - hours: '1' + hours: 1 actions: - action: homeassistant.update_entity target: diff --git a/source/_integrations/hyperion.markdown b/source/_integrations/hyperion.markdown index 83a48592d39..98a6ff2689a 100644 --- a/source/_integrations/hyperion.markdown +++ b/source/_integrations/hyperion.markdown @@ -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 diff --git a/source/_integrations/ibeacon.markdown b/source/_integrations/ibeacon.markdown index af7636f0263..144b549696a 100644 --- a/source/_integrations/ibeacon.markdown +++ b/source/_integrations/ibeacon.markdown @@ -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 diff --git a/source/_integrations/ifttt.markdown b/source/_integrations/ifttt.markdown index 346a1acc6e1..065c535ca09 100644 --- a/source/_integrations/ifttt.markdown +++ b/source/_integrations/ifttt.markdown @@ -36,18 +36,16 @@ You then need to consume that incoming information with the following automation ```yaml automation: -- id: this_is_the_automation_id - alias: "The optional automation alias" +- alias: "The optional automation alias" triggers: - - trigger: event - event_type: ifttt_webhook_received - event_data: - action: call_service # the same action 'name' you used in the Body section of the IFTTT recipe - conditions: + - trigger: event + event_type: ifttt_webhook_received + event_data: + action: call_service # the same action 'name' you used in the Body section of the IFTTT recipe actions: - - action: '{{ trigger.event.data.service }}' - target: - entity_id: '{{ trigger.event.data.entity_id }}' + - action: '{{ trigger.event.data.service }}' + target: + entity_id: '{{ trigger.event.data.entity_id }}' ``` @@ -144,11 +142,11 @@ Add the *Then That* action. The below example sends a notification to the IFTTT automation: alias: "Startup Notification" triggers: - trigger: homeassistant - event: start + - trigger: homeassistant + event: start actions: - action: ifttt.trigger - data: {"event":"TestHA_Trigger", "value1":"Hello World!"} + - action: ifttt.trigger + data: {"event":"TestHA_Trigger", "value1":"Hello World!"} ``` {% endraw %} @@ -162,14 +160,14 @@ IFTTT can also be used in scripts and with templates. Here is the above automati automation: alias: "Startup Notification" triggers: - trigger: homeassistant - event: start + - trigger: homeassistant + event: start actions: - action: script.ifttt_notify - data: - value1: "HA Status:" - value2: "{{ trigger.event.data.entity_id.split('_')[1] }} is " - value3: "{{ trigger.event.data.to_state.state }}" + - action: script.ifttt_notify + data: + value1: "HA Status:" + value2: "{{ trigger.event.data.entity_id.split('_')[1] }} is " + value3: "{{ trigger.event.data.to_state.state }}" ``` {% endraw %} diff --git a/source/_integrations/image_processing.markdown b/source/_integrations/image_processing.markdown index bf4dbed8d0d..799f1e18d9f 100644 --- a/source/_integrations/image_processing.markdown +++ b/source/_integrations/image_processing.markdown @@ -35,11 +35,11 @@ The `found_plate` event is triggered after OpenALPR has found a new license plat automation: - alias: "Open garage door" triggers: - trigger: event - event_type: image_processing.found_plate - event_data: - entity_id: openalpr.camera_garage_1 - plate: BE2183423 + - trigger: event + event_type: image_processing.found_plate + event_data: + entity_id: openalpr.camera_garage_1 + plate: BE2183423 ... ``` @@ -56,11 +56,11 @@ The `detect_face` event is triggered after a Face entity has found a face. automation: - alias: "Known person in front of my door" triggers: - trigger: event - event_type: image_processing.detect_face - event_data: - entity_id: image_processing.door - name: "Hans Maier" + - trigger: event + event_type: image_processing.detect_face + event_data: + entity_id: image_processing.door + name: "Hans Maier" ... ``` diff --git a/source/_integrations/imap.markdown b/source/_integrations/imap.markdown index 595199419a6..c1403b4e91d 100644 --- a/source/_integrations/imap.markdown +++ b/source/_integrations/imap.markdown @@ -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 %} diff --git a/source/_integrations/incomfort.markdown b/source/_integrations/incomfort.markdown index e07c7c088a5..f35e7fe3184 100644 --- a/source/_integrations/incomfort.markdown +++ b/source/_integrations/incomfort.markdown @@ -49,16 +49,16 @@ To send an alert if the CV pressure is too low or too high, consider the followi ```yaml - alias: "Low CV Pressure Alert" triggers: - trigger: numeric_state - entity_id: sensor.cv_pressure - below: 1.0 + - trigger: numeric_state + entity_id: sensor.cv_pressure + below: 1.0 actions: - - action: notify.pushbullet_notifier - data: - title: "Warning: Low CH Pressure" - message: >- - {{ trigger.to_state.attributes.friendly_name }} - is low, {{ trigger.to_state.state }} bar. + - action: notify.pushbullet_notifier + data: + title: "Warning: Low CH Pressure" + message: >- + {{ trigger.to_state.attributes.friendly_name }} + is low, {{ trigger.to_state.state }} bar. ``` {% endraw %} diff --git a/source/_integrations/input_datetime.markdown b/source/_integrations/input_datetime.markdown index 55947610956..cffda094677 100644 --- a/source/_integrations/input_datetime.markdown +++ b/source/_integrations/input_datetime.markdown @@ -118,12 +118,12 @@ automation: # Turns on bedroom light at the time specified. automation: triggers: - trigger: time - at: input_datetime.bedroom_alarm_clock_time + - trigger: time + at: input_datetime.bedroom_alarm_clock_time actions: - action: light.turn_on - target: - entity_id: light.bedroom + - action: light.turn_on + target: + entity_id: light.bedroom ``` To dynamically set the `input_datetime` you can call diff --git a/source/_integrations/input_number.markdown b/source/_integrations/input_number.markdown index ba1e4c4cc26..56fb95be037 100644 --- a/source/_integrations/input_number.markdown +++ b/source/_integrations/input_number.markdown @@ -125,11 +125,12 @@ input_number: min: 0 max: 254 step: 1 + automation: - alias: "Bedroom Light - Adjust Brightness" triggers: - trigger: state - entity_id: input_number.bedroom_brightness + - trigger: state + entity_id: input_number.bedroom_brightness actions: - action: light.turn_on target: @@ -157,6 +158,7 @@ input_select: - Relax - 'OFF' initial: "Select" + input_number: bedroom_brightness: name: Brightness @@ -164,12 +166,13 @@ input_number: min: 0 max: 254 step: 1 + automation: - alias: "Bedroom Light - Custom" triggers: - trigger: state - entity_id: input_select.scene_bedroom - to: CUSTOM + - trigger: state + entity_id: input_select.scene_bedroom + to: "CUSTOM" actions: - action: light.turn_on target: @@ -200,27 +203,27 @@ input_number: automation: - alias: "Set temp slider" triggers: - trigger: mqtt - topic: "setTemperature" + - trigger: mqtt + topic: "setTemperature" actions: - action: input_number.set_value - target: - entity_id: input_number.target_temp - data: - value: "{{ trigger.payload }}" + - action: input_number.set_value + target: + entity_id: input_number.target_temp + data: + value: "{{ trigger.payload }}" # This second automation script runs when the target temperature slider is moved. # It publishes its value to the same MQTT topic it is also subscribed to. - alias: "Temp slider moved" triggers: - trigger: state - entity_id: input_number.target_temp + - trigger: state + entity_id: input_number.target_temp actions: - action: mqtt.publish - data: - topic: "setTemperature" - retain: true - payload: "{{ states('input_number.target_temp') | int }}" + - action: mqtt.publish + data: + topic: "setTemperature" + retain: true + payload: "{{ states('input_number.target_temp') | int }}" ``` {% endraw %} @@ -249,16 +252,16 @@ input_number: step: 10 automation: - - alias: "turn something off after x time after turning it on" - triggers: - trigger: state - entity_id: switch.something - to: "on" - actions: - - delay: "00:{{ states('input_number.minutes') | int }}:{{ states('input_number.seconds') | int }}" - - action: switch.turn_off - target: - entity_id: switch.something + - alias: "turn something off after x time after turning it on" + triggers: + - trigger: state + entity_id: switch.something + to: "on" + actions: + - delay: "00:{{ states('input_number.minutes') | int }}:{{ states('input_number.seconds') | int }}" + - action: switch.turn_off + target: + entity_id: switch.something ``` {% endraw %} diff --git a/source/_integrations/input_select.markdown b/source/_integrations/input_select.markdown index 30c253bedfc..a31e21b2602 100644 --- a/source/_integrations/input_select.markdown +++ b/source/_integrations/input_select.markdown @@ -136,14 +136,14 @@ The following example shows the usage of the `input_select.select_option` action automation: - alias: "example automation" triggers: - trigger: event - event_type: MY_CUSTOM_EVENT + - trigger: event + event_type: MY_CUSTOM_EVENT actions: - action: input_select.select_option target: entity_id: input_select.who_cooks data: - option: Paulus + option: "Paulus" ``` To dynamically set the `input_select` options you can call `input_select.set_options` in an automation: @@ -153,8 +153,8 @@ To dynamically set the `input_select` options you can call `input_select.set_opt automation: - alias: "example automation" triggers: - trigger: event - event_type: MY_CUSTOM_EVENT + - trigger: event + event_type: MY_CUSTOM_EVENT actions: - action: input_select.set_options target: @@ -186,28 +186,28 @@ input_select: # It sets the value selector on the GUI. This selector also had its own automation when the value is changed. - alias: "Set Thermostat Mode Selector" triggers: - trigger: mqtt - topic: "thermostatMode" + - trigger: mqtt + topic: "thermostatMode" # entity_id: input_select.thermostat_mode actions: - action: input_select.select_option - target: - entity_id: input_select.thermostat_mode - data: - option: "{{ trigger.payload }}" + - action: input_select.select_option + target: + entity_id: input_select.thermostat_mode + data: + option: "{{ trigger.payload }}" # This automation script runs when the thermostat mode selector is changed. # It publishes its value to the same MQTT topic it is also subscribed to. - alias: "Set Thermostat Mode" triggers: - trigger: state - entity_id: input_select.thermostat_mode + - trigger: state + entity_id: input_select.thermostat_mode actions: - action: mqtt.publish - data: - topic: "thermostatMode" - retain: true - payload: "{{ states('input_select.thermostat_mode') }}" + - action: mqtt.publish + data: + topic: "thermostatMode" + retain: true + payload: "{{ states('input_select.thermostat_mode') }}" ``` {% endraw %} diff --git a/source/_integrations/input_text.markdown b/source/_integrations/input_text.markdown index eb2b9f528ca..737e796618b 100644 --- a/source/_integrations/input_text.markdown +++ b/source/_integrations/input_text.markdown @@ -130,8 +130,8 @@ input_text: automation: - alias: "Bedroom Light - Custom" triggers: - trigger: state - entity_id: input_select.scene_bedroom + - trigger: state + entity_id: input_select.scene_bedroom actions: - action: input_text.set_value target: diff --git a/source/_integrations/insteon.markdown b/source/_integrations/insteon.markdown index aa430a97b7a..2a39cf79d74 100644 --- a/source/_integrations/insteon.markdown +++ b/source/_integrations/insteon.markdown @@ -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 diff --git a/source/_integrations/isy994.markdown b/source/_integrations/isy994.markdown index a4b0d742724..af81c6740a3 100644 --- a/source/_integrations/isy994.markdown +++ b/source/_integrations/isy994.markdown @@ -93,19 +93,19 @@ A Home Assistant `isy994_control` event is emitted for every "control" event in automation: - alias: "turn off living room on double tap lightswitch" triggers: - trigger: event - event_type: isy994_control - event_data: - entity_id: light.lr_track_lights_front - control: "DFON" - value: 255 - formatted: "On" - uom: "100" - prec: "0" + - trigger: event + event_type: isy994_control + event_data: + entity_id: light.lr_track_lights_front + control: "DFON" + value: 255 + formatted: "On" + uom: "100" + prec: "0" actions: - action: light.turn_off - target: - entity_id: light.lr_track_lights_rear + - action: light.turn_off + target: + entity_id: light.lr_track_lights_rear ``` All `isy994_control` events will have an `entity_id` and `control` parameter in its `event_data`. You'll need to refer to ISY documentation for the list of every possible control type, but the common ones are: diff --git a/source/_integrations/kaleidescape.markdown b/source/_integrations/kaleidescape.markdown index 51abfe8c939..835a7145b88 100644 --- a/source/_integrations/kaleidescape.markdown +++ b/source/_integrations/kaleidescape.markdown @@ -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 diff --git a/source/_integrations/keyboard_remote.markdown b/source/_integrations/keyboard_remote.markdown index 8543001ee7a..ed02e3db7ba 100644 --- a/source/_integrations/keyboard_remote.markdown +++ b/source/_integrations/keyboard_remote.markdown @@ -94,17 +94,17 @@ And an automation rule to breathe life into it: automation: alias: "Keyboard all lights on" triggers: - trigger: event - event_type: keyboard_remote_command_received - event_data: - device_descriptor: "/dev/input/event0" - key_code: 107 # inspect log to obtain desired keycode - type: key_down # only trigger on key_down events (optional) + - trigger: event + event_type: keyboard_remote_command_received + event_data: + device_descriptor: "/dev/input/event0" + key_code: 107 # inspect log to obtain desired keycode + type: key_down # only trigger on key_down events (optional) actions: - action: light.turn_on - target: - entity_id: light.all + - action: light.turn_on + target: + entity_id: light.all ``` `device_descriptor` or `device_name` may be specified in the trigger so the automation will be fired only for that keyboard. This is especially useful if you wish to use several Bluetooth remotes to control different devices. Omit them to ensure the same key triggers the automation for all keyboards/remotes. @@ -125,8 +125,8 @@ Here's an automation example that plays a sound through a media player whenever automation: - alias: "Keyboard Connected" triggers: - trigger: event - event_type: keyboard_remote_connected + - trigger: event + event_type: keyboard_remote_connected actions: - action: media_player.play_media target: @@ -137,10 +137,10 @@ automation: - alias: "Bluetooth Keyboard Disconnected" triggers: - trigger: event - event_type: keyboard_remote_disconnected - event_data: - device_name: "00:58:56:4C:C0:91" + - trigger: event + event_type: keyboard_remote_disconnected + event_data: + device_name: "00:58:56:4C:C0:91" actions: - action: media_player.play_media target: diff --git a/source/_integrations/kira.markdown b/source/_integrations/kira.markdown index 96baf890a74..321651c244e 100644 --- a/source/_integrations/kira.markdown +++ b/source/_integrations/kira.markdown @@ -208,32 +208,29 @@ Example automation using these IR codes to toggle a Sonoff plug. ```yaml # Example kira_sensor -- id: "1583339338363" - alias: "Panasonic On" - description: Turn on sonoff s20 relay +- alias: "Panasonic on" + description: "Turn on sonoff s20 relay" triggers: - - entity_id: sensor.kira_wireless - trigger: state - to: PanaOne - conditions: [] + - trigger: state + entity_id: sensor.kira_wireless + to: "PanaOne" actions: - - device_id: 3628b4f34df943b3b721ead954cf3ca7 - domain: switch - entity_id: switch.plug2_relay - type: turn_on -- id: "1584035716024" - alias: "Panaxonic Off " - description: Turn off sonoff s20 relay + - device_id: 3628b4f34df943b3b721ead954cf3ca7 + domain: switch + entity_id: switch.plug2_relay + type: turn_on + +- alias: "Panaxonic off" + description: "Turn off sonoff s20 relay" triggers: - - entity_id: sensor.kira_wireless - trigger: state - to: PanaTwo - conditions: [] + - trigger: state + entity_id: sensor.kira_wireless + to: "PanaTwo" actions: - - device_id: 3628b4f34df943b3b721ead954cf3ca7 - domain: switch - entity_id: switch.plug2_relay - type: turn_off + - device_id: 3628b4f34df943b3b721ead954cf3ca7 + domain: switch + entity_id: switch.plug2_relay + type: turn_off ``` ### Code types diff --git a/source/_integrations/knx.markdown b/source/_integrations/knx.markdown index 7803330654f..c65ab302bdb 100644 --- a/source/_integrations/knx.markdown +++ b/source/_integrations/knx.markdown @@ -241,16 +241,14 @@ Example automation configuration {% raw %} ```yaml -- alias: Single group address trigger - description: '' +- alias: "Single group address trigger" triggers: - - trigger: knx.telegram - destination: 1/2/3 - group_value_read: false - outgoing: false + - trigger: knx.telegram + destination: 1/2/3 + group_value_read: false + outgoing: false conditions: "{{ trigger.value == 0 }}" - action: [] - mode: single + actions: [] ``` {% endraw %} @@ -352,7 +350,7 @@ response: ```yaml # Example script to send a fixed value and the state of an entity -alias: My Script +alias: "My Script" sequence: - action: knx.send data: @@ -623,33 +621,36 @@ Let's pretend you have a binary sensor with the name `Livingroom.Switch` and you # Example automation.yaml entry automation: - triggers: - trigger: numeric_state - entity_id: binary_sensor.livingroom_switch - attribute: counter - above: 0 - below: 2 - condition: + - trigger: numeric_state + entity_id: binary_sensor.livingroom_switch + attribute: counter + above: 0 + below: 2 + condition: - condition: state entity_id: binary_sensor.cover_abstell state: "on" actions: - - entity_id: light.hue_color_lamp_1 - action: light.turn_on + - action: light.turn_on + entity_id: light.hue_color_lamp_1 + - triggers: - trigger: numeric_state - entity_id: binary_sensor.livingroom_switch - attribute: counter - above: 1 - below: 3 + - trigger: numeric_state + entity_id: binary_sensor.livingroom_switch + attribute: counter + above: 1 + below: 3 conditions: - condition: state entity_id: binary_sensor.cover_abstell state: "on" actions: - - entity_id: light.hue_bloom_1 - action: homeassistant.turn_on - - entity_id: light.hue_bloom_2 - action: homeassistant.turn_on + - action: light.turn_on + target: + entity_id: + - light.hue_bloom_1 + - light.hue_bloom_2 + ``` {% configuration %} diff --git a/source/_integrations/kodi.markdown b/source/_integrations/kodi.markdown index 45e7bba2cdb..6244048b0f1 100644 --- a/source/_integrations/kodi.markdown +++ b/source/_integrations/kodi.markdown @@ -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 diff --git a/source/_integrations/lametric.markdown b/source/_integrations/lametric.markdown index b8ef5b65509..cf052229617 100644 --- a/source/_integrations/lametric.markdown +++ b/source/_integrations/lametric.markdown @@ -165,20 +165,20 @@ To add a notification sound, icon, cycles, or priority override, ```yaml - alias: "Send notification on arrival at school" triggers: - trigger: state - entity_id: device_tracker.tom_mobile - from: "not_home" - to: "school" + - trigger: state + entity_id: device_tracker.tom_mobile + from: "not_home" + to: "school" actions: - action: notify.my_lametric - data: - message: "Tom has arrived at school!" + - action: notify.my_lametric data: - sound: "notification" - icon: "51" - cycles: 0 - priority: "critical" - icon_type: "info" + message: "Tom has arrived at school!" + data: + sound: "notification" + icon: "51" + cycles: 0 + priority: "critical" + icon_type: "info" ``` ## List of notification sounds diff --git a/source/_integrations/lcn.markdown b/source/_integrations/lcn.markdown index 6ebef5218c5..aae0d7d856b 100644 --- a/source/_integrations/lcn.markdown +++ b/source/_integrations/lcn.markdown @@ -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: ... ``` diff --git a/source/_integrations/light.markdown b/source/_integrations/light.markdown index ff9a357f75f..ed2824aee6f 100644 --- a/source/_integrations/light.markdown +++ b/source/_integrations/light.markdown @@ -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: diff --git a/source/_integrations/lirc.markdown b/source/_integrations/lirc.markdown index 8d61c5c4ae0..97ed4511e90 100644 --- a/source/_integrations/lirc.markdown +++ b/source/_integrations/lirc.markdown @@ -85,14 +85,14 @@ The LIRC integration fires `ir_command_received` events on the bus. You can capt automation: - alias: "Off on Remote" triggers: - trigger: event - event_type: ir_command_received - event_data: - button_name: KEY_0 + - trigger: event + event_type: ir_command_received + event_data: + button_name: KEY_0 actions: - action: homeassistant.turn_off - target: - entity_id: group.a_lights + - action: homeassistant.turn_off + target: + entity_id: group.a_lights ``` The `button_name` data values (e.g., `KEY_0`) are set by you in the `.lircrc` file. diff --git a/source/_integrations/mailgun.markdown b/source/_integrations/mailgun.markdown index a11f9579daa..b4d72e23556 100644 --- a/source/_integrations/mailgun.markdown +++ b/source/_integrations/mailgun.markdown @@ -54,14 +54,14 @@ You can then consume that information with the following automation: ```yaml automation: triggers: - trigger: event - event_type: mailgun_message_received - event_data: - action: call_service + - trigger: event + event_type: mailgun_message_received + event_data: + action: call_service actions: - action: light.turn_on - target: - entity_id: light.office + - action: light.turn_on + target: + entity_id: light.office ``` ## Notifications @@ -103,15 +103,15 @@ The following automation reacts to an event by sending out an email with two att # Example automation using Mailgun notifications automation: triggers: - trigger: event - event_type: SPECIAL_EVENT + - trigger: event + event_type: SPECIAL_EVENT actions: - action: notify.mailgun - data: - title: "Something special has happened" - message: "This a test message from Home Assistant" + - action: notify.mailgun data: - images: - - /home/pi/pic_test1.png - - /home/pi/pic_test2.png + title: "Something special has happened" + message: "This a test message from Home Assistant" + data: + images: + - /home/pi/pic_test1.png + - /home/pi/pic_test2.png ``` diff --git a/source/_integrations/manual.markdown b/source/_integrations/manual.markdown index 3014c7edabd..3bf9a84598b 100644 --- a/source/_integrations/manual.markdown +++ b/source/_integrations/manual.markdown @@ -194,9 +194,9 @@ automation: entity_id: alarm_control_panel.home_alarm state: armed_away actions: - action: alarm_control_panel.alarm_trigger - target: - entity_id: alarm_control_panel.home_alarm + - action: alarm_control_panel.alarm_trigger + target: + entity_id: alarm_control_panel.home_alarm ``` Sending a notification when the alarm is triggered. diff --git a/source/_integrations/matrix.markdown b/source/_integrations/matrix.markdown index c71c2124f5b..c90b07e88c4 100644 --- a/source/_integrations/matrix.markdown +++ b/source/_integrations/matrix.markdown @@ -128,26 +128,27 @@ notify: default_room: "#hasstest:matrix.org" automation: - - alias: 'React to !testword' + - alias: "React to !testword" triggers: - trigger: event - event_type: matrix_command - event_data: - command: testword + - trigger: event + event_type: matrix_command + event_data: + command: testword actions: - action: notify.matrix_notify - data: - message: "It looks like you wrote !testword" - - alias: 'React to an introduction' + - action: notify.matrix_notify + data: + message: "It looks like you wrote !testword" + + - alias: "React to an introduction" triggers: - trigger: event - event_type: matrix_command - event_data: - command: introduction + - trigger: event + event_type: matrix_command + event_data: + command: introduction actions: - action: notify.matrix_notify - data: - message: "Hello {{trigger.event.data.args['name']}}" + - action: notify.matrix_notify + data: + message: "Hello {{trigger.event.data.args['name']}}" ``` {% endraw %} @@ -197,12 +198,12 @@ Supported formats are: `text` (default), and `html`. ```yaml # Example of notification as HTML actions: - action: notify.matrix_notify - data: - message: >- -

Hello, world!

+ - action: notify.matrix_notify data: - format: "html" + message: >- +

Hello, world!

+ data: + format: "html" ``` ### Images in notification @@ -212,12 +213,12 @@ It is possible to send images with notifications. To do so, add a list of paths ```yaml # Example of notification with images actions: - action: notify.matrix_notify - data: - message: "Test with images" + - action: notify.matrix_notify data: - images: - - /path/to/picture.jpg + message: "Test with images" + data: + images: + - /path/to/picture.jpg ``` {% important %} diff --git a/source/_integrations/mediaroom.markdown b/source/_integrations/mediaroom.markdown index 3d59cdee745..e97a707895a 100644 --- a/source/_integrations/mediaroom.markdown +++ b/source/_integrations/mediaroom.markdown @@ -69,12 +69,12 @@ The `play_media` function can be used in scripts to change channels: # change_channel: sequence: - action: media_player.play_media - target: - entity_id: media_player.mediaroom_stb - data: - media_content_id: "{{ channel_number }}" - media_content_type: "channel" + - action: media_player.play_media + target: + entity_id: media_player.mediaroom_stb + data: + media_content_id: "{{ channel_number }}" + media_content_type: "channel" ``` {% endraw %} @@ -88,12 +88,12 @@ The `play_media` function can also be used to trigger actions on the set-up-box # press_button: sequence: - action: media_player.play_media - target: - entity_id: media_player.mediaroom_stb - data: - media_content_id: "{{ action }}" - media_content_type: "mediaroom" + - action: media_player.play_media + target: + entity_id: media_player.mediaroom_stb + data: + media_content_id: "{{ action }}" + media_content_type: "mediaroom" ``` {% endraw %} diff --git a/source/_integrations/meteoalarm.markdown b/source/_integrations/meteoalarm.markdown index 1780cd1f568..547c1a0af31 100644 --- a/source/_integrations/meteoalarm.markdown +++ b/source/_integrations/meteoalarm.markdown @@ -92,9 +92,9 @@ Example automation automation: - alias: "Alert me about weather warnings" triggers: - trigger: state - entity_id: binary_sensor.meteoalarm - from: 'off' + - trigger: state + entity_id: binary_sensor.meteoalarm + from: "off" actions: - action: notify.notify data: diff --git a/source/_integrations/minio.markdown b/source/_integrations/minio.markdown index 16af015f810..ecdc07c0920 100644 --- a/source/_integrations/minio.markdown +++ b/source/_integrations/minio.markdown @@ -89,10 +89,10 @@ Automations can be triggered on new files created on the Minio server using the automation: - alias: "Upload camera snapshot" triggers: - trigger: event - event_type: folder_watcher - event_data: - event_type: created + - trigger: event + event_type: folder_watcher + event_data: + event_type: created actions: - delay: "00:00:01" - action: minio.put @@ -107,16 +107,16 @@ automation: - alias: "Download new Minio file" triggers: - - trigger: event - event_type: minio + - trigger: event + event_type: minio conditions: [] actions: - - action: minio.get - data: - bucket: "{{trigger.event.data.bucket}}" - key: "{{trigger.event.data.key}}" - file_path: "/tmp/{{ trigger.event.data.file_name }}" + - action: minio.get + data: + bucket: "{{trigger.event.data.bucket}}" + key: "{{trigger.event.data.key}}" + file_path: "/tmp/{{ trigger.event.data.file_name }}" ``` {% endraw %} diff --git a/source/_integrations/modem_callerid.markdown b/source/_integrations/modem_callerid.markdown index 81b7dc756ec..fe740706089 100644 --- a/source/_integrations/modem_callerid.markdown +++ b/source/_integrations/modem_callerid.markdown @@ -39,34 +39,36 @@ An example automation: ```yaml automation: - - alias: Notify CallerID + - alias: "Notify CallerID" triggers: - trigger: state - entity_id: sensor.phone_modem - to: "callerid" + - trigger: state + entity_id: sensor.phone_modem + to: "callerid" actions: - action: notify.notify - data: - message: "Call from {{ state_attr('sensor.phone_modem', 'cid_name') }} at {{ state_attr('sensor.phone_modem', 'cid_number') }} " - - alias: Notify CallerID webui + - action: notify.notify + data: + message: "Call from {{ state_attr('sensor.phone_modem', 'cid_name') }} at {{ state_attr('sensor.phone_modem', 'cid_number') }} " + + - alias: "Notify CallerID webui" triggers: - trigger: state - entity_id: sensor.phone_modem - to: "callerid" + - trigger: state + entity_id: sensor.phone_modem + to: "callerid" actions: - action: persistent_notification.create - data: - title: "Call from" - message: "{{ state_attr('sensor.phone_modem', 'cid_time').strftime("%I:%M %p") }} {{ state_attr('sensor.phone_modem', 'cid_name') }} {{ state_attr('sensor.phone_modem', 'cid_number') }} " - - alias: Say CallerID + - action: persistent_notification.create + data: + title: "Call from" + message: "{{ state_attr('sensor.phone_modem', 'cid_time').strftime("%I:%M %p") }} {{ state_attr('sensor.phone_modem', 'cid_name') }} {{ state_attr('sensor.phone_modem', 'cid_number') }} " + + - alias: "Say CallerID" triggers: - trigger: state - entity_id: sensor.phone_modem - to: "callerid" + - trigger: state + entity_id: sensor.phone_modem + to: "callerid" actions: - action: tts.google_say - data: - message: "Call from {{ state_attr('sensor.phone_modem', 'cid_name') }}" + - action: tts.google_say + data: + message: "Call from {{ state_attr('sensor.phone_modem', 'cid_name') }}" ``` {% endraw %} diff --git a/source/_integrations/motion_blinds.markdown b/source/_integrations/motion_blinds.markdown index 542467567b8..50840fab488 100644 --- a/source/_integrations/motion_blinds.markdown +++ b/source/_integrations/motion_blinds.markdown @@ -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" diff --git a/source/_integrations/motionblinds_ble.markdown b/source/_integrations/motionblinds_ble.markdown index 66251117094..4ca25e31265 100644 --- a/source/_integrations/motionblinds_ble.markdown +++ b/source/_integrations/motionblinds_ble.markdown @@ -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" diff --git a/source/_integrations/mqtt.markdown b/source/_integrations/mqtt.markdown index ce107239ace..71486e19b5e 100644 --- a/source/_integrations/mqtt.markdown +++ b/source/_integrations/mqtt.markdown @@ -1063,14 +1063,14 @@ Use as [`script`](/integrations/script/) in automations. automation: alias: "Send me a message when I get home" triggers: - trigger: state - entity_id: device_tracker.me - to: "home" + - trigger: state + entity_id: device_tracker.me + to: "home" actions: - action: script.notify_mqtt - data: - target: "me" - message: "I'm home" + - action: script.notify_mqtt + data: + target: "me" + message: "I'm home" script: notify_mqtt: diff --git a/source/_integrations/nest.markdown b/source/_integrations/nest.markdown index 69b5bbe35d4..cf7a5cb88e8 100644 --- a/source/_integrations/nest.markdown +++ b/source/_integrations/nest.markdown @@ -410,7 +410,6 @@ data: data: image: "{{ trigger.event.data.attachment.image }}" video: "{{ trigger.event.data.attachment.video }}" -mode: single ``` {% endraw %} diff --git a/source/_integrations/netatmo.markdown b/source/_integrations/netatmo.markdown index 224f6ceb4fc..622a7d62447 100644 --- a/source/_integrations/netatmo.markdown +++ b/source/_integrations/netatmo.markdown @@ -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 %} diff --git a/source/_integrations/nightscout.markdown b/source/_integrations/nightscout.markdown index ac49d80a254..d67e5233e18 100644 --- a/source/_integrations/nightscout.markdown +++ b/source/_integrations/nightscout.markdown @@ -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 diff --git a/source/_integrations/notify.markdown b/source/_integrations/notify.markdown index b8be4c5cde0..7856277dd29 100644 --- a/source/_integrations/notify.markdown +++ b/source/_integrations/notify.markdown @@ -127,9 +127,9 @@ The notify integration supports specifying [templates](/docs/configuration/templ ```yaml actions: - action: notify.persistent_notification - data: - message: "You have {{ states('todo.shopping_list') }} items on your shopping list." + - action: notify.persistent_notification + data: + message: "You have {{ states('todo.shopping_list') }} items on your shopping list." ``` {% endraw %} @@ -138,9 +138,9 @@ actions: ```yaml actions: - action: notify.persistent_notification - data: - message: "The sun is {% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}!" + - action: notify.persistent_notification + data: + message: "The sun is {% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}!" ``` {% endraw %} diff --git a/source/_integrations/nzbget.markdown b/source/_integrations/nzbget.markdown index 1dca6b3bd2c..c4c8b773475 100644 --- a/source/_integrations/nzbget.markdown +++ b/source/_integrations/nzbget.markdown @@ -52,15 +52,15 @@ Example automation to send a Telegram message on a completed download: ```yaml - alias: "Completed Torrent" triggers: - trigger: event - event_type: nzbget_download_complete - - event_data: - category: tv + - trigger: event + event_type: nzbget_download_complete + event_data: + category: tv actions: - action: notify.telegram_notifier - data: - title: "Download completed!" - message: "{{trigger.event.data.name}}" + - action: notify.telegram_notifier + data: + title: "Download completed!" + message: "{{trigger.event.data.name}}" ``` {% endraw %} diff --git a/source/_integrations/openai_conversation.markdown b/source/_integrations/openai_conversation.markdown index a5128d435d8..870f232c947 100644 --- a/source/_integrations/openai_conversation.markdown +++ b/source/_integrations/openai_conversation.markdown @@ -149,9 +149,9 @@ automation: template: - triggers: - alias: "Update image when a new weather image is generated" - trigger: event - event_type: new_weather_image + - alias: "Update image when a new weather image is generated" + trigger: event + event_type: new_weather_image image: name: "AI generated image of New York" url: "{{ trigger.event.data.url }}" diff --git a/source/_integrations/opensky.markdown b/source/_integrations/opensky.markdown index 58cb0237a0a..65c35aa121b 100644 --- a/source/_integrations/opensky.markdown +++ b/source/_integrations/opensky.markdown @@ -60,12 +60,12 @@ To receive notifications of the entering flights using the [Home Assistant Compa automation: - alias: "Flight entry notification" triggers: - trigger: event - event_type: opensky_entry + - trigger: event + event_type: opensky_entry actions: - action: notify.mobile_app_ - data: - message: "Flight entry of {{ trigger.event.data.callsign }}" + - action: notify.mobile_app_ + data: + message: "Flight entry of {{ trigger.event.data.callsign }}" ``` {% endraw %} @@ -77,18 +77,18 @@ One can also get a direct link to the OpenSky website to see the flight using th automation: - alias: "Flight entry notification" triggers: - trigger: event - event_type: opensky_entry + - trigger: event + event_type: opensky_entry actions: - action: notify.mobile_app_ - data: - message: "Flight entry of {{ trigger.event.data.callsign }}" + - action: notify.mobile_app_ data: - actions: - - action: URI - title: Track the flight - uri: >- - https://opensky-network.org/aircraft-profile?icao24={{ - trigger.event.data.icao24 }} + message: "Flight entry of {{ trigger.event.data.callsign }}" + data: + actions: + - action: URI + title: "Track the flight" + uri: >- + https://opensky-network.org/aircraft-profile?icao24={{ + trigger.event.data.icao24 }} ``` {% endraw %} diff --git a/source/_integrations/openuv.markdown b/source/_integrations/openuv.markdown index 3d0ddfa24c6..8f96087e145 100644 --- a/source/_integrations/openuv.markdown +++ b/source/_integrations/openuv.markdown @@ -102,17 +102,17 @@ horizon: automation: - alias: "Update OpenUV" triggers: - trigger: time_pattern - minutes: "/20" + - trigger: time_pattern + minutes: "/20" conditions: - condition: numeric_state - entity_id: sun.sun - value_template: "{{ state.attributes.elevation }}" - above: 10 + - condition: numeric_state + entity_id: sun.sun + value_template: "{{ state.attributes.elevation }}" + above: 10 actions: - action: homeassistant.update_entity - target: - entity_id: sensor.LATITUDE_LONGITUDE_current_uv_index + - action: homeassistant.update_entity + target: + entity_id: sensor.LATITUDE_LONGITUDE_current_uv_index ``` {% endraw %} @@ -122,12 +122,12 @@ Update the protection window once a day at 12:00pm: automation: - alias: "Update OpenUV" triggers: - trigger: time - at: "12:00:00" + - trigger: time + at: "12:00:00" actions: - action: homeassistant.update_entity - target: - entity_id: binary_sensor.LATITUDE_LONGITUDE_protection_window + - action: homeassistant.update_entity + target: + entity_id: binary_sensor.LATITUDE_LONGITUDE_protection_window ``` To perform an optimal amount of API calls in locations where the amount of daylight @@ -165,12 +165,12 @@ automation: ) >= timedelta(hours = 0, minutes = 40) }} actions: - action: homeassistant.update_entity - target: - entity_id: - # Update both UV and protection window data: - - binary_sensor.LATITUDE_LONGITUDE_protection_window - - sensor.LATITUDE_LONGITUDE_current_uv_index + - action: homeassistant.update_entity + target: + entity_id: + # Update both UV and protection window data: + - binary_sensor.LATITUDE_LONGITUDE_protection_window + - sensor.LATITUDE_LONGITUDE_current_uv_index ``` {% endraw %} diff --git a/source/_integrations/persistent_notification.markdown b/source/_integrations/persistent_notification.markdown index 45685782f9d..dda66e1a033 100644 --- a/source/_integrations/persistent_notification.markdown +++ b/source/_integrations/persistent_notification.markdown @@ -57,10 +57,10 @@ Here is how an [action](/docs/automation/action) of your [automation setup](/get ```yaml actions: - action: persistent_notification.create - data: - message: "Your message goes here" - title: "Custom subject" + - action: persistent_notification.create + data: + message: "Your message goes here" + title: "Custom subject" ``` If you want to show some runtime information, you have to use [templates](/docs/configuration/templating/). @@ -69,11 +69,11 @@ If you want to show some runtime information, you have to use [templates](/docs/ ```yaml actions: - action: persistent_notification.create - data: - title: > - Thermostat is {{ state_attr('climate.thermostat', 'hvac_action') }} - message: "Temperature {{ state_attr('climate.thermostat', 'current_temperature') }}" + - action: persistent_notification.create + data: + title: > + Thermostat is {{ state_attr('climate.thermostat', 'hvac_action') }} + message: "Temperature {{ state_attr('climate.thermostat', 'current_temperature') }}" ``` {% endraw %} @@ -88,16 +88,16 @@ This action allows you to remove a notifications by script or automation. ```yaml actions: - action: persistent_notification.dismiss - data: - notification_id: "1234" + - action: persistent_notification.dismiss + data: + notification_id: "1234" ``` The `persistent_notification.dismiss_all` action allows you to remove all notifications. ```yaml actions: - action: persistent_notification.dismiss_all + - action: persistent_notification.dismiss_all ``` ### Markdown support diff --git a/source/_integrations/plex.markdown b/source/_integrations/plex.markdown index 5e687a892a2..c64c6238530 100644 --- a/source/_integrations/plex.markdown +++ b/source/_integrations/plex.markdown @@ -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 diff --git a/source/_integrations/point.markdown b/source/_integrations/point.markdown index d8d7e7d8489..5e2a4d603e3 100644 --- a/source/_integrations/point.markdown +++ b/source/_integrations/point.markdown @@ -121,8 +121,8 @@ automation: event_type: point_webhook_received event_data: {} conditions: - condition: template - value_template: "{{ trigger.event.data.event.type == 'short_button_press' }}" + - condition: template + value_template: "{{ trigger.event.data.event.type == 'short_button_press' }}" actions: - action: persistent_notification.create data: diff --git a/source/_integrations/pushbullet.markdown b/source/_integrations/pushbullet.markdown index ca96d2eab62..75e29e3d943 100644 --- a/source/_integrations/pushbullet.markdown +++ b/source/_integrations/pushbullet.markdown @@ -86,12 +86,12 @@ To use notifications, please see the [getting started with automation page](/get ```yaml actions: - action: notify.NOTIFIER_NAME - data: - title: Send URL - message: This is an url + - action: notify.NOTIFIER_NAME data: - url: google.com + title: "Send URL" + message: "This is an url" + data: + url: "google.com" ``` - `url` (*Required*): Page URL to send with Pushbullet. @@ -100,12 +100,12 @@ actions: ```yaml actions: - action: notify.NOTIFIER_NAME - data: - title: Send file - message: This is a file + - action: notify.NOTIFIER_NAME data: - file: /path/to/my/file + title: "Send file" + message: "This is a file" + data: + file: /path/to/my/file ``` - `file` (*Required*): File to send with Pushbullet. @@ -114,12 +114,12 @@ actions: ```yaml actions: - action: notify.NOTIFIER_NAME - data: - title: Send file - message: This is a file URL + - action: notify.NOTIFIER_NAME data: - file_url: https://cdn.pixabay.com/photo/2014/06/03/19/38/test-361512_960_720.jpg + title: "Send file" + message: "This is a file URL" + data: + file_url: https://cdn.pixabay.com/photo/2014/06/03/19/38/test-361512_960_720.jpg ``` - `file_url` (*Required*): File to send with Pushbullet. @@ -127,8 +127,8 @@ actions: ### Single target ```yaml - actions: - action: notify.NOTIFIER_NAME +actions: + - action: notify.NOTIFIER_NAME data: title: "Send to one device" message: "This only goes to one specific device" diff --git a/source/_integrations/pushsafer.markdown b/source/_integrations/pushsafer.markdown index e9013555cf4..e92328848de 100644 --- a/source/_integrations/pushsafer.markdown +++ b/source/_integrations/pushsafer.markdown @@ -47,66 +47,66 @@ Message to two devices with formatted text. ```yaml actions: - action: notify.notify - data: - title: "Test to 2 devices" - message: "Attention [b]bold[/b] text[br][url=https://www.pushsafer.com]Link to Pushsafer[/url]" + - action: notify.notify data: - icon: "2" - iconcolor: "#FF0000" - sound: "2" - vibration: "1" - url: "https://www.home-assistant.io/" - urltitle: "Open Home Assistant" - time2live: "0" + title: "Test to 2 devices" + message: "Attention [b]bold[/b] text[br][url=https://www.pushsafer.com]Link to Pushsafer[/url]" + data: + icon: "2" + iconcolor: "#FF0000" + sound: "2" + vibration: "1" + url: "https://www.home-assistant.io/" + urltitle: "Open Home Assistant" + time2live: "0" ``` Message to one device with formatted text and image from an external URL. ```yaml actions: - action: notify.notify - data: - title: "Test to 1 device with image from an url" - message: "Attention [i]italic[/i] Text[br][url=https://www.home-assistant.io/]Testlink[/url]" + - action: notify.notify data: - icon: "14" - iconcolor: "#FFFF00" - sound: "22" - vibration: "31" - url: "https://www.home-assistant.io/" - urltitle: "Open Home Assistant" - time2live: "60" - picture1: - url: "https://www.home-assistant.io/images/integrations/alexa/alexa-512x512.png" + title: "Test to 1 device with image from an url" + message: "Attention [i]italic[/i] Text[br][url=https://www.home-assistant.io/]Testlink[/url]" + data: + icon: "14" + iconcolor: "#FFFF00" + sound: "22" + vibration: "31" + url: "https://www.home-assistant.io/" + urltitle: "Open Home Assistant" + time2live: "60" + picture1: + url: "https://www.home-assistant.io/images/integrations/alexa/alexa-512x512.png" ``` Message to two devices and one device group with formatted text and local image. ```yaml actions: - action: notify.notify - data: - title: "Test to 3 devices with local image" - message: "Attention [i]italic[/i] Text[br][url=https://www.home-assistant.io/]Testlink[/url]" - target: ["1111","2222","gs3333"], + - action: notify.notify data: - icon: "20" - iconcolor: "#FF00FF" - sound: "33" - vibration: "0" - url: "https://www.home-assistant.io/" - urltitle: "Open Home Assistant" - time2live: "10" - priority: "2" - retry: "60" - expire: "600" - confirm: "10" - answer: "1" - answeroptions: "yes|no|maybe" - answerforce: "1" - picture1: { - path: "C:\\Users\\Kevin\\AppData\\Roaming\\.homeassistant\\image-760-testimage.jpg" + title: "Test to 3 devices with local image" + message: "Attention [i]italic[/i] Text[br][url=https://www.home-assistant.io/]Testlink[/url]" + target: ["1111","2222","gs3333"], + data: + icon: "20" + iconcolor: "#FF00FF" + sound: "33" + vibration: "0" + url: "https://www.home-assistant.io/" + urltitle: "Open Home Assistant" + time2live: "10" + priority: "2" + retry: "60" + expire: "600" + confirm: "10" + answer: "1" + answeroptions: "yes|no|maybe" + answerforce: "1" + picture1: { + path: "C:\\Users\\Kevin\\AppData\\Roaming\\.homeassistant\\image-760-testimage.jpg" ``` To customize your push-notification you can take a look at the [Pushsafer API description](https://www.pushsafer.com/en/pushapi). diff --git a/source/_integrations/qwikswitch.markdown b/source/_integrations/qwikswitch.markdown index cc8a7513758..80bc692e920 100644 --- a/source/_integrations/qwikswitch.markdown +++ b/source/_integrations/qwikswitch.markdown @@ -109,8 +109,8 @@ QwikSwitch devices (i.e., transmitter buttons) will fire events on the Home Assi automation: - alias: "Action - Respond to A button press" triggers: - trigger: event - event_type: qwikswitch.button.@12df34 + - trigger: event + event_type: qwikswitch.button.@12df34 ``` `event_type` names should be in the format **qwikswitch.button.@_QS_id_**. where **@_QS_id_** will be captured in the Home Assistant log when pressing the button. Alternatively, you can also get the device ID from the QS Mobile application or by using the listen API call by browsing to `http://127.0.0.1:2020/&listen` and then pressing the button. diff --git a/source/_integrations/recorder.markdown b/source/_integrations/recorder.markdown index 970e17a932a..95dca003352 100644 --- a/source/_integrations/recorder.markdown +++ b/source/_integrations/recorder.markdown @@ -243,7 +243,6 @@ actions: data: keep_days: 5 entity_id: sensor.power_sensor_0 -mode: single ``` ### Action `disable` diff --git a/source/_integrations/remember_the_milk.markdown b/source/_integrations/remember_the_milk.markdown index 5791645fe20..87f83606a1a 100644 --- a/source/_integrations/remember_the_milk.markdown +++ b/source/_integrations/remember_the_milk.markdown @@ -91,21 +91,19 @@ Here's an example for an automation that creates a new task whenever `sensor.mys {% raw %} ```yaml -- id: mysensor_on - triggers: - trigger: state - entity_id: sensor.mysensor - to: on +- triggers: + - trigger: state + entity_id: sensor.mysensor + to: "on" actions: - action: remember_the_milk.myaccount_create_task data: name: "Please switch off {{trigger.entity_id}}" id: "{{trigger.entity_id}}" -- id: mysensor_off - triggers: - trigger: state - entity_id: sensor.mysensor - to: off +- triggers: + - trigger: state + entity_id: sensor.mysensor + to: "off" actions: - action: remember_the_milk.myaccount_complete_task data: diff --git a/source/_integrations/rest_command.markdown b/source/_integrations/rest_command.markdown index d8b5b2e9688..6824535e384 100644 --- a/source/_integrations/rest_command.markdown +++ b/source/_integrations/rest_command.markdown @@ -184,10 +184,10 @@ Call the new action from [developer tools](/docs/tools/dev-tools/) in the sideba automation: - alias: "Arrive at Work" triggers: - trigger: zone - entity_id: device_tracker.my_device - zone: zone.work - event: enter + - trigger: zone + entity_id: device_tracker.my_device + zone: zone.work + event: enter actions: - action: rest_command.my_request data: diff --git a/source/_integrations/rfxtrx.markdown b/source/_integrations/rfxtrx.markdown index 15af42102b8..083a2a50828 100644 --- a/source/_integrations/rfxtrx.markdown +++ b/source/_integrations/rfxtrx.markdown @@ -330,9 +330,9 @@ automation: values: Sound: 9 actions: - action: scene.turn_on - target: - entity_id: scene.welcomescene + - action: scene.turn_on + target: + entity_id: scene.welcomescene ``` ## Actions @@ -346,9 +346,9 @@ Simulate a button being pressed: ```yaml ... actions: - action: rfxtrx.send - data: - event: 0b1111e003af16aa10000060 + - action: rfxtrx.send + data: + event: 0b1111e003af16aa10000060 ``` Alternatively: diff --git a/source/_integrations/roborock.markdown b/source/_integrations/roborock.markdown index eac9c9fa8e5..ba1918a64ea 100644 --- a/source/_integrations/roborock.markdown +++ b/source/_integrations/roborock.markdown @@ -196,7 +196,6 @@ We plan to make the process simpler in the future, but for now, it is a multi-st action: roborock.get_maps target: entity_id: vacuum.s7_roborock - data: {} ``` - **Result**: You will get a response like this: diff --git a/source/_integrations/roon.markdown b/source/_integrations/roon.markdown index a80659ab29a..72ba7df8273 100644 --- a/source/_integrations/roon.markdown +++ b/source/_integrations/roon.markdown @@ -76,8 +76,8 @@ In this autimation you can use Home Assistant actions to provide `volume_up` and Here is an example automation using an IR blaster to control `media_player_study` ```yaml -alias: Roon Study Volume -description: "" +alias: "Roon Study Volume" +mode: queued triggers: - trigger: state entity_id: @@ -114,6 +114,4 @@ actions: command: volume_down target: entity_id: remote.ir_blaster -mode: queued - ``` diff --git a/source/_integrations/satel_integra.markdown b/source/_integrations/satel_integra.markdown index 23338a4bd56..495e7e5fc2b 100644 --- a/source/_integrations/satel_integra.markdown +++ b/source/_integrations/satel_integra.markdown @@ -173,11 +173,11 @@ For example: ```yaml alias: "Flick the input switch when movement in bedroom detected" triggers: - trigger: state + - trigger: state entity_id: "binary_sensor.bedroom" to: "on" actions: - action: input_boolean.turn_on + - action: input_boolean.turn_on target: entity_id: input_boolean.movement_detected ``` diff --git a/source/_integrations/scene.markdown b/source/_integrations/scene.markdown index fe937b60ba1..498966d3fdc 100644 --- a/source/_integrations/scene.markdown +++ b/source/_integrations/scene.markdown @@ -102,14 +102,14 @@ Scenes can be activated using the `scene.turn_on` action (there is no `scene.tur # Example automation automation: triggers: - trigger: state - entity_id: device_tracker.sweetheart - from: "not_home" - to: "home" + - trigger: state + entity_id: device_tracker.sweetheart + from: "not_home" + to: "home" actions: - action: scene.turn_on - target: - entity_id: scene.romantic + - action: scene.turn_on + target: + entity_id: scene.romantic ``` ## Applying a scene without defining it @@ -120,21 +120,21 @@ With the `scene.apply` action you are able to apply a scene without first defini # Example automation automation: triggers: - trigger: state - entity_id: device_tracker.sweetheart - from: "not_home" - to: "home" + - trigger: state + entity_id: device_tracker.sweetheart + from: "not_home" + to: "home" actions: - action: scene.apply - data: - entities: - light.tv_back_light: - state: "on" - brightness: 100 - light.ceiling: off - media_player.sony_bravia_tv: - state: "on" - source: HDMI 1 + - action: scene.apply + data: + entities: + light.tv_back_light: + state: "on" + brightness: 100 + light.ceiling: off + media_player.sony_bravia_tv: + state: "on" + source: HDMI 1 ``` ## Using scene transitions @@ -149,16 +149,16 @@ light will transition to the scene in 2.5 seconds. # Example automation automation: triggers: - trigger: state - entity_id: device_tracker.sweetheart - from: "not_home" - to: "home" + - trigger: state + entity_id: device_tracker.sweetheart + from: "not_home" + to: "home" actions: - action: scene.turn_on - target: - entity_id: scene.romantic - data: - transition: 2.5 + - action: scene.turn_on + target: + entity_id: scene.romantic + data: + transition: 2.5 ``` Transitions are currently only support by lights, which in their turn, have @@ -186,20 +186,20 @@ This video tutorial explains how scenes work and how you can utilize scenes on t # Example automation using entities automation: triggers: - trigger: homeassistant - event: start + - trigger: homeassistant + event: start actions: - action: scene.create - data: - scene_id: my_scene - entities: - light.tv_back_light: - state: "on" - brightness: 100 - light.ceiling: off - media_player.sony_bravia_tv: - state: "on" - source: HDMI 1 + - action: scene.create + data: + scene_id: my_scene + entities: + light.tv_back_light: + state: "on" + brightness: 100 + light.ceiling: off + media_player.sony_bravia_tv: + state: "on" + source: HDMI 1 ``` ## Deleting dynamically created scenes @@ -214,9 +214,9 @@ If the scene was not previously created by `scene.create`, the action will fail # Example automation automation: triggers: - trigger: state - entity_id: sun.sun - to: below_horizon + - trigger: state + entity_id: sun.sun + to: "below_horizon" actions: - action: scene.delete data: diff --git a/source/_integrations/script.markdown b/source/_integrations/script.markdown index 405595a93d6..33234489052 100644 --- a/source/_integrations/script.markdown +++ b/source/_integrations/script.markdown @@ -177,15 +177,15 @@ Aside from the automation editor UI, variables can be passed to scripts within t # Example configuration.yaml entry automation: triggers: - trigger: state - entity_id: light.bedroom - from: "off" - to: "on" + - trigger: state + entity_id: light.bedroom + from: "off" + to: "on" actions: - action: script.notify_pushover - data: - title: "State change" - message: "The light is on!" + - action: script.notify_pushover + data: + title: "State change" + message: "The light is on!" ``` {% endraw %} @@ -196,18 +196,18 @@ This example shows using `script.turn_on` action: # Example configuration.yaml entry automation: triggers: - trigger: state - entity_id: light.bedroom - from: "off" - to: "on" + - trigger: state + entity_id: light.bedroom + from: "off" + to: "on" actions: - action: script.turn_on - target: - entity_id: script.notify_pushover - data: - variables: - title: "State change" - message: "The light is on!" + - action: script.turn_on + target: + entity_id: script.notify_pushover + data: + variables: + title: "State change" + message: "The light is on!" ``` {% endraw %} diff --git a/source/_integrations/shell_command.markdown b/source/_integrations/shell_command.markdown index 1d37b129c13..bc720ca3e7c 100644 --- a/source/_integrations/shell_command.markdown +++ b/source/_integrations/shell_command.markdown @@ -83,10 +83,10 @@ helper and an automation. automation: - alias: "run_set_ac" triggers: - trigger: state - entity_id: input_number.ac_temperature + - trigger: state + entity_id: input_number.ac_temperature actions: - action: shell_command.set_ac_to_slider + - action: shell_command.set_ac_to_slider input_number: ac_temperature: diff --git a/source/_integrations/shelly.markdown b/source/_integrations/shelly.markdown index 807fc2e535c..83dd6ae8a09 100644 --- a/source/_integrations/shelly.markdown +++ b/source/_integrations/shelly.markdown @@ -200,29 +200,29 @@ You can also create automations using YAML, for example: ```yaml - alias: "Toggle living room light" triggers: - trigger: event - event_type: shelly.click - event_data: - device: shellyswitch25-AABBCC - channel: 1 - click_type: single + - trigger: event + event_type: shelly.click + event_data: + device: shellyswitch25-AABBCC + channel: 1 + click_type: single actions: - action: light.toggle - target: - entity_id: light.living_room + - action: light.toggle + target: + entity_id: light.living_room - alias: "Toggle living room lamp" triggers: - trigger: event - event_type: shelly.click - event_data: - device: shellyswitch25-AABBCC - channel: 2 - click_type: long + - trigger: event + event_type: shelly.click + event_data: + device: shellyswitch25-AABBCC + channel: 2 + click_type: long actions: - action: light.toggle - target: - entity_id: light.lamp_living_room + - action: light.toggle + target: + entity_id: light.lamp_living_room ``` ### Possible values for `click_type` diff --git a/source/_integrations/sighthound.markdown b/source/_integrations/sighthound.markdown index 13cec68daac..2b907d54c34 100644 --- a/source/_integrations/sighthound.markdown +++ b/source/_integrations/sighthound.markdown @@ -83,12 +83,11 @@ An example using two automations: ```yaml # Example automations.yaml entry -- id: "SOME_UNIQUE_ID" - alias: "Entrance Motion Image Processing" +- alias: "Entrance motion image processing" description: "Send a camera image to sighthound, when motion is detected at the entrance" triggers: - - type: motion - trigger: device + - trigger: device + type: motion device_id: YOUR_DEVICE_ID entity_id: binary_sensor.my_motion_sensor domain: binary_sensor @@ -96,10 +95,8 @@ An example using two automations: - action: image_processing.scan target: entity_id: image_processing.sighthound_my_cam - mode: single -- id: "ANOTHER_UNIQUE_ID" - alias: "Arriving Vehicle Notification" +- alias: "Arriving vehicle notification" description: "Send a notification to a phone, when a vehicle is detected at the entrance" triggers: - trigger: event @@ -108,5 +105,4 @@ An example using two automations: - action: notify.mobile_app_my_iphone data: message: "Somebody has just arrived by car." - mode: single ``` diff --git a/source/_integrations/signal_messenger.markdown b/source/_integrations/signal_messenger.markdown index dcaaf7251f7..52f845e5096 100644 --- a/source/_integrations/signal_messenger.markdown +++ b/source/_integrations/signal_messenger.markdown @@ -81,12 +81,12 @@ A few examples on how to use this integration to send notifications from automat ```yaml ... actions: - action: notify.NOTIFIER_NAME - data: - message: "That's an example that sends a simple text message to the recipients specified in the configuration.yaml. If text mode is 'styled', you can use *italic*, **bold** or ~strikethrough~ ." - ## Optional + - action: notify.NOTIFIER_NAME data: - text_mode: styled + message: "That's an example that sends a simple text message to the recipients specified in the configuration.yaml. If text mode is 'styled', you can use *italic*, **bold** or ~strikethrough~ ." + ## Optional + data: + text_mode: styled ``` | Attribute | Optional | Default |Description | @@ -100,13 +100,13 @@ This example assumes you have an image stored in the default `www`-folder in Hom ```yaml ... actions: - action: notify.NOTIFIER_NAME - data: - message: "Alarm in the living room!" + - action: notify.NOTIFIER_NAME data: - attachments: - - "/config/www/surveillance_camera.jpg" - text_mode: styled + message: "Alarm in the living room!" + data: + attachments: + - "/config/www/surveillance_camera.jpg" + text_mode: styled ``` | Data attribute | Optional | Default |Description | @@ -119,14 +119,14 @@ actions: ```yaml ... actions: - action: notify.NOTIFIER_NAME - data: - message: "Person detected on Front Camera!" + - action: notify.NOTIFIER_NAME data: - verify_ssl: false - urls: - - "http://homeassistant.local/api/frigate/notifications//thumbnail.jpg" - text_mode: styled + message: "Person detected on Front Camera!" + data: + verify_ssl: false + urls: + - "http://homeassistant.local/api/frigate/notifications//thumbnail.jpg" + text_mode: styled ``` | Data attribute | Optional | Default |Description | diff --git a/source/_integrations/slack.markdown b/source/_integrations/slack.markdown index 730fd6960dc..046de9275af 100644 --- a/source/_integrations/slack.markdown +++ b/source/_integrations/slack.markdown @@ -105,9 +105,9 @@ alias: "Notify: Slack Notification Template" sequence: - action: notify.YOUR_SLACK_TEAM data: - message: Fallback Text + message: "Fallback Text" target: "#test-channel" - title: Reminder + title: "Reminder" data: blocks: - type: section @@ -116,7 +116,6 @@ sequence: text: >- This is a mrkdwn section block *this is bold*, and ~this is crossed out~, and -mode: single ``` Update the blocks array with valid Slack blocks. The easiest way to create this is using [Slack Block Kit Builder](https://app.slack.com/block-kit-builder). Up to 50 blocks may be included per message. diff --git a/source/_integrations/sms.markdown b/source/_integrations/sms.markdown index 4a9180e8da3..424ab34539d 100644 --- a/source/_integrations/sms.markdown +++ b/source/_integrations/sms.markdown @@ -34,10 +34,10 @@ To use notifications, please see the [getting started with automation page](/get ```yaml actions: - action: notify.sms - data: - message: "This is a message for you!" - target: "+5068081-8181" + - action: notify.sms + data: + message: "This is a message for you!" + target: "+5068081-8181" ``` ### Sending SMS using GSM alphabet @@ -46,12 +46,12 @@ Some devices (receiving or sending) do not support Unicode (the default encoding ```yaml actions: - action: notify.sms - data: - message: "This is a message for you in ANSI" - target: "+5068081-8181" + - action: notify.sms data: - unicode: False + message: "This is a message for you in ANSI" + target: "+5068081-8181" + data: + unicode: False ``` ### Getting SMS messages @@ -85,7 +85,6 @@ notify_sms_user1: data: message: "{{ message }}" target: "{{ states('sensor.user1_phone_number') }}" - mode: single icon: mdi:chat-alert ``` @@ -105,7 +104,7 @@ notify_sms_user1: data: message: | From: {{trigger.event.data.phone}} - {{trigger.event.data.text}} mode: single + {{trigger.event.data.text}} ``` {% endraw %} diff --git a/source/_integrations/smtp.markdown b/source/_integrations/smtp.markdown index ceab1dfbb29..c49f8af2827 100644 --- a/source/_integrations/smtp.markdown +++ b/source/_integrations/smtp.markdown @@ -90,11 +90,9 @@ A notify integration will be created using the name without spaces. In the above ```yaml - alias: "Send E-Mail Every Morning" - description: "" triggers: - platform: time at: "08:00:00" - conditions: [] actions: - action: notify.NOTIFIER_NAME data: @@ -102,7 +100,6 @@ A notify integration will be created using the name without spaces. In the above message: "Rise and shine" target: - "morning@example.com" - mode: single ``` The optional `target` field is used to specify recipient(s) for this specific action. When `target` field is not used, this message will be sent to default recipient(s), specified in the `recipient` part of the smtp notifier in `configuration.yaml`. Line breaks can be added in the body part of the email by using `\r\n`, for instance `message: "Rise and shine\r\n\r\nIt's a brand new day!"` diff --git a/source/_integrations/sonos.markdown b/source/_integrations/sonos.markdown index 5886e642573..2aa67094c4b 100644 --- a/source/_integrations/sonos.markdown +++ b/source/_integrations/sonos.markdown @@ -396,7 +396,6 @@ Removes an item from the queue. ```yaml # Example automation to remove just played song from queue alias: "Remove last played song from queue" -id: Remove last played song from queue triggers: - trigger: state entity_id: media_player.kitchen @@ -405,20 +404,20 @@ triggers: - trigger: state entity_id: media_player.move conditions: - condition: and - conditions: - # Coordinator - - condition: template - value_template: > - {{ state_attr( trigger.entity_id , 'group_members')[0] == trigger.entity_id }} - # Going from queue to queue - - condition: template - value_template: > - {{ 'queue_position' in trigger.from_state.attributes and 'queue_position' in trigger.to_state.attributes }} - # Moving forward - - condition: template - value_template: > - {{ trigger.from_state.attributes.queue_position < trigger.to_state.attributes.queue_position }} + - condition: and + conditions: + # Coordinator + - condition: template + value_template: > + {{ state_attr( trigger.entity_id , 'group_members')[0] == trigger.entity_id }} + # Going from queue to queue + - condition: template + value_template: > + {{ 'queue_position' in trigger.from_state.attributes and 'queue_position' in trigger.to_state.attributes }} + # Moving forward + - condition: template + value_template: > + {{ trigger.from_state.attributes.queue_position < trigger.to_state.attributes.queue_position }} actions: - action: sonos.remove_from_queue target: diff --git a/source/_integrations/system_log.markdown b/source/_integrations/system_log.markdown index 189c3f65f86..3390312216a 100644 --- a/source/_integrations/system_log.markdown +++ b/source/_integrations/system_log.markdown @@ -91,14 +91,14 @@ counter: automation: - alias: "Count warnings" triggers: - trigger: event - event_type: system_log_event - event_data: - level: WARNING + - trigger: event + event_type: system_log_event + event_data: + level: WARNING actions: - action: counter.increment - target: - entity_id: counter.warning_counter + - action: counter.increment + target: + entity_id: counter.warning_counter ``` ### Conditional Messages @@ -111,16 +111,16 @@ This automation will create a persistent notification whenever an error or warni automation: - alias: "Create notifications for 'action' errors" triggers: - trigger: event - event_type: system_log_event + - trigger: event + event_type: system_log_event conditions: - condition: template - value_template: '{{ "action" in trigger.event.data.message[0] }}' + - condition: template + value_template: '{{ "action" in trigger.event.data.message[0] }}' actions: - action: persistent_notification.create - data: - title: Something bad happened - message: "{{ trigger.event.data.message[0] }}" + - action: persistent_notification.create + data: + title: "Something bad happened" + message: "{{ trigger.event.data.message[0] }}" ``` {% endraw %} @@ -133,13 +133,13 @@ This automation will create a new log entry when the door is opened: automation: - alias: "Log door opened" triggers: - trigger: state - entity_id: binary_sensor.door - from: "off" - to: "on" + - trigger: state + entity_id: binary_sensor.door + from: "off" + to: "on" actions: - action: system_log.write - data: - message: "Door opened!" - level: info + - action: system_log.write + data: + message: "Door opened!" + level: info ``` diff --git a/source/_integrations/tag.markdown b/source/_integrations/tag.markdown index 0e2bd0ee6a5..f780b3020d5 100644 --- a/source/_integrations/tag.markdown +++ b/source/_integrations/tag.markdown @@ -58,9 +58,7 @@ One of the most fun applications of tags is to pick music in your living room. T ```yaml automation: -- id: handle_tag_scan - alias: "Handle Tag Scan" - mode: single +- alias: "Handle Tag Scan" # Hide warnings when triggered while in delay. max_exceeded: silent variables: @@ -76,8 +74,8 @@ automation: media_content_id: spotify:playlist:0OtWh3u6fZrBJTQtVBQWge media_content_type: playlist triggers: - trigger: event - event_type: tag_scanned + - trigger: event + event_type: tag_scanned conditions: # Test that we support this device and tag - "{{ trigger.event.data.tag_id in tags }}" diff --git a/source/_integrations/telegram.markdown b/source/_integrations/telegram.markdown index 2360435c9e3..53030077bcd 100644 --- a/source/_integrations/telegram.markdown +++ b/source/_integrations/telegram.markdown @@ -177,14 +177,14 @@ To use notifications, please see the [getting started with automation page](/get ```yaml ... actions: - action: notify.NOTIFIER_NAME - data: - title: "*Send a message*" - message: "That's an example that _sends_ a *formatted* message with a custom inline keyboard." + - action: notify.NOTIFIER_NAME data: - inline_keyboard: - - 'Task 1:/command1, Task 2:/command2' - - 'Task 3:/command3, Task 4:/command4' + title: "*Send a message*" + message: "That's an example that _sends_ a *formatted* message with a custom inline keyboard." + data: + inline_keyboard: + - 'Task 1:/command1, Task 2:/command2' + - 'Task 3:/command3, Task 4:/command4' ``` {% configuration %} @@ -211,19 +211,19 @@ inline_keyboard: ```yaml ... actions: - action: notify.NOTIFIER_NAME - data: - title: Send an images - message: "That's an example that sends an image." + - action: notify.NOTIFIER_NAME data: - photo: - - url: http://192.168.1.28/camera.jpg - username: admin - password: secret - - file: /tmp/picture.jpg - caption: Picture Title xy - - url: http://somebla.ie/video.png - caption: i.e., for a Title + title: "Send an images" + message: "That's an example that sends an image." + data: + photo: + - url: http://192.168.1.28/camera.jpg + username: "admin" + password: "secret" + - file: /tmp/picture.jpg + caption: "Picture Title xy" + - url: http://somebla.ie/video.png + caption: "i.e., for a Title" ``` {% configuration %} @@ -287,19 +287,19 @@ homeassistant: ```yaml ... actions: - action: notify.NOTIFIER_NAME - data: - title: Send a video - message: "That's an example that sends a video." + - action: notify.NOTIFIER_NAME data: - video: - - url: http://192.168.1.28/camera.mp4 - username: admin - password: secret - - file: /tmp/video.mp4 - caption: Video Title xy - - url: http://somebla.ie/video.mp4 - caption: i.e., for a Title + title: "Send a video" + message: "That's an example that sends a video." + data: + video: + - url: http://192.168.1.28/camera.mp4 + username: "admin" + password: "secret" + - file: /tmp/video.mp4 + caption: "Video Title xy" + - url: http://somebla.ie/video.mp4 + caption: "i.e., for a Title" ``` {% configuration %} @@ -348,17 +348,17 @@ inline_keyboard: ```yaml ... actions: - action: notify.NOTIFIER_NAME - data: - title: Send a document - message: "That's an example that sends a document and a custom keyboard." + - action: notify.NOTIFIER_NAME data: - document: - file: /tmp/whatever.odf - caption: Document Title xy - keyboard: - - '/command1, /command2' - - '/command3, /command4' + title: "Send a document" + message: "That's an example that sends a document and a custom keyboard." + data: + document: + file: /tmp/whatever.odf + caption: "Document Title xy" + keyboard: + - '/command1, /command2' + - '/command3, /command4' ``` {% configuration %} @@ -408,14 +408,14 @@ inline_keyboard: ... actions: - action: notify.NOTIFIER_NAME - data: - title: Send location - message: Location updated. + - action: notify.NOTIFIER_NAME data: - location: - latitude: 32.87336 - longitude: 117.22743 + title: "Send location" + message: "Location updated." + data: + location: + latitude: 32.87336 + longitude: 117.22743 ``` {% configuration %} @@ -442,17 +442,17 @@ inline_keyboard: ```yaml ... actions: - action: notify.NOTIFIER_NAME - data: - title: "*Send a message*" - message: |- - That's an example that sends a message with message_tag, disable_notification and disable_web_page_preview. - HA site + - action: notify.NOTIFIER_NAME data: - parse_mode: html - message_tag: "example_tag" - disable_notification: True - disable_web_page_preview: True + title: "*Send a message*" + message: |- + That's an example that sends a message with message_tag, disable_notification and disable_web_page_preview. + HA site + data: + parse_mode: html + message_tag: "example_tag" + disable_notification: True + disable_web_page_preview: True ``` {% configuration %} diff --git a/source/_integrations/telegram_bot.markdown b/source/_integrations/telegram_bot.markdown index 99dd6aaf43b..329ee348122 100644 --- a/source/_integrations/telegram_bot.markdown +++ b/source/_integrations/telegram_bot.markdown @@ -345,12 +345,12 @@ chat_id: "" Simple ping pong example. ```yaml -alias: 'Telegram bot that reply pong to ping' +alias: "Telegram bot that reply pong to ping" triggers: - trigger: event - event_type: telegram_command - event_data: - command: "/ping" + - trigger: event + event_type: telegram_command + event_data: + command: "/ping" actions: - action: notify.notify data: @@ -361,10 +361,10 @@ An example that shows keyboard interaction with `notify.telegram` ```yaml triggers: - trigger: event - event_type: telegram_command - event_data: - command: "/start" + - trigger: event + event_type: telegram_command + event_data: + command: "/start" actions: - action: notify.telegram data: @@ -379,10 +379,10 @@ and an automation to trigger a related command "/siren". ```yaml triggers: - trigger: event - event_type: telegram_command - event_data: - command: "/siren" + - trigger: event + event_type: telegram_command + event_data: + command: "/siren" actions: - action: homeassistant.turn_on target: @@ -399,12 +399,12 @@ An example to show the use of event_data in action: {% raw %} ```yaml -- alias: 'Kitchen Telegram Speak' +- alias: "Kitchen Telegram Speak" triggers: - trigger: event - event_type: telegram_command - event_data: - command: "/speak" + - trigger: event + event_type: telegram_command + event_data: + command: "/speak" actions: - action: notify.kitchen_echo data: @@ -427,10 +427,10 @@ Text repeater: {% raw %} ```yaml -- alias: 'Telegram bot that repeats text' +- alias: "Telegram bot that repeats text" triggers: - trigger: event - event_type: telegram_text + - trigger: event + event_type: telegram_text actions: - action: telegram_bot.send_message data: @@ -450,12 +450,12 @@ Message editor: {% raw %} ```yaml -- alias: 'Telegram bot that edits the last sent message' +- alias: "Telegram bot that edits the last sent message" triggers: - trigger: event - event_type: telegram_callback - event_data: - command: "/edit_msg" + - trigger: event + event_type: telegram_callback + event_data: + command: "/edit_msg" actions: - action: telegram_bot.answer_callback_query data: @@ -483,12 +483,12 @@ Keyboard editor: {% raw %} ```yaml -- alias: 'Telegram bot that edits the keyboard' +- alias: "Telegram bot that edits the keyboard" triggers: - trigger: event - event_type: telegram_callback - event_data: - command: "/remove_button" + - trigger: event + event_type: telegram_callback + event_data: + command: "/remove_button" actions: - action: telegram_bot.answer_callback_query data: @@ -509,12 +509,12 @@ Only acknowledges the 'NO' answer: {% raw %} ```yaml -- alias: 'Telegram bot that simply acknowledges' +- alias: "Telegram bot that simply acknowledges" triggers: - trigger: event - event_type: telegram_callback - event_data: - command: "/do_nothing" + - trigger: event + event_type: telegram_callback + event_data: + command: "/do_nothing" actions: - action: telegram_bot.answer_callback_query data: @@ -529,12 +529,12 @@ Telegram callbacks also support arguments and commands the same way as normal me {% raw %} ```yaml -- alias: 'Telegram bot repeats arguments on callback query' +- alias: "Telegram bot repeats arguments on callback query" triggers: - trigger: event - event_type: telegram_callback - event_data: - command: "/repeat" + - trigger: event + event_type: telegram_callback + event_data: + command: "/repeat" actions: - action: telegram_bot.answer_callback_query data: @@ -554,10 +554,10 @@ Receiving `chat_id` and `message_id` identifiers of sent messages by the `telegr ```yaml - alias: 'Notifications about messages sent by Telegram bot' triggers: - trigger: event - event_type: telegram_sent - event_data: - message_tag: "msg_start" + - trigger: event + event_type: telegram_sent + event_data: + message_tag: "msg_start" actions: - action: input_number.set_value data_template: diff --git a/source/_integrations/thermoworks_smoke.markdown b/source/_integrations/thermoworks_smoke.markdown index 2cdb272f0e4..1b5488a96b4 100644 --- a/source/_integrations/thermoworks_smoke.markdown +++ b/source/_integrations/thermoworks_smoke.markdown @@ -108,13 +108,13 @@ input_number: automation: - alias: "Alert when My Smoke Probe 1 is above threshold" triggers: - trigger: template - value_template: >- - {% if (states("sensor.my_smoke_probe_1") | float) > (states("input_number.smoke_probe_1_threshold") | float) %} - True - {% else %} - False - {% endif %} + - trigger: template + value_template: >- + {% if (states("sensor.my_smoke_probe_1") | float) > (states("input_number.smoke_probe_1_threshold") | float) %} + True + {% else %} + False + {% endif %} actions: - action: notify.all data: diff --git a/source/_integrations/tibber.markdown b/source/_integrations/tibber.markdown index d4d533bf733..fa01b4d7fdf 100644 --- a/source/_integrations/tibber.markdown +++ b/source/_integrations/tibber.markdown @@ -43,11 +43,11 @@ To use notifications, please see the [getting started with automation page](/get ```yaml actions: - action: notify.send_message - data: - entity_id: notify.tibber - title: Your title - message: This is a message for you! + - action: notify.send_message + data: + entity_id: notify.tibber + title: "Your title" + message: "This is a message for you!" ``` ## Sensor @@ -144,12 +144,12 @@ The electricity price can be used to make automations. The sensor has a `max_pri ```yaml - alias: "Electricity price" triggers: - trigger: time_pattern - # Matches every hour at 1 minutes past whole - minutes: 1 + - trigger: time_pattern + # Matches every hour at 1 minutes past whole + minutes: 1 conditions: - condition: template - value_template: '{{ float(states('sensor.electricity_price_hamretunet_10')) > 0.9 * float(state_attr('sensor.electricity_price_hamretunet_10', 'max_price')) }}' + - condition: template + value_template: '{{ float(states('sensor.electricity_price_hamretunet_10')) > 0.9 * float(state_attr('sensor.electricity_price_hamretunet_10', 'max_price')) }}' actions: - action: notify.pushbullet data: @@ -158,6 +158,4 @@ The electricity price can be used to make automations. The sensor has a `max_pri message: "The electricity price is now {{ states('sensor.electricity_price_hamretunet_10') }}" ``` - - {% endraw %} diff --git a/source/_integrations/totalconnect.markdown b/source/_integrations/totalconnect.markdown index 5e188a99d10..275910d0942 100644 --- a/source/_integrations/totalconnect.markdown +++ b/source/_integrations/totalconnect.markdown @@ -36,38 +36,41 @@ Give the user access to your Location, along with a user code, usually a 4 digit **Require Code:** if enabled, you must enter the user code to disarm the alarm. ## Automation example + ```yaml automation: - alias: "Alarm: Disarmed Daytime" triggers: - trigger: state - entity_id: alarm_control_panel.total_connect - to: "disarmed" + - trigger: state + entity_id: alarm_control_panel.total_connect + to: "disarmed" conditions: - condition: sun - before: sunset + - condition: sun + before: sunset actions: - action: scene.turn_on - target: - entity_id: scene.OnDisarmedDaytime + - action: scene.turn_on + target: + entity_id: scene.on_disarmed_day_time + - alias: "Alarm: Armed Away" triggers: - trigger: state - entity_id: alarm_control_panel.total_connect - to: "armed_away" + - trigger: state + entity_id: alarm_control_panel.total_connect + to: "armed_away" actions: - action: scene.turn_on - target: - entity_id: scene.OnArmedAway + - action: scene.turn_on + target: + entity_id: scene.on_armed_away + - alias: "Alarm: Arm Home Instant at Sunset" triggers: - trigger: sun - event: sunset - offset: '0' + - trigger: sun + event: sunset + offset: 0 actions: - action: totalconnect.arm_home_instant - target: - entity_id: alarm_control_panel.total_connect + - action: totalconnect.arm_home_instant + target: + entity_id: alarm_control_panel.total_connect ``` {% details "Notes for Home Assistant Core Installations" %} diff --git a/source/_integrations/twilio.markdown b/source/_integrations/twilio.markdown index d57b3ea90b2..cdae2343b91 100644 --- a/source/_integrations/twilio.markdown +++ b/source/_integrations/twilio.markdown @@ -57,17 +57,17 @@ Here is an example: ```yaml automation: triggers: - trigger: event - event_type: twilio_data_received - event_data: - From: '+1XXXXXXXXXXX' - To: '+1YYYYYYYYYYY' - CallStatus: ringing - Direction: inbound + - trigger: event + event_type: twilio_data_received + event_data: + From: '+1XXXXXXXXXXX' + To: '+1YYYYYYYYYYY' + CallStatus: ringing + Direction: inbound actions: - action: cover.open_cover - target: - entity_id: cover.garage_door + - action: cover.open_cover + target: + entity_id: cover.garage_door ``` The above opens the garage door when the number `+1XXXXXXXXXXX` calls `+1YYYYYYYYYYY` (considering that `+1YYYYYYYYYYY` is one of your numbers registered in Twilio). @@ -76,7 +76,7 @@ An example of an SMS handler: {% raw %} ```yaml -alias: Twilio incoming +alias: "Twilio incoming" triggers: - trigger: event event_type: twilio_data_received diff --git a/source/_integrations/twilio_call.markdown b/source/_integrations/twilio_call.markdown index f5d0c6a0743..d39677cfacd 100644 --- a/source/_integrations/twilio_call.markdown +++ b/source/_integrations/twilio_call.markdown @@ -49,13 +49,13 @@ Twilio is a notification platform and thus can be controlled by calling the noti automation: - alias: "The sun has set" triggers: - trigger: sun - event: sunset + - trigger: sun + event: sunset actions: - action: notify.twilio_call - data: - message: "The sun has set" - target: - - +14151234567 - - +15105555555 + - action: notify.twilio_call + data: + message: "The sun has set" + target: + - +14151234567 + - +15105555555 ``` diff --git a/source/_integrations/twilio_sms.markdown b/source/_integrations/twilio_sms.markdown index 3bdd13b2ff3..5850f113425 100644 --- a/source/_integrations/twilio_sms.markdown +++ b/source/_integrations/twilio_sms.markdown @@ -52,16 +52,16 @@ Media can be included with messages by setting the optional `media_url` variable automation: - alias: "The sun has set" triggers: - trigger: sun - event: sunset + - trigger: sun + event: sunset actions: - action: notify.twilio_sms - data: - message: "The sun has set" - target: - - '+14151234567' - - '+15105555555' + - action: notify.twilio_sms data: - media_url: - - "https://www.home-assistant.io/images/supported_brands/home-assistant.png" + message: "The sun has set" + target: + - '+14151234567' + - '+15105555555' + data: + media_url: + - "https://www.home-assistant.io/images/supported_brands/home-assistant.png" ``` diff --git a/source/_integrations/universal.markdown b/source/_integrations/universal.markdown index 4a0735dc028..0083d073bc9 100644 --- a/source/_integrations/universal.markdown +++ b/source/_integrations/universal.markdown @@ -226,7 +226,7 @@ media_player: volume_level: media_player.kodi|volume_level - platform: kodi - name: Kodi + name: "Kodi" host: 192.168.1.10 turn_on_action: - action: input_boolean.turn_on @@ -240,6 +240,7 @@ media_player: addonid: script.json-cec params: command: activate + turn_off_action: - action: input_boolean.turn_off target: @@ -257,23 +258,24 @@ media_player: command: standby automation: - - alias: Turn on the TV when Kodi is activated + - alias: "Turn on the TV when Kodi is activated" triggers: - trigger: state - entity_id: media_player.kodi_tv - from: "off" - to: playing + - trigger: state + entity_id: media_player.kodi_tv + from: "off" + to: "playing" actions: - action: media_player.turn_on target: entity_id: media_player.kodi_tv - - alias: Turn off the TV when Kodi is in idle > 15 min + + - alias: "Turn off the TV when Kodi is in idle > 15 min" triggers: - trigger: state - entity_id: media_player.kodi_tv - to: idle - for: - minutes: 15 + - trigger: state + entity_id: media_player.kodi_tv + to: "idle" + for: + minutes: 15 actions: - action: media_player.turn_off target: diff --git a/source/_integrations/upb.markdown b/source/_integrations/upb.markdown index e5430e53241..c039b61f91f 100644 --- a/source/_integrations/upb.markdown +++ b/source/_integrations/upb.markdown @@ -176,20 +176,20 @@ Start a scene blinking. ```yaml #automation: -- alias: "'Specific scene activated'" +- alias: "Specific scene activated" description: "Trigger when scene 9 on network 42 is activated" triggers: - trigger: event - event_type: upb.scene_changed - event_data: - command: activated - address: "42_9" + - trigger: event + event_type: upb.scene_changed + event_data: + command: activated + address: "42_9" actions: - action: persistent_notification.create - data: - title: "Scene Activated" - message: > - Activated scene 9 on network 42: {{trigger.event.data.command}}, {{trigger.event.data.address}} + - action: persistent_notification.create + data: + title: "Scene Activated" + message: > + Activated scene 9 on network 42: {{trigger.event.data.command}}, {{trigger.event.data.address}} ``` diff --git a/source/_integrations/update.markdown b/source/_integrations/update.markdown index b383b0db9f6..932bf1cb5d7 100644 --- a/source/_integrations/update.markdown +++ b/source/_integrations/update.markdown @@ -148,13 +148,13 @@ the update for a light bulb becomes available. automation: - alias: "Send notification when update available" triggers: - trigger: state - entity_id: update.my_light_bulb - to: "on" + - trigger: state + entity_id: update.my_light_bulb + to: "on" actions: - alias: "Send notification to my phone about the update" - action: notify.iphone - data: - title: "New update available" - message: "New update available for my_light_bulb!" + - alias: "Send notification to my phone about the update" + action: notify.iphone + data: + title: "New update available" + message: "New update available for my_light_bulb!" ``` diff --git a/source/_integrations/vacuum.mqtt.markdown b/source/_integrations/vacuum.mqtt.markdown index 12e665ab47c..dd09750f59d 100644 --- a/source/_integrations/vacuum.mqtt.markdown +++ b/source/_integrations/vacuum.mqtt.markdown @@ -278,13 +278,13 @@ Action trigger example: - trigger: state entity_id: sensor.sensor actions: - action: vacuum.send_command - target: - entity_id: vacuum.vacuum_entity - data: - command: "custom_command" - params: - - key: value + - action: vacuum.send_command + target: + entity_id: vacuum.vacuum_entity + data: + command: "custom_command" + params: + - key: value ``` MQTT topic: `vacuum/send_command` diff --git a/source/_integrations/valve.markdown b/source/_integrations/valve.markdown index b5adc82ab29..4b38e165503 100644 --- a/source/_integrations/valve.markdown +++ b/source/_integrations/valve.markdown @@ -58,8 +58,8 @@ Valves that allow setting a specific position may also be controlled with `valve ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: valve.close target: @@ -80,8 +80,8 @@ Set the position of one or multiple valves if they support setting a specific po ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: valve.set_position target: diff --git a/source/_integrations/velbus.markdown b/source/_integrations/velbus.markdown index 172adcde8a9..1e1ff9fa19c 100644 --- a/source/_integrations/velbus.markdown +++ b/source/_integrations/velbus.markdown @@ -82,11 +82,11 @@ script: trash_memo: alias: "Trash memo text" sequence: - - data: + - action: velbus.set_memo_text + data: address: 65 memo_text: "It's trash day" interface: "tls://192.168.1.9:27015" - action: velbus.set_memo_text ``` ### Action `velbus.clear_cache` @@ -122,47 +122,46 @@ The actual linking can be realized by two automation rules. One rule to control ```yaml # Control light living from Velbus push_button_10 -- id: 'Control_light_living_from_Velbus' - alias: "Control light living using Velbus push_button_10" +- alias: "Control light living using Velbus push_button_10" triggers: - - entity_id: binary_sensor.push_button_10 - trigger: state - to: "on" - conditions: [] + - trigger: state + entity_id: binary_sensor.push_button_10 + to: "on" actions: - - entity_id: light.living - action: light.toggle + - action: light.toggle + entity_id: light.living + # Keep status LED push_button_10 in sync to status light living -- id: 'Update LED of push_button_10' - alias: "Update LED state of push_button_10" +- alias: "Update LED state of push_button_10" triggers: - - entity_id: light.living - trigger: state - to: "on" - - entity_id: light.living - trigger: state - to: "off" - conditions: [] + - trigger: state + entity_id: light.living + to: "on" + - trigger: state + entity_id: light.living + to: "off" + conditions: + - condition: or + conditions: + - condition: and + conditions: + - condition: state + entity_id: light.led_push_button_10 + state: "on" + - condition: state + entity_id: light.living + state: "off" + - condition: and + conditions: + - condition: state + entity_id: light.led_push_button_10 + state: "off" + - condition: state + entity_id: light.living + state: "on" actions: - - condition: or - conditions: - - condition: and - conditions: - - condition: state - entity_id: light.led_push_button_10 - state: "on" - - condition: state - entity_id: light.living - state: "off" - - condition: and - conditions: - - condition: state - entity_id: light.led_push_button_10 - state: "off" - - condition: state - entity_id: light.living - state: "on" - - entity_id: light.led_push_button_10 - action: light.toggle + - action: light.toggle + entity_id: light.led_push_button_10 + ``` diff --git a/source/_integrations/velux.markdown b/source/_integrations/velux.markdown index cbb8141ec06..5456babc746 100644 --- a/source/_integrations/velux.markdown +++ b/source/_integrations/velux.markdown @@ -48,13 +48,13 @@ As a workaround, you can use an automation to force a restart of the KLF 200 bef ```yaml automation: - alias: KLF reboot on hass stop event - description: Reboots the KLF200 in order to avoid SSL Handshake issue - triggers: - - trigger: homeassistant - event: shutdown - actions: - - action: velux.reboot_gateway + - alias: "KLF reboot on hass stop event" + description: "Reboots the KLF200 in order to avoid SSL Handshake issue" + triggers: + - trigger: homeassistant + event: shutdown + actions: + - action: velux.reboot_gateway ``` ## Velux Active (KIX 300) diff --git a/source/_integrations/vivotek.markdown b/source/_integrations/vivotek.markdown index dde5a43382c..95ff695e816 100644 --- a/source/_integrations/vivotek.markdown +++ b/source/_integrations/vivotek.markdown @@ -122,11 +122,11 @@ For example, the following action in an automation would send an `hls` live stre ```yaml actions: - action: camera.play_stream - target: - entity_id: camera.yourcamera - data: - media_player: media_player.chromecast + - action: camera.play_stream + target: + entity_id: camera.yourcamera + data: + media_player: media_player.chromecast ``` #### Action `enable_motion_detection` @@ -162,11 +162,11 @@ For example, the following action is an automation that would take a snapshot fr ```yaml actions: - action: camera.snapshot - target: - entity_id: camera.front_door_camera - data: - filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg' + - action: camera.snapshot + target: + entity_id: camera.front_door_camera + data: + filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg' ``` {% endraw %} diff --git a/source/_integrations/water_heater.markdown b/source/_integrations/water_heater.markdown index b2717e3084e..b7af270d6c8 100644 --- a/source/_integrations/water_heater.markdown +++ b/source/_integrations/water_heater.markdown @@ -59,8 +59,8 @@ Sets target temperature of water heater device. ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: water_heater.set_temperature target: @@ -84,8 +84,8 @@ Set operation mode for water heater device ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: water_heater.set_operation_mode target: @@ -108,8 +108,8 @@ Turn away mode on or off for water heater device ```yaml automation: triggers: - trigger: time - at: "07:15:00" + - trigger: time + at: "07:15:00" actions: - action: water_heater.set_away_mode target: diff --git a/source/_integrations/webostv.markdown b/source/_integrations/webostv.markdown index c1651c6a401..f5cd57c02ca 100644 --- a/source/_integrations/webostv.markdown +++ b/source/_integrations/webostv.markdown @@ -163,15 +163,15 @@ The icon can be overridden for individual notifications by providing a path to a automation: - alias: "Front door motion" triggers: - trigger: state - entity_id: binary_sensor.front_door_motion - to: "on" + - trigger: state + entity_id: binary_sensor.front_door_motion + to: "on" actions: - action: notify.livingroom_tv - data: - message: "Movement detected: Front Door" + - action: notify.livingroom_tv data: - icon: "/home/homeassistant/images/doorbell.png" + message: "Movement detected: Front Door" + data: + icon: "/home/homeassistant/images/doorbell.png" ``` ## Notes diff --git a/source/_integrations/workday.markdown b/source/_integrations/workday.markdown index 7e40f982ea2..067f3ac54b4 100644 --- a/source/_integrations/workday.markdown +++ b/source/_integrations/workday.markdown @@ -85,14 +85,14 @@ Example usage for automation: automation: alias: "Turn on heater on workdays" triggers: - trigger: time - at: "08:00:00" + - trigger: time + at: "08:00:00" conditions: - condition: state - entity_id: binary_sensor.workday_sensor - state: "on" + - condition: state + entity_id: binary_sensor.workday_sensor + state: "on" actions: - action: switch.turn_on - target: - entity_id: switch.heater + - action: switch.turn_on + target: + entity_id: switch.heater ``` diff --git a/source/_integrations/xiaomi_aqara.markdown b/source/_integrations/xiaomi_aqara.markdown index 00f86e0e63d..112c1b71969 100644 --- a/source/_integrations/xiaomi_aqara.markdown +++ b/source/_integrations/xiaomi_aqara.markdown @@ -164,29 +164,29 @@ This example plays the sound of a dog barking when the button is held down and s ```yaml - alias: "Let a dog bark on long press" triggers: - trigger: event - event_type: xiaomi_aqara.click - event_data: - entity_id: binary_sensor.switch_158d000xxxxxc2 - click_type: long_click_press + - trigger: event + event_type: xiaomi_aqara.click + event_data: + entity_id: binary_sensor.switch_158d000xxxxxc2 + click_type: long_click_press actions: - action: xiaomi_aqara.play_ringtone - data: - gw_mac: xxxxxxxxxxxx - ringtone_id: 8 - ringtone_vol: 8 + - action: xiaomi_aqara.play_ringtone + data: + gw_mac: xxxxxxxxxxxx + ringtone_id: 8 + ringtone_vol: 8 - alias: "Stop barking immediately on single click" triggers: - trigger: event - event_type: xiaomi_aqara.click - event_data: - entity_id: binary_sensor.switch_158d000xxxxxc2 - click_type: single + - trigger: event + event_type: xiaomi_aqara.click + event_data: + entity_id: binary_sensor.switch_158d000xxxxxc2 + click_type: single actions: - action: xiaomi_aqara.stop_ringtone - data: - gw_mac: xxxxxxxxxxxx + - action: xiaomi_aqara.stop_ringtone + data: + gw_mac: xxxxxxxxxxxx ``` ### Double click on smart button @@ -196,15 +196,15 @@ This example toggles the living room lamp on a double click of the button. ```yaml - alias: "Double Click to toggle living room lamp" triggers: - trigger: event - event_type: xiaomi_aqara.click - event_data: - entity_id: binary_sensor.switch_158d000xxxxxc2 - click_type: double + - trigger: event + event_type: xiaomi_aqara.click + event_data: + entity_id: binary_sensor.switch_158d000xxxxxc2 + click_type: double actions: - action: light.toggle - target: - entity_id: light.living_room_lamp + - action: light.toggle + target: + entity_id: light.living_room_lamp ``` ## Troubleshooting diff --git a/source/_integrations/xiaomi_miio.markdown b/source/_integrations/xiaomi_miio.markdown index 55df3d0f315..f888856dba4 100644 --- a/source/_integrations/xiaomi_miio.markdown +++ b/source/_integrations/xiaomi_miio.markdown @@ -1500,9 +1500,8 @@ Inline array: automation: - alias: "Test vacuum zone3" triggers: - - event: start - trigger: homeassistant - conditions: [] + - trigger: homeassistant + event: start actions: - action: xiaomi_miio.vacuum_clean_zone target: @@ -1521,9 +1520,8 @@ Array with inline zone: automation: - alias: "Test vacuum zone3" triggers: - - event: start - trigger: homeassistant - conditions: [] + - trigger: homeassistant + event: start actions: - action: xiaomi_miio.vacuum_clean_zone target: @@ -1543,9 +1541,8 @@ Array mode: automation: - alias: "Test vacuum zone3" triggers: - - event: start - trigger: homeassistant - conditions: [] + - trigger: homeassistant + event: start actions: - action: xiaomi_miio.vacuum_clean_zone target: @@ -1580,9 +1577,8 @@ Multiple segments: automation: - alias: "Vacuum kitchen and living room" triggers: - - event: start - trigger: homeassistant - conditions: [] + - trigger: homeassistant + event: start actions: - action: xiaomi_miio.vacuum_clean_segment target: @@ -1597,9 +1593,8 @@ Single segment: automation: - alias: "Vacuum kitchen" triggers: - - event: start - trigger: homeassistant - conditions: [] + - trigger: homeassistant + event: start actions: - action: xiaomi_miio.vacuum_clean_segment target: @@ -1614,8 +1609,8 @@ The original app for Xiaomi vacuum has a nice feature of room cleaning with repe automation: - alias: "Vacuum kitchen" triggers: - - event: start - trigger: homeassistant + - trigger: homeassistant + event: start actions: - action: xiaomi_miio.vacuum_clean_segment target: diff --git a/source/_integrations/yale.markdown b/source/_integrations/yale.markdown index 6ae90c2bf2a..bc696f45b40 100644 --- a/source/_integrations/yale.markdown +++ b/source/_integrations/yale.markdown @@ -137,20 +137,17 @@ Using the lock operation sensors, you can detect when a user operates a lock and {% raw %} ```yaml -- id: "1583706446906" - alias: "joe_doe_front_door_operate" - description: John Doe locks or unlocks the Front Door +- alias: "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') }}" + - condition: template + value_template: "{{ not state_attr('sensor.front_door_operator', 'remote') }}" actions: - - data: {} - entity_id: camera.inside - service: camera.turn_off + - action: camera.turn_off + entity_id: camera.inside ``` {% endraw %} diff --git a/source/_integrations/zwave_js.markdown b/source/_integrations/zwave_js.markdown index f07493e2e0c..aacd2786d92 100644 --- a/source/_integrations/zwave_js.markdown +++ b/source/_integrations/zwave_js.markdown @@ -672,23 +672,23 @@ This trigger platform can be used to trigger automations on any Z-Wave JS value ```yaml # Fires whenever the `latchStatus` value changes from `closed` to `opened` on the three devices (devices will be derived from an entity ID). triggers: - trigger: zwave_js.value_updated - # At least one `device_id` or `entity_id` must be provided - device_id: 45d7d3230dbb7441473ec883dab294d4 # Garage Door Lock device ID - entity_id: - - lock.front_lock - - lock.back_door - # `property` and `command_class` are required - command_class: 98 # Door Lock CC - property: "latchStatus" - # `property_key` and `endpoint` are optional - property_key: null - endpoint: 0 - # `from` and `to` will both accept lists of values and the trigger will fire if the value update matches any of the listed values - from: - - "closed" - - "jammed" - to: "opened" + - trigger: zwave_js.value_updated + # At least one `device_id` or `entity_id` must be provided + device_id: 45d7d3230dbb7441473ec883dab294d4 # Garage Door Lock device ID + entity_id: + - lock.front_lock + - lock.back_door + # `property` and `command_class` are required + command_class: 98 # Door Lock CC + property: "latchStatus" + # `property_key` and `endpoint` are optional + property_key: null + endpoint: 0 + # `from` and `to` will both accept lists of values and the trigger will fire if the value update matches any of the listed values + from: + - "closed" + - "jammed" + to: "opened" ``` #### Available trigger data @@ -722,21 +722,21 @@ There is strict validation in place based on all known event types, so if you co ```yaml # Fires whenever the `interview failed` event is fired on the three devices (devices will be derived from device and entity IDs). triggers: - trigger: zwave_js.event - # At least one `device_id` or `entity_id` must be provided for `node` events. For any other events, a `config_entry_id` needs to be provided. - device_id: 45d7d3230dbb7441473ec883dab294d4 # Garage Door Lock device ID - entity_id: - - lock.front_lock - - lock.back_door - config_entry_id: - # `event_source` and `event` are required - event_source: node # options are node, controller, and driver - event: "interview failed" # event names can be retrieved from the Z-Wave JS docs (see links above) - # `event_data` and `partial_dict_match` are optional. If `event_data` isn't included, all events of a given type for the given context will trigger the automation. When the `interview failed` event is fired, all argument live in a dictionary within the `event_data` dictionary under the `args` key. The default behavior is to require a full match of the event_data dictionary below and the dictionary that is passed to the event. By setting `partial_dict_match` to true, Home Assistant will check if the isFinal argument is true and ignore any other values in the dictionary. If this setting was false, this trigger would never fire because the dictionary always contains more keys than `isFinal` so the comparison check would never evaluate to true. - event_data: - args: - isFinal: true - partial_dict_match: true # defaults to false + - trigger: zwave_js.event + # At least one `device_id` or `entity_id` must be provided for `node` events. For any other events, a `config_entry_id` needs to be provided. + device_id: 45d7d3230dbb7441473ec883dab294d4 # Garage Door Lock device ID + entity_id: + - lock.front_lock + - lock.back_door + config_entry_id: + # `event_source` and `event` are required + event_source: node # options are node, controller, and driver + event: "interview failed" # event names can be retrieved from the Z-Wave JS docs (see links above) + # `event_data` and `partial_dict_match` are optional. If `event_data` isn't included, all events of a given type for the given context will trigger the automation. When the `interview failed` event is fired, all argument live in a dictionary within the `event_data` dictionary under the `args` key. The default behavior is to require a full match of the event_data dictionary below and the dictionary that is passed to the event. By setting `partial_dict_match` to true, Home Assistant will check if the isFinal argument is true and ignore any other values in the dictionary. If this setting was false, this trigger would never fire because the dictionary always contains more keys than `isFinal` so the comparison check would never evaluate to true. + event_data: + args: + isFinal: true + partial_dict_match: true # defaults to false ``` #### Available trigger data