The automation state trigger has deprecated its state alias (#2758)

The "state" used to be an alias for "to" but this was deprecated to make the
meaning more clear.

This commit updates the examples to no longer use the deprecated name.
This commit is contained in:
Anders Melchiorsen 2017-06-04 18:45:40 +02:00 committed by Fabian Affolter
parent 8c13dcfe99
commit 476449131c
10 changed files with 23 additions and 25 deletions

View File

@ -43,16 +43,16 @@ automation:
trigger: trigger:
- platform: state - platform: state
entity_id: sensor.pir1 entity_id: sensor.pir1
state: 'active' to: 'active'
- platform: state - platform: state
entity_id: sensor.pir2 entity_id: sensor.pir2
state: 'active' to: 'active'
- platform: state - platform: state
entity_id: sensor.door entity_id: sensor.door
state: 'open' to: 'open'
- platform: state - platform: state
entity_id: sensor.window entity_id: sensor.window
state: 'open' to: 'open'
condition: condition:
- condition: state - condition: state
entity_id: alarm_control_panel.ha_alarm entity_id: alarm_control_panel.ha_alarm

View File

@ -26,7 +26,7 @@ automation:
trigger: trigger:
- platform: state - platform: state
entity_id: group.all_devices entity_id: group.all_devices
state: 'not_home' to: 'not_home'
condition: condition:
- platform: state - platform: state
entity_id: sun.sun entity_id: sun.sun
@ -37,11 +37,11 @@ automation:
- alias: 'ManyThing Recording OFF' - alias: 'ManyThing Recording OFF'
# This calls an IFTTT recipe to turn off recording of the ManyThing Camera # This calls an IFTTT recipe to turn off recording of the ManyThing Camera
# when we are home unless it's nighttime. # when we get home unless it's nighttime.
trigger: trigger:
- platform: state - platform: state
entity_id: group.all_devices entity_id: group.all_devices
state: 'home' to: 'home'
condition: condition:
- condition: state - condition: state
entity_id: sun.sun entity_id: sun.sun

View File

@ -53,10 +53,8 @@ alias: "Bathroom Motion Detected"
trigger: trigger:
platform: state platform: state
entity_id: binary_sensor.motion_sensor_166d0001171111 entity_id: binary_sensor.motion_sensor_166d0001171111
from: 'off' from: 'off'
to: 'on' to: 'on'
state: 'on'
action: action:
service: media_player.turn_on service: media_player.turn_on
data: data:

View File

@ -59,7 +59,7 @@ automation:
trigger: trigger:
platform: state platform: state
entity_id: binary_sensor.front_door_motion entity_id: binary_sensor.front_door_motion
state: 'on' to: 'on'
action: action:
service: notify.livingroom_tv service: notify.livingroom_tv
data: data:

View File

@ -45,7 +45,7 @@ Some example automations:
trigger: trigger:
platform: state platform: state
entity_id: sensor.modem_callerid entity_id: sensor.modem_callerid
state: "callerid" to: "callerid"
action: action:
service: notify.notify service: notify.notify
data: data:
@ -54,7 +54,7 @@ Some example automations:
trigger: trigger:
platform: state platform: state
entity_id: sensor.modem_callerid entity_id: sensor.modem_callerid
state: "callerid" to: "callerid"
action: action:
service: persistent_notification.create service: persistent_notification.create
data: data:
@ -64,7 +64,7 @@ Some example automations:
trigger: trigger:
platform: state platform: state
entity_id: sensor.modem_callerid entity_id: sensor.modem_callerid
state: "callerid" to: "callerid"
action: action:
service: tts.google_say service: tts.google_say
data_template: data_template:

View File

@ -23,7 +23,7 @@ automation:
trigger: trigger:
platform: state platform: state
entity_id: binary_sensor.PIR1 entity_id: binary_sensor.PIR1
state: 'on' to: 'on'
condition: condition:
- condition: state - condition: state
entity_id: switch.AlmAct1 entity_id: switch.AlmAct1
@ -41,7 +41,7 @@ automation:
trigger: trigger:
platform: state platform: state
entity_id: switch.AlmSnd1 entity_id: switch.AlmSnd1
state: 'on' to: 'on'
action: action:
service: script.turn_on service: script.turn_on
entity_id: script.flash_room1 entity_id: script.flash_room1
@ -50,11 +50,11 @@ automation:
trigger: trigger:
platform: state platform: state
entity_id: switch.REL1 entity_id: switch.REL1
state: 'off' to: 'off'
condition: condition:
condition: state condition: state
entity_id: switch.AlmSnd1 entity_id: switch.AlmSnd1
state: 'off' to: 'off'
action: action:
service: script.turn_off service: script.turn_off
entity_id: script.flash_room1 entity_id: script.flash_room1

View File

@ -20,7 +20,7 @@ automation:
trigger: trigger:
- platform: state - platform: state
entity_id: sensor.precip_intensity entity_id: sensor.precip_intensity
state: 'rain' to: 'rain'
condition: condition:
- platform: state - platform: state
entity_id: group.all_devices entity_id: group.all_devices
@ -40,7 +40,7 @@ And then of course turn off the lamp when it stops raining but only if it's with
trigger: trigger:
- platform: state - platform: state
entity_id: sensor.precip_intensity entity_id: sensor.precip_intensity
state: 'None' to: 'None'
condition: condition:
- condition: sun - condition: sun
after: 'sunset' after: 'sunset'

View File

@ -80,7 +80,7 @@ automation:
trigger: trigger:
- platform: state - platform: state
entity_id: switch.KillHass entity_id: switch.KillHass
state: 'on' to: 'on'
action: action:
service: homeassistant.stop service: homeassistant.stop
- alias: 'Stop restarting HA is WeMo is found' - alias: 'Stop restarting HA is WeMo is found'

View File

@ -20,7 +20,7 @@ automation:
trigger: trigger:
platform: state platform: state
entity_id: sensor.motion_sensor entity_id: sensor.motion_sensor
state: 'on' to: 'on'
action: action:
service: homeassistant.turn_on service: homeassistant.turn_on
entity_id: light.kitchen entity_id: light.kitchen
@ -29,7 +29,7 @@ automation:
trigger: trigger:
platform: state platform: state
entity_id: sensor.motion_sensor entity_id: sensor.motion_sensor
state: 'off' to: 'off'
for: for:
minutes: 10 minutes: 10
action: action:

View File

@ -26,7 +26,7 @@ automation:
offset: '-01:00:00' offset: '-01:00:00'
- platform: state - platform: state
entity_id: group.all_devices entity_id: group.all_devices
state: 'home' to: 'home'
condition: condition:
# Prefix the first line of each condition configuration # Prefix the first line of each condition configuration
# with a '-'' to enter multiple # with a '-'' to enter multiple
@ -45,7 +45,7 @@ automation:
trigger: trigger:
platform: state platform: state
entity_id: group.all_devices entity_id: group.all_devices
state: 'not_home' to: 'not_home'
action: action:
service: light.turn_off service: light.turn_off
entity_id: group.all_lights entity_id: group.all_lights