From 0b4218f46605ca47ddcd5a3aea4671c196355f95 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Wed, 16 Oct 2024 15:12:02 -0700 Subject: [PATCH] Replace `platform: state` with `trigger: state` --- automations/adaptive_lighting.yaml | 2 +- automations/climate.yaml | 2 +- automations/frontend.yaml | 6 +++--- automations/leaving.yaml | 6 +++--- automations/light.yaml | 30 +++++++++++++++--------------- automations/mailbox.yaml | 2 +- automations/media_player.yaml | 8 ++++---- automations/plant.yaml | 6 +++--- automations/security.yaml | 4 ++-- automations/sleep_mode.yaml | 2 +- automations/utilities.yaml | 4 ++-- automations/vacuum.yaml | 2 +- 12 files changed, 37 insertions(+), 37 deletions(-) diff --git a/automations/adaptive_lighting.yaml b/automations/adaptive_lighting.yaml index d04e5eaa..5a9b2638 100644 --- a/automations/adaptive_lighting.yaml +++ b/automations/adaptive_lighting.yaml @@ -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 diff --git a/automations/climate.yaml b/automations/climate.yaml index 530b7a34..ef336dda 100755 --- a/automations/climate.yaml +++ b/automations/climate.yaml @@ -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: diff --git a/automations/frontend.yaml b/automations/frontend.yaml index 1be6fe19..87d13a6f 100755 --- a/automations/frontend.yaml +++ b/automations/frontend.yaml @@ -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 diff --git a/automations/leaving.yaml b/automations/leaving.yaml index 1c84df28..41e9dc56 100644 --- a/automations/leaving.yaml +++ b/automations/leaving.yaml @@ -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" @@ -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: diff --git a/automations/light.yaml b/automations/light.yaml index c5a77f7e..b67418a4 100755 --- a/automations/light.yaml +++ b/automations/light.yaml @@ -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: @@ -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: @@ -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: @@ -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" @@ -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 @@ -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: @@ -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: diff --git a/automations/mailbox.yaml b/automations/mailbox.yaml index 4f100608..20b0d751 100644 --- a/automations/mailbox.yaml +++ b/automations/mailbox.yaml @@ -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: diff --git a/automations/media_player.yaml b/automations/media_player.yaml index 112f9245..7a5e9df6 100644 --- a/automations/media_player.yaml +++ b/automations/media_player.yaml @@ -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: @@ -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: diff --git a/automations/plant.yaml b/automations/plant.yaml index 4261ccc6..b734b1be 100755 --- a/automations/plant.yaml +++ b/automations/plant.yaml @@ -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 @@ -28,7 +28,7 @@ - alias: "Plant: problem with Monstera" triggers: - - platform: state + - trigger: state entity_id: plant.monstera to: "problem" - platform: time @@ -46,7 +46,7 @@ - alias: "Plant: problem with Peace lily" triggers: - - platform: state + - trigger: state entity_id: plant.peace_lily to: "problem" - platform: time diff --git a/automations/security.yaml b/automations/security.yaml index 5c04c8e3..e2540b7a 100644 --- a/automations/security.yaml +++ b/automations/security.yaml @@ -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 @@ -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: diff --git a/automations/sleep_mode.yaml b/automations/sleep_mode.yaml index 98adcfd2..75a33fd5 100755 --- a/automations/sleep_mode.yaml +++ b/automations/sleep_mode.yaml @@ -13,7 +13,7 @@ triggers: - platform: time at: "07:00" - - platform: state + - trigger: state entity_id: input_boolean.alarm_clock from: "on" to: "off" diff --git a/automations/utilities.yaml b/automations/utilities.yaml index 99503acb..966f34e9 100755 --- a/automations/utilities.yaml +++ b/automations/utilities.yaml @@ -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 }}" diff --git a/automations/vacuum.yaml b/automations/vacuum.yaml index a9df34e2..7189348a 100755 --- a/automations/vacuum.yaml +++ b/automations/vacuum.yaml @@ -60,7 +60,7 @@ triggers: - platform: time at: "13:00" - - platform: state + - trigger: state entity_id: group.persons from: home to: not_home