Update some service calls to use target (#16592)

This commit is contained in:
Franck Nijhof 2021-02-20 00:14:14 +01:00 committed by GitHub
parent c8bddfce04
commit 616103c28c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
65 changed files with 313 additions and 194 deletions

View File

@ -109,7 +109,7 @@ automation:
to: "None"
action:
service: media_player.turn_off
data:
target:
entity_id: >
{% if is_state("input_select.radio_player", "Mansarda") %}
media_player.bed_2
@ -133,7 +133,7 @@ automation:
entity_id: input_select.radio_station
action:
- service: media_player.play_media
data:
target:
entity_id: >
{% if is_state("input_select.radio_player", "Mansarda") %}
media_player.bed_2
@ -150,6 +150,7 @@ automation:
{% else %}
none
{% endif %}
data:
media_content_id: >
{% if is_state("input_select.radio_station", "Z88.3") %}
http://ice.zradio.org/z/high.mp3

View File

@ -95,13 +95,14 @@ Templates can also be used for the data that you pass to the service call.
```yaml
service: thermostat.set_temperature
data:
target:
entity_id: >
{% if is_state('device_tracker.paulus', 'home') %}
thermostat.upstairs
{% else %}
thermostat.downstairs
{% endif %}
data:
temperature: {{ 22 - distance(states.device_tracker.paulus) }}
```

View File

@ -42,8 +42,9 @@ automation:
at: "07:15:00"
action:
- service: fan.set_speed
data:
target:
entity_id: fan.kitchen
data:
speed: low
```
@ -65,8 +66,9 @@ automation:
at: "07:15:00"
action:
- service: fan.set_direction
data:
target:
entity_id: fan.kitchen
data:
direction: forward
```
@ -88,8 +90,9 @@ automation:
at: "07:15:00"
action:
- service: fan.oscillate
data:
target:
entity_id: fan.kitchen
data:
oscillating: True
```

View File

@ -85,8 +85,9 @@ automation:
to: "on"
action:
- service: light.turn_on
data:
target:
entity_id: light.hyperion
data:
effect: "Full color mood blobs"
```
@ -106,8 +107,9 @@ To have the lights playing an effect when pausing, idle or turn off a media play
to: "idle"
action:
- service: light.turn_on
data:
target:
entity_id: light.hyperion
data:
effect: "Full color mood blobs"
```
@ -121,7 +123,8 @@ To capture the screen when playing something on a media_player you can use this
to: "playing"
action:
- service: light.turn_on
data:
target:
entity_id: light.hyperion
data:
effect: V4L
```

View File

@ -44,7 +44,7 @@ automation:
platform: event
condition: []
action:
- data:
- target:
entity_id: '{{ trigger.event.data.entity_id }}'
service: '{{ trigger.event.data.service }}'
```

View File

@ -131,8 +131,9 @@ automation:
entity_id: input_number.bedroom_brightness
action:
- service: light.turn_on
data:
target:
entity_id: light.bedroom
data:
brightness: "{{ trigger.to_state.state | int }}"
```
@ -170,8 +171,9 @@ automation:
to: CUSTOM
action:
- service: light.turn_on
data:
target:
entity_id: light.bedroom
data:
brightness: "{{ states('input_number.bedroom_brightness') | int }}"
```
@ -201,8 +203,9 @@ automation:
topic: "setTemperature"
action:
service: input_number.set_value
data:
target:
entity_id: input_number.target_temp
data:
value: "{{ trigger.payload }}"
# This second automation script runs when the target temperature slider is moved.

View File

@ -141,8 +141,9 @@ automation:
event_type: MY_CUSTOM_EVENT
action:
- service: input_select.select_option
data:
target:
entity_id: input_select.who_cooks
data:
option: Paulus
```
@ -157,8 +158,9 @@ automation:
event_type: MY_CUSTOM_EVENT
action:
- service: input_select.set_options
data:
target:
entity_id: input_select.who_cooks
data:
options: ["Item A", "Item B", "Item C"]
```
@ -189,9 +191,10 @@ input_select:
topic: "thermostatMode"
# entity_id: input_select.thermostat_mode
action:
service: input_select.select_option
data:
service: input_select.select_option
target:
entity_id: input_select.thermostat_mode
data:
option: "{{ trigger.payload }}"
# This automation script runs when the thermostat mode selector is changed.

View File

@ -133,8 +133,9 @@ automation:
entity_id: input_select.scene_bedroom
action:
- service: input_text.set_value
data:
target:
entity_id: input_text.bedroom
data:
value: "{{ states('input_select.scene_bedroom') }}"
```

View File

@ -116,8 +116,9 @@ automation:
event_type: keyboard_remote_connected
action:
- service: media_player.play_media
data:
target:
entity_id: media_player.speaker
data:
media_content_id: keyboard_connected.wav
media_content_type: music
@ -129,8 +130,9 @@ automation:
device_name: "00:58:56:4C:C0:91"
action:
- service: media_player.play_media
data:
target:
entity_id: media_player.speaker
data:
media_content_id: keyboard_disconnected.wav
media_content_type: music
```

View File

@ -128,8 +128,9 @@ script:
kodi_quit:
sequence:
- service: kodi.call_method
data:
target:
entity_id: media_player.kodi
data:
method: Application.Quit
```
@ -140,8 +141,9 @@ script:
kodi_hibernate:
sequence:
- service: kodi.call_method
data:
target:
entity_id: media_player.kodi
data:
method: System.Hibernate
```
@ -152,8 +154,9 @@ script:
kodi_suspend:
sequence:
- service: kodi.call_method
data:
target:
entity_id: media_player.kodi
data:
method: System.Suspend
```
@ -164,8 +167,9 @@ script:
kodi_reboot:
sequence:
- service: kodi.call_method
data:
target:
entity_id: media_player.kodi
data:
method: System.Reboot
```
@ -176,8 +180,9 @@ script:
kodi_shutdown:
sequence:
- service: kodi.call_method
data:
target:
entity_id: media_player.kodi
data:
method: System.Shutdown
```
@ -190,8 +195,9 @@ script:
turn_on_kodi_with_cec:
sequence:
- service: kodi.call_method
data:
target:
entity_id: media_player.kodi
data:
method: Addons.ExecuteAddon
addonid: script.json-cec
params:
@ -200,11 +206,12 @@ script:
turn_off_kodi_with_cec:
sequence:
- service: media_player.media_stop
data:
target:
entity_id: media_player.kodi
- service: kodi.call_method
data:
target:
entity_id: media_player.kodi
data:
method: Addons.ExecuteAddon
addonid: script.json-cec
params:
@ -230,12 +237,13 @@ script:
sequence:
- alias: "TV on"
service: media_player.turn_on
data:
target:
entity_id: media_player.kodi
- alias: "Play TV channel"
service: media_player.play_media
data:
target:
entity_id: media_player.kodi
data:
media_content_type: "CHANNEL"
media_content_id: >
{% if (now().hour < 14) or ((now().hour == 14) and (now().minute < 50)) %}
@ -266,11 +274,12 @@ script:
sequence:
- alias: "TV on"
service: media_player.turn_on
data:
target:
entity_id: media_player.kodi
- service: media_player.play_media
data:
target:
entity_id: media_player.kodi
data:
media_content_type: DIRECTORY
media_content_id: special://profile/playlists/video/feuerwehrmann_sam.xsp
```
@ -286,8 +295,9 @@ script:
sequence:
- alias: "Call Kodi update"
service: kodi.call_method
data:
target:
entity_id: media_player.kodi
data:
method: VideoLibrary.Scan
```

View File

@ -58,6 +58,6 @@ media_player:
host: 192.168.0.20
turn_on_action:
service: switch.turn_on
data:
target:
entity_id: switch.tv_switch
```

View File

@ -47,8 +47,9 @@ automation:
# ...
action:
- service: light.turn_on
data:
target:
entity_id: light.office, light.kitchen
data:
effect: lifx_effect_pulse
```
@ -59,8 +60,9 @@ script:
alias: "Start colorloop"
sequence:
- service: lifx.effect_colorloop
data:
target:
entity_id: group.livingroom
data:
brightness: 255
period: 10
spread: 30

View File

@ -53,7 +53,8 @@ script:
alias: "Kitchen lights on"
sequence:
service: light.turn_on
data:
target:
entity_id: light.kitchen_lights
data:
brightness: 100
```

View File

@ -59,8 +59,9 @@ automation:
to: "on"
action:
- service: light.turn_on
data:
target:
entity_id: light.living_room
data:
brightness: 255
kelvin: 2700
```
@ -73,8 +74,9 @@ automation:
platform: time
action:
- service: light.turn_on
data:
target:
entity_id: light.ledliststair
data:
brightness: 130
rgb_color: [255,0,0]
```

View File

@ -178,18 +178,21 @@ light:
{% endif %}
turn_on:
service: media_player.volume_mute
data:
target:
entity_id: media_player.receiver
data:
is_volume_muted: false
turn_off:
service: media_player.volume_mute
data:
target:
entity_id: media_player.receiver
data:
is_volume_muted: true
set_level:
service: media_player.volume_set
data:
target:
entity_id: media_player.receiver
data:
volume_level: "{{ (brightness / 255 * 100)|int / 100 }}"
level_template: >-
{% if is_state('media_player.receiver', 'on') %}
@ -235,13 +238,15 @@ light:
{% endif %}
turn_on:
service: media_player.volume_mute
data:
target:
entity_id: media_player.receiver
data:
is_volume_muted: false
turn_off:
service: media_player.volume_mute
data:
target:
entity_id: media_player.receiver
data:
is_volume_muted: true
```
@ -281,13 +286,15 @@ light:
{% endif %}
turn_on:
service: media_player.volume_mute
data:
target:
entity_id: media_player.receiver
data:
is_volume_muted: false
turn_off:
service: media_player.volume_mute
data:
target:
entity_id: media_player.receiver
data:
is_volume_muted: true
```

View File

@ -111,8 +111,11 @@ automation:
# ...
action:
- service: light.turn_on
target:
entity_id:
- light.office
- light.kitchen
data:
entity_id: light.office, light.kitchen
effect: night
```

View File

@ -31,7 +31,7 @@ Lock your door, the attribute should appear under a 'data' attribute for the ser
```yaml
action:
service: lock.lock
data:
target:
entity_id: lock.my_place
```
@ -48,7 +48,7 @@ Unlock your door, the attribute should appear under a 'data' attribute for the s
```yaml
action:
service: lock.unlock
data:
target:
entity_id: lock.my_place
```

View File

@ -31,11 +31,11 @@ lock:
value_template: "{{ is_state('sensor.door', 'on') }}"
lock:
service: switch.turn_on
data:
target:
entity_id: switch.door
unlock:
service: switch.turn_off
data:
target:
entity_id: switch.door
```
@ -96,11 +96,11 @@ lock:
value_template: "{{ is_state('switch.source', 'on') }}"
lock:
service: switch.turn_on
data:
target:
entity_id: switch.source
unlock:
service: switch.turn_off
data:
target:
entity_id: switch.source
```
@ -120,11 +120,11 @@ lock:
optimistic: true
lock:
service: switch.turn_on
data:
target:
entity_id: switch.source
unlock:
service: switch.turn_off
data:
target:
entity_id: switch.source
```
@ -143,11 +143,11 @@ lock:
value_template: "{{ is_state('sensor.skylight.state', 'on') }}"
lock:
service: switch.turn_on
data:
target:
entity_id: switch.skylight_open
unlock:
service: switch.turn_on
data:
target:
entity_id: switch.skylight_close
```

View File

@ -65,8 +65,9 @@ Default `media_dir`is `local`.
Example:
```yaml
service: media_player.play_media
data:
target:
entity_id: media_player.living_room_tv
data:
media_content_type: video/mp4
media_content_id: media-source://media_source/local/videos/favourites/Epic Sax Guy 10 Hours.mp4
```

View File

@ -63,8 +63,9 @@ The `play_media` function can be used in scripts to change channels:
change_channel:
sequence:
service: media_player.play_media
data:
target:
entity_id: media_player.mediaroom_stb
data:
media_content_id: "{{ channel_number }}"
media_content_type: "channel"
```
@ -81,8 +82,9 @@ The `play_media` function can also be used to trigger actions on the set-up-box
press_button:
sequence:
service: media_player.play_media
data:
target:
entity_id: media_player.mediaroom_stb
data:
media_content_id: "{{ action }}"
media_content_type: "mediaroom"
```

View File

@ -50,14 +50,16 @@ Example script to load a saved playlist called "DeckMusic" and set the volume:
relaxdeck:
sequence:
- service: media_player.play_media
data:
target:
entity_id: media_player.main
data:
media_content_type: playlist
media_content_id: DeckMusic
- service: media_player.volume_set
data:
target:
entity_id: media_player.main
data:
volume_level: 0.60
```

View File

@ -34,14 +34,15 @@ The state is the last reading from Nightscout, and you can see other information
alias: "overnight_low_kitchen_lights"
description: Turn on the lights in the kitchen if my blood sugar drops low overnight
trigger:
- below: "65"
- platform: numeric_state
entity_id: sensor.blood_glucose
platform: numeric_state
condition: time
after: "22:00:00"
before: "06:00:00"
below: "65"
condition:
- condition: time
after: "22:00:00"
before: "06:00:00"
action:
- service: light.turn_on
data:
- service: light.turn_on
target:
entity_id: light.kitchen
```

View File

@ -123,11 +123,12 @@ script:
alias: "Radio 1"
sequence:
- service: media_player.turn_on
data:
target:
entity_id: media_player.onkyo
- service: media_player.play_media
data:
target:
entity_id: media_player.onkyo
data:
media_content_type: "radio"
media_content_id: "1"
```

View File

@ -25,9 +25,9 @@ media_player:
```yaml
action:
- service: media_player.play_media
target:
entity_id: media_player.linn_bedroom
data:
entity_id:
- media_player.linn_bedroom
media_content_id: "http://172.24.32.13/Doorbell.mp3"
media_content_type: music
```
@ -36,9 +36,9 @@ action:
```yaml
- service: media_player.play_media
target:
entity_id: media_player.linn_bedroom
data:
entity_id:
- media_player.linn_bedroom
media_content_id: "http://media-ice.musicradio.com:80/ClassicFMMP3"
media_content_type: music
```

View File

@ -74,17 +74,18 @@ script:
alias: "Show who's at the door"
sequence:
- service: media_player.turn_on
data:
target:
entity_id: media_player.living_room_tv
- service: media_player.play_media
data:
target:
entity_id: media_player.living_room_tv
data:
media_content_type: "url"
media_content_id: YOUR_URL
- delay:
seconds: 5
- service: media_player.media_stop
data:
target:
entity_id: media_player.living_room_tv
```

View File

@ -250,8 +250,9 @@ play_plex_on_tv:
timeout: "00:00:10"
continue_on_timeout: false
- service: media_player.play_media
data:
target:
entity_id: media_player.plex_smart_tv
data:
media_content_id: "{"library_name": "Movies", "title": "Zoolander"}"
media_content_type: movie
```

View File

@ -70,7 +70,7 @@ script:
force_adam_update:
sequence:
- service: homeassistant.update_entity
data:
target:
entity_id: climate.anna
```
@ -89,8 +89,9 @@ script:
lisa_reactive_last_schedule:
sequence:
- service: climate.set_hvac_mode
data:
target:
entity_id: climate.lisa_bios
data:
hvac_mode: auto
```
@ -113,8 +114,9 @@ script:
anna_set_predefined_temperature:
sequence:
- service: climate.set_temperature
data:
target:
entity_id: climate.anna
data:
temperature: 19.5
```

View File

@ -67,9 +67,10 @@ if entity_id is not None:
The above `python_script` can be called using the following YAML as an input.
```yaml
service: python_script.turn_on_light
data:
- service: python_script.turn_on_light
target:
entity_id: light.bedroom
data:
rgb_color: [255, 0, 0]
```

View File

@ -88,11 +88,12 @@ script:
run_grass_zones:
sequence:
- service: rachio.start_multiple_zone_schedule
data:
target:
entity_id:
- switch.front_yard_west
- switch.front_yard_east
- switch.side_yard_west
data:
duration: 20, 15, 10
```
@ -102,11 +103,12 @@ script:
run_grass_zones:
sequence:
- service: rachio.start_multiple_zone_schedule
data:
target:
entity_id:
- switch.front_yard_west
- switch.front_yard_east
- switch.side_yard_west
data:
duration: 20
```
### Service `rachio.set_zone_moisture_percent`

View File

@ -453,22 +453,22 @@ switch:
data:
led: 6
- service: homeassistant.update_entity
data:
target:
entity_id: sensor.steam_system_data
- delay: 00:00:15
- service: homeassistant.update_entity
data:
target:
entity_id: sensor.steam_system_data
turn_off:
- service: rest_command.set_steam_led
data:
led: 7
- service: homeassistant.update_entity
data:
target:
entity_id: sensor.steam_system_data
- delay: 00:00:15
- service: homeassistant.update_entity
data:
target:
entity_id: sensor.steam_system_data
friendly_name: Steam

View File

@ -67,8 +67,9 @@ A typical service call for pressing several buttons looks like this.
```yaml
service: remote.send_command
data:
target:
entity_id: remote.roku
data:
command:
- left
- left
@ -80,8 +81,9 @@ data:
When the Home Assistant Roku integration is enabled and a Roku device has been configured, in the Home Assistant UI the Roku media player will show a listing of the installed channels, or apps, under “source”. Select one and it will attempt to launch the channel on your Roku device. This action can also be automated. Channels can be launched by `name` using a configuration similar to the one below:
```yaml
action:
- data:
entity_id: media_player.roku
- target:
entity_id: media_player.
data:
source: "Prime Video"
service: media_player.select_source
```
@ -106,21 +108,23 @@ To use this information in Home Assistant, the format is as follows. Note that `
```yaml
action:
- data:
entity_id: media_player.roku
source: 20197
service: media_player.select_source
- service: media_player.select_source
target:
entity_id: media_player.roku
data:
source: 20197
```
It is also possible to tune directly to specific channels if you have a Roku TV and use an OTA antenna. This service only supports `media_channel_type` of 'channel'. `media_content_id` corresponds to the TV channel, which you should see when navigating to these on your TV UI.
```yaml
action:
- data:
entity_id: media_player.roku
media_content_id: 5.1
media_content_type: channel
service: media_player.play_media
- service: media_player.play_media
target:
entity_id: media_player.roku
data:
media_content_id: 5.1
media_content_type: channel
```
## Remote

View File

@ -173,6 +173,6 @@ For example:
to: "on"
action:
service: input_boolean.turn_on
data:
target:
entity_id: input_boolean.movement_detected
```

View File

@ -116,8 +116,9 @@ automation:
to: "home"
action:
service: scene.turn_on
data:
target:
entity_id: scene.romantic
data:
transition: 2.5
```
@ -176,11 +177,12 @@ The following example turns off some entities as soon as a window opens. The sta
- climate.ecobee
- light.ceiling_lights
- service: light.turn_off
data:
target:
entity_id: light.ceiling_lights
- service: climate.set_hvac_mode
data:
target:
entity_id: climate.ecobee
data:
hvac_mode: "off"
- alias: "Window closed"
trigger:
@ -191,6 +193,6 @@ The following example turns off some entities as soon as a window opens. The sta
condition: []
action:
- service: scene.turn_on
data:
target:
entity_id: scene.before
```

View File

@ -139,15 +139,16 @@ script: 
domain: light
- alias: "Bedroom lights on"
service: light.turn_on
data:
target:
entity_id: group.bedroom
data:
brightness: 100
- delay:
# supports seconds, milliseconds, minutes, hours
minutes: "{{ minutes }}"
- alias: "Living room lights on"
service: light.turn_on
data:
target:
entity_id: "{{ turn_on_entity }}"
```

View File

@ -66,13 +66,14 @@ switch:
value_template: "{{ is_state('climate.ac', 'cool') or is_state('climate.ac', 'heat') or is_state('climate.ac', 'dry') or is_state('climate.ac', 'fan_only') }}"
turn_on:
service: climate.set_hvac_mode
data:
target:
entity_id: climate.ac
hvac_mode: cool
turn_off:
service: climate.set_hvac_mode
data:
target:
entity_id: climate.ac
data:
hvac_mode: off
```

View File

@ -153,8 +153,9 @@ intent_script:
ActivateLightColor:
action:
- service: light.turn_on
data:
target:
entity_id: 'light.{{ objectLocation | replace(" ","_") }}'
data:
color_name: "{{ objectColor }}"
```
@ -236,7 +237,7 @@ intent_script:
text: "OK, opening the garage door"
action:
- service: cover.open_cover
data:
target:
entity_id: garage_door
```

View File

@ -164,9 +164,10 @@ condition:
{{ trigger.from_state.attributes.queue_position < trigger.to_state.attributes.queue_position }}
action:
- service: sonos.remove_from_queue
data:
target:
entity_id: >
{{ trigger.entity_id }}
data:
queue_position: >
{{ trigger.from_state.attributes.queue_position }}
```

View File

@ -60,8 +60,9 @@ You can switch between one of your 6 pre-configured presets using ```media_playe
```yaml
# Play media preset
- service: media_player.play_media
data:
target:
entity_id: media_player.soundtouch_living_room
data:
media_content_id: 1..6
media_content_type: PLAYLIST
```
@ -71,8 +72,9 @@ You can also play HTTP (not HTTPS) URLs:
```yaml
# Play media URL
- service: media_player.play_media
data:
target:
entity_id: media_player.soundtouch_living_room
data:
media_content_id: http://example.com/music.mp3
media_content_type: MUSIC
```

View File

@ -96,8 +96,9 @@ script:
play_jazz_guitar:
sequence:
- service: media_player.play_media
data:
target:
entity_id: media_player.spotify
data:
media_content_id: "https://open.spotify.com/playlist/5xddIVAtLrZKtt4YGLM1SQ?si=YcvRqaKNTxOi043Qn4LYkg"
media_content_type: playlist
```

View File

@ -30,8 +30,9 @@ transporter_toslink:
target:
entity_id: media_player.transporter
- service: media_player.play_media
data:
target:
entity_id: media_player.transporter
data:
media_content_id: "source:toslink"
media_content_type: "music"
```

View File

@ -47,8 +47,9 @@ For example, the following action in an automation would take a recording from `
```yaml
action:
service: camera.record
data:
target:
entity_id: camera.quintal
data:
filename: "/config/www/my_stream.mp4"
duration: 30
```

View File

@ -30,11 +30,11 @@ switch:
value_template: "{{ is_state('sensor.skylight', 'on') }}"
turn_on:
service: switch.turn_on
data:
target:
entity_id: switch.skylight_open
turn_off:
service: switch.turn_off
data:
target:
entity_id: switch.skylight_close
```
@ -104,11 +104,11 @@ switch:
value_template: "{{ is_state('switch.source', 'on') }}"
turn_on:
service: switch.turn_on
data:
target:
entity_id: switch.target
turn_off:
service: switch.turn_off
data:
target:
entity_id: switch.target
```
@ -129,11 +129,11 @@ switch:
value_template: "{{ is_state_attr('switch.blind_toggle', 'sensor_state', 'on') }}"
turn_on:
service: switch.toggle
data:
target:
entity_id: switch.blind_toggle
turn_off:
service: switch.toggle
data:
target:
entity_id: switch.blind_toggle
```
@ -155,11 +155,11 @@ switch:
value_template: "{{ is_state('sensor.skylight', 'on') }}"
turn_on:
service: switch.turn_on
data:
target:
entity_id: switch.skylight_open
turn_off:
service: switch.turn_on
data:
target:
entity_id: switch.skylight_close
```
@ -179,11 +179,11 @@ switch:
value_template: "{{ is_state('cover.garage_door', 'on') }}"
turn_on:
service: cover.open_cover
data:
target:
entity_id: cover.garage_door
turn_off:
service: cover.close_cover
data:
target:
entity_id: cover.garage_door
icon_template: >-
{% if is_state('cover.garage_door', 'open') %}
@ -209,11 +209,11 @@ switch:
value_template: "{{ is_state('cover.garage_door', 'on') }}"
turn_on:
service: cover.open_cover
data:
target:
entity_id: cover.garage_door
turn_off:
service: cover.close_cover
data:
target:
entity_id: cover.garage_door
entity_picture_template: >-
{% if is_state('cover.garage_door', 'open') %}

View File

@ -152,13 +152,15 @@ script:
boost_heating:
sequence:
- service: tado.set_climate_timer
data:
target:
entity_id: climate.heating
data:
time_period: "01:30:00"
temperature: 25
- service: tado.set_water_heater_timer
data:
target:
entity_id: water_heater.hot_water
data:
time_period: "01:30:00"
```
@ -184,8 +186,9 @@ automation:
# Work out what the new offset should be (tado temp less the room temp but add the current offset value) and turn that to a negative value for setting as the new offset
action:
- service: tado.set_climate_temperature_offset
data:
target:
entity_id: climate.tado
data:
offset: >
{% set tado_temp = states('sensor.tado_temperature')|float %}
{% set room_temp = states('sensor.temp_sensor_room')|float %}

View File

@ -81,8 +81,9 @@ automation:
media_content_id: "{{ tags[trigger.event.data.tag_id].media_content_id }}"
media_content_type: "{{ tags[trigger.event.data.tag_id].media_content_type }}"
- service: media_player.play_media
data:
target:
entity_id: "{{ media_player_entity_id }}"
data:
media_content_id: "{{ media_content_id }}"
media_content_type: "{{ media_content_type }}"
- delay: 2 # timeout before we allow processing next scan

View File

@ -97,33 +97,35 @@ media_player:
commands:
turn_on:
service: switch.turn_on
data:
target:
entity_id: switch.living_room_tv
turn_off:
service: switch.turn_off
data:
target:
entity_id: switch.living_room_tv
volume_up:
service: switch.turn_on
data:
target:
entity_id: switch.living_room_volume_up
volume_down:
service: switch.turn_on
data:
target:
entity_id: switch.living_room_volume_down
volume_mute:
service: switch.turn_on
data:
target:
entity_id: switch.living_room_mute
select_source:
service: media_player.select_source
data:
target:
entity_id: media_player.receiver
data:
source: "{{ source }}"
volume_set:
service: media_player.volume_set
data:
target:
entity_id: media_player.receiver
data:
volume_level: "{{ volume_level }}"
attributes:
@ -171,11 +173,11 @@ media_player:
commands:
turn_on:
service: media_player.turn_on
data:
target:
entity_id: media_player.kodi
turn_off:
service: media_player.turn_off
data:
target:
entity_id: media_player.kodi
attributes:
is_volume_muted: media_player.kodi|is_volume_muted
@ -186,25 +188,27 @@ media_player:
host: 192.168.1.10
turn_on_action:
- service: input_boolean.turn_on
data:
target:
entity_id: input_boolean.kodi_tv_state
- service: media_player.kodi_call_method
data:
target:
entity_id: media_player.kodi
data:
method: Addons.ExecuteAddon
addonid: script.json-cec
params:
command: activate
turn_off_action:
- service: input_boolean.turn_off
data:
target:
entity_id: input_boolean.kodi_tv_state
- service: media_player.media_stop
data:
target:
entity_id: media_player.kodi
- service: media_player.kodi_call_method
data:
target:
entity_id: media_player.kodi
data:
method: Addons.ExecuteAddon
addonid: script.json-cec
params:
@ -276,8 +280,9 @@ media_player:
command: VolumeDown
select_source:
service: remote.turn_on
data:
target:
entity_id: remote.alexander_down_guest
data:
activity: "{{ source }}"
```

View File

@ -218,8 +218,9 @@ kitchen_fade_on:
description: "Turn on kitchen light to 75% over a period of 10 seconds"
sequence:
- service: upb.light_fade_start
data:
target:
entity_id: light.kitchen
data:
brightness_pct: 75
rate: 10
```

View File

@ -526,8 +526,9 @@ Service trigger example:
entity_id: sensor.sensor
action:
service: vacuum.send_command
data:
target:
entity_id: vacuum.vacuum_entity
data:
command: "custom_command"
params:
- key: value
@ -601,8 +602,9 @@ Service trigger example:
entity_id: sensor.sensor
action:
service: vacuum.send_command
data:
target:
entity_id: vacuum.vacuum_entity
data:
command: "custom_command"
params:
- key: value

View File

@ -116,20 +116,23 @@ vacuum:
living_room_vacuum:
start:
- service: remote.send_command
data:
target:
entity_id: remote.harmony_hub
data:
command: Clean
device: 52840686
return_to_base:
- service: remote.send_command
data:
target:
entity_id: remote.harmony_hub
data:
command: Home
device: 52840686
clean_spot:
- service: remote.send_command
data:
target:
entity_id: remote.harmony_hub
data:
command: SpotCleaning
device: 52840686
```

View File

@ -85,8 +85,9 @@ automation:
platform: state
action:
- service: input_select.select_option
data:
target:
entity_id: input_select.ventilation_profile
data:
option: "{{ states('sensor.vallox_current_profile') }}"
```

View File

@ -118,8 +118,9 @@ For example, the following action in an automation would send an `hls` live stre
```yaml
action:
service: camera.play_stream
data:
target:
entity_id: camera.yourcamera
data:
media_player: media_player.chromecast
```
@ -157,8 +158,9 @@ For example, the following action is an automation that would take a snapshot fr
```yaml
action:
service: camera.snapshot
data:
target:
entity_id: camera.front_door_camera
data:
filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
```

View File

@ -47,8 +47,9 @@ automation:
at: "07:15:00"
action:
- service: water_heater.set_temperature
data:
target:
entity_id: water_heater.demo
data:
temperature: 24
operation_mode: eco
```
@ -71,8 +72,9 @@ automation:
at: "07:15:00"
action:
- service: water_heater.set_operation_mode
data:
target:
entity_id: water_heater.demo
data:
operation_mode: eco
```
@ -94,7 +96,8 @@ automation:
at: "07:15:00"
action:
- service: water_heater.set_away_mode
data:
target:
entity_id: water_heater.demo
data:
away_mode: true
```

View File

@ -85,8 +85,9 @@ Say to the `media_player.living_room` device entity:
```yaml
- service: tts.watson_tts_say
data:
target:
entity_id: media_player.living_room
data:
message: >
<speak>
Hello from Watson

View File

@ -149,15 +149,17 @@ The `play_media` service can be used in a script to switch to the specified TV c
```yaml
# Example action entry in script to switch to channel number 1
service: media_player.play_media
data:
target:
entity_id: media_player.lg_webos_smart_tv
data:
media_content_id: 1
media_content_type: "channel"
# Example action entry in script to switch to channel including 'TF1' in its name
service: media_player.play_media
data:
target:
entity_id: media_player.lg_webos_smart_tv
data:
media_content_id: "TF1"
media_content_type: "channel"
```
@ -207,15 +209,17 @@ script:
home_button:
sequence:
- service: webostv.button
data:
target:
entity_id: media_player.lg_webos_smart_tv
data:
button: "HOME"
open_google_command:
sequence:
- service: webostv.command
data:
target:
entity_id: media_player.lg_webos_smart_tv
data:
command: "system.launcher/open"
payload:
target: https://www.google.com

View File

@ -349,8 +349,9 @@ script:
set_dial_1_value:
sequence:
- service: wink.set_nimbus_dial_state
data:
target:
entity_id: wink.nimbus_dial_1
data:
value: 150
labels:
- "Dial 1"
@ -379,8 +380,9 @@ script:
set_dial_1_value:
sequence:
- service: wink.set_nimbus_dial_state
data:
target:
entity_id: wink.nimbus_dial_1
data:
rotation: "ccw"
```

View File

@ -121,8 +121,9 @@ You can automate changing the effect using a service call like this:
```yaml
service: wled.effect
data:
target:
entity_id: light.wled
data:
effect: "{{ state_attr('light.wled', 'effect_list') | random }}"
```
@ -148,8 +149,9 @@ In this case (using WLED v0.11.0) there are 54 palettes, so the following servic
```yaml
service: wled.effect
data:
target:
entity_id: light.wled
data:
palette: "{{ range(0,53) | random }}"
```

View File

@ -202,7 +202,7 @@ This example toggles the living room lamp on a double click of the button.
click_type: double
action:
service: light.toggle
data:
target:
entity_id: light.living_room_lamp
```

View File

@ -1299,8 +1299,9 @@ automation:
condition: []
action:
- service: xiaomi_miio.vacuum_clean_zone
data:
target:
entity_id: vacuum.xiaomi_vacuum
data:
repeats: "{{states('input_number.vacuum_passes')|int}}"
zone: [[30914,26007,35514,28807], [20232,22496,26032,26496]]
```
@ -1319,8 +1320,9 @@ automation:
condition: []
action:
- service: xiaomi_miio.vacuum_clean_zone
data:
target:
entity_id: vacuum.xiaomi_vacuum
data:
repeats: "{{states('input_number.vacuum_passes')|int}}"
zone:
- [30914,26007,35514,28807]
@ -1340,8 +1342,9 @@ automation:
condition: []
action:
- service: xiaomi_miio.vacuum_clean_zone
data:
target:
entity_id: vacuum.xiaomi_vacuum
data:
repeats: 1
zone:
- - 30914
@ -1385,8 +1388,9 @@ automation:
condition: []
action:
- service: xiaomi_miio.vacuum_clean_segment
data:
target:
entity_id: vacuum.xiaomi_vacuum
data:
segments: [1,2]
```
@ -1401,8 +1405,9 @@ automation:
condition: []
action:
- service: xiaomi_miio.vacuum_clean_segment
data:
target:
entity_id: vacuum.xiaomi_vacuum
data:
segments: 1
```
@ -1451,8 +1456,9 @@ vacuum_kitchen:
alias: "Clean the kitchen"
sequence:
- service: vacuum.send_command
data:
target:
entity_id: vacuum.xiaomi_vacuum_cleaner
data:
command: app_segment_clean
params: [18]
```
@ -1472,8 +1478,9 @@ reset_main_brush_left:
alias: "Reset hours for main brush replacement"
sequence:
- service: vacuum.send_Command
data:
target:
entity_id: vacuum.xiaomi_vacuum_cleaner
data:
command: reset_consumable
params: ['main_brush_work_time']
```
@ -1506,8 +1513,9 @@ vacuum_kitchen:
alias: "vacuum kitchen"
sequence:
- service: vacuum.send_command
data:
target:
entity_id: "vacuum.xiaomi_vacuum_cleaner"
data:
command: app_zoned_clean
params: [[23084,26282,27628,29727,1]]
```

View File

@ -116,15 +116,17 @@ script:
alias: "Radio Paradise Porch"
sequence:
- service: media_player.turn_on
data:
target:
entity_id: media_player.living_room_stereo_zone_2
- service: media_player.volume_set
data:
target:
entity_id: media_player.living_room_stereo_zone_2
data:
volume_level: 0.48
- service: media_player.play_media
data:
target:
entity_id: media_player.living_room_stereo_zone_2
data:
media_content_type: "NET RADIO"
media_content_id: "Bookmarks>Internet>Radio Paradise"

View File

@ -88,12 +88,14 @@ automation:
at: "20:00:00"
action:
- service: climate.set_hvac_mode
data:
target:
entity_id: climate.remotec_zxt120_heating_1_id
data:
hvac_mode: Heat
- service: climate.set_temperature
data:
target:
entity_id: climate.remotec_zxt120_heating_1_39
data:
temperature: 24
```
@ -107,8 +109,9 @@ automation:
at: "21:00:00"
action:
- service: climate.set_hvac_mode
data:
target:
entity_id: climate.remotec_zxt120_heating_1_id
data:
hvac_mode: "Off"
```

View File

@ -41,7 +41,7 @@ automation:
{% else %}
switch.turn_off
{% endif %}
data:
target:
entity_id: switch.{{ states('input_select.is') }}
```

View File

@ -105,7 +105,7 @@ script:
message: "The washing machine has finished its cycle, please empty it!"
- alias: "Living Room Lights Blue"
service: scene.turn_on
data:
target:
entity_id: scene.blue
```

View File

@ -110,7 +110,7 @@ intent_script:
content: I have turned on the lights.
action:
service: light.turn_on
data:
target:
entity_id: light.kitchen
conversation:

View File

@ -361,8 +361,9 @@ automation:
condition: []
action:
- service: xiaomi_miio.vacuum_clean_zone
data:
target:
entity_id: vacuum.xiaomi_vacuum
data:
repeats: "{{states('input_number.vacuum_passes')|int}}"
zone: [[30914,26007,35514,28807], [20232,22496,26032,26496]]
```

View File

@ -99,8 +99,9 @@ automation:
media_content_id: "{{ tags[trigger.event.data.tag_id].media_content_id }}"
media_content_type: "{{ tags[trigger.event.data.tag_id].media_content_type }}"
- service: media_player.play_media
data:
target:
entity_id: "{{ media_player_entity_id }}"
data:
media_content_id: "{{ media_content_id }}"
media_content_type: "{{ media_content_type }}"
- delay: 2 # timeout before we allow processing next scan

View File

@ -958,8 +958,9 @@ script:
learn_tv_power:
sequence:
- service: remote.learn_command
data:
target:
entity_id: remote.bedroom
data:
device: tv
command: power
```
@ -983,8 +984,9 @@ script:
send_tv_power:
sequence:
- service: remote.send_command
data:
target:
entity_id: remote.bedroom
data:
command: b64:JgAcAB0dHB44HhweGx4cHR06HB0cHhwdHB8bHhwADQUAAAAAAAAAAAAAAAA=
```
@ -995,8 +997,9 @@ script:
send_tv_power:
sequence:
- service: remote.send_command
data:
target:
entity_id: remote.bedroom
data:
device: tv
command: power
```