Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example automations to modern HA yaml syntax #678

Merged
merged 3 commits into from
Dec 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ Save these automations in your automations file `<config dir>/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
actions:
- action: notify.ios_my_ios_device
data_template:
title: "Passat GTE Position Changed"
message: |
Expand All @@ -102,17 +102,17 @@ Save these automations in your automations file `<config dir>/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
actions:
- action: notify.ios_my_ios_device
data_template:
title: "VW Car Climatisation State"
message: |
Expand All @@ -130,20 +130,20 @@ Save these automations in your automations file `<config dir>/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:
actions:
# 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: |
Expand All @@ -162,12 +162,12 @@ Save these automations in your automations file `<config dir>/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
actions:
- action: notify.ios_my_ios_device
data_template:
title: "Passat GTE Fully Charged"
message: |
Expand All @@ -184,9 +184,9 @@ Save these automations in your automations file `<config dir>/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:
Expand All @@ -199,19 +199,19 @@ Save these automations in your automations file `<config dir>/automations.yaml`
- condition: time
after: '07:00:00'
before: '21:00:00'
action:
actions:
# 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!"
Expand Down
Loading