Skip to content

Commit

Permalink
Replace platform: state with trigger: state
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Oct 16, 2024
1 parent a6a93d6 commit 008ae35
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion automations/arriving.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# XXX: sometimes triggers when leaving!
- alias: "Arriving: switch music from iPhone to speakers if no one is home"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.openclose_front_door
from: "off"
to: "on"
Expand Down
2 changes: 1 addition & 1 deletion automations/bike.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

- alias: "Bike: started charging"
triggers:
platform: state
trigger: state
entity_id: switch.bike_charger
to: "on"
from: "off"
Expand Down
2 changes: 1 addition & 1 deletion automations/climate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
- alias: "Climate: warning when heating on and living room door open"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.openclose_bedroom
to: "on"
for: "00:05:00"
Expand Down
2 changes: 1 addition & 1 deletion automations/leaving.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
event: 1002 # single click
actions:
- wait_for_trigger: # when the door closes, turn off everything
platform: state
trigger: state
entity_id: binary_sensor.openclose_front_door
from: "on"
to: "off"
Expand Down
28 changes: 14 additions & 14 deletions automations/light.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

- alias: "Light: turn on living room"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_living_room
to: "on"
conditions:
Expand Down Expand Up @@ -91,7 +91,7 @@

- alias: "Light: toggle dinner area lights"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_dinner_area
conditions:
- condition: state
Expand All @@ -116,7 +116,7 @@
- condition: time
after: "18:00:00"
triggers:
platform: state
trigger: state
entity_id: light.dinner_area
to: "off"
actions:
Expand All @@ -133,7 +133,7 @@

- alias: "Light: turn on kitchen counter if sleep mode is off"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_kitchen
to: "on"
conditions:
Expand All @@ -148,7 +148,7 @@

- alias: "Light: turn off kitchen counter"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_kitchen
to: "off"
actions:
Expand All @@ -171,7 +171,7 @@

- alias: "Light: turn on bathroom"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_bathroom
to: "on"
conditions: "{{ states('input_select.sleep_mode') != 'total' }}"
Expand All @@ -183,7 +183,7 @@

- alias: "Light: turn off bathroom"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_bathroom
to: "off"
actions:
Expand Down Expand Up @@ -230,7 +230,7 @@

- alias: "Light: turn off hall"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_hall
from: "on"
to: "off"
Expand All @@ -250,7 +250,7 @@

- alias: "Light: automatically turn on the bedroom"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_master_bedroom
to: "on"
variables:
Expand Down Expand Up @@ -281,7 +281,7 @@
- alias: "Light: automatically turn off the bedroom"
initial_state: "on"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_master_bedroom
to: "off"
for: "00:08:00"
Expand Down Expand Up @@ -337,7 +337,7 @@

- alias: "Light: turn off bedroom after 2 hours of inactivity"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_master_bedroom
from: "on"
to: "off"
Expand All @@ -358,7 +358,7 @@
- alias: 'Light: Update input_select when bedroom lights turned off'
description: "Set the input_select.last_script_bedroom such that colored lights will be chosen"
triggers:
platform: state
trigger: state
entity_id: light.bedroom_lights
to: 'off'
actions:
Expand Down Expand Up @@ -469,7 +469,7 @@

- alias: "Light: toggle guest room"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_guest_room
conditions:
- condition: state
Expand All @@ -490,7 +490,7 @@

- alias: "Light: toggle baby room"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_baby_room
actions:
- service: light.turn_{{ trigger.to_state.state }}
Expand Down
2 changes: 1 addition & 1 deletion automations/lovelace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- alias: "Lovelace: convert lovelace.json to lovelace-ui.yaml"
initial_state: "on"
triggers:
platform: state
trigger: state
entity_id: sensor.lovelace
actions:
- service: shell_command.convert_lovelace
Expand Down
6 changes: 3 additions & 3 deletions automations/media_player.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

- alias: "Media player: turn off speakers when turning off TV"
triggers:
platform: state
trigger: state
entity_id: media_player.tv
to: "off"
conditions:
Expand All @@ -60,7 +60,7 @@

- alias: "Media player: if speakers off and TV on, turn on the speaker on TV state change"
triggers:
platform: state
trigger: state
entity_id: media_player.tv
conditions: # Happens e.g., when speakers auto-shutdown and the TV is on but idle
- condition: state
Expand Down Expand Up @@ -128,7 +128,7 @@
- alias: "Media player: automatically turn off TV and Xbox after two hours of inactivity"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.motion_sensor_living_room_klok
to: "off"
for: "02:00:00"
Expand Down
4 changes: 2 additions & 2 deletions automations/music.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- alias: "Music: start playlist"
initial_state: "on"
triggers:
platform: state
trigger: state
entity_id: input_boolean.start_the_music
from: "off"
to: "on"
Expand All @@ -25,7 +25,7 @@

- alias: "Music: switch music from iPhone to speakers if coming home"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.openclose_front_door
from: "off"
to: "on"
Expand Down
4 changes: 2 additions & 2 deletions automations/notifications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

- alias: "Notifications: Marcella arrived at Rotterdam Centraal"
triggers:
platform: state
trigger: state
entity_id: device_tracker.marcella_iphone
to: rotterdam_centraal
actions:
Expand All @@ -22,7 +22,7 @@

- alias: "Notifications: front door has opened"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.openclose_front_door
to: "on"
conditions:
Expand Down
10 changes: 5 additions & 5 deletions automations/security.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: "Security: motion detected but we are not home"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.motion_detected
from: "off"
to: "on"
Expand Down Expand Up @@ -47,7 +47,7 @@

- alias: "Security: front door has been open for more than 5 minutes"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.openclose_front_door
from: "off"
to: "on"
Expand All @@ -60,7 +60,7 @@

- alias: "Security: utility room door has been open for more than 5 minutes"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.openclose_front_door
from: "off"
to: "on"
Expand Down Expand Up @@ -95,7 +95,7 @@
- alias: "Security: bathroom door has opened"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.openclose_bathroom
to: "on"
conditions:
Expand All @@ -122,7 +122,7 @@

- alias: "Security: activity in master bedroom"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_master_bedroom
to: "on"
conditions:
Expand Down
10 changes: 5 additions & 5 deletions automations/sleep_mode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

- alias: "Night mode: turn off automatic bedroom lights"
triggers:
platform: state
trigger: state
entity_id: input_select.sleep_mode
from: "off"
actions:
Expand All @@ -38,7 +38,7 @@

- alias: "Night mode: set low temperature when sleep mode turns on"
triggers:
platform: state
trigger: state
entity_id: input_select.sleep_mode
from: "off"
actions:
Expand All @@ -49,7 +49,7 @@
When it is half sleeping mode and there is no activity in
the house for more than an hour go to total sleeping mode.
triggers:
platform: state
trigger: state
entity_id: binary_sensor.activity_outside_bedroom
to: "off"
for: "01:00:00"
Expand All @@ -71,15 +71,15 @@
description: >
Set the living room lights to sleep mode only when no-one is there anymore.
triggers:
platform: state
trigger: state
entity_id: input_select.sleep_mode
to: "total"
actions:
choose:
- conditions: "{{ is_state('binary_sensor.activity_in_living_room', 'on') }}"
sequence:
- wait_for_trigger:
platform: state
trigger: state
entity_id: binary_sensor.activity_in_living_room
from: "on"
to: "off"
Expand Down
4 changes: 2 additions & 2 deletions automations/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

- alias: "Test: time"
triggers:
platform: state
trigger: state
entity_id: sensor.time
actions:
- variables:
Expand All @@ -42,7 +42,7 @@

- alias: "Test: flash lights"
triggers:
platform: state
trigger: state
entity_id: sensor.time
variables: # 'light.bathroom_ceiling',
lights: 'light.bed_led,light.philips_go,light.bed_reading_up,light.hall_3,light.toilet,light.ceiling_kitchen,light.bamboo,light.lampan,light.sphere_2,light.sphere_1,light.hall_2,light.bed_reading_down,light.corner_living_room,light.tv_led,light.stairs_up,light.stairs_down,light.ceiling_bedroom,light.ceiling_living_room,light.hall_1,light.bed_reading'
Expand Down
4 changes: 2 additions & 2 deletions automations/utilities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

- alias: "Utilities: washing machine notification"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.washing_machine
from: "off"
to: "on"
Expand All @@ -40,7 +40,7 @@

- alias: "Utilities: dishwasher notification"
triggers:
platform: state
trigger: state
entity_id: binary_sensor.dishwasher
from: "off"
to: "on"
Expand Down
4 changes: 2 additions & 2 deletions automations/vacation_mode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- alias: "Vacation mode: auto turn on"
initial_state: "on"
triggers:
platform: state
trigger: state
entity_id: group.persons
from: home
to: not_home
Expand All @@ -31,7 +31,7 @@
- alias: "Vacation mode: auto turn off"
initial_state: "on"
triggers:
platform: state
trigger: state
entity_id: group.persons
from: not_home
to: home
Expand Down
Loading

0 comments on commit 008ae35

Please sign in to comment.