Update some service calls to use target (#16575)

This commit is contained in:
Franck Nijhof 2021-02-15 12:32:12 +01:00 committed by GitHub
parent cabcd91686
commit a1d0b36e81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
75 changed files with 362 additions and 186 deletions

View File

@ -33,7 +33,8 @@ automation:
devname: living_room_switch devname: living_room_switch
action: action:
service: light.turn_on 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" - alias: "Turn off living room light"
trigger: trigger:
@ -44,5 +45,6 @@ automation:
devname: living_room_switch devname: living_room_switch
action: action:
service: light.turn_off service: light.turn_off
entity_id: light.hue_color_lamp_3 target:
entity_id: light.hue_color_lamp_3
``` ```

View File

@ -29,7 +29,8 @@ automation:
at: "05:00:00" at: "05:00:00"
action: action:
service: homeassistant.turn_on 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 # turns it off an hour after sunrise
- alias: "Disable First Morning Trigger" - alias: "Disable First Morning Trigger"
@ -39,7 +40,8 @@ automation:
offset: "01:00:00" offset: "01:00:00"
action: action:
service: homeassistant.turn_off 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 # turn off the "waiting" boolean regardless of whether lights will turn on
# so that this happens only once # so that this happens only once
- service: homeassistant.turn_off - 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 # 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 # If a condition tests false, the automation will end
@ -84,7 +87,8 @@ automation:
# Trigger a scene # Trigger a scene
# You could add as many services or scenes as you'd like # You could add as many services or scenes as you'd like
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.morning_first_motion target:
entity_id: scene.morning_first_motion
``` ```
{% endraw %} {% endraw %}

View File

@ -29,7 +29,8 @@ automation:
# start alarm on movement if alarm activated # start alarm on movement if alarm activated
# and the alarm is not triggered # and the alarm is not triggered
service: script.turn_on service: script.turn_on
entity_id: script.alarm_room1 target:
entity_id: script.alarm_room1
- alias: "flash_room1_start" - alias: "flash_room1_start"
trigger: trigger:
@ -38,7 +39,8 @@ automation:
to: "on" to: "on"
action: action:
service: script.turn_on service: script.turn_on
entity_id: script.flash_room1 target:
entity_id: script.flash_room1
- alias: "flash_room1_stop" - alias: "flash_room1_stop"
trigger: trigger:
@ -51,7 +53,8 @@ automation:
state: "off" state: "off"
action: action:
service: script.turn_off service: script.turn_off
entity_id: script.flash_room1 target:
entity_id: script.flash_room1
script: script:
alarm_room1: alarm_room1:

View File

@ -24,7 +24,8 @@ automation:
before: "23:00" before: "23:00"
action: action:
service: light.turn_on 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. 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" after_offset: "-01:00:00"
action: action:
service: light.turn_off service: light.turn_off
entity_id: light.couch_lamp target:
entity_id: light.couch_lamp
``` ```

View File

@ -18,7 +18,8 @@ automation:
state: home state: home
action: action:
service: light.turn_on service: light.turn_on
entity_id: group.living_room_lights target:
entity_id: group.living_room_lights
``` ```
#### Natural wake up light #### Natural wake up light
@ -32,7 +33,8 @@ automation:
at: "07:15:00" at: "07:15:00"
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.bedroom target:
entity_id: light.bedroom
data: data:
# 900 seconds = 15 minutes # 900 seconds = 15 minutes
transition: 900 transition: 900
@ -79,7 +81,8 @@ Solar elevation automations can cope with offsets from sunset / sunrise as the s
below: 3.5 below: 3.5
action: action:
service: scene.turn_on 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" - alias: "Turn more lights on as the sun gets dimmer"
trigger: trigger:
@ -89,7 +92,8 @@ Solar elevation automations can cope with offsets from sunset / sunrise as the s
below: 1.5 below: 1.5
action: action:
service: scene.turn_on service: scene.turn_on
entity_id: scene.more_lights target:
entity_id: scene.more_lights
- alias: "Close blind at dusk" - alias: "Close blind at dusk"
trigger: trigger:
@ -99,7 +103,8 @@ Solar elevation automations can cope with offsets from sunset / sunrise as the s
below: -2.5 below: -2.5
action: action:
service: switch.turn_off service: switch.turn_off
entity_id: switch.blind target:
entity_id: switch.blind
``` ```
{% endraw %} {% endraw %}

View File

@ -27,7 +27,8 @@ automation:
state: "on" state: "on"
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.woonkamer_livingcolors target:
entity_id: light.woonkamer_livingcolors
data: data:
effect: random effect: random
transition: 5 transition: 5

View File

@ -23,7 +23,8 @@ automation:
entity_id: zwave.YOUR_REMOTE entity_id: zwave.YOUR_REMOTE
action: action:
- service: script.turn_on - service: script.turn_on
entity_id: script.ramp_light target:
entity_id: script.ramp_light
data: data:
variables: variables:
direction: up direction: up
@ -39,7 +40,8 @@ automation:
entity_id: zwave.YOUR_REMOTE entity_id: zwave.YOUR_REMOTE
action: action:
- service: script.turn_on - service: script.turn_on
entity_id: script.ramp_light target:
entity_id: script.ramp_light
data: data:
variables: variables:
direction: down direction: down
@ -60,7 +62,8 @@ automation:
entity_id: zwave.YOUR_REMOTE entity_id: zwave.YOUR_REMOTE
action: action:
- service: script.turn_off - 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. 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.

View File

@ -53,7 +53,8 @@ automation:
state: "below_horizon" state: "below_horizon"
action: action:
service: scene.turn_on service: scene.turn_on
entity_id: scene.livingroom_normal target:
entity_id: scene.livingroom_normal
- alias: "Media player playing" - alias: "Media player playing"
trigger: trigger:
@ -67,6 +68,7 @@ automation:
state: "below_horizon" state: "below_horizon"
action: action:
service: scene.turn_on service: scene.turn_on
entity_id: scene.livingroom_dim target:
entity_id: scene.livingroom_dim
``` ```

View File

@ -73,7 +73,8 @@ automation:
state: "off" state: "off"
action: action:
service: homeassistant.turn_on service: homeassistant.turn_on
entity_id: script.restarthawemo target:
entity_id: script.restarthawemo
- alias: "Stop HA" - alias: "Stop HA"
trigger: trigger:
- platform: state - platform: state
@ -91,7 +92,8 @@ automation:
state: "on" state: "on"
action: action:
service: homeassistant.turn_off service: homeassistant.turn_off
entity_id: script.restarthawemo target:
entity_id: script.restarthawemo
``` ```
{% endraw %} {% endraw %}

View File

@ -17,7 +17,8 @@ automation:
to: "on" to: "on"
action: action:
service: light.turn_on 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" - alias: "Turn off kitchen light 10 minutes after last movement"
trigger: trigger:
@ -28,7 +29,8 @@ automation:
minutes: 10 minutes: 10
action: action:
service: light.turn_off service: light.turn_off
entity_id: light.kitchen_light target:
entity_id: light.kitchen_light
``` ```
Or in the case of multiple sensors/triggers: 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" before: "23:30"
action: action:
service: homeassistant.turn_on service: homeassistant.turn_on
entity_id: group.office_lights target:
entity_id: group.office_lights
data: data:
transition: 15 transition: 15
@ -96,7 +99,8 @@ You can also restrict lights from turning on based on time of day and implement
minutes: 15 minutes: 15
action: action:
- service: homeassistant.turn_off - service: homeassistant.turn_off
entity_id: group.office_lights target:
entity_id: group.office_lights
data: data:
transition: 160 transition: 160
``` ```

View File

@ -281,7 +281,8 @@ automation:
seconds: "{{ states('input_number.lock_sec')|int }}" seconds: "{{ states('input_number.lock_sec')|int }}"
action: action:
service: lock.lock service: lock.lock
entity_id: lock.my_place target:
entity_id: lock.my_place
``` ```
{% endraw %} {% endraw %}
@ -337,7 +338,8 @@ automation:
below: -4.0 below: -4.0
action: action:
service: switch.turn_on service: switch.turn_on
entity_id: switch.exterior_lighting target:
entity_id: switch.exterior_lighting
``` ```
{% endraw %} {% endraw %}
@ -466,9 +468,11 @@ automation:
to: "on" to: "on"
action: action:
- service: climate.turn_on - service: climate.turn_on
entity_id: climate.office target:
entity_id: climate.office
- service: input_datetime.set_datetime - service: input_datetime.set_datetime
entity_id: input_datetime.turn_off_ac target:
entity_id: input_datetime.turn_off_ac
data: data:
datetime: > datetime: >
{{ (now().timestamp() + 2*60*60) {{ (now().timestamp() + 2*60*60)
@ -479,7 +483,8 @@ automation:
at: input_datetime.turn_off_ac at: input_datetime.turn_off_ac
action: action:
service: climate.turn_off service: climate.turn_off
entity_id: climate.office target:
entity_id: climate.office
``` ```
{% endraw %} {% endraw %}
@ -495,7 +500,8 @@ automation:
at: sensor.phone_next_alarm at: sensor.phone_next_alarm
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.bedroom target:
entity_id: light.bedroom
``` ```
#### Multiple Times #### Multiple Times

View File

@ -238,7 +238,8 @@ automation:
to: "home" to: "home"
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.entryway target:
entity_id: light.entryway
- alias: "Automation 2" - alias: "Automation 2"
trigger: trigger:
platform: state platform: state
@ -246,7 +247,8 @@ automation:
from: "home" from: "home"
action: action:
service: light.turn_off service: light.turn_off
entity_id: light.entryway target:
entity_id: light.entryway
``` ```
can be turned into: can be turned into:
@ -267,7 +269,8 @@ trigger:
to: "home" to: "home"
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.entryway target:
entity_id: light.entryway
``` ```
`automation/presence/automation2.yaml` `automation/presence/automation2.yaml`
@ -280,7 +283,8 @@ trigger:
from: "home" from: "home"
action: action:
service: light.turn_off 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`. 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" to: "home"
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.entryway target:
entity_id: light.entryway
- alias: "Automation 2" - alias: "Automation 2"
trigger: trigger:
platform: state platform: state
@ -385,7 +390,8 @@ automation:
from: "home" from: "home"
action: action:
service: light.turn_off service: light.turn_off
entity_id: light.entryway target:
entity_id: light.entryway
``` ```
can be turned into: can be turned into:
@ -406,7 +412,8 @@ automation: !include_dir_merge_list automation/
to: "home" to: "home"
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.entryway target:
entity_id: light.entryway
- alias: "Automation 2" - alias: "Automation 2"
trigger: trigger:
platform: state platform: state
@ -414,7 +421,8 @@ automation: !include_dir_merge_list automation/
from: "home" from: "home"
action: action:
service: light.turn_off 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. 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.

View File

@ -55,7 +55,8 @@ automation:
to: "home" to: "home"
action: action:
service: scene.turn_on service: scene.turn_on
entity_id: scene.romantic target:
entity_id: scene.romantic
``` ```
## Applying a scene without defining it ## Applying a scene without defining it

View File

@ -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 - service: script.door_did_not_open
default: default:
- service: script.turn_on - service: script.turn_on
entity_id: target:
- script.door_did_open entity_id:
- script.play_fanfare - script.door_did_open
- script.play_fanfare
# Wait a total of 10 seconds. # Wait a total of 10 seconds.
- wait_template: "{{ is_state('binary_sensor.door_1', 'on') }}" - wait_template: "{{ is_state('binary_sensor.door_1', 'on') }}"
timeout: 10 timeout: 10
continue_on_timeout: false continue_on_timeout: false
- service: switch.turn_on - service: switch.turn_on
entity_id: switch.some_light target:
entity_id: switch.some_light
- wait_for_trigger: - wait_for_trigger:
- platform: state - platform: state
entity_id: binary_sensor.door_2 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 }}" timeout: "{{ wait.remaining }}"
continue_on_timeout: false continue_on_timeout: false
- service: switch.turn_off - service: switch.turn_off
entity_id: switch.some_light target:
entity_id: switch.some_light
``` ```
{% endraw %} {% endraw %}
@ -486,7 +489,8 @@ automation:
data: data:
duration: 60 duration: 60
- service: light.turn_on - service: light.turn_on
entity_id: all target:
entity_id: all
``` ```
```yaml ```yaml
@ -504,13 +508,15 @@ automation:
value_template: "{{ trigger.to_state.state == 'on' }}" value_template: "{{ trigger.to_state.state == 'on' }}"
sequence: sequence:
- service: script.turn_on - service: script.turn_on
entity_id: target:
- script.slowly_turn_on_front_lights entity_id:
- script.announce_someone_at_door - script.slowly_turn_on_front_lights
- script.announce_someone_at_door
# ELSE (i.e., motion stopped) # ELSE (i.e., motion stopped)
default: default:
- service: light.turn_off - service: light.turn_off
entity_id: light.front_lights target:
entity_id: light.front_lights
``` ```
```yaml ```yaml
@ -535,16 +541,19 @@ automation:
value_template: "{{ now().hour < 18 }}" value_template: "{{ now().hour < 18 }}"
sequence: sequence:
- service: light.turn_off - service: light.turn_off
entity_id: light.living_room target:
entity_id: light.living_room
- service: script.sim_day - service: script.sim_day
# ELSE night # ELSE night
default: default:
- service: light.turn_off - service: light.turn_off
entity_id: light.kitchen target:
entity_id: light.kitchen
- delay: - delay:
minutes: "{{ range(1, 11)|random }}" minutes: "{{ range(1, 11)|random }}"
- service: light.turn_off - service: light.turn_off
entity_id: all target:
entity_id: all
``` ```
{% endraw %} {% endraw %}
@ -573,7 +582,8 @@ automation:
is_state('binary_sensor.all_clear', 'off') }} is_state('binary_sensor.all_clear', 'off') }}
sequence: sequence:
- service: script.turn_on - service: script.turn_on
entity_id: script.flash_lights target:
entity_id: script.flash_lights
- service: script.arrive_home - service: script.arrive_home
data: data:
ok: false ok: false

View File

@ -1165,7 +1165,8 @@ Let's see how this works in an automation for a Scene Master that's assigned as
action: action:
- data: - data:
service: light.toggle service: light.toggle
entity_id: group.all_lights target:
entity_id: group.all_lights
``` ```
### RFWDC Cooper 5-button Scene Control Keypad ### RFWDC Cooper 5-button Scene Control Keypad
@ -1402,7 +1403,8 @@ Example Event:
scene_data: 7680 scene_data: 7680
action: action:
- service: switch.toggle - service: switch.toggle
entity_id: switch.office_fan target:
entity_id: switch.office_fan
``` ```
### Zooz S2 MultiRelay (Zen16) ### Zooz S2 MultiRelay (Zen16)
@ -1604,7 +1606,8 @@ Example Event:
scene_data: 0 scene_data: 0
action: action:
- service: switch.toggle - 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) ### EATON On/Off & Dimmer (RF9501/RF9540-N/RF9640-N/RF9601-N)

View File

@ -299,7 +299,8 @@ intent_script:
amzn1.ask.skill.08888888-7777-6666-5555-444444444444: amzn1.ask.skill.08888888-7777-6666-5555-444444444444:
action: action:
service: script.turn_on service: script.turn_on
entity_id: script.red_alert target:
entity_id: script.red_alert
speech: speech:
type: plain type: plain
text: OK text: OK

View File

@ -64,7 +64,8 @@ The Arlo integration also provides a camera service to enable/disable the motion
event: start event: start
action: action:
service: camera.enable_motion_detection service: camera.enable_motion_detection
entity_id: camera.arlo_frontdoor target:
entity_id: camera.arlo_frontdoor
``` ```
## Alarm ## Alarm
@ -112,7 +113,8 @@ Arming the Arlo Base Station when leaving.
to: not_home to: not_home
action: action:
service: alarm_control_panel.alarm_arm_away 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. 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 to: home
action: action:
service: alarm_control_panel.alarm_arm_home 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. 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.

View File

@ -50,7 +50,8 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
below: 300 below: 300
action: action:
- service: light.turn_on - service: light.turn_on
entity_id: light.gateway_light_34ce00xxxx11 target:
entity_id: light.gateway_light_34ce00xxxx11
data: data:
brightness: 5 brightness: 5
- service: automation.turn_on - service: automation.turn_on
@ -66,7 +67,8 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
minutes: 5 minutes: 5
action: action:
- service: light.turn_off - service: light.turn_off
entity_id: light.gateway_light_34ce00xxxx11 target:
entity_id: light.gateway_light_34ce00xxxx11
- service: automation.turn_off - service: automation.turn_off
data: data:
entity_id: automation.Motion_off entity_id: automation.Motion_off
@ -83,7 +85,8 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
to: "on" to: "on"
action: action:
service: climate.set_operation_mode service: climate.set_operation_mode
entity_id: climate.livingroom target:
entity_id: climate.livingroom
data: data:
operation_mode: "Off" operation_mode: "Off"
- alias: "If the window is closed for 5 minutes turn on the radiator again" - 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 minutes: 5
action: action:
service: climate.set_operation_mode service: climate.set_operation_mode
entity_id: climate.livingroom target:
entity_id: climate.livingroom
data: data:
operation_mode: "Smart schedule" operation_mode: "Smart schedule"
- alias: "Notify if door is opened when away" - 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 click_type: single
action: action:
service: switch.toggle 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" - alias: "Toggle couch light on double click"
trigger: trigger:
platform: event 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 click_type: double
action: action:
service: switch.toggle 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" - alias: "Let a dog bark on long press"
trigger: trigger:
platform: event platform: event
@ -210,7 +216,8 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
action_type: flip90 action_type: flip90
action: action:
- service: light.turn_on - service: light.turn_on
entity_id: light.gateway_light_28xxxxxxxxxx target:
entity_id: light.gateway_light_28xxxxxxxxxx
data: data:
color_name: "springgreen" color_name: "springgreen"
- alias: "Cube event flip180" - alias: "Cube event flip180"
@ -222,7 +229,8 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
action_type: flip180 action_type: flip180
action: action:
- service: light.turn_on - service: light.turn_on
entity_id: light.gateway_light_28xxxxxxxxxx target:
entity_id: light.gateway_light_28xxxxxxxxxx
data: data:
color_name: "darkviolet" color_name: "darkviolet"
- alias: "Cube event move" - alias: "Cube event move"
@ -234,7 +242,8 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
action_type: move action_type: move
action: action:
- service: light.turn_on - service: light.turn_on
entity_id: light.gateway_light_28xxxxxxxxxx target:
entity_id: light.gateway_light_28xxxxxxxxxx
data: data:
color_name: "gold" color_name: "gold"
- alias: "Cube event tap_twice" - 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_type: tap_twice
action: action:
- service: light.turn_on - service: light.turn_on
entity_id: light.gateway_light_28xxxxxxxxxx target:
entity_id: light.gateway_light_28xxxxxxxxxx
data: data:
color_name: "deepskyblue" color_name: "deepskyblue"
- alias: "Cube event shake_air" - 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_type: shake_air
action: action:
- service: light.turn_on - service: light.turn_on
entity_id: light.gateway_light_28xxxxxxxxxx target:
entity_id: light.gateway_light_28xxxxxxxxxx
data: data:
color_name: "blue" color_name: "blue"
``` ```
@ -279,7 +290,8 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac
click_type: single click_type: single
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.gateway_light_34xxxxxxxx13 target:
entity_id: light.gateway_light_34xxxxxxxx13
data: data:
brightness: >- brightness: >-
{% if state_attr('light.gateway_light_34xxxxxxxx13', '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 click_type: single
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.gateway_light_34xxxxxxxx13 target:
entity_id: light.gateway_light_34xxxxxxxx13
data: data:
brightness: >- brightness: >-
{% if state_attr('light.gateway_light_34xxxxxxxx13', '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 click_type: both
action: action:
service: light.turn_off service: light.turn_off
entity_id: light.gateway_light_34xxxxxxxx13 target:
entity_id: light.gateway_light_34xxxxxxxx13
``` ```
{% endraw %} {% endraw %}

View File

@ -129,7 +129,8 @@ Here, this example assumes your blink module is named `My Sync Module` and that
to: "not_home" to: "not_home"
action: action:
service: alarm_control_panel.alarm_arm_away 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 ### Disarm Blink When Home
@ -145,7 +146,8 @@ Similar to the previous example, this automation will disarm blink when arriving
to: "home" to: "home"
action: action:
service: alarm_control_panel.alarm_disarm 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 ### Save Video Locally When Motion Detected

View File

@ -169,7 +169,8 @@ calendar:
at: "06:40:00" at: "06:40:00"
action: action:
- service: media_player.media_play - service: media_player.media_play
entity_id: media_player.bedroom target:
entity_id: media_player.bedroom
condition: condition:
- condition: state - condition: state
entity_id: calendar.work_holiday entity_id: calendar.work_holiday

View File

@ -205,7 +205,8 @@ automation:
event: 1002 event: 1002
action: action:
service: light.toggle service: light.toggle
entity_id: light.lamp target:
entity_id: light.lamp
- alias: "Increase brightness of lamp from dimmer" - alias: "Increase brightness of lamp from dimmer"
initial_state: "on" initial_state: "on"
@ -249,7 +250,8 @@ automation:
gesture: 7 gesture: 7
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.lamp target:
entity_id: light.lamp
``` ```
{% endraw %} {% endraw %}

View File

@ -216,5 +216,6 @@ image_processing:
- binary_sensor.driveway - binary_sensor.driveway
action: action:
- service: image_processing.scan - service: image_processing.scan
entity_id: image_processing.doods_camera_driveway target:
entity_id: image_processing.doods_camera_driveway
``` ```

View File

@ -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 event_type: doorbird_driveway_gate_somebody_pressed_the_button
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.side_entry_porch target:
entity_id: light.side_entry_porch
``` ```
## Camera ## Camera

View File

@ -119,7 +119,8 @@ The following is an example implementation of an automation:
key: Fwd key: Fwd
action: action:
- service: media_player.volume_up - service: media_player.volume_up
entity_id: media_player.amplifier target:
entity_id: media_player.amplifier
``` ```
## Troubleshooting ## Troubleshooting

View File

@ -62,7 +62,8 @@ automation:
event_type: feedreader event_type: feedreader
action: action:
service: script.turn_on service: script.turn_on
entity_id: script.my_action target:
entity_id: script.my_action
``` ```
{% raw %} {% raw %}

View File

@ -126,7 +126,8 @@ automation:
entity_id: sensor.incidents entity_id: sensor.incidents
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.bedroom target:
entity_id: light.bedroom
- alias: "Play TTS incident details when incident is received" - alias: "Play TTS incident details when incident is received"
trigger: trigger:
@ -154,7 +155,8 @@ automation:
entity_id: switch.response_button entity_id: switch.response_button
action: action:
service: homeassistant.turn_on service: homeassistant.turn_on
entity_id: switch.incident_response target:
entity_id: switch.incident_response
- alias: "Cast FireServiceRota dashboard to Nest Hub" - alias: "Cast FireServiceRota dashboard to Nest Hub"
trigger: trigger:

View File

@ -81,7 +81,8 @@ automation:
click_type: single click_type: single
action: action:
service: homeassistant.turn_on service: homeassistant.turn_on
entity_id: group.lights_livingroom target:
entity_id: group.lights_livingroom
``` ```
Event data: Event data:

View File

@ -56,7 +56,8 @@ automation:
event_type: foursquare.push event_type: foursquare.push
action: action:
service: script.turn_on service: script.turn_on
entity_id: script.my_action target:
entity_id: script.my_action
``` ```
### Check ins ### Check ins

View File

@ -158,5 +158,6 @@ You can also use the `homeassistant.update_entity` service to update the sensor
- fri - fri
action: action:
- service: homeassistant.update_entity - service: homeassistant.update_entity
entity_id: sensor.morning_commute target:
entity_id: sensor.morning_commute
``` ```

View File

@ -63,5 +63,6 @@ The current price for the Load Zone will appear as a sensor:
zone: zone.home zone: zone.home
action: action:
- service: switch.turn_off - service: switch.turn_off
entity_id: switch.my_tesla_charger_switch target:
entity_id: switch.my_tesla_charger_switch
``` ```

View File

@ -79,7 +79,8 @@ Using the activity name 'Watch TV', you can call a service via automation to swi
```yaml ```yaml
action: action:
- service: remote.turn_on - service: remote.turn_on
entity_id: remote.bed_room_hub target:
entity_id: remote.bed_room_hub
data: data:
activity: "Watch TV" activity: "Watch TV"
``` ```
@ -207,7 +208,8 @@ automation:
value_template: '{{ trigger.to_state.attributes.current_activity == "Kodi" }}' value_template: '{{ trigger.to_state.attributes.current_activity == "Kodi" }}'
action: action:
service: input_boolean.turn_on service: input_boolean.turn_on
entity_id: input_boolean.notify target:
entity_id: input_boolean.notify
- alias: "PowerOff started from harmony hub" - alias: "PowerOff started from harmony hub"
trigger: trigger:
platform: state platform: state
@ -217,7 +219,8 @@ automation:
value_template: '{{ trigger.to_state.attributes.current_activity == "PowerOff" }}' value_template: '{{ trigger.to_state.attributes.current_activity == "PowerOff" }}'
action: action:
service: input_boolean.turn_off service: input_boolean.turn_off
entity_id: input_boolean.notify target:
entity_id: input_boolean.notify
``` ```
{% endraw %} {% endraw %}

View File

@ -176,5 +176,6 @@ automation:
- fri - fri
action: action:
- service: homeassistant.update_entity - service: homeassistant.update_entity
entity_id: sensor.morning_commute target:
entity_id: sensor.morning_commute
``` ```

View File

@ -261,7 +261,8 @@ automation:
param: PRESS_SHORT param: PRESS_SHORT
action: action:
service: switch.turn_on 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. 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: action:
service: lock.lock service: lock.lock
entity_id: lock.leq1234567 target:
entity_id: lock.leq1234567
``` ```
Manually set unlock on KeyMatic devices: Manually set unlock on KeyMatic devices:
@ -432,7 +434,8 @@ Manually set unlock on KeyMatic devices:
... ...
action: action:
service: lock.unlock service: lock.unlock
entity_id: lock.leq1234567 target:
entity_id: lock.leq1234567
``` ```
#### Detecting lost connections #### Detecting lost connections

View File

@ -36,5 +36,6 @@ To add `Hunter Douglas PowerView` to your installation, go to **Configuration**
at: "18:00:00" at: "18:00:00"
action: action:
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.10877 target:
entity_id: scene.10877
``` ```

View File

@ -121,7 +121,8 @@ automation:
at: input_datetime.bedroom_alarm_clock_time at: input_datetime.bedroom_alarm_clock_time
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.bedroom target:
entity_id: light.bedroom
``` ```
To dynamically set the `input_datetime` you can call To dynamically set the `input_datetime` you can call

View File

@ -253,7 +253,8 @@ automation:
action: action:
- delay: "00:{{ states('input_number.minutes') | int }}:{{ states('input_number.seconds') | int }}" - delay: "00:{{ states('input_number.minutes') | int }}:{{ states('input_number.seconds') | int }}"
- service: switch.turn_off - service: switch.turn_off
entity_id: switch.something target:
entity_id: switch.something
``` ```
{% endraw %} {% endraw %}

View File

@ -139,7 +139,8 @@ automation:
state: "off" state: "off"
action: action:
- service: light.turn_on - service: light.turn_on
entity_id: light.some_light target:
entity_id: light.some_light
# single button remote # single button remote
- id: light_off - id: light_off
@ -155,7 +156,8 @@ automation:
state: "off" state: "off"
action: action:
- service: light.turn_on - service: light.turn_on
entity_id: light.some_light target:
entity_id: light.some_light
``` ```
## Manual configuration ## Manual configuration
@ -400,7 +402,8 @@ automation:
state: "off" state: "off"
action: action:
- service: light.turn_on - service: light.turn_on
entity_id: light.some_light target:
entity_id: light.some_light
# single button remote # single button remote
- id: light_off - id: light_off
@ -416,5 +419,6 @@ automation:
state: "off" state: "off"
action: action:
- service: light.turn_on - service: light.turn_on
entity_id: light.some_light target:
entity_id: light.some_light
``` ```

View File

@ -130,7 +130,8 @@ automation:
prec: "0" prec: "0"
action: action:
service: light.turn_off 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: 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:

View File

@ -93,7 +93,8 @@ automation:
key_code: 107 # inspect log to obtain desired keycode key_code: 107 # inspect log to obtain desired keycode
action: action:
service: light.turn_on 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. `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.

View File

@ -22,7 +22,8 @@ You can then activate each scene with its name from the smartphone app:
```yaml ```yaml
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.goodnight target:
entity_id: scene.goodnight
``` ```
{% configuration %} {% configuration %}

View File

@ -91,7 +91,8 @@ automation:
button_name: KEY_0 button_name: KEY_0
action: action:
service: homeassistant.turn_off 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. The `button_name` data values (e.g., `KEY_0`) are set by you in the `.lircrc` file.

View File

@ -59,7 +59,8 @@ automation:
action: call_service action: call_service
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.office target:
entity_id: light.office
``` ```
## Notifications ## Notifications

View File

@ -175,7 +175,8 @@ automation:
state: armed_away state: armed_away
action: action:
service: alarm_control_panel.alarm_trigger 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. 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' # many z-wave locks use Alarm Type 19 for 'Unlocked by Keypad'
action: action:
- service: alarm_control_panel.alarm_disarm - 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 Sending a Notification when the Alarm is Armed (Away/Home), Disarmed and in Pending Status

View File

@ -75,7 +75,8 @@ dropdown on UI. You can apply a scene by clicking an item from the dropdown or b
```yaml ```yaml
- service: light.turn_on - service: light.turn_on
entity_id: light.bedroom target:
entity_id: light.bedroom
data: data:
effect: Romance effect: Romance
``` ```

View File

@ -241,7 +241,8 @@ Example script:
play_plex_on_tv: play_plex_on_tv:
sequence: sequence:
- service: media_player.select_source - service: media_player.select_source
entity_id: media_player.smart_tv target:
entity_id: media_player.smart_tv
data: data:
source: "Plex" source: "Plex"
- wait_template: "{{ is_state('media_player.smart_tv', 'On') }}" - wait_template: "{{ is_state('media_player.smart_tv', 'On') }}"

View File

@ -130,7 +130,8 @@ automation:
at: "5:30:00" at: "5:30:00"
action: action:
service: rainbird.start_irrigation service: rainbird.start_irrigation
entity_id: switch.sprinkler_1 target:
entity_id: switch.sprinkler_1
data: data:
duration: 5 duration: 5
``` ```

View File

@ -292,7 +292,8 @@ automation:
Sound: 9 Sound: 9
action: action:
service: scene.turn_on service: scene.turn_on
entity_id: scene.welcomescene target:
entity_id: scene.welcomescene
``` ```
## Services ## Services

View File

@ -69,7 +69,8 @@ automation:
to: "home" to: "home"
action: action:
service: scene.turn_on service: scene.turn_on
entity_id: scene.romantic target:
entity_id: scene.romantic
``` ```
## Applying a scene without defining it ## Applying a scene without defining it

View File

@ -169,7 +169,8 @@ automation:
to: "on" to: "on"
action: action:
service: script.turn_on service: script.turn_on
entity_id: script.notify_pushover target:
entity_id: script.notify_pushover
data: data:
variables: variables:
title: "State change" title: "State change"
@ -243,7 +244,8 @@ script:
script_1: script_1:
sequence: sequence:
- service: script.turn_on - service: script.turn_on
entity_id: script.script_2 target:
entity_id: script.script_2
# Perform some other steps here while second script runs... # Perform some other steps here while second script runs...
# Now wait for called script to complete. # Now wait for called script to complete.
- wait_template: "{{ is_state('script.script_2', 'off') }}" - wait_template: "{{ is_state('script.script_2', 'off') }}"

View File

@ -81,7 +81,8 @@ If the **BUTTON TYPE** of the switch connected to the device is set to `momentar
click_type: single click_type: single
action: action:
service: light.toggle service: light.toggle
entity_id: light.living_room target:
entity_id: light.living_room
- alias: "Toggle living room lamp" - alias: "Toggle living room lamp"
trigger: trigger:
@ -93,7 +94,8 @@ If the **BUTTON TYPE** of the switch connected to the device is set to `momentar
click_type: long click_type: long
action: action:
service: light.toggle service: light.toggle
entity_id: light.lamp_living_room target:
entity_id: light.lamp_living_room
``` ```
### Possible values for `click_type` ### Possible values for `click_type`

View File

@ -56,7 +56,8 @@ The Logitech Transporter which have two digital inputs can be activated using a
transporter_toslink: transporter_toslink:
sequence: sequence:
- service: homeassistant.turn_on - service: homeassistant.turn_on
entity_id: media_player.transporter target:
entity_id: media_player.transporter
- service: media_player.play_media - service: media_player.play_media
data: data:
entity_id: media_player.transporter entity_id: media_player.transporter

View File

@ -67,7 +67,8 @@ automation:
at: "5:30:00" at: "5:30:00"
action: action:
service: mysensors.send_ir_code service: mysensors.send_ir_code
entity_id: switch.hvac_1_1 target:
entity_id: switch.hvac_1_1
data: data:
V_IR_SEND: "0xC284" # the IR code to send V_IR_SEND: "0xC284" # the IR code to send
@ -77,7 +78,8 @@ automation:
at: "0:30:00" at: "0:30:00"
action: action:
service: mysensors.send_ir_code service: mysensors.send_ir_code
entity_id: switch.hvac_1_1 target:
entity_id: switch.hvac_1_1
data: data:
V_IR_SEND: "0xC288" # the IR code to send V_IR_SEND: "0xC288" # the IR code to send
``` ```

View File

@ -97,7 +97,8 @@ automation:
level: WARNING level: WARNING
action: action:
service: counter.increment service: counter.increment
entity_id: counter.warning_counter target:
entity_id: counter.warning_counter
``` ```
### Conditional Messages ### Conditional Messages

View File

@ -332,11 +332,13 @@ trigger:
command: "/siren" command: "/siren"
action: action:
- service: homeassistant.turn_on - 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: - delay:
seconds: 10 seconds: 10
- service: homeassistant.turn_off - 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: An example to show the use of event_data in action:

View File

@ -372,7 +372,8 @@ automation:
minutes: "/5" minutes: "/5"
action: action:
- service: homeassistant.update_entity - service: homeassistant.update_entity
entity_id: sensor.random_number target:
entity_id: sensor.random_number
``` ```
{% endraw %} {% endraw %}

View File

@ -208,5 +208,6 @@ image_processing:
- binary_sensor.driveway - binary_sensor.driveway
action: action:
- service: image_processing.scan - service: image_processing.scan
entity_id: camera.driveway target:
entity_id: camera.driveway
``` ```

View File

@ -137,7 +137,8 @@ timer:
to: "on" to: "on"
action: action:
- service: timer.start - service: timer.start
entity_id: timer.test target:
entity_id: timer.test
# When timer is stopped, the time run out, another message is sent # When timer is stopped, the time run out, another message is sent
- alias: "Timerstop" - alias: "Timerstop"
@ -163,20 +164,24 @@ script:
alias: "Start timer" alias: "Start timer"
sequence: sequence:
- service: timer.start - service: timer.start
entity_id: timer.test target:
entity_id: timer.test
pause_timer: pause_timer:
alias: "Pause timer" alias: "Pause timer"
sequence: sequence:
- service: timer.pause - service: timer.pause
entity_id: timer.test target:
entity_id: timer.test
cancel_timer: cancel_timer:
alias: "Cancel timer" alias: "Cancel timer"
sequence: sequence:
- service: timer.cancel - service: timer.cancel
entity_id: timer.test target:
entity_id: timer.test
finish_timer: finish_timer:
alias: "Finish timer" alias: "Finish timer"
sequence: sequence:
- service: timer.finish - service: timer.finish
entity_id: timer.test target:
entity_id: timer.test
``` ```

View File

@ -55,7 +55,8 @@ automation:
before: sunset before: sunset
action: action:
service: scene.turn_on service: scene.turn_on
entity_id: scene.OnDisarmedDaytime target:
entity_id: scene.OnDisarmedDaytime
- alias: "Alarm: Armed Away" - alias: "Alarm: Armed Away"
trigger: trigger:
platform: state platform: state
@ -63,7 +64,8 @@ automation:
to: "armed_away" to: "armed_away"
action: action:
service: scene.turn_on 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. 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.

View File

@ -59,5 +59,6 @@ automation:
action: call_service action: call_service
action: action:
service: light.turn_on service: light.turn_on
entity_id: light.office target:
entity_id: light.office
``` ```

View File

@ -219,7 +219,8 @@ automation:
to: "playing" to: "playing"
action: action:
- service: media_player.turn_on - 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" - alias: "Turn off the TV when Kodi is in idle > 15 min"
trigger: trigger:
@ -230,7 +231,8 @@ automation:
minutes: 15 minutes: 15
action: action:
- service: media_player.turn_off - service: media_player.turn_off
entity_id: media_player.kodi_tv target:
entity_id: media_player.kodi_tv
``` ```
{% endraw %} {% endraw %}
@ -252,19 +254,23 @@ media_player:
commands: commands:
turn_on: turn_on:
service: remote.turn_on service: remote.turn_on
entity_id: remote.alexander_down_guest target:
entity_id: remote.alexander_down_guest
turn_off: turn_off:
service: remote.turn_off service: remote.turn_off
entity_id: remote.alexander_down_guest target:
entity_id: remote.alexander_down_guest
volume_up: volume_up:
service: remote.send_command service: remote.send_command
entity_id: remote.alexander_down_guest target:
entity_id: remote.alexander_down_guest
data: data:
device: Receiver device: Receiver
command: VolumeUp command: VolumeUp
volume_down: volume_down:
service: remote.send_command service: remote.send_command
entity_id: remote.alexander_down_guest target:
entity_id: remote.alexander_down_guest
data: data:
device: Receiver device: Receiver
command: VolumeDown command: VolumeDown

View File

@ -198,18 +198,20 @@ all_lights_on:
description: "Activate two UPB scenes named interior_lights and exterior_lights" description: "Activate two UPB scenes named interior_lights and exterior_lights"
sequence: sequence:
- service: scene.turn_on - service: scene.turn_on
entity_id: target:
- scene.interior_lights entity_id:
- scene.exterior_lights - scene.interior_lights
- scene.exterior_lights
all_lights_off: all_lights_off:
alias: "All Lights Off" alias: "All Lights Off"
description: "Deactivate two UPB scenes named interior_lights and exterior_lights" description: "Deactivate two UPB scenes named interior_lights and exterior_lights"
sequence: sequence:
- service: upb.scene_deactivate - service: upb.scene_deactivate
entity_id: target:
- scene.interior_lights entity_id:
- scene.exterior_lights - scene.interior_lights
- scene.exterior_lights
kitchen_fade_on: kitchen_fade_on:
alias: "Kitchen Fade to On" alias: "Kitchen Fade to On"

View File

@ -153,9 +153,11 @@ automation:
at: "21:00:00" at: "21:00:00"
action: action:
- service: utility_meter.next_tariff - service: utility_meter.next_tariff
entity_id: utility_meter.daily_energy target:
entity_id: utility_meter.daily_energy
- service: utility_meter.next_tariff - service: utility_meter.next_tariff
entity_id: utility_meter.monthly_energy target:
entity_id: utility_meter.monthly_energy
``` ```
## Advanced Configuration for DSMR users ## Advanced Configuration for DSMR users

View File

@ -143,7 +143,8 @@ automation:
state: "on" state: "on"
action: action:
service: switch.turn_on service: switch.turn_on
entity_id: switch.heater target:
entity_id: switch.heater
``` ```
<div class='note'> <div class='note'>

View File

@ -1094,14 +1094,16 @@ script:
towel_heater: towel_heater:
sequence: sequence:
- service: remote.send_command - service: remote.send_command
entity_id: "remote.bathroom_remote" target:
entity_id: "remote.bathroom_remote"
data: data:
command: command:
- 'activate_towel_heater' - 'activate_towel_heater'
please_cover_your_ears: please_cover_your_ears:
sequence: sequence:
- service: remote.send_command - service: remote.send_command
entity_id: "remote.bathroom_remote" target:
entity_id: "remote.bathroom_remote"
data: data:
command: command:
- 'read_bad_poem' - 'read_bad_poem'

View File

@ -61,7 +61,8 @@ automation:
before: sunset before: sunset
action: action:
service: scene.turn_on service: scene.turn_on
entity_id: scene.OnDisarmedDaytime target:
entity_id: scene.OnDisarmedDaytime
- alias: "Alarm: Armed Away" - alias: "Alarm: Armed Away"
trigger: trigger:
platform: state platform: state
@ -69,5 +70,6 @@ automation:
to: "armed_away" to: "armed_away"
action: action:
service: scene.turn_on service: scene.turn_on
entity_id: scene.OnArmedAway target:
entity_id: scene.OnArmedAway
``` ```

View File

@ -54,7 +54,8 @@ automation:
before: "23:00:00" before: "23:00:00"
action: action:
service: homeassistant.turn_on service: homeassistant.turn_on
entity_id: group.living_room target:
entity_id: group.living_room
``` ```
__Verisure Alarms__ __Verisure Alarms__

View File

@ -72,7 +72,8 @@ automation:
state: "off" state: "off"
action: action:
service: switch.turn_on service: switch.turn_on
entity_id: switch.gate target:
entity_id: switch.gate
``` ```
Or warn you if you leave your keys behind Or warn you if you leave your keys behind
@ -90,7 +91,8 @@ automation:
value_template: '{{ states.device_tracker.greg_gregphone.state != "home" }}' value_template: '{{ states.device_tracker.greg_gregphone.state != "home" }}'
action: action:
service: script.turn_on service: script.turn_on
entity_id: script.send_key_alert target:
entity_id: script.send_key_alert
- alias: "Forgotten keys - cancel" - alias: "Forgotten keys - cancel"
trigger: trigger:
@ -102,7 +104,8 @@ automation:
state: "on" state: "on"
action: action:
service: script.turn_off service: script.turn_off
entity_id: script.send_key_alert target:
entity_id: script.send_key_alert
``` ```
{% endraw %} {% endraw %}

View File

@ -81,7 +81,8 @@ automation:
to: "Complete" to: "Complete"
action: action:
service: script.turn_on service: script.turn_on
entity_id: script.washer_complete target:
entity_id: script.washer_complete
- alias: "Washer emptied" - alias: "Washer emptied"
trigger: trigger:
@ -91,7 +92,8 @@ automation:
to: "Empty" to: "Empty"
action: action:
service: scene.turn_on service: scene.turn_on
entity_id: scene.normal target:
entity_id: scene.normal
script: script:
washer_complete: washer_complete:

View File

@ -80,7 +80,8 @@ automation:
to: "on" to: "on"
action: action:
service: ffmpeg.start service: ffmpeg.start
entity_id: binary_sensor.ffmpeg_noise target:
entity_id: binary_sensor.ffmpeg_noise
- alias: "Babyphone off" - alias: "Babyphone off"
trigger: trigger:
@ -90,7 +91,8 @@ automation:
to: "off" to: "off"
action: action:
service: ffmpeg.stop service: ffmpeg.stop
entity_id: binary_sensor.ffmpeg_noise target:
entity_id: binary_sensor.ffmpeg_noise
``` ```
### Trigger an alarm ### Trigger an alarm
@ -107,20 +109,25 @@ automation:
to: "on" to: "on"
action: action:
- service: media_player.sonos_snapshot - service: media_player.sonos_snapshot
entity_id: media_player.bedroom target:
entity_id: media_player.bedroom
- service: media_player.sonos_unjoin - service: media_player.sonos_unjoin
entity_id: media_player.bedroom target:
entity_id: media_player.bedroom
- service: media_player.volume_set - service: media_player.volume_set
entity_id: media_player.bedroom target:
entity_id: media_player.bedroom
data: data:
volume_level: 0.4 volume_level: 0.4
- service: media_player.play_media - service: media_player.play_media
entity_id: media_player.bedroom target:
entity_id: media_player.bedroom
data: data:
media_content_type: "music" media_content_type: "music"
media_content_id: http://my_ip_icecast:8000/babyphone.mp3 media_content_id: http://my_ip_icecast:8000/babyphone.mp3
- service: light.turn_on: - service: light.turn_on:
entity_id: target:
entity_id:
- light.floor - light.floor
- light.bedroom - light.bedroom
data: data:
@ -134,11 +141,13 @@ automation:
to: "off" to: "off"
action: action:
- service: media_player.sonos_restore - service: media_player.sonos_restore
entity_id: media_player.bedroom target:
entity_id: media_player.bedroom
- service: light.turn_off: - service: light.turn_off:
entity_id: target:
- light.floor entity_id:
- light.bedroom - light.floor
- light.bedroom
``` ```
### Thanks ### Thanks

View File

@ -221,7 +221,8 @@ Experiencing issues introduced by this release? Please report them in our [issue
entity_id: all entity_id: all
action: action:
service: light.turn_off 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. - __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.

View File

@ -46,7 +46,8 @@ automation:
action: close_garage action: close_garage
action: action:
service: cover.close_cover 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: After adding these automations, whenever your garage door remains open for 30 minutes, your device will get a notification that looks like this:

View File

@ -215,7 +215,8 @@ condition:
state: disarmed state: disarmed
action: action:
- service: light.turn_off - service: light.turn_off
entity_id: light.kitchen target:
entity_id: light.kitchen
``` ```
## HomeKit ## HomeKit

View File

@ -80,11 +80,13 @@ automation:
to: "on" to: "on"
action: action:
- service: light.turn_on - service: light.turn_on
entity_id: light.bulb target:
entity_id: light.bulb
- delay: - delay:
seconds: 10 seconds: 10
- service: light.turn_off - 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 This automation turns on a light bulb when the button is pressed, and after
@ -240,14 +242,16 @@ automation:
state: "on" state: "on"
sequence: sequence:
- service: light.turn_on - service: light.turn_on
entity_id: light.bulb target:
entity_id: light.bulb
- conditions: - conditions:
- condition: state - condition: state
entity_id: binary_sensor.button2 entity_id: binary_sensor.button2
state: "on" state: "on"
sequence: sequence:
- service: light.turn_off - service: light.turn_off
entity_id: light.bulb target:
entity_id: light.bulb
default: default:
- service: notify.frenck - service: notify.frenck
data: data:
@ -284,7 +288,8 @@ script:
count: 10 count: 10
sequence: sequence:
- service: light.toggle - service: light.toggle
entity_id: light.bulb target:
entity_id: light.bulb
- delay: - delay:
milliseconds: 500 milliseconds: 500
``` ```

View File

@ -468,7 +468,8 @@ automation:
state: "on" state: "on"
action: action:
- service: cover.open_cover - service: cover.open_cover
entity_id: cover.sonne_abstellkammer target:
entity_id: cover.sonne_abstellkammer
- alias: "Binary sensor test counter=1 off" - alias: "Binary sensor test counter=1 off"
trigger: trigger:
@ -483,7 +484,8 @@ automation:
state: "off" state: "off"
action: action:
- service: cover.close_cover - 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 If you intend to use the counter feature (counter > 1) make sure you also

View File

@ -139,7 +139,8 @@ For example:
```yaml ```yaml
action: action:
service: tts.cloud_say service: tts.cloud_say
entity_id: media_player.family_room_speaker target:
entity_id: media_player.family_room_speaker
data: data:
message: These new voices sound absolutely stunning! message: These new voices sound absolutely stunning!
options: options: