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

View File

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

View File

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

View File

@ -24,7 +24,8 @@ automation:
before: "23:00"
action:
service: light.turn_on
entity_id: light.couch_lamp
target:
entity_id: light.couch_lamp
```
And then of course turn off the lamp when it stops raining but only if it's within an hour before sunset.
@ -41,6 +42,7 @@ And then of course turn off the lamp when it stops raining but only if it's with
after_offset: "-01:00:00"
action:
service: light.turn_off
entity_id: light.couch_lamp
target:
entity_id: light.couch_lamp
```

View File

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

View File

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

View File

@ -23,7 +23,8 @@ automation:
entity_id: zwave.YOUR_REMOTE
action:
- service: script.turn_on
entity_id: script.ramp_light
target:
entity_id: script.ramp_light
data:
variables:
direction: up
@ -39,7 +40,8 @@ automation:
entity_id: zwave.YOUR_REMOTE
action:
- service: script.turn_on
entity_id: script.ramp_light
target:
entity_id: script.ramp_light
data:
variables:
direction: down
@ -60,7 +62,8 @@ automation:
entity_id: zwave.YOUR_REMOTE
action:
- service: script.turn_off
entity_id: script.ramp_light
target:
entity_id: script.ramp_light
```
There are two variables that control the speed of the change for the script below. The first is the step -- small steps create a smooth transition. The second is the delay -- larger delays will create a slower transition.

View File

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

View File

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

View File

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

View File

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

View File

@ -238,7 +238,8 @@ automation:
to: "home"
action:
service: light.turn_on
entity_id: light.entryway
target:
entity_id: light.entryway
- alias: "Automation 2"
trigger:
platform: state
@ -246,7 +247,8 @@ automation:
from: "home"
action:
service: light.turn_off
entity_id: light.entryway
target:
entity_id: light.entryway
```
can be turned into:
@ -267,7 +269,8 @@ trigger:
to: "home"
action:
service: light.turn_on
entity_id: light.entryway
target:
entity_id: light.entryway
```
`automation/presence/automation2.yaml`
@ -280,7 +283,8 @@ trigger:
from: "home"
action:
service: light.turn_off
entity_id: light.entryway
target:
entity_id: light.entryway
```
It is important to note that each file must contain only **one** entry when using `!include_dir_list`.
@ -377,7 +381,8 @@ automation:
to: "home"
action:
service: light.turn_on
entity_id: light.entryway
target:
entity_id: light.entryway
- alias: "Automation 2"
trigger:
platform: state
@ -385,7 +390,8 @@ automation:
from: "home"
action:
service: light.turn_off
entity_id: light.entryway
target:
entity_id: light.entryway
```
can be turned into:
@ -406,7 +412,8 @@ automation: !include_dir_merge_list automation/
to: "home"
action:
service: light.turn_on
entity_id: light.entryway
target:
entity_id: light.entryway
- alias: "Automation 2"
trigger:
platform: state
@ -414,7 +421,8 @@ automation: !include_dir_merge_list automation/
from: "home"
action:
service: light.turn_off
entity_id: light.entryway
target:
entity_id: light.entryway
```
It is important to note that when using `!include_dir_merge_list`, you must include a list in each file (each list item is denoted with a hyphen [-]). Each file may contain one or more entries.

View File

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

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

View File

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

View File

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

View File

@ -64,7 +64,8 @@ The Arlo integration also provides a camera service to enable/disable the motion
event: start
action:
service: camera.enable_motion_detection
entity_id: camera.arlo_frontdoor
target:
entity_id: camera.arlo_frontdoor
```
## Alarm
@ -112,7 +113,8 @@ Arming the Arlo Base Station when leaving.
to: not_home
action:
service: alarm_control_panel.alarm_arm_away
entity_id: alarm_control_panel.my_arlo_base_station
target:
entity_id: alarm_control_panel.my_arlo_base_station
```
Setting Arlo to a custom mode (mapped to `home_mode_name` in `configuration.yaml`) when arriving.
@ -127,7 +129,8 @@ Setting Arlo to a custom mode (mapped to `home_mode_name` in `configuration.yaml
to: home
action:
service: alarm_control_panel.alarm_arm_home
entity_id: alarm_control_panel.my_arlo_base_station
target:
entity_id: alarm_control_panel.my_arlo_base_station
```
You can also completely disarm the Arlo base station by calling the `alarm_control_panel.alarm_disarm` service, and trigger the alarm by calling the `alarm_control_panel.alarm_trigger` service.

View File

@ -50,7 +50,8 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
below: 300
action:
- service: light.turn_on
entity_id: light.gateway_light_34ce00xxxx11
target:
entity_id: light.gateway_light_34ce00xxxx11
data:
brightness: 5
- service: automation.turn_on
@ -66,7 +67,8 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
minutes: 5
action:
- service: light.turn_off
entity_id: light.gateway_light_34ce00xxxx11
target:
entity_id: light.gateway_light_34ce00xxxx11
- service: automation.turn_off
data:
entity_id: automation.Motion_off
@ -83,7 +85,8 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
to: "on"
action:
service: climate.set_operation_mode
entity_id: climate.livingroom
target:
entity_id: climate.livingroom
data:
operation_mode: "Off"
- alias: "If the window is closed for 5 minutes turn on the radiator again"
@ -96,7 +99,8 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
minutes: 5
action:
service: climate.set_operation_mode
entity_id: climate.livingroom
target:
entity_id: climate.livingroom
data:
operation_mode: "Smart schedule"
- alias: "Notify if door is opened when away"
@ -170,7 +174,8 @@ As indicated in the table on top of this page there are 3 versions of the button
click_type: single
action:
service: switch.toggle
entity_id: switch.wall_switch_left_158d000xxxxx01
target:
entity_id: switch.wall_switch_left_158d000xxxxx01
- alias: "Toggle couch light on double click"
trigger:
platform: event
@ -180,7 +185,8 @@ As indicated in the table on top of this page there are 3 versions of the button
click_type: double
action:
service: switch.toggle
entity_id: switch.wall_switch_right_158d000xxxxx01
target:
entity_id: switch.wall_switch_right_158d000xxxxx01
- alias: "Let a dog bark on long press"
trigger:
platform: event
@ -210,7 +216,8 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
action_type: flip90
action:
- service: light.turn_on
entity_id: light.gateway_light_28xxxxxxxxxx
target:
entity_id: light.gateway_light_28xxxxxxxxxx
data:
color_name: "springgreen"
- alias: "Cube event flip180"
@ -222,7 +229,8 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
action_type: flip180
action:
- service: light.turn_on
entity_id: light.gateway_light_28xxxxxxxxxx
target:
entity_id: light.gateway_light_28xxxxxxxxxx
data:
color_name: "darkviolet"
- alias: "Cube event move"
@ -234,7 +242,8 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
action_type: move
action:
- service: light.turn_on
entity_id: light.gateway_light_28xxxxxxxxxx
target:
entity_id: light.gateway_light_28xxxxxxxxxx
data:
color_name: "gold"
- alias: "Cube event tap_twice"
@ -246,7 +255,8 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
action_type: tap_twice
action:
- service: light.turn_on
entity_id: light.gateway_light_28xxxxxxxxxx
target:
entity_id: light.gateway_light_28xxxxxxxxxx
data:
color_name: "deepskyblue"
- alias: "Cube event shake_air"
@ -258,7 +268,8 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
action_type: shake_air
action:
- service: light.turn_on
entity_id: light.gateway_light_28xxxxxxxxxx
target:
entity_id: light.gateway_light_28xxxxxxxxxx
data:
color_name: "blue"
```
@ -279,7 +290,8 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac
click_type: single
action:
service: light.turn_on
entity_id: light.gateway_light_34xxxxxxxx13
target:
entity_id: light.gateway_light_34xxxxxxxx13
data:
brightness: >-
{% if state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') %}
@ -301,7 +313,8 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac
click_type: single
action:
service: light.turn_on
entity_id: light.gateway_light_34xxxxxxxx13
target:
entity_id: light.gateway_light_34xxxxxxxx13
data:
brightness: >-
{% if state_attr('light.gateway_light_34xxxxxxxx13', 'brightness') %}
@ -323,7 +336,8 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac
click_type: both
action:
service: light.turn_off
entity_id: light.gateway_light_34xxxxxxxx13
target:
entity_id: light.gateway_light_34xxxxxxxx13
```
{% endraw %}

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -176,5 +176,6 @@ automation:
- fri
action:
- 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
action:
service: switch.turn_on
entity_id: switch.Kitchen_Ambience
target:
entity_id: switch.Kitchen_Ambience
```
The channel parameter is equal to the channel of the button you are configuring the automation for. You can view the available channels in the UI you use to pair your devices.
@ -423,7 +424,8 @@ Manually set lock on KeyMatic devices:
...
action:
service: lock.lock
entity_id: lock.leq1234567
target:
entity_id: lock.leq1234567
```
Manually set unlock on KeyMatic devices:
@ -432,7 +434,8 @@ Manually set unlock on KeyMatic devices:
...
action:
service: lock.unlock
entity_id: lock.leq1234567
target:
entity_id: lock.leq1234567
```
#### Detecting lost connections

View File

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

View File

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

View File

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

View File

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

View File

@ -130,7 +130,8 @@ automation:
prec: "0"
action:
service: light.turn_off
entity_id: light.lr_track_lights_rear
target:
entity_id: light.lr_track_lights_rear
```
All `isy994_control` events will have an `entity_id` and `control` parameter in its `event_data`. You'll need to refer to ISY994 documentation for the list of every possible control type, but the common ones are:

View File

@ -93,7 +93,8 @@ automation:
key_code: 107 # inspect log to obtain desired keycode
action:
service: light.turn_on
entity_id: light.all
target:
entity_id: light.all
```
`device_descriptor` or `device_name` may be specificed in the trigger so the automation will be fired only for that keyboard. This is especially useful if you wish to use several Bluetooth remotes to control different devices. Omit them to ensure the same key triggers the automation for all keyboards/remotes.

View File

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

View File

@ -91,7 +91,8 @@ automation:
button_name: KEY_0
action:
service: homeassistant.turn_off
entity_id: group.a_lights
target:
entity_id: group.a_lights
```
The `button_name` data values (e.g., `KEY_0`) are set by you in the `.lircrc` file.

View File

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

View File

@ -175,7 +175,8 @@ automation:
state: armed_away
action:
service: alarm_control_panel.alarm_trigger
entity_id: alarm_control_panel.ha_alarm
target:
entity_id: alarm_control_panel.ha_alarm
```
Sending a notification when the alarm is triggered.
@ -205,7 +206,8 @@ automation:
# many z-wave locks use Alarm Type 19 for 'Unlocked by Keypad'
action:
- service: alarm_control_panel.alarm_disarm
entity_id: alarm_control_panel.house_alarm
target:
entity_id: alarm_control_panel.house_alarm
```
Sending a Notification when the Alarm is Armed (Away/Home), Disarmed and in Pending Status

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -332,11 +332,13 @@ trigger:
command: "/siren"
action:
- service: homeassistant.turn_on
entity_id: switch.vision_zm1601eu5_battery_operated_siren_switch_9_0
target:
entity_id: switch.vision_zm1601eu5_battery_operated_siren_switch_9_0
- delay:
seconds: 10
- service: homeassistant.turn_off
entity_id: switch.vision_zm1601eu5_battery_operated_siren_switch_9_0
target:
entity_id: switch.vision_zm1601eu5_battery_operated_siren_switch_9_0
```
An example to show the use of event_data in action:

View File

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

View File

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

View File

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

View File

@ -55,7 +55,8 @@ automation:
before: sunset
action:
service: scene.turn_on
entity_id: scene.OnDisarmedDaytime
target:
entity_id: scene.OnDisarmedDaytime
- alias: "Alarm: Armed Away"
trigger:
platform: state
@ -63,7 +64,8 @@ automation:
to: "armed_away"
action:
service: scene.turn_on
entity_id: scene.OnArmedAway
target:
entity_id: scene.OnArmedAway
```
If you have issues running this component, you may require `libxml2-dev` and `libxmlsec1-dev` packages. To install these on Raspbian, run the command `apt install libxml2-dev libxmlsec1-dev` with sudo.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -221,7 +221,8 @@ Experiencing issues introduced by this release? Please report them in our [issue
entity_id: all
action:
service: light.turn_off
entity_id: all
target:
entity_id: all
```
- __Group__ *Deprecated* - Group configurations options, services and service options related to the old states UI are now deprecated and pending for removal in Home Assistant 0.107.0.

View File

@ -46,7 +46,8 @@ automation:
action: close_garage
action:
service: cover.close_cover
entity_id: cover.garage_door
target:
entity_id: cover.garage_door
```
After adding these automations, whenever your garage door remains open for 30 minutes, your device will get a notification that looks like this:

View File

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

View File

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

View File

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

View File

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