Skip to content

Commit

Permalink
Replace remaining platform: ... with trigger: ... syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Oct 16, 2024
1 parent 3ff4d62 commit 98c311c
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion automations/adaptive_lighting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
triggers:
- trigger: state
entity_id: input_select.sleep_mode
- platform: homeassistant
- trigger: homeassistant
event: start # in case the states aren't properly restored
variables:
sleep_mode: "{{ states('input_select.sleep_mode') }}"
Expand Down
2 changes: 1 addition & 1 deletion automations/alarm_clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#- from github.com/basnijholt/home-assistant-config
- alias: "Alarm clock: wake up with Spotify and light"
triggers:
platform: template
trigger: template
value_template: >
{{ states("sensor.time")[0:5] == states("sensor.ten_minutes_before_alarm") }}
conditions:
Expand Down
2 changes: 1 addition & 1 deletion automations/bike.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

- alias: "Bike: stop charging"
triggers:
platform: time_pattern
trigger: time_pattern
minutes: '/1'
conditions:
conditions: template
Expand Down
12 changes: 6 additions & 6 deletions automations/climate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

- alias: "Climate: turn on the heating 30 min before waking up"
triggers:
platform: template
trigger: template
value_template: >
{{ states("sensor.time")[0:5] == states("sensor.half_hour_before_alarm") }}
conditions:
Expand All @@ -25,7 +25,7 @@

- alias: "Climate: turn on the heating when going home"
triggers:
platform: numeric_state
trigger: numeric_state
entity_id: proximity.home
below: 6
above: 1
Expand All @@ -50,7 +50,7 @@

- alias: "Climate: turn off the heating at 22:00"
triggers:
platform: time
trigger: time
at: "22:00"
conditions:
- condition: state
Expand Down Expand Up @@ -83,7 +83,7 @@

- alias: "Climate: set outside temperature every hour"
triggers:
platform: time_pattern
trigger: time_pattern
hours: "/1"
actions:
service: mqtt.publish
Expand Down Expand Up @@ -128,7 +128,7 @@
- alias: "Climate: set temperature setpoint to 50 °C"
triggers:
platform: time_pattern
trigger: time_pattern
hours: "/2"
actions:
service: mqtt.publish
Expand All @@ -138,7 +138,7 @@

- alias: "Climate: automatically turn off spaceheater when no-one is in the guest room"
triggers:
- platform: time_pattern
- trigger: time_pattern
minutes: "/10"
- trigger: state
entity_id: binary_sensor.activity_in_guest_room
Expand Down
10 changes: 5 additions & 5 deletions automations/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#- from github.com/basnijholt/home-assistant-config
- alias: "Frontend: turn on dark mode"
triggers:
- platform: time
- trigger: time
at: "20:00"
- platform: sun
- trigger: sun
event: sunset
conditions: "{{ is_state('input_boolean.dark_mode', 'off') }}"
actions:
Expand All @@ -21,9 +21,9 @@

- alias: "Frontend: turn on light mode"
triggers:
- platform: time
- trigger: time
at: "06:00"
- platform: sun
- trigger: sun
event: sunrise
conditions: "{{ is_state('input_boolean.dark_mode', 'on') }}"
actions:
Expand All @@ -38,7 +38,7 @@
entity_id: input_boolean.dark_mode
- trigger: state
entity_id: input_boolean.theme_alternative
- platform: homeassistant
- trigger: homeassistant
event: start
actions:
service: frontend.set_theme
Expand Down
2 changes: 1 addition & 1 deletion automations/leaving.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from: "on"
to: "off"
for: "00:01:00"
- platform: time_pattern
- trigger: time_pattern
hours: "/1"
conditions:
- condition: state
Expand Down
28 changes: 14 additions & 14 deletions automations/light.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

- alias: "Light: reset automatic dinner area lights at 06:00"
triggers:
platform: time
trigger: time
at: "06:00:00"
actions:
service: input_boolean.turn_on
Expand Down Expand Up @@ -157,7 +157,7 @@

- alias: "Light: reboot kitchen ceiling Shelly"
triggers:
platform: time
trigger: time
at: "05:00:00"
actions:
service: shell_command.reboot_kitchen_ceiling
Expand Down Expand Up @@ -329,7 +329,7 @@

- alias: "Light: turn on automatic_bedroom_lights switch"
triggers:
platform: time
trigger: time
at: "12:00"
actions:
entity_id: input_boolean.automatic_bedroom_lights
Expand All @@ -350,7 +350,7 @@

- alias: "Light: reboot bedroom ceiling Shelly"
triggers:
platform: time
trigger: time
at: "13:00:00"
actions:
service: shell_command.reboot_bedroom_ceiling
Expand Down Expand Up @@ -439,10 +439,10 @@

- alias: "Light: turn on the outside front light"
triggers:
- platform: sun
- trigger: sun
event: sunset
offset: "-01:00:00"
- platform: sun
- trigger: sun
event: sunrise
offset: "-02:00:00"
actions:
Expand All @@ -451,9 +451,9 @@

- alias: "Light: turn off the outside front light"
triggers:
- platform: time
- trigger: time
at: "01:00:00"
- platform: sun
- trigger: sun
event: sunrise
offset: "+01:00:00"
actions:
Expand Down Expand Up @@ -509,7 +509,7 @@
- alias: "Light: turn off living room (extra check)"
description: In case the other automation failed
triggers:
platform: time_pattern
trigger: time_pattern
minutes: 60
conditions:
- condition: state
Expand All @@ -525,7 +525,7 @@
- alias: "Light: turn off guest room (extra check)"
description: In case the other automation failed
triggers:
platform: time_pattern
trigger: time_pattern
minutes: "/10"
conditions:
- condition: state
Expand All @@ -541,7 +541,7 @@
- alias: "Light: turn off baby room (extra check)"
description: In case the other automation failed
triggers:
platform: time_pattern
trigger: time_pattern
minutes: "/10"
conditions:
- condition: state
Expand All @@ -563,7 +563,7 @@
- alias: "Light: turn off bedroom (extra check)"
description: In case the other automation failed
triggers:
platform: time_pattern
trigger: time_pattern
minutes: "/30"
conditions:
- condition: state
Expand All @@ -584,7 +584,7 @@
- alias: "Light: turn off utility room / garage (extra check)"
description: In case the other automation failed
triggers:
platform: time_pattern
trigger: time_pattern
minutes: "/10"
conditions:
- condition: state
Expand Down Expand Up @@ -644,7 +644,7 @@
- alias: "Light: Update Zigbee2MQTT Lights State"
description: 'Refresh the state of all Zigbee2MQTT lights'
triggers:
platform: time_pattern
trigger: time_pattern
minutes: "/5"
actions:
service: script.sync_z2m_to_ha_lights
Expand Down
4 changes: 2 additions & 2 deletions automations/media_player.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

- alias: "Media player: update Spotify entity when TV is on every 5 seconds"
triggers:
platform: time_pattern
trigger: time_pattern
seconds: "/5"
conditions:
- condition: state
Expand Down Expand Up @@ -140,7 +140,7 @@

- alias: "Media player: Turn On Living Room TV with WakeOnLan"
triggers:
platform: webostv.turn_on
trigger: webostv.turn_on
entity_id: media_player.tv
actions:
- service: wake_on_lan.send_magic_packet
Expand Down
2 changes: 1 addition & 1 deletion automations/notifications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

- alias: "Notifications: Daily New Word Notification"
triggers:
- platform: time
- trigger: time
at: "07:30:00"
actions:
- service: notify.mobile_app_marcella_iphone_14_pro
Expand Down
6 changes: 3 additions & 3 deletions automations/plant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- trigger: state
entity_id: plant.calathea
to: "problem"
- platform: time
- trigger: time
at: "20:00"
conditions:
conditions: state
Expand All @@ -31,7 +31,7 @@
- trigger: state
entity_id: plant.monstera
to: "problem"
- platform: time
- trigger: time
at: "20:00"
conditions:
conditions: state
Expand All @@ -49,7 +49,7 @@
- trigger: state
entity_id: plant.peace_lily
to: "problem"
- platform: time
- trigger: time
at: "20:00"
conditions:
conditions: state
Expand Down
2 changes: 1 addition & 1 deletion automations/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
- trigger: state
entity_id: binary_sensor.no_one_home
to: "on"
- platform: time_pattern
- trigger: time_pattern
minutes: "/10"
conditions:
- condition: state
Expand Down
2 changes: 1 addition & 1 deletion automations/sleep_mode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

- alias: "Night mode: automatically turn off when alarm turns off or at 7AM"
triggers:
- platform: time
- trigger: time
at: "07:00"
- trigger: state
entity_id: input_boolean.alarm_clock
Expand Down
14 changes: 7 additions & 7 deletions automations/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#- from github.com/basnijholt/home-assistant-config
- alias: "System: warning about high CPU usage"
triggers:
platform: numeric_state
trigger: numeric_state
entity_id: sensor.processor_use
above: 70
for:
Expand All @@ -23,7 +23,7 @@

- alias: "System: warning about high CPU temperature"
triggers:
platform: numeric_state
trigger: numeric_state
entity_id: sensor.cpu_temperature
above: 70
for:
Expand All @@ -36,7 +36,7 @@

- alias: "System: warning about high Xbox temperature"
triggers:
platform: numeric_state
trigger: numeric_state
entity_id: sensor.temperature_xbox
above: 50
actions:
Expand All @@ -56,23 +56,23 @@
- alias: "System: update DNS"
description: Update the DNS at Gandi to point my domain to my Home Assistant instance.
triggers:
platform: time_pattern # XXX: trigger on IP change
trigger: time_pattern # XXX: trigger on IP change
minutes: "/15"
actions:
service: script.update_dns

- alias: "System: run chores"
description: Run shell and Python scripts in utils folder.
triggers:
platform: time_pattern
trigger: time_pattern
minutes: "/15"
actions:
service: shell_command.chores

- alias: "System: MQTT sensors are not updating"
description: Check whether we are receiving messages over MQTT from my other HA instance.
triggers:
platform: time_pattern
trigger: time_pattern
minutes: "/5"
conditions: "{{ (as_timestamp(now()) - as_timestamp(states.sensor.power_consumption.last_changed)) > 20 * 60 }}"
actions:
Expand All @@ -84,7 +84,7 @@

- alias: "System: battery level low"
triggers:
platform: time
trigger: time
at: "14:30:00"
variables:
min_battery_level: 50
Expand Down
2 changes: 1 addition & 1 deletion automations/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
- alias: 'Test: Light Baby Room Loop'
mode: parallel
triggers:
platform: homeassistant
trigger: homeassistant
event: start
actions:
- condition: "{{ is_state('automation.test_light_baby_room_loop', 'on') }}"
Expand Down
Loading

0 comments on commit 98c311c

Please sign in to comment.