From 5459c9b701f09b7381c8b08c1f7b743e88185026 Mon Sep 17 00:00:00 2001 From: Anders Melchiorsen Date: Sun, 4 Jun 2017 13:33:23 +0200 Subject: [PATCH] The automation state trigger has deprecated its state alias 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. --- source/_components/alarm_control_panel.manual.markdown | 8 ++++---- source/_components/ifttt.manything.markdown | 8 ++++---- source/_components/media_player.frontier_silicon.markdown | 2 -- source/_components/notify.webostv.markdown | 2 +- source/_components/sensor.modem_callerid.markdown | 6 +++--- source/_cookbook/automation_flashing_lights.markdown | 8 ++++---- source/_cookbook/automation_for_rainy_days.markdown | 4 ++-- .../restart_ha_if_wemo_switch_is_not_detected.markdown | 2 +- ..._on_light_for_10_minutes_when_motion_detected.markdown | 4 ++-- source/_docs/automation/examples.markdown | 4 ++-- 10 files changed, 23 insertions(+), 25 deletions(-) diff --git a/source/_components/alarm_control_panel.manual.markdown b/source/_components/alarm_control_panel.manual.markdown index e500f2603ec1..b30ceb63a2ce 100644 --- a/source/_components/alarm_control_panel.manual.markdown +++ b/source/_components/alarm_control_panel.manual.markdown @@ -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 diff --git a/source/_components/ifttt.manything.markdown b/source/_components/ifttt.manything.markdown index 0a8727857736..5113b8bbcb78 100644 --- a/source/_components/ifttt.manything.markdown +++ b/source/_components/ifttt.manything.markdown @@ -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 diff --git a/source/_components/media_player.frontier_silicon.markdown b/source/_components/media_player.frontier_silicon.markdown index 6507bd0ad82f..3300f8dffd1d 100644 --- a/source/_components/media_player.frontier_silicon.markdown +++ b/source/_components/media_player.frontier_silicon.markdown @@ -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: diff --git a/source/_components/notify.webostv.markdown b/source/_components/notify.webostv.markdown index 8bfdc9cd6405..408c31eef023 100644 --- a/source/_components/notify.webostv.markdown +++ b/source/_components/notify.webostv.markdown @@ -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: diff --git a/source/_components/sensor.modem_callerid.markdown b/source/_components/sensor.modem_callerid.markdown index 3226f51990d2..1c17c3f47427 100644 --- a/source/_components/sensor.modem_callerid.markdown +++ b/source/_components/sensor.modem_callerid.markdown @@ -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: diff --git a/source/_cookbook/automation_flashing_lights.markdown b/source/_cookbook/automation_flashing_lights.markdown index cf09063f1f27..df1412130701 100644 --- a/source/_cookbook/automation_flashing_lights.markdown +++ b/source/_cookbook/automation_flashing_lights.markdown @@ -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 diff --git a/source/_cookbook/automation_for_rainy_days.markdown b/source/_cookbook/automation_for_rainy_days.markdown index d33a8cbef245..0a1d8a7c6f53 100644 --- a/source/_cookbook/automation_for_rainy_days.markdown +++ b/source/_cookbook/automation_for_rainy_days.markdown @@ -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' diff --git a/source/_cookbook/restart_ha_if_wemo_switch_is_not_detected.markdown b/source/_cookbook/restart_ha_if_wemo_switch_is_not_detected.markdown index cdb5fd2e8f6f..9e2f06633788 100644 --- a/source/_cookbook/restart_ha_if_wemo_switch_is_not_detected.markdown +++ b/source/_cookbook/restart_ha_if_wemo_switch_is_not_detected.markdown @@ -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' diff --git a/source/_cookbook/turn_on_light_for_10_minutes_when_motion_detected.markdown b/source/_cookbook/turn_on_light_for_10_minutes_when_motion_detected.markdown index ed859cdaeeda..4da386bbbc9c 100644 --- a/source/_cookbook/turn_on_light_for_10_minutes_when_motion_detected.markdown +++ b/source/_cookbook/turn_on_light_for_10_minutes_when_motion_detected.markdown @@ -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: diff --git a/source/_docs/automation/examples.markdown b/source/_docs/automation/examples.markdown index f31c35df84e6..a1eb7ddfae70 100644 --- a/source/_docs/automation/examples.markdown +++ b/source/_docs/automation/examples.markdown @@ -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