From 81d0265f1bb2a81fd85a942a59a209735e6269c8 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 15 Feb 2021 13:27:38 +0100 Subject: [PATCH] Update some service calls to use target (#16586) --- .../automation_flashing_lights.markdown | 14 ++++---- .../dim_and_brighten_lights.markdown | 3 +- .../_cookbook/foscam_away_mode_PTZ.markdown | 6 ++-- ...orm_actions_based_on_input_select.markdown | 8 +++-- ...ha_if_wemo_switch_is_not_detected.markdown | 2 +- source/_cookbook/sonos_say.markdown | 10 +++--- ...r_10_minutes_when_motion_detected.markdown | 6 ++-- source/_docs/scene.markdown | 3 +- source/_docs/scripts.markdown | 12 ++++--- .../alarm_control_panel.template.markdown | 9 +++-- source/_integrations/alexa.intent.markdown | 4 +-- source/_integrations/amazon_polly.markdown | 2 +- source/_integrations/androidtv.markdown | 15 +++++--- source/_integrations/apple_tv.markdown | 3 +- .../binary_sensor.xiaomi_aqara.markdown | 8 ++--- source/_integrations/blink.markdown | 5 +-- source/_integrations/broadlink.markdown | 36 ++++++++++++------- source/_integrations/camera.markdown | 9 +++-- source/_integrations/cast.markdown | 21 +++++++---- source/_integrations/climate.markdown | 24 ++++++++----- source/_integrations/counter.markdown | 2 +- source/_integrations/cover.markdown | 6 ++-- source/_integrations/cover.template.markdown | 14 ++++---- source/_integrations/deconz.markdown | 6 ++-- source/_integrations/dexcom.markdown | 2 +- source/_integrations/dialogflow.markdown | 2 +- source/_integrations/directv.markdown | 3 +- source/_integrations/eight_sleep.markdown | 3 +- source/_integrations/enocean.markdown | 2 +- source/_integrations/evohome.markdown | 6 ++-- .../_integrations/frontier_silicon.markdown | 2 +- source/_integrations/gstreamer.markdown | 3 +- source/_integrations/harmony.markdown | 9 +++-- source/_integrations/hive.markdown | 6 ++-- source/_integrations/homeassistant.markdown | 8 ++--- source/_integrations/homematic.markdown | 3 +- .../_integrations/homematicip_cloud.markdown | 5 +-- source/_integrations/humidifier.markdown | 6 ++-- .../_integrations/image_processing.markdown | 2 +- source/_integrations/input_boolean.markdown | 2 +- source/_posts/2020-10-28-release-117.markdown | 3 +- source/_posts/2020-11-18-release-118.markdown | 3 +- 42 files changed, 183 insertions(+), 115 deletions(-) diff --git a/source/_cookbook/automation_flashing_lights.markdown b/source/_cookbook/automation_flashing_lights.markdown index d2960cf8978..1ecce435d1d 100644 --- a/source/_cookbook/automation_flashing_lights.markdown +++ b/source/_cookbook/automation_flashing_lights.markdown @@ -62,11 +62,11 @@ script: sequence: - alias: "Alarm Room1 Start" service: homeassistant.turn_on - data: + target: entity_id: switch.AlmSnd1 - alias: "Set Ack Room1" service: homeassistant.turn_on - data: + target: entity_id: input_boolean.ack1 - alias: "email_Room1" service: notify.email @@ -77,7 +77,7 @@ script: seconds: 60 - alias: "Alarm Room1 Stop" service: homeassistant.turn_off - data: + target: entity_id: switch.AlmSnd1 flash_room1: @@ -85,18 +85,18 @@ script: sequence: - alias: "Light Room1 On" service: homeassistant.turn_on - data: + target: entity_id: switch.REL1 - delay: # time for flash light on seconds: 1 - alias: "Light Room1 Off" service: homeassistant.turn_off - data: + target: entity_id: switch.REL1 - alias: "loop_room1" service: script.turn_on - data: + target: entity_id: script.flash_loop flash_loop: @@ -107,7 +107,7 @@ script: seconds: 1 - alias: "loop_room1" service: script.turn_on - data: + target: entity_id: script.flash_room1 ``` diff --git a/source/_cookbook/dim_and_brighten_lights.markdown b/source/_cookbook/dim_and_brighten_lights.markdown index a2eec5da950..160d30db7b6 100644 --- a/source/_cookbook/dim_and_brighten_lights.markdown +++ b/source/_cookbook/dim_and_brighten_lights.markdown @@ -132,8 +132,9 @@ script: direction == 'down' and br > mn }} sequence: - service: light.turn_on - data: + target: entity_id: "{{ light }}" + data: brightness: > {% set br = state_attr(light, 'brightness')|int(0) %} {% set mn = states('input_number.light_minimum')|int %} diff --git a/source/_cookbook/foscam_away_mode_PTZ.markdown b/source/_cookbook/foscam_away_mode_PTZ.markdown index f0fe98c930a..7cdaaffdc9a 100644 --- a/source/_cookbook/foscam_away_mode_PTZ.markdown +++ b/source/_cookbook/foscam_away_mode_PTZ.markdown @@ -46,17 +46,17 @@ script: foscam_off: sequence: - service: switch.turn_off - data: + target: entity_id: switch.foscam_motion - service: shell_command.foscam_turn_off foscam_on: sequence: - service: switch.turn_off - data: + target: entity_id: switch.foscam_motion - service: shell_command.foscam_turn_on - service: switch.turn_on - data: + target: entity_id: switch.foscam_motion ``` diff --git a/source/_cookbook/perform_actions_based_on_input_select.markdown b/source/_cookbook/perform_actions_based_on_input_select.markdown index e264f5bf13a..cf4f4b764c9 100644 --- a/source/_cookbook/perform_actions_based_on_input_select.markdown +++ b/source/_cookbook/perform_actions_based_on_input_select.markdown @@ -35,8 +35,9 @@ automation: action: service: media_player.play_media - data: + target: entity_id: media_player.nursery + data: media_content_id: http://fileserver/rain.mp3 media_content_type: music @@ -51,8 +52,9 @@ automation: action: service: media_player.play_media - data: + target: entity_id: media_player.nursery + data: media_content_id: http://fileserver/babbling_brook.mp3 media_content_type: music @@ -66,7 +68,7 @@ automation: action: service: media_player.turn_off - data: + target: entity_id: media_player.nursery ``` A little bit more complex example that uses [`input_select`](/integrations/input_select/) and template to decide what to play, and which [Chromecast](/integrations/cast/) to play on. 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 88321c79d9f..f315c64d9b4 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 @@ -55,7 +55,7 @@ script: data: message: "WeMo not found, restarting HA" - service: switch.turn_on - data: + target: entity_id: switch.killhass automation: diff --git a/source/_cookbook/sonos_say.markdown b/source/_cookbook/sonos_say.markdown index 478b0c54f02..4d25186ac8d 100644 --- a/source/_cookbook/sonos_say.markdown +++ b/source/_cookbook/sonos_say.markdown @@ -16,22 +16,22 @@ script: alias: "Sonos TTS script" sequence: - service: sonos.snapshot - data: + target: entity_id: "{{ sonos_entity }}" - service: sonos.unjoin - data: + target: entity_id: "{{ sonos_entity }}" - service: media_player.volume_set - data: + target: entity_id: "{{ sonos_entity }}" volume_level: "{{ volume }}" - service: tts.voicerss_say - data: + target: entity_id: "{{ sonos_entity }}" message: "{{ message }}" - delay: "{{ delay }}" - service: sonos.restore - data: + target: entity_id: "{{ sonos_entity }}" ``` 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 ab760f4a038..07a929ebda9 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 @@ -44,12 +44,12 @@ automation: to: "on" action: - service: light.turn_on - data: + target: entity_id: - light.hallway_0 - light.hallway_1 - service: timer.start - data: + target: entity_id: timer.hallway - alias: "Turn off hallway lights 10 minutes after trigger" @@ -60,7 +60,7 @@ automation: entity_id: timer.hallway action: service: light.turn_off - data: + target: entity_id: - light.hallway_0 - light.hallway_1 diff --git a/source/_docs/scene.markdown b/source/_docs/scene.markdown index e62e178d8ac..c2ede2d14ca 100644 --- a/source/_docs/scene.markdown +++ b/source/_docs/scene.markdown @@ -102,8 +102,9 @@ automation: to: "home" action: service: scene.turn_on - data: + target: entity_id: scene.romantic + data: transition: 2.5 ``` diff --git a/source/_docs/scripts.markdown b/source/_docs/scripts.markdown index 4165ada7b06..61b21bfc948 100644 --- a/source/_docs/scripts.markdown +++ b/source/_docs/scripts.markdown @@ -16,7 +16,7 @@ script: sequence: # This is written using the Script Syntax - service: light.turn_on - data: + target: entity_id: light.ceiling - service: notify.notify data: @@ -49,8 +49,9 @@ The most important one is the action to call a service. This can be done in vari ```yaml - alias: "Bedroom lights on" service: light.turn_on - data: + target: entity_id: group.bedroom + data: brightness: 100 ``` @@ -76,8 +77,9 @@ The variables action allows you to set/override variables that will be accessibl brightness: 100 - alias: "Control lights" service: light.turn_on - data: + target: entity_id: "{{ entities }}" + data: brightness: "{{ brightness }}" ``` @@ -339,14 +341,14 @@ script: mode: restart sequence: - service: light.turn_on - data: + target: entity_id: "light.{{ light }}" - repeat: count: "{{ count|int * 2 - 1 }}" sequence: - delay: 2 - service: light.toggle - data: + target: entity_id: "light.{{ light }}" flash_hallway_light: sequence: diff --git a/source/_integrations/alarm_control_panel.template.markdown b/source/_integrations/alarm_control_panel.template.markdown index ac8b932bbc9..a17f3f5bc18 100644 --- a/source/_integrations/alarm_control_panel.template.markdown +++ b/source/_integrations/alarm_control_panel.template.markdown @@ -36,21 +36,24 @@ alarm_control_panel: value_template: "{{ states('alarm_control_panel.real_alarm') }}" arm_away: service: alarm_control_panel.alarm_arm_away - data: + target: entity_id: alarm_control_panel.real_alarm + data: code: !secret alarm_code arm_home: service: alarm_control_panel.alarm_arm_home - data: + target: entity_id: alarm_control_panel.real_alarm + data: code: !secret alarm_code disarm: - condition: state entity_id: device_tracker.paulus state: "home" - service: alarm_control_panel.alarm_arm_home - data: + target: entity_id: alarm_control_panel.real_alarm + data: code: !secret alarm_code ``` diff --git a/source/_integrations/alexa.intent.markdown b/source/_integrations/alexa.intent.markdown index b0b7b978791..063aebf23f5 100644 --- a/source/_integrations/alexa.intent.markdown +++ b/source/_integrations/alexa.intent.markdown @@ -217,7 +217,7 @@ intent_script: ActivateSceneIntent: action: service: scene.turn_on - data: + target: entity_id: scene.{{ Scene | replace(" ", "_") }} speech: type: plain @@ -269,7 +269,7 @@ intent_script: RunScriptIntent: action: service: script.turn_on - data: + target: entity_id: script.{{ Script | replace(" ", "_") }} speech: type: plain diff --git a/source/_integrations/amazon_polly.markdown b/source/_integrations/amazon_polly.markdown index a804c2691a0..d970322650f 100644 --- a/source/_integrations/amazon_polly.markdown +++ b/source/_integrations/amazon_polly.markdown @@ -104,7 +104,7 @@ Say to the `media_player.living_room` device entity: ```yaml - service: tts.amazon_polly_say - data: + target: entity_id: media_player.living_room message: > diff --git a/source/_integrations/androidtv.markdown b/source/_integrations/androidtv.markdown index 3cdf6e6edb4..513eac6bef8 100644 --- a/source/_integrations/androidtv.markdown +++ b/source/_integrations/androidtv.markdown @@ -215,15 +215,17 @@ You can launch an app on your device using the `media_player.select_source` comm start_netflix: sequence: - service: media_player.select_source - data: + target: entity_id: media_player.fire_tv_living_room + data: source: "com.netflix.ninja" stop_netflix: sequence: - service: media_player.select_source - data: + target: entity_id: media_player.fire_tv_living_room + data: source: "!com.netflix.ninja" ``` @@ -241,8 +243,9 @@ In an [action](/getting-started/automation-action/) of your [automation setup](/ ```yaml action: service: androidtv.adb_command - data: + target: entity_id: media_player.androidtv_tv_living_room + data: command: "HOME" ``` @@ -282,8 +285,9 @@ As an example, a service call in a [script](/docs/scripts) could be changed from ```yaml # Send the "UP" command (slow) - service: androidtv.adb_command - data: + target: entity_id: media_player.fire_tv_living_room + data: command: UP ``` @@ -292,8 +296,9 @@ to this: ```yaml # Send the "UP" command using `sendevent` (faster) - service: androidtv.adb_command - data: + target: entity_id: media_player.fire_tv_living_room + data: command: "sendevent /dev/input/event4 4 4 786979 && sendevent /dev/input/event4 1 172 1 && sendevent /dev/input/event4 0 0 0 && sendevent /dev/input/event4 4 4 786979 && sendevent /dev/input/event4 1 172 0 && sendevent /dev/input/event4 0 0 0" ``` diff --git a/source/_integrations/apple_tv.markdown b/source/_integrations/apple_tv.markdown index b677bc6dbca..72b6b8f0d15 100644 --- a/source/_integrations/apple_tv.markdown +++ b/source/_integrations/apple_tv.markdown @@ -88,8 +88,9 @@ A typical service call for press several buttons looks like this. ```yaml service: remote.send_command -data: +target: entity_id: remote.apple_tv +data: command: - left - left diff --git a/source/_integrations/binary_sensor.xiaomi_aqara.markdown b/source/_integrations/binary_sensor.xiaomi_aqara.markdown index 0ad58ed5f51..edaab8fc2a2 100644 --- a/source/_integrations/binary_sensor.xiaomi_aqara.markdown +++ b/source/_integrations/binary_sensor.xiaomi_aqara.markdown @@ -55,7 +55,7 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra data: brightness: 5 - service: automation.turn_on - data: + target: entity_id: automation.MOTION_OFF - alias: "If there no motion for 5 minutes turn off the gateway light" trigger: @@ -70,7 +70,7 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra target: entity_id: light.gateway_light_34ce00xxxx11 - service: automation.turn_off - data: + target: entity_id: automation.Motion_off ``` @@ -356,7 +356,7 @@ This automation toggles the living room lamp on vibration/tilt. movement_type: vibrate action: service: light.toggle - data: + target: entity_id: light.living_room_lamp - alias: "Turn on Living Room Lamp on tilt" trigger: @@ -367,6 +367,6 @@ This automation toggles the living room lamp on vibration/tilt. movement_type: tilt action: service: light.toggle - data: + target: entity_id: light.living_room_lamp ``` diff --git a/source/_integrations/blink.markdown b/source/_integrations/blink.markdown index c0fa9469c11..0b7f1781d19 100644 --- a/source/_integrations/blink.markdown +++ b/source/_integrations/blink.markdown @@ -104,13 +104,14 @@ This example script shows how to take a picture with your camera, named `My Came alias: "Blink Snap Picture" sequence: - service: blink.trigger_camera - data: + target: entity_id: camera.blink_my_camera - delay: 00:00:05 - service: blink.blink_update - service: camera.snapshot - data: + target: entity_id: camera.blink_my_camera + data: filename: /tmp/my_image.jpg ``` diff --git a/source/_integrations/broadlink.markdown b/source/_integrations/broadlink.markdown index a4d3f298eb8..d63e66e135f 100644 --- a/source/_integrations/broadlink.markdown +++ b/source/_integrations/broadlink.markdown @@ -69,8 +69,9 @@ script: learn_tv_power: sequence: - service: remote.learn_command - data: + target: entity_id: remote.bedroom + data: device: television command: power ``` @@ -89,8 +90,9 @@ script: learn_car_unlock: sequence: - service: remote.learn_command - data: + target: entity_id: remote.garage + data: device: car command: unlock command_type: rf @@ -112,8 +114,9 @@ script: learn_tv_commands: sequence: - service: remote.learn_command - data: + target: entity_id: remote.bedroom + data: device: television command: - turn on @@ -138,8 +141,9 @@ script: learn_tv_power_button: sequence: - service: remote.learn_command - data: + target: entity_id: remote.bedroom + data: device: television command: power alternative: true @@ -173,8 +177,9 @@ script: tv_power: sequence: - service: remote.send_command - data: + target: entity_id: remote.bedroom + data: device: television command: power ``` @@ -189,8 +194,9 @@ script: turn_up_tv_volume_20: sequence: - service: remote.send_command - data: + target: entity_id: remote.bedroom + data: device: television command: volume up num_repeats: 20 @@ -206,8 +212,9 @@ script: turn_on_ac: sequence: - service: remote.send_command - data: + target: entity_id: remote.bedroom + data: device: air conditioner command: - turn on @@ -224,8 +231,9 @@ script: turn_on_tv: sequence: - service: remote.send_command - data: + target: entity_id: remote.bedroom + data: command: b64:JgAcAB0dHB44HhweGx4cHR06HB0cHhwdHB8bHhwADQUAAAAAAAAAAAAAAAA= ``` @@ -239,8 +247,9 @@ script: turn_on_ac: sequence: - service: remote.send_command - data: + target: entity_id: remote.bedroom + data: command: - b64:JgAcAB0dHB44HhweGx4cHR06HB0cHhwdHB8bHhwADQUAAAAAAAAAAAAAAAA= - b64:JgAaABweOR4bHhwdHB4dHRw6HhsdHR0dOTocAA0FAAAAAAAAAAAAAAAAAAA= @@ -256,8 +265,9 @@ script: turn_on_ac: sequence: - service: remote.send_command - data: + target: entity_id: remote.bedroom + data: device: television command: - turn on @@ -284,8 +294,9 @@ script: delete_tv_power: sequence: - service: remote.delete_command - data: + target: entity_id: remote.bedroom + data: device: television command: power ``` @@ -300,8 +311,9 @@ script: delete_tv_commands: sequence: - service: remote.delete_command - data: + target: entity_id: remote.bedroom + data: device: television command: - power diff --git a/source/_integrations/camera.markdown b/source/_integrations/camera.markdown index 452f64974cc..497b3b520ae 100644 --- a/source/_integrations/camera.markdown +++ b/source/_integrations/camera.markdown @@ -60,8 +60,9 @@ For example, the following action in an automation would send an `hls` live stre ```yaml action: service: camera.play_stream - data: + target: entity_id: camera.yourcamera + data: media_player: media_player.chromecast ``` @@ -87,8 +88,9 @@ For example, the following action in an automation would take a recording from " ```yaml action: service: camera.record - data: + target: entity_id: camera.yourcamera + data: filename: '/tmp/{{ entity_id.name }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4' ``` @@ -112,8 +114,9 @@ For example, the following action in an automation would take a snapshot from "y ```yaml action: service: camera.snapshot - data: + target: entity_id: camera.yourcamera + data: filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg' ``` diff --git a/source/_integrations/cast.markdown b/source/_integrations/cast.markdown index 8bf93345abc..64f12c4cd94 100644 --- a/source/_integrations/cast.markdown +++ b/source/_integrations/cast.markdown @@ -54,8 +54,9 @@ Optional: 'cast_youtube_to_my_chromecast': alias: "Cast YouTube to My Chromecast" sequence: - - data: + - target: entity_id: media_player.my_chromecast + data: media_content_type: cast media_content_id: ' { @@ -79,8 +80,9 @@ Optional: 'cast_supla_to_my_chromecast': alias: "Cast supla to My Chromecast" sequence: - - data: + - target: entity_id: media_player.my_chromecast + data: media_content_type: cast media_content_id: ' { @@ -99,8 +101,9 @@ To cast media directly from a configured Plex server, set the fields [as documen alias: "Cast Plex to Chromecast" sequence: - service: media_player.play_media - data: + target: entity_id: media_player.chromecast + data: media_content_type: movie media_content_id: 'plex://{"library_name": "Movies", "title": "Groundhog Day"}' ``` @@ -116,8 +119,9 @@ You can play MP3 streams like net radios, FLAC files or videos from your local n ```yaml # Play a video file from the local network: service: media_player.play_media -data: +target: entity_id: media_player.chromecast +data: media_content_type: "video" media_content_id: "http://192.168.0.100/movies/sample-video.mkv" ``` @@ -125,8 +129,9 @@ data: ```yaml # Show a jpeg image: service: media_player.play_media -data: +target: entity_id: media_player.chromecast +data: media_content_type: "image/jpeg" media_content_id: "http://via.placeholder.com/1024x600.jpg/0B6B94/FFFFFF/?text=Hello,%20Home%20Assistant!" ``` @@ -137,8 +142,9 @@ For the possible metadata types and values check [Google cast documentation > Me ```yaml # Play a movie from the internet, with extra metadata provided: service: media_player.play_media -data: +target: entity_id: media_player.chromecast +data: media_content_type: "video/mp4" media_content_id: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" extra: @@ -153,8 +159,9 @@ data: ```yaml # Play a netradio, with extra metadata provided: service: media_player.play_media -data: +target: entity_id: media_player.chromecast +data: media_content_type: "audio/mp3" media_content_id: "http://stream.tilos.hu:8000/tilos" extra: diff --git a/source/_integrations/climate.markdown b/source/_integrations/climate.markdown index 324390b81ca..da7bf82dcdd 100644 --- a/source/_integrations/climate.markdown +++ b/source/_integrations/climate.markdown @@ -41,8 +41,9 @@ automation: at: "07:15:00" action: - service: climate.set_aux_heat - data: + target: entity_id: climate.kitchen + data: aux_heat: true ``` @@ -66,8 +67,9 @@ automation: at: "07:15:00" action: - service: climate.set_preset_mode - data: + target: entity_id: climate.kitchen + data: preset_mode: "eco" ``` @@ -93,8 +95,9 @@ automation: at: "07:15:00" action: - service: climate.set_temperature - data: + target: entity_id: climate.kitchen + data: temperature: 24 hvac_mode: heat ``` @@ -107,8 +110,9 @@ automation: at: "07:15:00" action: - service: climate.set_temperature - data: + target: entity_id: climate.kitchen + data: target_temp_high: 24 target_temp_low: 20 hvac_mode: heat_cool @@ -132,8 +136,9 @@ automation: at: "07:15:00" action: - service: climate.set_humidity - data: + target: entity_id: climate.kitchen + data: humidity: 60 ``` @@ -155,8 +160,9 @@ automation: at: "07:15:00" action: - service: climate.set_fan_mode - data: + target: entity_id: climate.kitchen + data: fan_mode: "On Low" ``` @@ -178,8 +184,9 @@ automation: at: "07:15:00" action: - service: climate.set_hvac_mode - data: + target: entity_id: climate.kitchen + data: hvac_mode: heat ``` @@ -201,8 +208,9 @@ automation: at: "07:15:00" action: - service: climate.set_swing_mode - data: + target: entity_id: climate.kitchen + data: swing_mode: 1 ``` diff --git a/source/_integrations/counter.markdown b/source/_integrations/counter.markdown index 1db050c705c..f238fd3da02 100644 --- a/source/_integrations/counter.markdown +++ b/source/_integrations/counter.markdown @@ -151,7 +151,7 @@ automation: level: ERROR action: service: counter.increment - data: + target: entity_id: counter.error_counter counter: diff --git a/source/_integrations/cover.markdown b/source/_integrations/cover.markdown index 9d1d05e2388..d9a50a34cd3 100644 --- a/source/_integrations/cover.markdown +++ b/source/_integrations/cover.markdown @@ -57,8 +57,9 @@ automation: at: "07:15:00" action: - service: cover.set_cover_position - data: + target: entity_id: cover.demo + data: position: 50 ``` @@ -80,7 +81,8 @@ automation: at: "07:15:00" action: - service: cover.set_cover_tilt_position - data: + target: entity_id: cover.demo + data: tilt_position: 50 ``` diff --git a/source/_integrations/cover.template.markdown b/source/_integrations/cover.template.markdown index 6817460ba63..d9068e53dcc 100644 --- a/source/_integrations/cover.template.markdown +++ b/source/_integrations/cover.template.markdown @@ -159,15 +159,15 @@ cover: position_template: "{{ states('sensor.garage_door') }}" open_cover: service: switch.turn_on - data: + target: entity_id: switch.garage_door close_cover: service: switch.turn_off - data: + target: entity_id: switch.garage_door stop_cover: service: switch.turn_on - data: + target: entity_id: switch.garage_door icon_template: >- {% if states('sensor.garage_door')|float > 0 %} @@ -237,17 +237,18 @@ script: cover_group: sequence: - service: "cover.{{modus}}_cover" - data: + target: entity_id: - cover.bedroom - cover.livingroom cover_group_position: sequence: - service: cover.set_cover_position - data: + target: entity_id: - cover.bedroom - cover.livingroom + data: position: "{{position}}" automation: @@ -258,8 +259,9 @@ automation: offset: "+00:30:00" action: - service: cover.set_cover_position - data: + target: entity_id: cover.cover_group + data: position: 25 ``` diff --git a/source/_integrations/deconz.markdown b/source/_integrations/deconz.markdown index 937ab53ccab..c94cf9c52a6 100644 --- a/source/_integrations/deconz.markdown +++ b/source/_integrations/deconz.markdown @@ -218,8 +218,9 @@ automation: event: 2002 action: - service: light.turn_on - data: + target: entity_id: light.lamp + data: brightness: > {% set bri = state_attr('light.lamp', 'brightness') | int %} {{ [bri+30, 249] | min }} @@ -234,8 +235,9 @@ automation: event: 3002 action: - service: light.turn_on - data: + target: entity_id: light.lamp + data: brightness: > {% set bri = state_attr('light.lamp', 'brightness') | int %} {{ [bri-30, 0] | max }} diff --git a/source/_integrations/dexcom.markdown b/source/_integrations/dexcom.markdown index 55ccaedf8b4..b1db93bd361 100644 --- a/source/_integrations/dexcom.markdown +++ b/source/_integrations/dexcom.markdown @@ -55,6 +55,6 @@ If you have a sensor session running, and once you have enabled the Dexcom integ before: "06:00:00" action: - service: light.turn_on - data: + target: entity_id: light.kitchen ``` diff --git a/source/_integrations/dialogflow.markdown b/source/_integrations/dialogflow.markdown index 1beea88b1f4..d70c30424db 100644 --- a/source/_integrations/dialogflow.markdown +++ b/source/_integrations/dialogflow.markdown @@ -112,7 +112,7 @@ intent_script: {%- else -%} switch.turn_off {%- endif -%} - data: + target: entity_id: "switch.light_{{ Room | striptags | replace(' ', '_') }}" ``` diff --git a/source/_integrations/directv.markdown b/source/_integrations/directv.markdown index a7eda859885..688e9d0f12b 100644 --- a/source/_integrations/directv.markdown +++ b/source/_integrations/directv.markdown @@ -119,8 +119,9 @@ A typical service call for press several buttons looks like this. ```yaml service: remote.send_command -data: +target: entity_id: remote.directv_entity +data: command: - left - left diff --git a/source/_integrations/eight_sleep.markdown b/source/_integrations/eight_sleep.markdown index 3b226acc71e..a8564b7bb39 100644 --- a/source/_integrations/eight_sleep.markdown +++ b/source/_integrations/eight_sleep.markdown @@ -86,8 +86,9 @@ script: bed_set_heat: sequence: - service: eight_sleep.heat_set - data: + target: entity_id: "sensor.eight_left_bed_state" + data: target: 35 duration: 3600 ``` diff --git a/source/_integrations/enocean.markdown b/source/_integrations/enocean.markdown index 8c164366c85..92c05f50140 100644 --- a/source/_integrations/enocean.markdown +++ b/source/_integrations/enocean.markdown @@ -142,7 +142,7 @@ automation: pushed: 0 action: service: "{% if trigger.event.data.onoff %} light.turn_on {% else %} light.turn_off {%endif %}" - data: + target: entity_id: "{% if trigger.event.data.which == 1 %} light.hall_left {% else %} light.hall_right {%endif %}" ``` diff --git a/source/_integrations/evohome.markdown b/source/_integrations/evohome.markdown index 9b7b462bf73..3b9d00e4496 100644 --- a/source/_integrations/evohome.markdown +++ b/source/_integrations/evohome.markdown @@ -158,8 +158,9 @@ This service call will set the `setpoint` of a zone, as identified by its `entit ```yaml - action: - service: evohome.set_zone_override + target: + entity_id: climate.loungeroom\ data: - entity_id: climate.loungeroom setpoint: 10 ``` @@ -168,8 +169,9 @@ The `duration` can be up to 24 hours, after which the zone mode will revert to s ```yaml - action: - service: evohome.set_zone_override - data: + target: entity_id: climate.loungeroom + data: setpoint: 10 duration: {minutes: 0} ``` diff --git a/source/_integrations/frontier_silicon.markdown b/source/_integrations/frontier_silicon.markdown index 3959070439a..0961e5574db 100644 --- a/source/_integrations/frontier_silicon.markdown +++ b/source/_integrations/frontier_silicon.markdown @@ -71,7 +71,7 @@ trigger: to: "on" action: service: media_player.turn_on - data: + target: entity_id: "media_player.badezimmer" ``` diff --git a/source/_integrations/gstreamer.markdown b/source/_integrations/gstreamer.markdown index 285320dc499..2f56aab92a3 100644 --- a/source/_integrations/gstreamer.markdown +++ b/source/_integrations/gstreamer.markdown @@ -79,8 +79,9 @@ script: tts: sequence: - service: tts.google_say # or amazon_polly, voicerss, etc - data: + target: entity_id: media_player.gstreamer + data: message: "example text-to-speech message" ``` diff --git a/source/_integrations/harmony.markdown b/source/_integrations/harmony.markdown index ef50982d232..b9d27bc4b18 100644 --- a/source/_integrations/harmony.markdown +++ b/source/_integrations/harmony.markdown @@ -127,8 +127,9 @@ A typical service call for sending several button presses looks like this: ```yaml service: remote.send_command -data: +target: entity_id: remote.tv_room +data: command: - PowerOn - Mute @@ -138,8 +139,9 @@ data: OR ```yaml service: remote.send_command -data: +target: entity_id: remote.tv_room +data: command: - PowerOn - Mute @@ -160,8 +162,9 @@ A typical service call for changing the channel would be:: ```yaml service: harmony.change_channel -data: +target: entity_id: remote.tv_room +data: channel: 200 ``` diff --git a/source/_integrations/hive.markdown b/source/_integrations/hive.markdown index 47ebc6dea35..de904ef746b 100644 --- a/source/_integrations/hive.markdown +++ b/source/_integrations/hive.markdown @@ -82,8 +82,9 @@ script: boost_heating: sequence: - service: hive.boost_heating - data: + target: entity_id: "climate.heating" + data: time_period: "01:30:00" temperature: "20.5" ``` @@ -106,8 +107,9 @@ script: boost_hot_water: sequence: - service: "hive.boost_hot_water" - data: + target: entity_id: "water_heater.hot_water" + data: time_period: "01:30:00" on_off: "on" ``` diff --git a/source/_integrations/homeassistant.markdown b/source/_integrations/homeassistant.markdown index 47d481ee945..cd242cb82ac 100644 --- a/source/_integrations/homeassistant.markdown +++ b/source/_integrations/homeassistant.markdown @@ -67,7 +67,7 @@ Generic service to toggle devices on/off under any domain. Same usage as the lig ```yaml action: service: homeassistant.toggle - data: + target: entity_id: light.living_room ``` @@ -84,7 +84,7 @@ Generic service to turn devices on under any domain. Same usage as the light.tur ```yaml action: service: homeassistant.turn_on - data: + target: entity_id: light.living_room ``` @@ -101,7 +101,7 @@ Generic service to turn devices off under any domain. Same usage as the light.tu ```yaml action: service: homeassistant.turn_off - data: + target: entity_id: light.living_room ``` @@ -118,7 +118,7 @@ Force one or more entities to update its data rather than wait for the next sche ```yaml action: service: homeassistant.update_entity - data: + target: entity_id: - light.living_room - switch.coffe_pot diff --git a/source/_integrations/homematic.markdown b/source/_integrations/homematic.markdown index 07cd4af76ac..df7ca5daf21 100644 --- a/source/_integrations/homematic.markdown +++ b/source/_integrations/homematic.markdown @@ -332,8 +332,9 @@ Set boolean variable to true: ... action: service: homematic.set_variable_value - data: + target: entity_id: homematic.ccu2 + data: name: Variablename value: true ``` diff --git a/source/_integrations/homematicip_cloud.markdown b/source/_integrations/homematicip_cloud.markdown index b25b3ea0b02..a3bf48d1bbd 100644 --- a/source/_integrations/homematicip_cloud.markdown +++ b/source/_integrations/homematicip_cloud.markdown @@ -287,8 +287,9 @@ You can get the required index from the native Homematic IP App. ... action: service: homematicip_cloud.set_active_climate_profile - data: + target: entity_id: climate.livingroom + data: climate_profile_index: 1 ``` @@ -308,7 +309,7 @@ Reset energy counter of measuring actuators. ... action: service: homematicip_cloud.reset_energy_counter - data: + target: entity_id: switch.livingroom ``` diff --git a/source/_integrations/humidifier.markdown b/source/_integrations/humidifier.markdown index df25806fa53..6a3ca0c8363 100644 --- a/source/_integrations/humidifier.markdown +++ b/source/_integrations/humidifier.markdown @@ -44,8 +44,9 @@ automation: at: "07:15:00" action: - service: humidifier.set_mode - data: + target: entity_id: humidifier.bedroom + data: preset_mode: "eco" ``` @@ -67,8 +68,9 @@ automation: at: "07:15:00" action: - service: humidifier.set_humidity - data: + target: entity_id: humidifier.bedroom + data: humidity: 60 ``` diff --git a/source/_integrations/image_processing.markdown b/source/_integrations/image_processing.markdown index bbf22daa65e..bf96344c82a 100644 --- a/source/_integrations/image_processing.markdown +++ b/source/_integrations/image_processing.markdown @@ -70,7 +70,7 @@ automation: to: "on" action: - service: image_processing.scan - data: + target: entity_id: image_processing.door ... ``` diff --git a/source/_integrations/input_boolean.markdown b/source/_integrations/input_boolean.markdown index 77fd350c25a..660d97d293e 100644 --- a/source/_integrations/input_boolean.markdown +++ b/source/_integrations/input_boolean.markdown @@ -91,6 +91,6 @@ You can also set or change the status of an `input_boolean` by using `input_bool ```yaml - service: input_boolean.turn_on - data: + target: entity_id: input_boolean.notify_home ``` diff --git a/source/_posts/2020-10-28-release-117.markdown b/source/_posts/2020-10-28-release-117.markdown index 4ba29998eb3..d9a9b869348 100644 --- a/source/_posts/2020-10-28-release-117.markdown +++ b/source/_posts/2020-10-28-release-117.markdown @@ -216,8 +216,9 @@ script: color: [255, 0, 0] sequence: service: light.turn_on - data: + target: entity_id: "{{ entities }}" + data: rgb_color: "{{ color }}" ``` diff --git a/source/_posts/2020-11-18-release-118.markdown b/source/_posts/2020-11-18-release-118.markdown index 5f016ca6e06..e242e993a30 100644 --- a/source/_posts/2020-11-18-release-118.markdown +++ b/source/_posts/2020-11-18-release-118.markdown @@ -155,8 +155,9 @@ script: color: [255, 0, 0] sequence: service: light.turn_on - data: + target: entity_id: "{{ entities }}" + data: rgb_color: "{{ color }}" ```