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 92af0c3 commit 0b4218f
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion automations/adaptive_lighting.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: "Adaptive lighting: turn on and off switches"
triggers:
- platform: state
- trigger: state
entity_id: input_select.sleep_mode
- platform: homeassistant
event: start # in case the states aren't properly restored
Expand Down
2 changes: 1 addition & 1 deletion automations/climate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
triggers:
- platform: time_pattern
minutes: "/10"
- platform: state
- trigger: state
entity_id: binary_sensor.activity_in_guest_room
to: "off"
conditions:
Expand Down
6 changes: 3 additions & 3 deletions automations/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@

- alias: "Frontend: change theme"
triggers:
- platform: state
- trigger: state
entity_id: input_select.theme
- platform: state
- trigger: state
entity_id: input_boolean.dark_mode
- platform: state
- trigger: state
entity_id: input_boolean.theme_alternative
- platform: homeassistant
event: start
Expand Down
6 changes: 3 additions & 3 deletions automations/leaving.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- alias: "Leaving: automatically turn off everything"
initial_state: "on"
triggers:
- platform: state
- trigger: state
entity_id: binary_sensor.someone_in_the_house_in_last_hour
from: "on"
to: "off"
Expand Down Expand Up @@ -40,10 +40,10 @@
- alias: "Leaving: ask to turn off everything"
initial_state: "on"
triggers:
- platform: state
- trigger: state
entity_id: person.bas
from: "home"
- platform: state
- trigger: state
entity_id: person.marcella
from: "home"
conditions:
Expand Down
30 changes: 15 additions & 15 deletions automations/light.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@

- alias: "Light: turn off living room"
triggers:
- platform: state
- trigger: state
entity_id: binary_sensor.activity_in_living_room
to: "off"
- platform: state
- trigger: state
entity_id: input_select.sleep_mode
from: total
conditions:
Expand All @@ -54,12 +54,12 @@

- alias: "Light: turn on Chrismas tree"
triggers:
- platform: state
- trigger: state
entity_id: input_select.sleep_mode
to:
- "off"
- "half"
- platform: state
- trigger: state
entity_id: binary_sensor.someone_in_the_house_in_last_hour
to: "on"
conditions:
Expand All @@ -72,10 +72,10 @@

- alias: "Light: turn off Chrismas tree"
triggers:
- platform: state
- trigger: state
entity_id: input_select.sleep_mode
to: "total"
- platform: state
- trigger: state
entity_id: binary_sensor.someone_in_the_house_in_last_hour
to: "off"
actions:
Expand Down Expand Up @@ -201,11 +201,11 @@
- alias: "Light: turn on hall"
mode: parallel
triggers:
- platform: state
- trigger: state
entity_id: binary_sensor.activity_in_hall
from: "off"
to: "on"
- platform: state
- trigger: state
entity_id: binary_sensor.openclose_front_door
from: "off"
to: "on"
Expand Down Expand Up @@ -304,7 +304,7 @@
- alias: "Light: turn off bedroom lights auto switch"
mode: parallel
triggers:
- platform: state
- trigger: state
entity_id: light.bedroom_lights
to: "off"
- platform: event
Expand Down Expand Up @@ -383,13 +383,13 @@

- alias: "Light: turn on utility room / garage outside"
triggers:
- platform: state
- trigger: state
to: "on"
entity_id: binary_sensor.activity_in_utility_room
- platform: state
- trigger: state
to: "on"
entity_id: binary_sensor.activity_outside_front_door
- platform: state
- trigger: state
to: "on"
entity_id: binary_sensor.activity_outside_garage
actions:
Expand All @@ -412,13 +412,13 @@

- alias: "Light: turn off utility room / garage outside"
triggers:
- platform: state
- trigger: state
to: "off"
entity_id: binary_sensor.activity_in_utility_room
- platform: state
- trigger: state
to: "off"
entity_id: binary_sensor.activity_outside_front_door
- platform: state
- trigger: state
to: "off"
entity_id: binary_sensor.activity_outside_garage
actions:
Expand Down
2 changes: 1 addition & 1 deletion automations/mailbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
In the UI show the `input_boolean.mailbox_full`. It needs to
be manually switched off after getting the mail."
triggers:
- platform: state
- trigger: state
entity_id: binary_sensor.mailbox_vibration
to: "on"
conditions:
Expand Down
8 changes: 4 additions & 4 deletions automations/media_player.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
aren't playing Spotify (via WiFi) directly, switch the source of the speakers
to "Opt".
triggers:
- platform: state
- trigger: state
entity_id: media_player.tv
- platform: state
- trigger: state
entity_id: media_player.spotify
to: paused
conditions:
Expand Down Expand Up @@ -101,10 +101,10 @@
mode: single
max_exceeded: silent
triggers:
- platform: state
- trigger: state
entity_id: media_player.kef_ls50
attribute: volume_level
- platform: state
- trigger: state
entity_id: media_player.tv
attribute: volume_level
conditions:
Expand Down
6 changes: 3 additions & 3 deletions automations/plant.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: "Plant: problem with Calathea"
triggers:
- platform: state
- trigger: state
entity_id: plant.calathea
to: "problem"
- platform: time
Expand All @@ -28,7 +28,7 @@
- alias: "Plant: problem with Monstera"
triggers:
- platform: state
- trigger: state
entity_id: plant.monstera
to: "problem"
- platform: time
Expand All @@ -46,7 +46,7 @@
- alias: "Plant: problem with Peace lily"
triggers:
- platform: state
- trigger: state
entity_id: plant.peace_lily
to: "problem"
- platform: time
Expand Down
4 changes: 2 additions & 2 deletions automations/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

- alias: "Security: no one is home but high power usage"
triggers:
- platform: state
- trigger: state
entity_id: binary_sensor.no_one_home
to: "on"
- platform: time_pattern
Expand Down Expand Up @@ -148,7 +148,7 @@
- alias: "Security: Door to outside open"
description: ''
triggers:
- platform: state
- trigger: state
entity_id: binary_sensor.door_to_outside_open
to: 'on'
for:
Expand Down
2 changes: 1 addition & 1 deletion automations/sleep_mode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
triggers:
- platform: time
at: "07:00"
- platform: state
- trigger: state
entity_id: input_boolean.alarm_clock
from: "on"
to: "off"
Expand Down
4 changes: 2 additions & 2 deletions automations/utilities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

- alias: "Utilities: washing machine or dishwasher started or finished"
triggers:
- platform: state
- trigger: state
entity_id: binary_sensor.dishwasher
- platform: state
- trigger: state
entity_id: binary_sensor.washing_machine
variables:
from_state: "{{ trigger.from_state.state }}"
Expand Down
2 changes: 1 addition & 1 deletion automations/vacuum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
triggers:
- platform: time
at: "13:00"
- platform: state
- trigger: state
entity_id: group.persons
from: home
to: not_home
Expand Down

0 comments on commit 0b4218f

Please sign in to comment.