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:
- platform: state
entity_id: sensor.pir1
state: 'active'
to: 'active'
- platform: state
entity_id: sensor.pir2
state: 'active'
to: 'active'
- platform: state
entity_id: sensor.door
state: 'open'
to: 'open'
- platform: state
entity_id: sensor.window
state: 'open'
to: 'open'
condition:
- condition: state
entity_id: alarm_control_panel.ha_alarm

View File

@ -26,22 +26,22 @@ automation:
trigger:
- platform: state
entity_id: group.all_devices
state: 'not_home'
to: 'not_home'
condition:
- platform: state
entity_id: sun.sun
state: 'above_horizon'
state: 'above_horizon'
action:
service: ifttt.trigger
data: {"event":"manything_on"}
- alias: 'ManyThing Recording OFF'
# 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:
- platform: state
entity_id: group.all_devices
state: 'home'
to: 'home'
condition:
- condition: state
entity_id: sun.sun

View File

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

View File

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

View File

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

View File

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

View File

@ -20,7 +20,7 @@ automation:
trigger:
- platform: state
entity_id: sensor.precip_intensity
state: 'rain'
to: 'rain'
condition:
- platform: state
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:
- platform: state
entity_id: sensor.precip_intensity
state: 'None'
to: 'None'
condition:
- condition: sun
after: 'sunset'

View File

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

View File

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

View File

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