From a1d0b36e81b2459af81424acb7c89a88bf7eb9a0 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 15 Feb 2021 12:32:12 +0100 Subject: [PATCH] Update some service calls to use target (#16575) --- .../automation_enocean_phue.markdown | 6 ++- .../_cookbook/automation_first_light.markdown | 12 ++++-- .../automation_flashing_lights.markdown | 9 ++-- .../automation_for_rainy_days.markdown | 6 ++- source/_cookbook/automation_sun.markdown | 15 ++++--- ...n_using_timeinterval_inputboolean.markdown | 3 +- .../dim_and_brighten_lights.markdown | 9 ++-- .../dim_lights_when_playing_media.markdown | 6 ++- ...ha_if_wemo_switch_is_not_detected.markdown | 6 ++- ...r_10_minutes_when_motion_detected.markdown | 12 ++++-- source/_docs/automation/trigger.markdown | 18 +++++--- .../splitting_configuration.markdown | 24 +++++++---- source/_docs/scene.markdown | 3 +- source/_docs/scripts.markdown | 38 ++++++++++------- source/_docs/z-wave/device-specific.markdown | 9 ++-- source/_integrations/alexa.intent.markdown | 3 +- source/_integrations/arlo.markdown | 9 ++-- .../binary_sensor.xiaomi_aqara.markdown | 42 ++++++++++++------- source/_integrations/blink.markdown | 6 ++- source/_integrations/caldav.markdown | 3 +- source/_integrations/deconz.markdown | 6 ++- source/_integrations/doods.markdown | 3 +- source/_integrations/doorbird.markdown | 3 +- source/_integrations/emulated_roku.markdown | 3 +- source/_integrations/feedreader.markdown | 3 +- source/_integrations/fireservicerota.markdown | 6 ++- source/_integrations/flic.markdown | 3 +- source/_integrations/foursquare.markdown | 3 +- .../_integrations/google_travel_time.markdown | 3 +- source/_integrations/griddy.markdown | 3 +- source/_integrations/harmony.markdown | 9 ++-- .../_integrations/here_travel_time.markdown | 3 +- source/_integrations/homematic.markdown | 9 ++-- .../hunterdouglas_powerview.markdown | 3 +- source/_integrations/input_datetime.markdown | 3 +- source/_integrations/input_number.markdown | 3 +- source/_integrations/insteon.markdown | 12 ++++-- source/_integrations/isy994.markdown | 3 +- source/_integrations/keyboard_remote.markdown | 3 +- source/_integrations/lifx_cloud.markdown | 3 +- source/_integrations/lirc.markdown | 3 +- source/_integrations/mailgun.markdown | 3 +- source/_integrations/manual.markdown | 6 ++- source/_integrations/osramlightify.markdown | 3 +- source/_integrations/plex.markdown | 3 +- source/_integrations/rainbird.markdown | 3 +- source/_integrations/rfxtrx.markdown | 3 +- source/_integrations/scene.markdown | 3 +- source/_integrations/script.markdown | 6 ++- source/_integrations/shelly.markdown | 6 ++- source/_integrations/squeezebox.markdown | 3 +- .../_integrations/switch.mysensors.markdown | 6 ++- source/_integrations/system_log.markdown | 3 +- source/_integrations/telegram_bot.markdown | 6 ++- source/_integrations/template.markdown | 3 +- source/_integrations/tensorflow.markdown | 3 +- source/_integrations/timer.markdown | 15 ++++--- source/_integrations/totalconnect.markdown | 6 ++- source/_integrations/twilio.markdown | 3 +- source/_integrations/universal.markdown | 18 +++++--- source/_integrations/upb.markdown | 14 ++++--- source/_integrations/utility_meter.markdown | 6 ++- source/_integrations/workday.markdown | 3 +- source/_integrations/xiaomi_miio.markdown | 6 ++- .../_integrations/yale_smart_alarm.markdown | 6 ++- ...19-alarm-sonos-and-itunes-support.markdown | 3 +- ...hat-cant-track-themselves-part-ii.markdown | 9 ++-- ...6-08-03-laundry-automation-update.markdown | 6 ++- source/_posts/2017-02-04-babyphone.markdown | 31 +++++++++----- source/_posts/2020-02-05-release-105.markdown | 3 +- .../2020-02-11-android-16-17-release.markdown | 3 +- source/_posts/2020-05-20-release-110.markdown | 3 +- source/_posts/2020-07-01-release-113.markdown | 15 ++++--- source/_posts/2020-10-07-release-116.markdown | 6 ++- .../_posts/2020-12-13-release-202012.markdown | 3 +- 75 files changed, 362 insertions(+), 186 deletions(-) diff --git a/source/_cookbook/automation_enocean_phue.markdown b/source/_cookbook/automation_enocean_phue.markdown index 58de9813d52..2d5f60b6436 100644 --- a/source/_cookbook/automation_enocean_phue.markdown +++ b/source/_cookbook/automation_enocean_phue.markdown @@ -33,7 +33,8 @@ automation: devname: living_room_switch action: service: light.turn_on - entity_id: light.hue_color_lamp_3 + target: + entity_id: light.hue_color_lamp_3 - alias: "Turn off living room light" trigger: @@ -44,5 +45,6 @@ automation: devname: living_room_switch action: service: light.turn_off - entity_id: light.hue_color_lamp_3 + target: + entity_id: light.hue_color_lamp_3 ``` diff --git a/source/_cookbook/automation_first_light.markdown b/source/_cookbook/automation_first_light.markdown index b693e5ee5f3..e31a5db69ea 100644 --- a/source/_cookbook/automation_first_light.markdown +++ b/source/_cookbook/automation_first_light.markdown @@ -29,7 +29,8 @@ automation: at: "05:00:00" action: service: homeassistant.turn_on - entity_id: input_boolean.trigger_first_morning + target: + entity_id: input_boolean.trigger_first_morning # turns it off an hour after sunrise - alias: "Disable First Morning Trigger" @@ -39,7 +40,8 @@ automation: offset: "01:00:00" action: service: homeassistant.turn_off - entity_id: input_boolean.trigger_first_morning + target: + entity_id: input_boolean.trigger_first_morning @@ -60,7 +62,8 @@ automation: # turn off the "waiting" boolean regardless of whether lights will turn on # so that this happens only once - service: homeassistant.turn_off - entity_id: input_boolean.trigger_first_morning + target: + entity_id: input_boolean.trigger_first_morning # But only turn on lights if the living room and kitchen lights are off or dimmed # If a condition tests false, the automation will end @@ -84,7 +87,8 @@ automation: # Trigger a scene # You could add as many services or scenes as you'd like - service: scene.turn_on - entity_id: scene.morning_first_motion + target: + entity_id: scene.morning_first_motion ``` {% endraw %} diff --git a/source/_cookbook/automation_flashing_lights.markdown b/source/_cookbook/automation_flashing_lights.markdown index 625c5480b3c..d2960cf8978 100644 --- a/source/_cookbook/automation_flashing_lights.markdown +++ b/source/_cookbook/automation_flashing_lights.markdown @@ -29,7 +29,8 @@ automation: # start alarm on movement if alarm activated # and the alarm is not triggered service: script.turn_on - entity_id: script.alarm_room1 + target: + entity_id: script.alarm_room1 - alias: "flash_room1_start" trigger: @@ -38,7 +39,8 @@ automation: to: "on" action: service: script.turn_on - entity_id: script.flash_room1 + target: + entity_id: script.flash_room1 - alias: "flash_room1_stop" trigger: @@ -51,7 +53,8 @@ automation: state: "off" action: service: script.turn_off - entity_id: script.flash_room1 + target: + entity_id: script.flash_room1 script: alarm_room1: diff --git a/source/_cookbook/automation_for_rainy_days.markdown b/source/_cookbook/automation_for_rainy_days.markdown index b29dcafa266..4a481e30015 100644 --- a/source/_cookbook/automation_for_rainy_days.markdown +++ b/source/_cookbook/automation_for_rainy_days.markdown @@ -24,7 +24,8 @@ automation: before: "23:00" action: service: light.turn_on - entity_id: light.couch_lamp + target: + entity_id: light.couch_lamp ``` And then of course turn off the lamp when it stops raining but only if it's within an hour before sunset. @@ -41,6 +42,7 @@ And then of course turn off the lamp when it stops raining but only if it's with after_offset: "-01:00:00" action: service: light.turn_off - entity_id: light.couch_lamp + target: + entity_id: light.couch_lamp ``` diff --git a/source/_cookbook/automation_sun.markdown b/source/_cookbook/automation_sun.markdown index eaa9630eabb..959a580de4d 100644 --- a/source/_cookbook/automation_sun.markdown +++ b/source/_cookbook/automation_sun.markdown @@ -18,7 +18,8 @@ automation: state: home action: service: light.turn_on - entity_id: group.living_room_lights + target: + entity_id: group.living_room_lights ``` #### Natural wake up light @@ -32,7 +33,8 @@ automation: at: "07:15:00" action: service: light.turn_on - entity_id: light.bedroom + target: + entity_id: light.bedroom data: # 900 seconds = 15 minutes transition: 900 @@ -79,7 +81,8 @@ Solar elevation automations can cope with offsets from sunset / sunrise as the s below: 3.5 action: service: scene.turn_on - entity_id: scene.background_lights + target: + entity_id: scene.background_lights - alias: "Turn more lights on as the sun gets dimmer" trigger: @@ -89,7 +92,8 @@ Solar elevation automations can cope with offsets from sunset / sunrise as the s below: 1.5 action: service: scene.turn_on - entity_id: scene.more_lights + target: + entity_id: scene.more_lights - alias: "Close blind at dusk" trigger: @@ -99,7 +103,8 @@ Solar elevation automations can cope with offsets from sunset / sunrise as the s below: -2.5 action: service: switch.turn_off - entity_id: switch.blind + target: + entity_id: switch.blind ``` {% endraw %} \ No newline at end of file diff --git a/source/_cookbook/automation_using_timeinterval_inputboolean.markdown b/source/_cookbook/automation_using_timeinterval_inputboolean.markdown index 7307f890f96..070399ddded 100644 --- a/source/_cookbook/automation_using_timeinterval_inputboolean.markdown +++ b/source/_cookbook/automation_using_timeinterval_inputboolean.markdown @@ -27,7 +27,8 @@ automation: state: "on" action: service: light.turn_on - entity_id: light.woonkamer_livingcolors + target: + entity_id: light.woonkamer_livingcolors data: effect: random transition: 5 diff --git a/source/_cookbook/dim_and_brighten_lights.markdown b/source/_cookbook/dim_and_brighten_lights.markdown index d55874a6da4..a2eec5da950 100644 --- a/source/_cookbook/dim_and_brighten_lights.markdown +++ b/source/_cookbook/dim_and_brighten_lights.markdown @@ -23,7 +23,8 @@ automation: entity_id: zwave.YOUR_REMOTE action: - service: script.turn_on - entity_id: script.ramp_light + target: + entity_id: script.ramp_light data: variables: direction: up @@ -39,7 +40,8 @@ automation: entity_id: zwave.YOUR_REMOTE action: - service: script.turn_on - entity_id: script.ramp_light + target: + entity_id: script.ramp_light data: variables: direction: down @@ -60,7 +62,8 @@ automation: entity_id: zwave.YOUR_REMOTE action: - service: script.turn_off - entity_id: script.ramp_light + target: + entity_id: script.ramp_light ``` There are two variables that control the speed of the change for the script below. The first is the step -- small steps create a smooth transition. The second is the delay -- larger delays will create a slower transition. diff --git a/source/_cookbook/dim_lights_when_playing_media.markdown b/source/_cookbook/dim_lights_when_playing_media.markdown index da90ecb3763..45231c140fc 100644 --- a/source/_cookbook/dim_lights_when_playing_media.markdown +++ b/source/_cookbook/dim_lights_when_playing_media.markdown @@ -53,7 +53,8 @@ automation: state: "below_horizon" action: service: scene.turn_on - entity_id: scene.livingroom_normal + target: + entity_id: scene.livingroom_normal - alias: "Media player playing" trigger: @@ -67,6 +68,7 @@ automation: state: "below_horizon" action: service: scene.turn_on - entity_id: scene.livingroom_dim + target: + entity_id: scene.livingroom_dim ``` diff --git a/source/_cookbook/restart_ha_if_wemo_switch_is_not_detected.markdown b/source/_cookbook/restart_ha_if_wemo_switch_is_not_detected.markdown index cf9347b9df8..88321c79d9f 100644 --- a/source/_cookbook/restart_ha_if_wemo_switch_is_not_detected.markdown +++ b/source/_cookbook/restart_ha_if_wemo_switch_is_not_detected.markdown @@ -73,7 +73,8 @@ automation: state: "off" action: service: homeassistant.turn_on - entity_id: script.restarthawemo + target: + entity_id: script.restarthawemo - alias: "Stop HA" trigger: - platform: state @@ -91,7 +92,8 @@ automation: state: "on" action: service: homeassistant.turn_off - entity_id: script.restarthawemo + target: + entity_id: script.restarthawemo ``` {% endraw %} diff --git a/source/_cookbook/turn_on_light_for_10_minutes_when_motion_detected.markdown b/source/_cookbook/turn_on_light_for_10_minutes_when_motion_detected.markdown index dce4b55bb26..ab760f4a038 100644 --- a/source/_cookbook/turn_on_light_for_10_minutes_when_motion_detected.markdown +++ b/source/_cookbook/turn_on_light_for_10_minutes_when_motion_detected.markdown @@ -17,7 +17,8 @@ automation: to: "on" action: service: light.turn_on - entity_id: light.kitchen_light + target: + entity_id: light.kitchen_light - alias: "Turn off kitchen light 10 minutes after last movement" trigger: @@ -28,7 +29,8 @@ automation: minutes: 10 action: service: light.turn_off - entity_id: light.kitchen_light + target: + entity_id: light.kitchen_light ``` Or in the case of multiple sensors/triggers: @@ -82,7 +84,8 @@ You can also restrict lights from turning on based on time of day and implement before: "23:30" action: service: homeassistant.turn_on - entity_id: group.office_lights + target: + entity_id: group.office_lights data: transition: 15 @@ -96,7 +99,8 @@ You can also restrict lights from turning on based on time of day and implement minutes: 15 action: - service: homeassistant.turn_off - entity_id: group.office_lights + target: + entity_id: group.office_lights data: transition: 160 ``` diff --git a/source/_docs/automation/trigger.markdown b/source/_docs/automation/trigger.markdown index cb7a31a4d80..cb29a7e25ee 100644 --- a/source/_docs/automation/trigger.markdown +++ b/source/_docs/automation/trigger.markdown @@ -281,7 +281,8 @@ automation: seconds: "{{ states('input_number.lock_sec')|int }}" action: service: lock.lock - entity_id: lock.my_place + target: + entity_id: lock.my_place ``` {% endraw %} @@ -337,7 +338,8 @@ automation: below: -4.0 action: service: switch.turn_on - entity_id: switch.exterior_lighting + target: + entity_id: switch.exterior_lighting ``` {% endraw %} @@ -466,9 +468,11 @@ automation: to: "on" action: - service: climate.turn_on - entity_id: climate.office + target: + entity_id: climate.office - service: input_datetime.set_datetime - entity_id: input_datetime.turn_off_ac + target: + entity_id: input_datetime.turn_off_ac data: datetime: > {{ (now().timestamp() + 2*60*60) @@ -479,7 +483,8 @@ automation: at: input_datetime.turn_off_ac action: service: climate.turn_off - entity_id: climate.office + target: + entity_id: climate.office ``` {% endraw %} @@ -495,7 +500,8 @@ automation: at: sensor.phone_next_alarm action: service: light.turn_on - entity_id: light.bedroom + target: + entity_id: light.bedroom ``` #### Multiple Times diff --git a/source/_docs/configuration/splitting_configuration.markdown b/source/_docs/configuration/splitting_configuration.markdown index ce3bc8a533e..642048da29f 100644 --- a/source/_docs/configuration/splitting_configuration.markdown +++ b/source/_docs/configuration/splitting_configuration.markdown @@ -238,7 +238,8 @@ automation: to: "home" action: service: light.turn_on - entity_id: light.entryway + target: + entity_id: light.entryway - alias: "Automation 2" trigger: platform: state @@ -246,7 +247,8 @@ automation: from: "home" action: service: light.turn_off - entity_id: light.entryway + target: + entity_id: light.entryway ``` can be turned into: @@ -267,7 +269,8 @@ trigger: to: "home" action: service: light.turn_on - entity_id: light.entryway + target: + entity_id: light.entryway ``` `automation/presence/automation2.yaml` @@ -280,7 +283,8 @@ trigger: from: "home" action: service: light.turn_off - entity_id: light.entryway + target: + entity_id: light.entryway ``` It is important to note that each file must contain only **one** entry when using `!include_dir_list`. @@ -377,7 +381,8 @@ automation: to: "home" action: service: light.turn_on - entity_id: light.entryway + target: + entity_id: light.entryway - alias: "Automation 2" trigger: platform: state @@ -385,7 +390,8 @@ automation: from: "home" action: service: light.turn_off - entity_id: light.entryway + target: + entity_id: light.entryway ``` can be turned into: @@ -406,7 +412,8 @@ automation: !include_dir_merge_list automation/ to: "home" action: service: light.turn_on - entity_id: light.entryway + target: + entity_id: light.entryway - alias: "Automation 2" trigger: platform: state @@ -414,7 +421,8 @@ automation: !include_dir_merge_list automation/ from: "home" action: service: light.turn_off - entity_id: light.entryway + target: + entity_id: light.entryway ``` It is important to note that when using `!include_dir_merge_list`, you must include a list in each file (each list item is denoted with a hyphen [-]). Each file may contain one or more entries. diff --git a/source/_docs/scene.markdown b/source/_docs/scene.markdown index 8275f5a0103..e62e178d8ac 100644 --- a/source/_docs/scene.markdown +++ b/source/_docs/scene.markdown @@ -55,7 +55,8 @@ automation: to: "home" action: service: scene.turn_on - entity_id: scene.romantic + target: + entity_id: scene.romantic ``` ## Applying a scene without defining it diff --git a/source/_docs/scripts.markdown b/source/_docs/scripts.markdown index 0a90a89aee2..4165ada7b06 100644 --- a/source/_docs/scripts.markdown +++ b/source/_docs/scripts.markdown @@ -234,16 +234,18 @@ This can be used to take different actions based on whether or not the condition - service: script.door_did_not_open default: - service: script.turn_on - entity_id: - - script.door_did_open - - script.play_fanfare + target: + entity_id: + - script.door_did_open + - script.play_fanfare # Wait a total of 10 seconds. - wait_template: "{{ is_state('binary_sensor.door_1', 'on') }}" timeout: 10 continue_on_timeout: false - service: switch.turn_on - entity_id: switch.some_light + target: + entity_id: switch.some_light - wait_for_trigger: - platform: state entity_id: binary_sensor.door_2 @@ -252,7 +254,8 @@ This can be used to take different actions based on whether or not the condition timeout: "{{ wait.remaining }}" continue_on_timeout: false - service: switch.turn_off - entity_id: switch.some_light + target: + entity_id: switch.some_light ``` {% endraw %} @@ -486,7 +489,8 @@ automation: data: duration: 60 - service: light.turn_on - entity_id: all + target: + entity_id: all ``` ```yaml @@ -504,13 +508,15 @@ automation: value_template: "{{ trigger.to_state.state == 'on' }}" sequence: - service: script.turn_on - entity_id: - - script.slowly_turn_on_front_lights - - script.announce_someone_at_door + target: + entity_id: + - script.slowly_turn_on_front_lights + - script.announce_someone_at_door # ELSE (i.e., motion stopped) default: - service: light.turn_off - entity_id: light.front_lights + target: + entity_id: light.front_lights ``` ```yaml @@ -535,16 +541,19 @@ automation: value_template: "{{ now().hour < 18 }}" sequence: - service: light.turn_off - entity_id: light.living_room + target: + entity_id: light.living_room - service: script.sim_day # ELSE night default: - service: light.turn_off - entity_id: light.kitchen + target: + entity_id: light.kitchen - delay: minutes: "{{ range(1, 11)|random }}" - service: light.turn_off - entity_id: all + target: + entity_id: all ``` {% endraw %} @@ -573,7 +582,8 @@ automation: is_state('binary_sensor.all_clear', 'off') }} sequence: - service: script.turn_on - entity_id: script.flash_lights + target: + entity_id: script.flash_lights - service: script.arrive_home data: ok: false diff --git a/source/_docs/z-wave/device-specific.markdown b/source/_docs/z-wave/device-specific.markdown index 28e62a69236..aba1a59adf2 100644 --- a/source/_docs/z-wave/device-specific.markdown +++ b/source/_docs/z-wave/device-specific.markdown @@ -1165,7 +1165,8 @@ Let's see how this works in an automation for a Scene Master that's assigned as action: - data: service: light.toggle - entity_id: group.all_lights + target: + entity_id: group.all_lights ``` ### RFWDC Cooper 5-button Scene Control Keypad @@ -1402,7 +1403,8 @@ Example Event: scene_data: 7680 action: - service: switch.toggle - entity_id: switch.office_fan + target: + entity_id: switch.office_fan ``` ### Zooz S2 MultiRelay (Zen16) @@ -1604,7 +1606,8 @@ Example Event: scene_data: 0 action: - service: switch.toggle - entity_id: switch.office_fan + target: + entity_id: switch.office_fan ``` ### EATON On/Off & Dimmer (RF9501/RF9540-N/RF9640-N/RF9601-N) diff --git a/source/_integrations/alexa.intent.markdown b/source/_integrations/alexa.intent.markdown index 72f4d203dcd..b0b7b978791 100644 --- a/source/_integrations/alexa.intent.markdown +++ b/source/_integrations/alexa.intent.markdown @@ -299,7 +299,8 @@ intent_script: amzn1.ask.skill.08888888-7777-6666-5555-444444444444: action: service: script.turn_on - entity_id: script.red_alert + target: + entity_id: script.red_alert speech: type: plain text: OK diff --git a/source/_integrations/arlo.markdown b/source/_integrations/arlo.markdown index 19b2e8784ec..bc19851c80d 100644 --- a/source/_integrations/arlo.markdown +++ b/source/_integrations/arlo.markdown @@ -64,7 +64,8 @@ The Arlo integration also provides a camera service to enable/disable the motion event: start action: service: camera.enable_motion_detection - entity_id: camera.arlo_frontdoor + target: + entity_id: camera.arlo_frontdoor ``` ## Alarm @@ -112,7 +113,8 @@ Arming the Arlo Base Station when leaving. to: not_home action: service: alarm_control_panel.alarm_arm_away - entity_id: alarm_control_panel.my_arlo_base_station + target: + entity_id: alarm_control_panel.my_arlo_base_station ``` Setting Arlo to a custom mode (mapped to `home_mode_name` in `configuration.yaml`) when arriving. @@ -127,7 +129,8 @@ Setting Arlo to a custom mode (mapped to `home_mode_name` in `configuration.yaml to: home action: service: alarm_control_panel.alarm_arm_home - entity_id: alarm_control_panel.my_arlo_base_station + target: + entity_id: alarm_control_panel.my_arlo_base_station ``` You can also completely disarm the Arlo base station by calling the `alarm_control_panel.alarm_disarm` service, and trigger the alarm by calling the `alarm_control_panel.alarm_trigger` service. diff --git a/source/_integrations/binary_sensor.xiaomi_aqara.markdown b/source/_integrations/binary_sensor.xiaomi_aqara.markdown index 72f3e340874..0ad58ed5f51 100644 --- a/source/_integrations/binary_sensor.xiaomi_aqara.markdown +++ b/source/_integrations/binary_sensor.xiaomi_aqara.markdown @@ -50,7 +50,8 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra below: 300 action: - service: light.turn_on - entity_id: light.gateway_light_34ce00xxxx11 + target: + entity_id: light.gateway_light_34ce00xxxx11 data: brightness: 5 - service: automation.turn_on @@ -66,7 +67,8 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra minutes: 5 action: - service: light.turn_off - entity_id: light.gateway_light_34ce00xxxx11 + target: + entity_id: light.gateway_light_34ce00xxxx11 - service: automation.turn_off data: entity_id: automation.Motion_off @@ -83,7 +85,8 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra to: "on" action: service: climate.set_operation_mode - entity_id: climate.livingroom + target: + entity_id: climate.livingroom data: operation_mode: "Off" - alias: "If the window is closed for 5 minutes turn on the radiator again" @@ -96,7 +99,8 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra minutes: 5 action: service: climate.set_operation_mode - entity_id: climate.livingroom + target: + entity_id: climate.livingroom data: operation_mode: "Smart schedule" - alias: "Notify if door is opened when away" @@ -170,7 +174,8 @@ As indicated in the table on top of this page there are 3 versions of the button click_type: single action: service: switch.toggle - entity_id: switch.wall_switch_left_158d000xxxxx01 + target: + entity_id: switch.wall_switch_left_158d000xxxxx01 - alias: "Toggle couch light on double click" trigger: platform: event @@ -180,7 +185,8 @@ As indicated in the table on top of this page there are 3 versions of the button click_type: double action: service: switch.toggle - entity_id: switch.wall_switch_right_158d000xxxxx01 + target: + entity_id: switch.wall_switch_right_158d000xxxxx01 - alias: "Let a dog bark on long press" trigger: platform: event @@ -210,7 +216,8 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi action_type: flip90 action: - service: light.turn_on - entity_id: light.gateway_light_28xxxxxxxxxx + target: + entity_id: light.gateway_light_28xxxxxxxxxx data: color_name: "springgreen" - alias: "Cube event flip180" @@ -222,7 +229,8 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi action_type: flip180 action: - service: light.turn_on - entity_id: light.gateway_light_28xxxxxxxxxx + target: + entity_id: light.gateway_light_28xxxxxxxxxx data: color_name: "darkviolet" - alias: "Cube event move" @@ -234,7 +242,8 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi action_type: move action: - service: light.turn_on - entity_id: light.gateway_light_28xxxxxxxxxx + target: + entity_id: light.gateway_light_28xxxxxxxxxx data: color_name: "gold" - alias: "Cube event tap_twice" @@ -246,7 +255,8 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi action_type: tap_twice action: - service: light.turn_on - entity_id: light.gateway_light_28xxxxxxxxxx + target: + entity_id: light.gateway_light_28xxxxxxxxxx data: color_name: "deepskyblue" - alias: "Cube event shake_air" @@ -258,7 +268,8 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi action_type: shake_air action: - service: light.turn_on - entity_id: light.gateway_light_28xxxxxxxxxx + target: + entity_id: light.gateway_light_28xxxxxxxxxx data: color_name: "blue" ``` @@ -279,7 +290,8 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac click_type: single action: service: light.turn_on - entity_id: light.gateway_light_34xxxxxxxx13 + target: + entity_id: light.gateway_light_34xxxxxxxx13 data: brightness: >- {% if state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') %} @@ -301,7 +313,8 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac click_type: single action: service: light.turn_on - entity_id: light.gateway_light_34xxxxxxxx13 + target: + entity_id: light.gateway_light_34xxxxxxxx13 data: brightness: >- {% if state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') %} @@ -323,7 +336,8 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac click_type: both action: service: light.turn_off - entity_id: light.gateway_light_34xxxxxxxx13 + target: + entity_id: light.gateway_light_34xxxxxxxx13 ``` {% endraw %} diff --git a/source/_integrations/blink.markdown b/source/_integrations/blink.markdown index 488987ce192..c0fa9469c11 100644 --- a/source/_integrations/blink.markdown +++ b/source/_integrations/blink.markdown @@ -129,7 +129,8 @@ Here, this example assumes your blink module is named `My Sync Module` and that to: "not_home" action: service: alarm_control_panel.alarm_arm_away - entity_id: alarm_control_panel.blink_my_sync_module + target: + entity_id: alarm_control_panel.blink_my_sync_module ``` ### Disarm Blink When Home @@ -145,7 +146,8 @@ Similar to the previous example, this automation will disarm blink when arriving to: "home" action: service: alarm_control_panel.alarm_disarm - entity_id: alarm_control_panel.blink_my_sync_module + target: + entity_id: alarm_control_panel.blink_my_sync_module ``` ### Save Video Locally When Motion Detected diff --git a/source/_integrations/caldav.markdown b/source/_integrations/caldav.markdown index 180e69eb3f0..5c9200a4fce 100644 --- a/source/_integrations/caldav.markdown +++ b/source/_integrations/caldav.markdown @@ -169,7 +169,8 @@ calendar: at: "06:40:00" action: - service: media_player.media_play - entity_id: media_player.bedroom + target: + entity_id: media_player.bedroom condition: - condition: state entity_id: calendar.work_holiday diff --git a/source/_integrations/deconz.markdown b/source/_integrations/deconz.markdown index af6c13a0d65..937ab53ccab 100644 --- a/source/_integrations/deconz.markdown +++ b/source/_integrations/deconz.markdown @@ -205,7 +205,8 @@ automation: event: 1002 action: service: light.toggle - entity_id: light.lamp + target: + entity_id: light.lamp - alias: "Increase brightness of lamp from dimmer" initial_state: "on" @@ -249,7 +250,8 @@ automation: gesture: 7 action: service: light.turn_on - entity_id: light.lamp + target: + entity_id: light.lamp ``` {% endraw %} diff --git a/source/_integrations/doods.markdown b/source/_integrations/doods.markdown index 691421502df..1b2e7b036d8 100644 --- a/source/_integrations/doods.markdown +++ b/source/_integrations/doods.markdown @@ -216,5 +216,6 @@ image_processing: - binary_sensor.driveway action: - service: image_processing.scan - entity_id: image_processing.doods_camera_driveway + target: + entity_id: image_processing.doods_camera_driveway ``` diff --git a/source/_integrations/doorbird.markdown b/source/_integrations/doorbird.markdown index bb6585e1332..d97d88f8d17 100644 --- a/source/_integrations/doorbird.markdown +++ b/source/_integrations/doorbird.markdown @@ -179,7 +179,8 @@ Note: Remember to complete the schedule assignment steps above for each event ty event_type: doorbird_driveway_gate_somebody_pressed_the_button action: service: light.turn_on - entity_id: light.side_entry_porch + target: + entity_id: light.side_entry_porch ``` ## Camera diff --git a/source/_integrations/emulated_roku.markdown b/source/_integrations/emulated_roku.markdown index 3e6bdb0b292..345d5a2ef5a 100644 --- a/source/_integrations/emulated_roku.markdown +++ b/source/_integrations/emulated_roku.markdown @@ -119,7 +119,8 @@ The following is an example implementation of an automation: key: Fwd action: - service: media_player.volume_up - entity_id: media_player.amplifier + target: + entity_id: media_player.amplifier ``` ## Troubleshooting diff --git a/source/_integrations/feedreader.markdown b/source/_integrations/feedreader.markdown index 2f053cdb2c0..e76745d04b1 100644 --- a/source/_integrations/feedreader.markdown +++ b/source/_integrations/feedreader.markdown @@ -62,7 +62,8 @@ automation: event_type: feedreader action: service: script.turn_on - entity_id: script.my_action + target: + entity_id: script.my_action ``` {% raw %} diff --git a/source/_integrations/fireservicerota.markdown b/source/_integrations/fireservicerota.markdown index e51d8cd6965..6e3f97df11d 100644 --- a/source/_integrations/fireservicerota.markdown +++ b/source/_integrations/fireservicerota.markdown @@ -126,7 +126,8 @@ automation: entity_id: sensor.incidents action: service: light.turn_on - entity_id: light.bedroom + target: + entity_id: light.bedroom - alias: "Play TTS incident details when incident is received" trigger: @@ -154,7 +155,8 @@ automation: entity_id: switch.response_button action: service: homeassistant.turn_on - entity_id: switch.incident_response + target: + entity_id: switch.incident_response - alias: "Cast FireServiceRota dashboard to Nest Hub" trigger: diff --git a/source/_integrations/flic.markdown b/source/_integrations/flic.markdown index 9b133683ec8..6ef19f761d2 100644 --- a/source/_integrations/flic.markdown +++ b/source/_integrations/flic.markdown @@ -81,7 +81,8 @@ automation: click_type: single action: service: homeassistant.turn_on - entity_id: group.lights_livingroom + target: + entity_id: group.lights_livingroom ``` Event data: diff --git a/source/_integrations/foursquare.markdown b/source/_integrations/foursquare.markdown index 3e2e960cc3a..6e471bb2c83 100644 --- a/source/_integrations/foursquare.markdown +++ b/source/_integrations/foursquare.markdown @@ -56,7 +56,8 @@ automation: event_type: foursquare.push action: service: script.turn_on - entity_id: script.my_action + target: + entity_id: script.my_action ``` ### Check ins diff --git a/source/_integrations/google_travel_time.markdown b/source/_integrations/google_travel_time.markdown index 5a0d7d84498..5a13b63405c 100644 --- a/source/_integrations/google_travel_time.markdown +++ b/source/_integrations/google_travel_time.markdown @@ -158,5 +158,6 @@ You can also use the `homeassistant.update_entity` service to update the sensor - fri action: - service: homeassistant.update_entity - entity_id: sensor.morning_commute + target: + entity_id: sensor.morning_commute ``` diff --git a/source/_integrations/griddy.markdown b/source/_integrations/griddy.markdown index d80eaae315a..5c34c401873 100644 --- a/source/_integrations/griddy.markdown +++ b/source/_integrations/griddy.markdown @@ -63,5 +63,6 @@ The current price for the Load Zone will appear as a sensor: zone: zone.home action: - service: switch.turn_off - entity_id: switch.my_tesla_charger_switch + target: + entity_id: switch.my_tesla_charger_switch ``` diff --git a/source/_integrations/harmony.markdown b/source/_integrations/harmony.markdown index 84bd70e10f6..ef50982d232 100644 --- a/source/_integrations/harmony.markdown +++ b/source/_integrations/harmony.markdown @@ -79,7 +79,8 @@ Using the activity name 'Watch TV', you can call a service via automation to swi ```yaml action: - service: remote.turn_on - entity_id: remote.bed_room_hub + target: + entity_id: remote.bed_room_hub data: activity: "Watch TV" ``` @@ -207,7 +208,8 @@ automation: value_template: '{{ trigger.to_state.attributes.current_activity == "Kodi" }}' action: service: input_boolean.turn_on - entity_id: input_boolean.notify + target: + entity_id: input_boolean.notify - alias: "PowerOff started from harmony hub" trigger: platform: state @@ -217,7 +219,8 @@ automation: value_template: '{{ trigger.to_state.attributes.current_activity == "PowerOff" }}' action: service: input_boolean.turn_off - entity_id: input_boolean.notify + target: + entity_id: input_boolean.notify ``` {% endraw %} diff --git a/source/_integrations/here_travel_time.markdown b/source/_integrations/here_travel_time.markdown index 702656fdf7a..b019a13aa51 100644 --- a/source/_integrations/here_travel_time.markdown +++ b/source/_integrations/here_travel_time.markdown @@ -176,5 +176,6 @@ automation: - fri action: - service: homeassistant.update_entity - entity_id: sensor.morning_commute + target: + entity_id: sensor.morning_commute ``` diff --git a/source/_integrations/homematic.markdown b/source/_integrations/homematic.markdown index 3c8b7db2940..07cd4af76ac 100644 --- a/source/_integrations/homematic.markdown +++ b/source/_integrations/homematic.markdown @@ -261,7 +261,8 @@ automation: param: PRESS_SHORT action: service: switch.turn_on - entity_id: switch.Kitchen_Ambience + 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. @@ -423,7 +424,8 @@ Manually set lock on KeyMatic devices: ... action: service: lock.lock - entity_id: lock.leq1234567 + target: + entity_id: lock.leq1234567 ``` Manually set unlock on KeyMatic devices: @@ -432,7 +434,8 @@ Manually set unlock on KeyMatic devices: ... action: service: lock.unlock - entity_id: lock.leq1234567 + target: + entity_id: lock.leq1234567 ``` #### Detecting lost connections diff --git a/source/_integrations/hunterdouglas_powerview.markdown b/source/_integrations/hunterdouglas_powerview.markdown index cf48c1466b8..99e19bab83a 100644 --- a/source/_integrations/hunterdouglas_powerview.markdown +++ b/source/_integrations/hunterdouglas_powerview.markdown @@ -36,5 +36,6 @@ To add `Hunter Douglas PowerView` to your installation, go to **Configuration** at: "18:00:00" action: - service: scene.turn_on - entity_id: scene.10877 + target: + entity_id: scene.10877 ``` diff --git a/source/_integrations/input_datetime.markdown b/source/_integrations/input_datetime.markdown index ff0bbdd700a..12568320ffd 100644 --- a/source/_integrations/input_datetime.markdown +++ b/source/_integrations/input_datetime.markdown @@ -121,7 +121,8 @@ automation: at: input_datetime.bedroom_alarm_clock_time action: service: light.turn_on - entity_id: light.bedroom + 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 0248fac164c..2a7499c16fa 100644 --- a/source/_integrations/input_number.markdown +++ b/source/_integrations/input_number.markdown @@ -253,7 +253,8 @@ automation: action: - delay: "00:{{ states('input_number.minutes') | int }}:{{ states('input_number.seconds') | int }}" - service: switch.turn_off - entity_id: switch.something + target: + entity_id: switch.something ``` {% endraw %} diff --git a/source/_integrations/insteon.markdown b/source/_integrations/insteon.markdown index 26551c1eb19..61f0aa3510e 100644 --- a/source/_integrations/insteon.markdown +++ b/source/_integrations/insteon.markdown @@ -139,7 +139,8 @@ automation: state: "off" action: - service: light.turn_on - entity_id: light.some_light + target: + entity_id: light.some_light # single button remote - id: light_off @@ -155,7 +156,8 @@ automation: state: "off" action: - service: light.turn_on - entity_id: light.some_light + target: + entity_id: light.some_light ``` ## Manual configuration @@ -400,7 +402,8 @@ automation: state: "off" action: - service: light.turn_on - entity_id: light.some_light + target: + entity_id: light.some_light # single button remote - id: light_off @@ -416,5 +419,6 @@ automation: state: "off" action: - service: light.turn_on - entity_id: light.some_light + target: + entity_id: light.some_light ``` diff --git a/source/_integrations/isy994.markdown b/source/_integrations/isy994.markdown index 13581ea987b..6fb4876a470 100644 --- a/source/_integrations/isy994.markdown +++ b/source/_integrations/isy994.markdown @@ -130,7 +130,8 @@ automation: prec: "0" action: service: light.turn_off - entity_id: light.lr_track_lights_rear + 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 ISY994 documentation for the list of every possible control type, but the common ones are: diff --git a/source/_integrations/keyboard_remote.markdown b/source/_integrations/keyboard_remote.markdown index db7d97d197b..48a119e736e 100644 --- a/source/_integrations/keyboard_remote.markdown +++ b/source/_integrations/keyboard_remote.markdown @@ -93,7 +93,8 @@ automation: key_code: 107 # inspect log to obtain desired keycode action: service: light.turn_on - entity_id: light.all + target: + entity_id: light.all ``` `device_descriptor` or `device_name` may be specificed 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. diff --git a/source/_integrations/lifx_cloud.markdown b/source/_integrations/lifx_cloud.markdown index f587f6f9c76..b07c7d7592b 100644 --- a/source/_integrations/lifx_cloud.markdown +++ b/source/_integrations/lifx_cloud.markdown @@ -22,7 +22,8 @@ You can then activate each scene with its name from the smartphone app: ```yaml - service: scene.turn_on - entity_id: scene.goodnight + target: + entity_id: scene.goodnight ``` {% configuration %} diff --git a/source/_integrations/lirc.markdown b/source/_integrations/lirc.markdown index 114743564ba..ac33d3244a5 100644 --- a/source/_integrations/lirc.markdown +++ b/source/_integrations/lirc.markdown @@ -91,7 +91,8 @@ automation: button_name: KEY_0 action: service: homeassistant.turn_off - entity_id: group.a_lights + 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 78b3f792326..840ed3fc1ab 100644 --- a/source/_integrations/mailgun.markdown +++ b/source/_integrations/mailgun.markdown @@ -59,7 +59,8 @@ automation: action: call_service action: service: light.turn_on - entity_id: light.office + target: + entity_id: light.office ``` ## Notifications diff --git a/source/_integrations/manual.markdown b/source/_integrations/manual.markdown index 8190c8ba610..8143552c69c 100644 --- a/source/_integrations/manual.markdown +++ b/source/_integrations/manual.markdown @@ -175,7 +175,8 @@ automation: state: armed_away action: service: alarm_control_panel.alarm_trigger - entity_id: alarm_control_panel.ha_alarm + target: + entity_id: alarm_control_panel.ha_alarm ``` Sending a notification when the alarm is triggered. @@ -205,7 +206,8 @@ automation: # many z-wave locks use Alarm Type 19 for 'Unlocked by Keypad' action: - service: alarm_control_panel.alarm_disarm - entity_id: alarm_control_panel.house_alarm + target: + entity_id: alarm_control_panel.house_alarm ``` Sending a Notification when the Alarm is Armed (Away/Home), Disarmed and in Pending Status diff --git a/source/_integrations/osramlightify.markdown b/source/_integrations/osramlightify.markdown index df3665a9048..90172db4d11 100644 --- a/source/_integrations/osramlightify.markdown +++ b/source/_integrations/osramlightify.markdown @@ -75,7 +75,8 @@ dropdown on UI. You can apply a scene by clicking an item from the dropdown or b ```yaml - service: light.turn_on - entity_id: light.bedroom + target: + entity_id: light.bedroom data: effect: Romance ``` diff --git a/source/_integrations/plex.markdown b/source/_integrations/plex.markdown index 28fff2531e3..75be3457ac6 100644 --- a/source/_integrations/plex.markdown +++ b/source/_integrations/plex.markdown @@ -241,7 +241,8 @@ Example script: play_plex_on_tv: sequence: - service: media_player.select_source - entity_id: media_player.smart_tv + target: + entity_id: media_player.smart_tv data: source: "Plex" - wait_template: "{{ is_state('media_player.smart_tv', 'On') }}" diff --git a/source/_integrations/rainbird.markdown b/source/_integrations/rainbird.markdown index 2e33133204f..448ea170815 100644 --- a/source/_integrations/rainbird.markdown +++ b/source/_integrations/rainbird.markdown @@ -130,7 +130,8 @@ automation: at: "5:30:00" action: service: rainbird.start_irrigation - entity_id: switch.sprinkler_1 + target: + entity_id: switch.sprinkler_1 data: duration: 5 ``` diff --git a/source/_integrations/rfxtrx.markdown b/source/_integrations/rfxtrx.markdown index b9897cb45cb..e55daed34bc 100644 --- a/source/_integrations/rfxtrx.markdown +++ b/source/_integrations/rfxtrx.markdown @@ -292,7 +292,8 @@ automation: Sound: 9 action: service: scene.turn_on - entity_id: scene.welcomescene + target: + entity_id: scene.welcomescene ``` ## Services diff --git a/source/_integrations/scene.markdown b/source/_integrations/scene.markdown index 36aaa670065..77d3eaa8e78 100644 --- a/source/_integrations/scene.markdown +++ b/source/_integrations/scene.markdown @@ -69,7 +69,8 @@ automation: to: "home" action: service: scene.turn_on - entity_id: scene.romantic + target: + entity_id: scene.romantic ``` ## Applying a scene without defining it diff --git a/source/_integrations/script.markdown b/source/_integrations/script.markdown index 9efdd9cc5f3..3608167604a 100644 --- a/source/_integrations/script.markdown +++ b/source/_integrations/script.markdown @@ -169,7 +169,8 @@ automation: to: "on" action: service: script.turn_on - entity_id: script.notify_pushover + target: + entity_id: script.notify_pushover data: variables: title: "State change" @@ -243,7 +244,8 @@ script: script_1: sequence: - service: script.turn_on - entity_id: script.script_2 + target: + entity_id: script.script_2 # Perform some other steps here while second script runs... # Now wait for called script to complete. - wait_template: "{{ is_state('script.script_2', 'off') }}" diff --git a/source/_integrations/shelly.markdown b/source/_integrations/shelly.markdown index 1461b146847..b826bdaa7fe 100644 --- a/source/_integrations/shelly.markdown +++ b/source/_integrations/shelly.markdown @@ -81,7 +81,8 @@ If the **BUTTON TYPE** of the switch connected to the device is set to `momentar click_type: single action: service: light.toggle - entity_id: light.living_room + target: + entity_id: light.living_room - alias: "Toggle living room lamp" trigger: @@ -93,7 +94,8 @@ If the **BUTTON TYPE** of the switch connected to the device is set to `momentar click_type: long action: service: light.toggle - entity_id: light.lamp_living_room + target: + entity_id: light.lamp_living_room ``` ### Possible values for `click_type` diff --git a/source/_integrations/squeezebox.markdown b/source/_integrations/squeezebox.markdown index fabe23d418a..ab376f81eef 100644 --- a/source/_integrations/squeezebox.markdown +++ b/source/_integrations/squeezebox.markdown @@ -56,7 +56,8 @@ The Logitech Transporter which have two digital inputs can be activated using a transporter_toslink: sequence: - service: homeassistant.turn_on - entity_id: media_player.transporter + target: + entity_id: media_player.transporter - service: media_player.play_media data: entity_id: media_player.transporter diff --git a/source/_integrations/switch.mysensors.markdown b/source/_integrations/switch.mysensors.markdown index c36c0962ef4..c51ea015496 100644 --- a/source/_integrations/switch.mysensors.markdown +++ b/source/_integrations/switch.mysensors.markdown @@ -67,7 +67,8 @@ automation: at: "5:30:00" action: service: mysensors.send_ir_code - entity_id: switch.hvac_1_1 + target: + entity_id: switch.hvac_1_1 data: V_IR_SEND: "0xC284" # the IR code to send @@ -77,7 +78,8 @@ automation: at: "0:30:00" action: service: mysensors.send_ir_code - entity_id: switch.hvac_1_1 + target: + entity_id: switch.hvac_1_1 data: V_IR_SEND: "0xC288" # the IR code to send ``` diff --git a/source/_integrations/system_log.markdown b/source/_integrations/system_log.markdown index 263da90fbf6..a4c8a480215 100644 --- a/source/_integrations/system_log.markdown +++ b/source/_integrations/system_log.markdown @@ -97,7 +97,8 @@ automation: level: WARNING action: service: counter.increment - entity_id: counter.warning_counter + target: + entity_id: counter.warning_counter ``` ### Conditional Messages diff --git a/source/_integrations/telegram_bot.markdown b/source/_integrations/telegram_bot.markdown index 6623f72256d..09465a458e0 100644 --- a/source/_integrations/telegram_bot.markdown +++ b/source/_integrations/telegram_bot.markdown @@ -332,11 +332,13 @@ trigger: command: "/siren" action: - service: homeassistant.turn_on - entity_id: switch.vision_zm1601eu5_battery_operated_siren_switch_9_0 + target: + entity_id: switch.vision_zm1601eu5_battery_operated_siren_switch_9_0 - delay: seconds: 10 - service: homeassistant.turn_off - entity_id: switch.vision_zm1601eu5_battery_operated_siren_switch_9_0 + target: + entity_id: switch.vision_zm1601eu5_battery_operated_siren_switch_9_0 ``` An example to show the use of event_data in action: diff --git a/source/_integrations/template.markdown b/source/_integrations/template.markdown index b48946b0c6d..f3886fd9574 100644 --- a/source/_integrations/template.markdown +++ b/source/_integrations/template.markdown @@ -372,7 +372,8 @@ automation: minutes: "/5" action: - service: homeassistant.update_entity - entity_id: sensor.random_number + target: + entity_id: sensor.random_number ``` {% endraw %} diff --git a/source/_integrations/tensorflow.markdown b/source/_integrations/tensorflow.markdown index 4752c2dcdea..082ea0cf239 100644 --- a/source/_integrations/tensorflow.markdown +++ b/source/_integrations/tensorflow.markdown @@ -208,5 +208,6 @@ image_processing: - binary_sensor.driveway action: - service: image_processing.scan - entity_id: camera.driveway + target: + entity_id: camera.driveway ``` diff --git a/source/_integrations/timer.markdown b/source/_integrations/timer.markdown index f38ee30c6f1..ce122dd7c04 100644 --- a/source/_integrations/timer.markdown +++ b/source/_integrations/timer.markdown @@ -137,7 +137,8 @@ timer: to: "on" action: - service: timer.start - entity_id: timer.test + target: + entity_id: timer.test # When timer is stopped, the time run out, another message is sent - alias: "Timerstop" @@ -163,20 +164,24 @@ script: alias: "Start timer" sequence: - service: timer.start - entity_id: timer.test + target: + entity_id: timer.test pause_timer: alias: "Pause timer" sequence: - service: timer.pause - entity_id: timer.test + target: + entity_id: timer.test cancel_timer: alias: "Cancel timer" sequence: - service: timer.cancel - entity_id: timer.test + target: + entity_id: timer.test finish_timer: alias: "Finish timer" sequence: - service: timer.finish - entity_id: timer.test + target: + entity_id: timer.test ``` diff --git a/source/_integrations/totalconnect.markdown b/source/_integrations/totalconnect.markdown index 6a81a1e3100..2c1db3ea0b8 100644 --- a/source/_integrations/totalconnect.markdown +++ b/source/_integrations/totalconnect.markdown @@ -55,7 +55,8 @@ automation: before: sunset action: service: scene.turn_on - entity_id: scene.OnDisarmedDaytime + target: + entity_id: scene.OnDisarmedDaytime - alias: "Alarm: Armed Away" trigger: platform: state @@ -63,7 +64,8 @@ automation: to: "armed_away" action: service: scene.turn_on - entity_id: scene.OnArmedAway + target: + entity_id: scene.OnArmedAway ``` If you have issues running this component, you may require `libxml2-dev` and `libxmlsec1-dev` packages. To install these on Raspbian, run the command `apt install libxml2-dev libxmlsec1-dev` with sudo. diff --git a/source/_integrations/twilio.markdown b/source/_integrations/twilio.markdown index a05b77e9b0e..7b762ce9550 100644 --- a/source/_integrations/twilio.markdown +++ b/source/_integrations/twilio.markdown @@ -59,5 +59,6 @@ automation: action: call_service action: service: light.turn_on - entity_id: light.office + target: + entity_id: light.office ``` diff --git a/source/_integrations/universal.markdown b/source/_integrations/universal.markdown index c93da60d6d5..6f9f716b610 100644 --- a/source/_integrations/universal.markdown +++ b/source/_integrations/universal.markdown @@ -219,7 +219,8 @@ automation: to: "playing" action: - service: media_player.turn_on - entity_id: media_player.kodi_tv + target: + entity_id: media_player.kodi_tv - alias: "Turn off the TV when Kodi is in idle > 15 min" trigger: @@ -230,7 +231,8 @@ automation: minutes: 15 action: - service: media_player.turn_off - entity_id: media_player.kodi_tv + target: + entity_id: media_player.kodi_tv ``` {% endraw %} @@ -252,19 +254,23 @@ media_player: commands: turn_on: service: remote.turn_on - entity_id: remote.alexander_down_guest + target: + entity_id: remote.alexander_down_guest turn_off: service: remote.turn_off - entity_id: remote.alexander_down_guest + target: + entity_id: remote.alexander_down_guest volume_up: service: remote.send_command - entity_id: remote.alexander_down_guest + target: + entity_id: remote.alexander_down_guest data: device: Receiver command: VolumeUp volume_down: service: remote.send_command - entity_id: remote.alexander_down_guest + target: + entity_id: remote.alexander_down_guest data: device: Receiver command: VolumeDown diff --git a/source/_integrations/upb.markdown b/source/_integrations/upb.markdown index 6d0515a5072..754adc3062c 100644 --- a/source/_integrations/upb.markdown +++ b/source/_integrations/upb.markdown @@ -198,18 +198,20 @@ all_lights_on: description: "Activate two UPB scenes named interior_lights and exterior_lights" sequence: - service: scene.turn_on - entity_id: - - scene.interior_lights - - scene.exterior_lights + target: + entity_id: + - scene.interior_lights + - scene.exterior_lights all_lights_off: alias: "All Lights Off" description: "Deactivate two UPB scenes named interior_lights and exterior_lights" sequence: - service: upb.scene_deactivate - entity_id: - - scene.interior_lights - - scene.exterior_lights + target: + entity_id: + - scene.interior_lights + - scene.exterior_lights kitchen_fade_on: alias: "Kitchen Fade to On" diff --git a/source/_integrations/utility_meter.markdown b/source/_integrations/utility_meter.markdown index 08fc5619dda..4ba7dad03c9 100644 --- a/source/_integrations/utility_meter.markdown +++ b/source/_integrations/utility_meter.markdown @@ -153,9 +153,11 @@ automation: at: "21:00:00" action: - service: utility_meter.next_tariff - entity_id: utility_meter.daily_energy + target: + entity_id: utility_meter.daily_energy - service: utility_meter.next_tariff - entity_id: utility_meter.monthly_energy + target: + entity_id: utility_meter.monthly_energy ``` ## Advanced Configuration for DSMR users diff --git a/source/_integrations/workday.markdown b/source/_integrations/workday.markdown index 23667b82221..d15c01e7446 100644 --- a/source/_integrations/workday.markdown +++ b/source/_integrations/workday.markdown @@ -143,7 +143,8 @@ automation: state: "on" action: service: switch.turn_on - entity_id: switch.heater + target: + entity_id: switch.heater ```
diff --git a/source/_integrations/xiaomi_miio.markdown b/source/_integrations/xiaomi_miio.markdown index 42d7268cff1..391494e95d1 100644 --- a/source/_integrations/xiaomi_miio.markdown +++ b/source/_integrations/xiaomi_miio.markdown @@ -1094,14 +1094,16 @@ script: towel_heater: sequence: - service: remote.send_command - entity_id: "remote.bathroom_remote" + target: + entity_id: "remote.bathroom_remote" data: command: - 'activate_towel_heater' please_cover_your_ears: sequence: - service: remote.send_command - entity_id: "remote.bathroom_remote" + target: + entity_id: "remote.bathroom_remote" data: command: - 'read_bad_poem' diff --git a/source/_integrations/yale_smart_alarm.markdown b/source/_integrations/yale_smart_alarm.markdown index 43f9ce05f21..208a66b8dc2 100644 --- a/source/_integrations/yale_smart_alarm.markdown +++ b/source/_integrations/yale_smart_alarm.markdown @@ -61,7 +61,8 @@ automation: before: sunset action: service: scene.turn_on - entity_id: scene.OnDisarmedDaytime + target: + entity_id: scene.OnDisarmedDaytime - alias: "Alarm: Armed Away" trigger: platform: state @@ -69,5 +70,6 @@ automation: to: "armed_away" action: service: scene.turn_on - entity_id: scene.OnArmedAway + target: + entity_id: scene.OnArmedAway ``` diff --git a/source/_posts/2015-09-19-alarm-sonos-and-itunes-support.markdown b/source/_posts/2015-09-19-alarm-sonos-and-itunes-support.markdown index 82d7a2b127b..91d75c2ace9 100644 --- a/source/_posts/2015-09-19-alarm-sonos-and-itunes-support.markdown +++ b/source/_posts/2015-09-19-alarm-sonos-and-itunes-support.markdown @@ -54,7 +54,8 @@ automation: before: "23:00:00" action: service: homeassistant.turn_on - entity_id: group.living_room + target: + entity_id: group.living_room ``` __Verisure Alarms__ diff --git a/source/_posts/2016-05-26-ibeacons-how-to-track-things-that-cant-track-themselves-part-ii.markdown b/source/_posts/2016-05-26-ibeacons-how-to-track-things-that-cant-track-themselves-part-ii.markdown index ea498f8b96e..200a33e6032 100644 --- a/source/_posts/2016-05-26-ibeacons-how-to-track-things-that-cant-track-themselves-part-ii.markdown +++ b/source/_posts/2016-05-26-ibeacons-how-to-track-things-that-cant-track-themselves-part-ii.markdown @@ -72,7 +72,8 @@ automation: state: "off" action: service: switch.turn_on - entity_id: switch.gate + target: + entity_id: switch.gate ``` Or warn you if you leave your keys behind @@ -90,7 +91,8 @@ automation: value_template: '{{ states.device_tracker.greg_gregphone.state != "home" }}' action: service: script.turn_on - entity_id: script.send_key_alert + target: + entity_id: script.send_key_alert - alias: "Forgotten keys - cancel" trigger: @@ -102,7 +104,8 @@ automation: state: "on" action: service: script.turn_off - entity_id: script.send_key_alert + target: + entity_id: script.send_key_alert ``` {% endraw %} diff --git a/source/_posts/2016-08-03-laundry-automation-update.markdown b/source/_posts/2016-08-03-laundry-automation-update.markdown index b95666b12ed..e4e1e412e45 100644 --- a/source/_posts/2016-08-03-laundry-automation-update.markdown +++ b/source/_posts/2016-08-03-laundry-automation-update.markdown @@ -81,7 +81,8 @@ automation: to: "Complete" action: service: script.turn_on - entity_id: script.washer_complete + target: + entity_id: script.washer_complete - alias: "Washer emptied" trigger: @@ -91,7 +92,8 @@ automation: to: "Empty" action: service: scene.turn_on - entity_id: scene.normal + target: + entity_id: scene.normal script: washer_complete: diff --git a/source/_posts/2017-02-04-babyphone.markdown b/source/_posts/2017-02-04-babyphone.markdown index 0a13c85ae48..8c094b2ff11 100644 --- a/source/_posts/2017-02-04-babyphone.markdown +++ b/source/_posts/2017-02-04-babyphone.markdown @@ -80,7 +80,8 @@ automation: to: "on" action: service: ffmpeg.start - entity_id: binary_sensor.ffmpeg_noise + target: + entity_id: binary_sensor.ffmpeg_noise - alias: "Babyphone off" trigger: @@ -90,7 +91,8 @@ automation: to: "off" action: service: ffmpeg.stop - entity_id: binary_sensor.ffmpeg_noise + target: + entity_id: binary_sensor.ffmpeg_noise ``` ### Trigger an alarm @@ -107,20 +109,25 @@ automation: to: "on" action: - service: media_player.sonos_snapshot - entity_id: media_player.bedroom + target: + entity_id: media_player.bedroom - service: media_player.sonos_unjoin - entity_id: media_player.bedroom + target: + entity_id: media_player.bedroom - service: media_player.volume_set - entity_id: media_player.bedroom + target: + entity_id: media_player.bedroom data: volume_level: 0.4 - service: media_player.play_media - entity_id: media_player.bedroom + target: + entity_id: media_player.bedroom data: media_content_type: "music" media_content_id: http://my_ip_icecast:8000/babyphone.mp3 - service: light.turn_on: - entity_id: + target: + entity_id: - light.floor - light.bedroom data: @@ -134,11 +141,13 @@ automation: to: "off" action: - service: media_player.sonos_restore - entity_id: media_player.bedroom + target: + entity_id: media_player.bedroom - service: light.turn_off: - entity_id: - - light.floor - - light.bedroom + target: + entity_id: + - light.floor + - light.bedroom ``` ### Thanks diff --git a/source/_posts/2020-02-05-release-105.markdown b/source/_posts/2020-02-05-release-105.markdown index d726f35b697..7b5e7978057 100644 --- a/source/_posts/2020-02-05-release-105.markdown +++ b/source/_posts/2020-02-05-release-105.markdown @@ -221,7 +221,8 @@ Experiencing issues introduced by this release? Please report them in our [issue entity_id: all action: service: light.turn_off - entity_id: all + target: + entity_id: all ``` - __Group__ *Deprecated* - Group configurations options, services and service options related to the old states UI are now deprecated and pending for removal in Home Assistant 0.107.0. diff --git a/source/_posts/2020-02-11-android-16-17-release.markdown b/source/_posts/2020-02-11-android-16-17-release.markdown index 9173ee84f6e..9bd4d0b3b78 100644 --- a/source/_posts/2020-02-11-android-16-17-release.markdown +++ b/source/_posts/2020-02-11-android-16-17-release.markdown @@ -46,7 +46,8 @@ automation: action: close_garage action: service: cover.close_cover - entity_id: cover.garage_door + target: + entity_id: cover.garage_door ``` After adding these automations, whenever your garage door remains open for 30 minutes, your device will get a notification that looks like this: diff --git a/source/_posts/2020-05-20-release-110.markdown b/source/_posts/2020-05-20-release-110.markdown index 6a3409f5cce..e5f20722e92 100644 --- a/source/_posts/2020-05-20-release-110.markdown +++ b/source/_posts/2020-05-20-release-110.markdown @@ -215,7 +215,8 @@ condition: state: disarmed action: - service: light.turn_off - entity_id: light.kitchen + target: + entity_id: light.kitchen ``` ## HomeKit diff --git a/source/_posts/2020-07-01-release-113.markdown b/source/_posts/2020-07-01-release-113.markdown index bfb2af582e8..23bf98ca150 100644 --- a/source/_posts/2020-07-01-release-113.markdown +++ b/source/_posts/2020-07-01-release-113.markdown @@ -80,11 +80,13 @@ automation: to: "on" action: - service: light.turn_on - entity_id: light.bulb + target: + entity_id: light.bulb - delay: seconds: 10 - service: light.turn_off - entity_id: light.bulb + target: + entity_id: light.bulb ``` This automation turns on a light bulb when the button is pressed, and after @@ -240,14 +242,16 @@ automation: state: "on" sequence: - service: light.turn_on - entity_id: light.bulb + target: + entity_id: light.bulb - conditions: - condition: state entity_id: binary_sensor.button2 state: "on" sequence: - service: light.turn_off - entity_id: light.bulb + target: + entity_id: light.bulb default: - service: notify.frenck data: @@ -284,7 +288,8 @@ script: count: 10 sequence: - service: light.toggle - entity_id: light.bulb + target: + entity_id: light.bulb - delay: milliseconds: 500 ``` diff --git a/source/_posts/2020-10-07-release-116.markdown b/source/_posts/2020-10-07-release-116.markdown index dbbcd13aadb..efe883fe8ec 100644 --- a/source/_posts/2020-10-07-release-116.markdown +++ b/source/_posts/2020-10-07-release-116.markdown @@ -468,7 +468,8 @@ automation: state: "on" action: - service: cover.open_cover - entity_id: cover.sonne_abstellkammer + target: + entity_id: cover.sonne_abstellkammer - alias: "Binary sensor test counter=1 off" trigger: @@ -483,7 +484,8 @@ automation: state: "off" action: - service: cover.close_cover - entity_id: cover.sonne_abstellkammer + target: + entity_id: cover.sonne_abstellkammer ``` If you intend to use the counter feature (counter > 1) make sure you also diff --git a/source/_posts/2020-12-13-release-202012.markdown b/source/_posts/2020-12-13-release-202012.markdown index df7fceb2a00..c4274e6cf64 100644 --- a/source/_posts/2020-12-13-release-202012.markdown +++ b/source/_posts/2020-12-13-release-202012.markdown @@ -139,7 +139,8 @@ For example: ```yaml action: service: tts.cloud_say - entity_id: media_player.family_room_speaker + target: + entity_id: media_player.family_room_speaker data: message: These new voices sound absolutely stunning! options: