From c157098004198fc6b12d6cf9014f23d8b371cd6f Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Tue, 26 Nov 2024 13:07:57 +0100 Subject: [PATCH 1/3] Update example automations to modern HA yaml syntax The examples uses outdated syntax --- README.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 55a03cd..e2662d3 100644 --- a/README.md +++ b/README.md @@ -73,11 +73,11 @@ Save these automations in your automations file `/automations.yaml` - id: notify_volkswagen_position_change description: Notify when position has been changed alias: VW position changed notification - trigger: - - platform: state + triggers: + - trigger: state entity_id: device_tracker.vw_carid - action: - - service: notify.ios_my_ios_device + action: + - action: notify.ios_my_ios_device data_template: title: "Passat GTE Position Changed" message: | @@ -102,17 +102,17 @@ Save these automations in your automations file `/automations.yaml` - id: notify_volkswagen_climatisation description: Notify when climatisation state changes alias: VW climatisation notifications - trigger: - - platform: state + triggers: + - trigger: state entity_id: switch.vw_carid_electric_climatisation from: 'off' to: 'on' - - platform: state + - trigger: state entity_id: switch.vw_carid_electric_climatisation from: 'on' to: 'off' action: - - service: notify.ios_my_ios_device + - action: notify.ios_my_ios_device data_template: title: "VW Car Climatisation State" message: | @@ -130,20 +130,20 @@ Save these automations in your automations file `/automations.yaml` - id: notify_volkswagen_charging description: Notify when charging state changes alias: VW charging notifications - trigger: - - platform: state + triggers: + - trigger: state entity_id: switch.vw_carid_charging from: 'off' to: 'on' - - platform: state + - trigger: state entity_id: switch.vw_carid_charging from: 'on' to: 'off' action: # delay so charging time gets updated - delay: '00:00:05' - - service: notify.ios_my_ios_device + - action: notify.ios_my_ios_device data_template: title: "VW Car Charging State" message: | @@ -162,12 +162,12 @@ Save these automations in your automations file `/automations.yaml` - id: notify_volkswagen_battery_full description: Notify when battery is fully charged alias: VW battery level full Notifications - trigger: - - platform: numeric_state + triggers: + - trigger: numeric_state entity_id: sensor.vw_carid_battery_level above: 99 action: - - service: notify.ios_my_ios_device + - action: notify.ios_my_ios_device data_template: title: "Passat GTE Fully Charged" message: | @@ -184,9 +184,9 @@ Save these automations in your automations file `/automations.yaml` ```yaml - id: 'notify_volkswagen_car_is_unlocked' alias: VW is at home and unlocked - trigger: - - entity_id: binary_sensor.vw_carid_external_power - platform: state + triggers: + - trigger: state + entity_id: binary_sensor.vw_carid_external_power to: 'on' for: 00:10:00 condition: @@ -201,17 +201,17 @@ Save these automations in your automations file `/automations.yaml` before: '21:00:00' action: # Notification via push message to smartphone - - service: notify.device + - action: notify.device data: message: "The car is unlocked!" target: - device/my_device # Notification via smart speaker (kitchen) - - service: media_player.volume_set + - action: media_player.volume_set data: entity_id: media_player.kitchen volume_level: '0.6' - - service: tts.google_translate_say + - action: tts.google_translate_say data: entity_id: media_player.kitchen message: "My Lord, the car is unlocked. Please attend this this issue at your earliest inconvenience!" From 7b2e7d33f066539356ba711dcd4281f48e20a814 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Tue, 26 Nov 2024 13:10:06 +0100 Subject: [PATCH 2/3] Remove extra space --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e2662d3..2431948 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Save these automations in your automations file `/automations.yaml` triggers: - trigger: state entity_id: device_tracker.vw_carid - action: + action: - action: notify.ios_my_ios_device data_template: title: "Passat GTE Position Changed" From 630f6fdb690b6b9a072709d68b136bb77309e033 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Tue, 26 Nov 2024 13:18:55 +0100 Subject: [PATCH 3/3] Actually, also "actions" should be in the plural sense --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2431948..b932b04 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Save these automations in your automations file `/automations.yaml` triggers: - trigger: state entity_id: device_tracker.vw_carid - action: + actions: - action: notify.ios_my_ios_device data_template: title: "Passat GTE Position Changed" @@ -111,7 +111,7 @@ Save these automations in your automations file `/automations.yaml` entity_id: switch.vw_carid_electric_climatisation from: 'on' to: 'off' - action: + actions: - action: notify.ios_my_ios_device data_template: title: "VW Car Climatisation State" @@ -140,7 +140,7 @@ Save these automations in your automations file `/automations.yaml` entity_id: switch.vw_carid_charging from: 'on' to: 'off' - action: + actions: # delay so charging time gets updated - delay: '00:00:05' - action: notify.ios_my_ios_device @@ -166,7 +166,7 @@ Save these automations in your automations file `/automations.yaml` - trigger: numeric_state entity_id: sensor.vw_carid_battery_level above: 99 - action: + actions: - action: notify.ios_my_ios_device data_template: title: "Passat GTE Fully Charged" @@ -199,7 +199,7 @@ Save these automations in your automations file `/automations.yaml` - condition: time after: '07:00:00' before: '21:00:00' - action: + actions: # Notification via push message to smartphone - action: notify.device data: