From 896d09e1d72d5a2de280d9b091e72f717846000d Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Wed, 16 Oct 2024 15:32:40 -0700 Subject: [PATCH] Use `action:` instead of `service:` --- automations/adaptive_lighting.yaml | 16 ++-- automations/alarm_clock.yaml | 8 +- automations/apple_watch.yaml | 54 ++++++------- automations/arriving.yaml | 8 +- automations/bike.yaml | 6 +- automations/climate.yaml | 24 +++--- automations/control_switches.yaml | 124 ++++++++++++++--------------- automations/cube.yaml | 20 ++--- automations/doorbell.yaml | 6 +- automations/frontend.yaml | 6 +- automations/leaving.yaml | 12 +-- automations/light.yaml | 82 +++++++++---------- automations/lovelace.yaml | 4 +- automations/mailbox.yaml | 4 +- automations/media_player.yaml | 20 ++--- automations/music.yaml | 10 +-- automations/notifications.yaml | 12 +-- automations/plant.yaml | 6 +- automations/security.yaml | 30 +++---- automations/sleep_mode.yaml | 14 ++-- automations/system.yaml | 16 ++-- automations/test.yaml | 22 ++--- automations/utilities.yaml | 6 +- automations/vacation_mode.yaml | 8 +- automations/vacuum.yaml | 18 ++--- automations/work.yaml | 10 +-- 26 files changed, 273 insertions(+), 273 deletions(-) diff --git a/automations/adaptive_lighting.yaml b/automations/adaptive_lighting.yaml index 2e58a363..8b3dde87 100644 --- a/automations/adaptive_lighting.yaml +++ b/automations/adaptive_lighting.yaml @@ -20,7 +20,7 @@ choose: - conditions: "{{ sleep_mode == 'off' }}" sequence: - - service: switch.turn_off + - action: switch.turn_off entity_id: - switch.adaptive_lighting_sleep_mode_bedroom - switch.adaptive_lighting_sleep_mode_bedroom_led @@ -29,10 +29,10 @@ - conditions: "{{ sleep_mode == 'half' }}" sequence: - - service: switch.turn_off + - action: switch.turn_off entity_id: - switch.adaptive_lighting_sleep_mode_living_room - - service: switch.turn_on + - action: switch.turn_on entity_id: - switch.adaptive_lighting_sleep_mode_bedroom - switch.adaptive_lighting_sleep_mode_bedroom_led @@ -40,7 +40,7 @@ - conditions: "{{ sleep_mode == 'total' }}" sequence: - - service: switch.turn_on + - action: switch.turn_on entity_id: - switch.adaptive_lighting_sleep_mode_bedroom - switch.adaptive_lighting_sleep_mode_bedroom_led @@ -63,12 +63,12 @@ - delay: "01:00:00" - condition: template value_template: "{{ light in state_attr('switch', 'manual_control') }}" - - service: adaptive_lighting.set_manual_control + - action: adaptive_lighting.set_manual_control data: entity_id: "{{ switch }}" lights: "{{ light }}" manual_control: false - - service: notify.iphone_bas + - action: notify.iphone_bas data: title: "Adaptive Ligthing: manual_control reset" message: "{{ light }} is reset to not 'manually controlled'" @@ -83,12 +83,12 @@ light: "{{ trigger.event.data.entity_id }}" conditions: "{{ 'hall' not in light and 'stairs' not in light }}" actions: - - service: system_log.write + - action: system_log.write data: message: "{{ light }} is manually controlled" level: error logger: yolo.yolo - - service: notify.iphone_bas + - action: notify.iphone_bas data: title: "Adaptive Ligthing: manual_control" message: "{{ light }} is now 'manually controlled', context={{ trigger.event.context }}" diff --git a/automations/alarm_clock.yaml b/automations/alarm_clock.yaml index 0f5a7bc3..7f4578d7 100755 --- a/automations/alarm_clock.yaml +++ b/automations/alarm_clock.yaml @@ -18,13 +18,13 @@ entity_id: input_boolean.alarm_clock state: "on" actions: - - service: input_boolean.turn_off + - action: input_boolean.turn_off entity_id: input_boolean.alarm_clock - - service: input_boolean.turn_on + - action: input_boolean.turn_on entity_id: input_boolean.wake_up_with_spotify - - service: input_boolean.turn_on + - action: input_boolean.turn_on entity_id: input_boolean.wake_up_light - - service: input_select.select_option + - action: input_select.select_option entity_id: input_select.sleep_mode data: option: "off" diff --git a/automations/apple_watch.yaml b/automations/apple_watch.yaml index 6b0a06f3..0148fda8 100644 --- a/automations/apple_watch.yaml +++ b/automations/apple_watch.yaml @@ -19,7 +19,7 @@ entity_id: media_player.tv state: "on" actions: - service: media_player.media_play_pause + action: media_player.media_play_pause target: entity_id: | media_player.{{ 'xbox' if is_state_attr('media_player.tv', 'source', 'XBOX') else 'tv'}} @@ -31,7 +31,7 @@ event_data: actionName: Minimal lights bedroom actions: - service: light.turn_on + action: light.turn_on data: entity_id: - light.philips_go @@ -46,7 +46,7 @@ event_data: actionName: Fix TV sound actions: - service: script.fix_sound + action: script.fix_sound - alias: "Apple Watch: set sleep mode" mode: parallel @@ -58,7 +58,7 @@ actions: - variables: iphone: "notify.mobile_app_{{ trigger.event.data.sourceDeviceName.replace('-', '_') }}" - - service: "{{ iphone }}" + - action: "{{ iphone }}" data: message: "Apple Watch: set sleep mode." data: @@ -86,7 +86,7 @@ continue_on_timeout: false - variables: event: "{{ wait.trigger.event.data.action.lower().split('_')[1] }}" - - service: input_select.select_option + - action: input_select.select_option data: entity_id: input_select.sleep_mode option: "{{ event }}" @@ -101,7 +101,7 @@ actions: - variables: iphone: "notify.mobile_app_{{ trigger.event.data.sourceDeviceName.replace('-', '_') }}" - - service: "{{ iphone }}" + - action: "{{ iphone }}" data: message: "Apple Watch: set lights" data: @@ -162,7 +162,7 @@ 'SET_LIGHTS_TOILET': 'light.toilet', 'SET_LIGHTS_KITCHEN': 'light.kitchen_lights', }[wait.trigger.event.data.action] }} - - service: "{{ iphone }}" + - action: "{{ iphone }}" data: message: "Apple Watch: choose option" data: @@ -217,44 +217,44 @@ - choose: - conditions: "{{ option == 'LIGHTS_OFF' }}" sequence: - service: light.turn_off + action: light.turn_off data: entity_id: "{{ light }}" - conditions: "{{ option == 'LIGHTS_ON' }}" sequence: - service: script.turn_on_lights + action: script.turn_on_lights data: entity_id: "{{ light }}" - conditions: "{{ option == 'LIGHTS_FIFTY' }}" sequence: - service: light.turn_on + action: light.turn_on data: entity_id: "{{ light }}" brightness_pct: 50 - conditions: "{{ option == 'LIGHTS_HUNDRED' }}" sequence: - service: light.turn_on + action: light.turn_on data: entity_id: "{{ light }}" brightness_pct: 100 - conditions: "{{ option == 'LIGHTS_ONE' }}" sequence: - service: light.turn_on + action: light.turn_on data: entity_id: "{{ light }}" brightness_pct: 1 - conditions: "{{ option == 'LIGHTS_WHITE' and light == 'light.living_room_lights'}}" sequence: - service: script.white_lights_living_room + action: script.white_lights_living_room - conditions: "{{ option == 'LIGHTS_WHITE' and light == 'light.bedroom_lights'}}" sequence: - service: script.white_lights_living_room + action: script.white_lights_living_room - conditions: "{{ option == 'LIGHTS_COZY' and light == 'light.living_room_lights'}}" sequence: - service: script.cozy_lights_living_room + action: script.cozy_lights_living_room - conditions: "{{ option == 'LIGHTS_COZY' and light == 'light.bedroom_lights'}}" sequence: - service: script.cozy_lights_bedroom + action: script.cozy_lights_bedroom - alias: "Apple Watch: temperature report" mode: parallel @@ -266,7 +266,7 @@ actions: - variables: iphone: "notify.mobile_app_{{ trigger.event.data.sourceDeviceName.replace('-', '_') }}" - - service: "{{ iphone }}" + - action: "{{ iphone }}" data: title: "Temperature" message: > @@ -286,7 +286,7 @@ actions: - variables: iphone: "notify.iphone_bas" - - service: "{{ iphone }}" + - action: "{{ iphone }}" data: title: Portfolio value message: > @@ -302,7 +302,7 @@ actions: - variables: iphone: "notify.mobile_app_{{ trigger.event.data.sourceDeviceName.replace('-', '_') }}" - - service: "{{ iphone }}" + - action: "{{ iphone }}" data: message: "Apple Watch: vacuum" data: @@ -354,7 +354,7 @@ continue_on_timeout: false - variables: location: "{{ wait.trigger.event.data.action.lower().split('vacuum_')[1] }}" - - service: script.vacuum_command + - action: script.vacuum_command data: option: "{{ location }}" @@ -365,17 +365,17 @@ event_data: actionName: Movie time actions: - - service: light.turn_on + - action: light.turn_on data: entity_id: - light.living_room_lights brightness: 5 color_name: red - - service: light.turn_off + - action: light.turn_off data: entity_id: - light.marble - - service: light.turn_on + - action: light.turn_on data: entity_id: - light.tv_led @@ -388,7 +388,7 @@ event_data: actionName: Reset adaptive lighting actions: - service: script.reset_adaptive_lighting + action: script.reset_adaptive_lighting - alias: "Apple Watch: set temperature" mode: parallel @@ -400,7 +400,7 @@ actions: - variables: iphone: "notify.mobile_app_{{ trigger.event.data.sourceDeviceName.replace('-', '_') }}" - - service: "{{ iphone }}" + - action: "{{ iphone }}" data: message: "Apple Watch: set temperature" data: @@ -452,7 +452,7 @@ continue_on_timeout: false - variables: temperature: "{{ wait.trigger.event.data.action.split('T')[1] | int }}" - - service: climate.set_temperature + - action: climate.set_temperature data: entity_id: climate.thermostat temperature: "{{ temperature }}" @@ -474,7 +474,7 @@ other_person: "{% if phone == 'basnijholt' %}Marcella{% else %}Bas{% endif %}" device_tracker: "device_tracker.{{ other_person }}_iphone" actions: - service: "notify.mobile_app_{{ phone }}_iphone" + action: "notify.mobile_app_{{ phone }}_iphone" data: message: "{{ other_person }} is {{ distance('device_tracker.basnijholt_iphone', 'device_tracker.marcella_iphone') | round(2) }} km away" data: diff --git a/automations/arriving.yaml b/automations/arriving.yaml index 2b8a83f3..6b2aa401 100644 --- a/automations/arriving.yaml +++ b/automations/arriving.yaml @@ -26,17 +26,17 @@ - "{{ is_state_attr('media_player.spotify', 'source', 'basnijholt-iphone') }}" - "{{ is_state('media_player.spotify', 'playing') }}" actions: - - service: notify.iphone_bas + - action: notify.iphone_bas data: title: "Arriving" message: "Switched music from phone to speakers" - - service: media_player.turn_on + - action: media_player.turn_on entity_id: media_player.kef_ls50 - - service: media_player.select_source + - action: media_player.select_source entity_id: media_player.kef_ls50 data: source: Spotify - - service: media_player.select_source + - action: media_player.select_source entity_id: media_player.spotify data: source: KEF LS50 diff --git a/automations/bike.yaml b/automations/bike.yaml index 2f4392d0..f0f4a319 100755 --- a/automations/bike.yaml +++ b/automations/bike.yaml @@ -18,11 +18,11 @@ to: "on" from: "off" actions: - - service: input_datetime.set_datetime + - action: input_datetime.set_datetime data: entity_id: input_datetime.bike_charger_on timestamp: "{{ now().timestamp() }}" - - service: input_datetime.set_datetime + - action: input_datetime.set_datetime data: entity_id: input_datetime.bike_charger_off timestamp: "{{ now().timestamp() + 3600 * 6 }}" @@ -35,6 +35,6 @@ conditions: template value_template: "{{ states('sensor.time') == states('input_datetime.bike_charger_off')[0:5] }}" actions: - service: switch.turn_off + action: switch.turn_off data: entity_id: switch.bike_charger diff --git a/automations/climate.yaml b/automations/climate.yaml index 02b3b795..3fa39083 100755 --- a/automations/climate.yaml +++ b/automations/climate.yaml @@ -21,7 +21,7 @@ - input_boolean.automatic_temperature state: "on" actions: - service: script.set_high_temperature + action: script.set_high_temperature - alias: "Climate: turn on the heating when going home" triggers: @@ -42,8 +42,8 @@ entity_id: binary_sensor.no_one_home state: "on" actions: - - service: script.set_high_temperature - - service: notify.all_iphones + - action: script.set_high_temperature + - action: notify.all_iphones data: title: "Climate" message: "Automatically turned on the heating πŸ₯΅β„ƒ" @@ -61,8 +61,8 @@ state: "off" - "{{ not is_state_attr('climate.thermostat', 'temperature', states('input_number.temperature_low')|float(0)) }}" actions: - - service: script.set_low_temperature - - service: notify.all_iphones + - action: script.set_low_temperature + - action: notify.all_iphones data: message: "Turned off the heating πŸ₯Ά, click to turn it on again?" data: @@ -79,14 +79,14 @@ actions: TURN_ON_HEATING timeout: "00:00:20" continue_on_timeout: false - - service: script.set_high_temperature + - action: script.set_high_temperature - alias: "Climate: set outside temperature every hour" triggers: trigger: time_pattern hours: "/1" actions: - service: mqtt.publish + action: mqtt.publish data: topic: actions/otmonitor/outside payload_template: > @@ -108,7 +108,7 @@ - condition: template value_template: "{{ repeat.index <= 6 }}" sequence: - - service: notify.all + - action: notify.all data: title: "Climate" message: "The living room door is open and the heating is on! ⚠️ Warning #{{ repeat.index }}!" @@ -116,11 +116,11 @@ - condition: state entity_id: binary_sensor.openclose_bedroom state: "on" - - service: notify.all + - action: notify.all data: title: "Climate" message: "Turning off the heating!" - - service: climate.set_temperature + - action: climate.set_temperature entity_id: climate.thermostat data: temperature: > @@ -131,7 +131,7 @@ trigger: time_pattern hours: "/2" actions: - service: mqtt.publish + action: mqtt.publish data: topic: actions/otmonitor/maxdhwsetpt payload: "50" @@ -148,5 +148,5 @@ entity_id: binary_sensor.activity_in_guest_room state: "off" actions: - service: switch.turn_off + action: switch.turn_off entity_id: switch.space_heater diff --git a/automations/control_switches.yaml b/automations/control_switches.yaml index 518813e3..4040c8f0 100644 --- a/automations/control_switches.yaml +++ b/automations/control_switches.yaml @@ -21,7 +21,7 @@ # Next color - conditions: "{{ action == 'off_press' }}" # Lowest button sequence: - service: script.next_colors + action: script.next_colors data: input_select: input_select.last_script_living_room @@ -32,8 +32,8 @@ entity_id: light.living_room_lights state: "on" sequence: - - service: script.white_lights_living_room - - service: light.turn_on + - action: script.white_lights_living_room + - action: light.turn_on entity_id: light.living_room_lights data: brightness: "255" @@ -41,7 +41,7 @@ # Increase brightness - conditions: "{{ action == 'on_press' }}" # Top button sequence: - service: script.increase_brightness + action: script.increase_brightness data: group: light.living_room_lights @@ -52,7 +52,7 @@ entity_id: light.living_room_lights state: "off" sequence: - - service: light.turn_on + - action: light.turn_on entity_id: light.living_room_lights # Turn off @@ -62,7 +62,7 @@ entity_id: light.living_room_lights state: "on" sequence: - - service: light.turn_off + - action: light.turn_off entity_id: light.living_room_lights # Reset adaptive_lighting @@ -70,7 +70,7 @@ - "{{ action == 'up_hold' }}" # Second from highest button - "{{ trigger.payload_json.action_duration > 2 }}" # Hold for more than two seconds sequence: - - service: script.reset_adaptive_lighting + - action: script.reset_adaptive_lighting - alias: "Control switches: bedroom Philips Hue dimmer switch" mode: parallel @@ -84,7 +84,7 @@ # Next color - conditions: "{{ action == 'off_press' }}" # Lowest button sequence: - service: script.next_colors + action: script.next_colors data: input_select: input_select.last_script_bedroom @@ -95,8 +95,8 @@ entity_id: light.bedroom_lights state: "on" sequence: - - service: script.white_lights_bedroom - - service: light.turn_on + - action: script.white_lights_bedroom + - action: light.turn_on entity_id: light.bedroom_lights data: brightness: "255" @@ -104,7 +104,7 @@ # Increase brightness - conditions: "{{ action == 'on_press' }}" # Top button sequence: - service: script.increase_brightness + action: script.increase_brightness data: group: light.bedroom_lights @@ -115,7 +115,7 @@ entity_id: light.bedroom_lights state: "off" sequence: - - service: light.turn_on + - action: light.turn_on entity_id: light.bedroom_lights # Turn off @@ -125,7 +125,7 @@ entity_id: light.bedroom_lights state: "on" sequence: - - service: light.turn_off + - action: light.turn_off entity_id: light.bedroom_lights # Reset adaptive_lighting @@ -133,7 +133,7 @@ - "{{ action == 'up_hold' }}" # Second from highest button - "{{ trigger.payload_json.action_duration > 2 }}" # Hold for more than two seconds sequence: - - service: script.reset_adaptive_lighting + - action: script.reset_adaptive_lighting # This automation is set up to control the lighting in your bedroom using two different IKEA remotes. # Here's a simplified explanation of the different actions that the automation performs: @@ -169,8 +169,8 @@ entity_id: light.bedroom_lights state: "on" sequence: - - service: script.white_lights_bedroom - - service: light.turn_on + - action: script.white_lights_bedroom + - action: light.turn_on entity_id: light.bedroom_lights data: brightness: "255" @@ -183,7 +183,7 @@ entity_id: light.bedroom_lights state: "on" sequence: - service: script.increase_brightness + action: script.increase_brightness data: group: light.bedroom_lights @@ -194,7 +194,7 @@ entity_id: light.bedroom_lights state: "off" sequence: - - service: light.turn_on + - action: light.turn_on entity_id: light.bedroom_lights # Turn off @@ -204,13 +204,13 @@ entity_id: light.bedroom_lights state: "on" sequence: - - service: light.turn_off + - action: light.turn_off entity_id: light.bedroom_lights # Next color - conditions: "{{ action == 'arrow_left_click' }}" sequence: - service: script.next_colors + action: script.next_colors data: input_select: input_select.last_script_bedroom @@ -219,14 +219,14 @@ - "{{ action == 'arrow_right_click' }}" - "{{ is_state(personal_light, 'off') }}" sequence: - service: light.toggle + action: light.toggle data: entity_id: "{{ personal_light }}" - conditions: - "{{ action == 'arrow_right_click' }}" - "{{ is_state(personal_light, 'on') }}" sequence: - service: script.increase_brightness + action: script.increase_brightness data: group: "{{ personal_light }}" @@ -235,22 +235,22 @@ - "{{ action == 'brightness_move_down' }}" # Hold lowest button - "{{ is_state('input_boolean.guest_mode', 'off') }}" sequence: - - service: input_select.select_option + - action: input_select.select_option data: entity_id: input_select.sleep_mode option: total - - service: script.turn_off_everything + - action: script.turn_off_everything # Turn off baby room and bedroom (with guests) - conditions: - "{{ action == 'brightness_move_down' }}" # Hold lowest button - "{{ is_state('input_boolean.guest_mode', 'on') }}" sequence: - - service: input_select.select_option + - action: input_select.select_option data: entity_id: input_select.sleep_mode option: total - - service: light.turn_off + - action: light.turn_off data: entity_id: - light.bedroom_lights @@ -268,14 +268,14 @@ # Next color - conditions: "{{ trigger.event.data.event == 1004 }}" # Double click sequence: - service: script.next_colors + action: script.next_colors data: input_select: input_select.last_script_living_room # Increase brightness - conditions: "{{ trigger.event.data.event == 1002 }}" # Single click sequence: - service: script.increase_brightness + action: script.increase_brightness data: group: light.living_room_lights @@ -286,17 +286,17 @@ entity_id: light.living_room_lights state: "on" sequence: - - service: light.turn_on + - action: light.turn_on data: flash: "short" entity_id: light.cabinet_led - - service: media_player.turn_off + - action: media_player.turn_off entity_id: media_player.tv - wait_template: "{{ is_state('media_player.tv', 'off') }}" timeout: "00:00:30" - - service: media_player.turn_off + - action: media_player.turn_off entity_id: media_player.kef_ls50 - - service: light.turn_off + - action: light.turn_off entity_id: light.living_room_lights data: transition: 30 @@ -304,7 +304,7 @@ # Fix the sounds on the TV (LG TV sound sync bug πŸ›) - conditions: "{{ trigger.event.data.event == 1001 }}" # Long click sequence: - service: script.fix_sound + action: script.fix_sound - alias: "Control switches: bedroom Aqara Wireless Mini Switch" mode: parallel @@ -322,21 +322,21 @@ # Next color - conditions: "{{ trigger.event.data.event == 1004 }}" # Double click sequence: - service: script.next_colors + action: script.next_colors data: input_select: input_select.last_script_bedroom # Increase brightness - conditions: "{{ trigger.event.data.event == 1002 }}" # Single click sequence: - service: script.increase_brightness + action: script.increase_brightness data: group: light.bedroom_lights # Turn off lights in and next to bedroom - conditions: "{{ trigger.event.data.event == 1001 }}" # Long click sequence: - service: light.turn_off + action: light.turn_off entity_id: - light.hall_lights - light.bedroom_lights @@ -354,7 +354,7 @@ {% set is_morning = now().replace(hour=6, minute=0) < now() < now().replace(hour=12, minute=0) %} {{ is_near_alarm or is_morning }} sequence: - service: light.turn_off + action: light.turn_off entity_id: all - conditions: # off -> half @@ -362,13 +362,13 @@ entity_id: input_select.sleep_mode state: "off" sequence: - - service: light.turn_off + - action: light.turn_off entity_id: - light.hall_lights - light.bedroom_lights - light.bathroom_ceiling - light.stairs_lights - - service: input_select.select_option + - action: input_select.select_option entity_id: input_select.sleep_mode data: option: half @@ -378,8 +378,8 @@ entity_id: input_select.sleep_mode state: half sequence: - - service: script.turn_off_everything - - service: input_select.select_option + - action: script.turn_off_everything + - action: input_select.select_option entity_id: input_select.sleep_mode data: option: total @@ -389,7 +389,7 @@ entity_id: input_select.sleep_mode state: total sequence: - service: light.turn_off + action: light.turn_off entity_id: all - alias: "Control switches: bathroom Aqara Wireless Mini Switch" @@ -404,13 +404,13 @@ # Toggle lights - conditions: "{{ trigger.event.data.event == 1002 }}" # Single click sequence: - service: light.toggle + action: light.toggle entity_id: light.bathroom_lights # Flash all lights - conditions: "{{ trigger.event.data.event == 1004 }}" # Double click sequence: - - service: light.turn_on + - action: light.turn_on data: entity_id: light.living_room_lights flash: "short" @@ -427,29 +427,29 @@ # Leaving: turn off everything - conditions: "{{ trigger.event.data.event == 1002 }}" # Single click sequence: - - service: light.turn_on + - action: light.turn_on data: entity_id: light.living_room_lights flash: "short" - - service: script.turn_off_everything_non_automatic - - service: script.set_low_temperature + - action: script.turn_off_everything_non_automatic + - action: script.set_low_temperature - if: "{{ is_state_attr('media_player.spotify', 'source', 'KEF LS50') and is_state('media_player.spotify', 'playing') }}" then: - - service: media_player.media_pause + - action: media_player.media_pause entity_id: media_player.spotify # Arriving: turn on music and cozy lights - conditions: "{{ trigger.event.data.event == 1004 }}" # Double click sequence: - - service: light.turn_on + - action: light.turn_on data: flash: "short" entity_id: light.ceiling_kitchen - - service: script.turn_on + - action: script.turn_on data: entity_id: light.living_room_lights - - service: script.arriving - - service: script.start_spotify + - action: script.arriving + - action: script.start_spotify data: source: KEF LS50 id: 'playlist:{{ states("sensor.favorite_playlist_of_nearest_person") }}' @@ -467,13 +467,13 @@ # Turn on - conditions: "{{ action == 'on' }}" # Lowest button sequence: - service: light.turn_on + action: light.turn_on entity_id: light.guest_room_lights # Turn off - conditions: "{{ action == 'off' }}" # Lowest button sequence: - service: light.turn_off + action: light.turn_off entity_id: light.guest_room_lights - alias: "Control switches: Guest Room Light" @@ -488,14 +488,14 @@ # Toggle - conditions: "{{ action == 'single' }}" sequence: - service: light.toggle + action: light.toggle data: entity_id: light.guest_room_lights # Toggle sleep mode - conditions: "{{ action == 'double' }}" sequence: - service: switch.toggle + action: switch.toggle entity_id: switch.adaptive_lighting_sleep_mode_guest_room - alias: "Control switches: Guest Room Space heater" @@ -510,7 +510,7 @@ # Toggle - conditions: "{{ action == 'single' }}" sequence: - service: switch.toggle + action: switch.toggle data: entity_id: switch.space_heater @@ -526,7 +526,7 @@ # Toggle light - conditions: "{{ action == 'single' }}" sequence: - service: light.toggle + action: light.toggle data: entity_id: - light.baby_room_lights @@ -534,7 +534,7 @@ # Toggle sleep mode - conditions: "{{ action == 'double' }}" sequence: - service: switch.toggle + action: switch.toggle entity_id: switch.adaptive_lighting_sleep_mode_baby_room - alias: "Control switches: Mid Room Changing Table Light" @@ -549,7 +549,7 @@ # Toggle - conditions: "{{ action == 'single' }}" sequence: - service: light.toggle + action: light.toggle data: entity_id: light.mid_room brightness_pct: 100 @@ -558,13 +558,13 @@ # Change brightness - conditions: "{{ action == 'double' }}" sequence: - service: script.increase_brightness + action: script.increase_brightness data: group: light.mid_room # Next colors - conditions: "{{ action == 'hold' }}" sequence: - service: script.next_colors + action: script.next_colors data: input_select: input_select.last_script_living_room diff --git a/automations/cube.yaml b/automations/cube.yaml index 86931f35..49bb91b4 100644 --- a/automations/cube.yaml +++ b/automations/cube.yaml @@ -29,7 +29,7 @@ {% set last_is_zero = event[-1] == 0 %} {{ correct_start and (first_last_different or last_is_zero) }} sequence: - - service: input_select.select_option + - action: input_select.select_option entity_id: input_select.cube_mode data: option: > @@ -38,7 +38,7 @@ - condition: state entity_id: media_player.tv state: "on" - - service: notify.tv + - action: notify.tv data: message: > Cube set to {{ states("input_select.cube_mode") }} @@ -48,11 +48,11 @@ - "{{ event == 7007 }}" - "{{ is_state_attr('media_player.spotify', 'source', 'KEF LS50') }}" sequence: - - service: media_player.shuffle_set + - action: media_player.shuffle_set entity_id: media_player.spotify data: shuffle: true - - service: media_player.media_next_track + - action: media_player.media_next_track entity_id: media_player.spotify # Pause and play Spotify song by tapping cube on side 1 @@ -60,13 +60,13 @@ - "{{ event in (1001, 2002, 3003, 4004, 5005, 6006) }}" - "{{ is_state_attr('media_player.spotify', 'source', 'KEF LS50') }}" sequence: - service: media_player.media_play_pause + action: media_player.media_play_pause entity_id: media_player.spotify # Start music by throwing the cube - conditions: "{{ event == 7008 }}" sequence: - service: script.start_spotify_playlist_of_nearest_person + action: script.start_spotify_playlist_of_nearest_person data: source: KEF LS50 entity_id: media_player.kef_ls50 @@ -89,7 +89,7 @@ sequence: - variables: hue_sat: "{{ state_attr('light.sphere', 'hs_color') or [30, 56] }}" - - service: light.turn_on + - action: light.turn_on entity_id: light.living_room_lights data: hs_color: @@ -104,7 +104,7 @@ entity_id: input_select.cube_mode state: "Brightness" sequence: - service: light.turn_on + action: light.turn_on entity_id: light.living_room_lights data: brightness: > @@ -118,7 +118,7 @@ entity_id: input_select.cube_mode state: "Volume" sequence: - - service: media_player.volume_set + - action: media_player.volume_set entity_id: media_player.kef_ls50 data: # 90 deg is 10% volume_level: > @@ -128,7 +128,7 @@ - condition: state entity_id: media_player.tv state: "on" - - service: notify.tv + - action: notify.tv data: message: > Volume set to {{ state_attr("media_player.kef_ls50", "volume_level") }} diff --git a/automations/doorbell.yaml b/automations/doorbell.yaml index db8f2890..976f79a5 100755 --- a/automations/doorbell.yaml +++ b/automations/doorbell.yaml @@ -17,17 +17,17 @@ id: smart_switch_doorbell event: 1002 # Single click actions: - - service: light.turn_on + - action: light.turn_on data: flash: "short" entity_id: all - - service: notify.all_iphones + - action: notify.all_iphones data: title: "Doorbell" message: "Someone in front of the door!" - condition: state entity_id: media_player.tv state: "on" - - service: notify.tv + - action: notify.tv data: message: "Someone in front of the door!" diff --git a/automations/frontend.yaml b/automations/frontend.yaml index 98cd243b..f563ba7e 100755 --- a/automations/frontend.yaml +++ b/automations/frontend.yaml @@ -17,7 +17,7 @@ conditions: "{{ is_state('input_boolean.dark_mode', 'off') }}" actions: entity_id: input_boolean.dark_mode - service: input_boolean.turn_on + action: input_boolean.turn_on - alias: "Frontend: turn on light mode" triggers: @@ -28,7 +28,7 @@ conditions: "{{ is_state('input_boolean.dark_mode', 'on') }}" actions: entity_id: input_boolean.dark_mode - service: input_boolean.turn_off + action: input_boolean.turn_off - alias: "Frontend: change theme" triggers: @@ -41,7 +41,7 @@ - trigger: homeassistant event: start actions: - service: frontend.set_theme + action: frontend.set_theme data: name: > {% set which = "dark" if is_state("input_boolean.dark_mode", "on") else "light" -%} diff --git a/automations/leaving.yaml b/automations/leaving.yaml index 280f4c26..3b496adc 100644 --- a/automations/leaving.yaml +++ b/automations/leaving.yaml @@ -31,8 +31,8 @@ - input_boolean.guest_mode state: "off" actions: - - service: script.leaving - - service: notify.all_iphones + - action: script.leaving + - action: notify.all_iphones data: title: "Leaving" message: "Everything automatically turned off!" @@ -60,7 +60,7 @@ - condition: state entity_id: binary_sensor.no_one_home state: "on" - - service: notify.all_iphones + - action: notify.all_iphones data: message: "No one is home, turn off everything?" data: @@ -78,7 +78,7 @@ event_data: actions: TURN_OFF_EVERYTHING actions: - service: script.leaving + action: script.leaving - alias: "Leaving: downstairs Aqara Wireless Mini Switch" @@ -96,8 +96,8 @@ to: "off" timeout: "00:01:00" continue_on_timeout: false - - service: script.turn_off_everything - - service: notify.all_iphones + - action: script.turn_off_everything + - action: notify.all_iphones data: title: "Bye πŸ‘‹" message: "See you soon!" diff --git a/automations/light.yaml b/automations/light.yaml index 3aa09b57..ef2a65fe 100755 --- a/automations/light.yaml +++ b/automations/light.yaml @@ -33,7 +33,7 @@ entity_id: input_boolean.guest_mode state: "off" actions: - service: light.turn_on + action: light.turn_on entity_id: light.living_room_lights - alias: "Light: turn off living room" @@ -49,7 +49,7 @@ entity_id: input_boolean.guest_mode state: "off" actions: - service: light.turn_off + action: light.turn_off entity_id: light.living_room_lights - alias: "Light: turn on Chrismas tree" @@ -67,7 +67,7 @@ entity_id: binary_sensor.someone_in_the_house_in_last_hour state: "on" actions: - service: switch.turn_on + action: switch.turn_on entity_id: switch.christmas_tree - alias: "Light: turn off Chrismas tree" @@ -79,7 +79,7 @@ entity_id: binary_sensor.someone_in_the_house_in_last_hour to: "off" actions: - service: switch.turn_off + action: switch.turn_off entity_id: switch.christmas_tree @@ -104,7 +104,7 @@ entity_id: input_boolean.guest_mode state: "off" actions: - service: light.turn_{{ trigger.to_state.state }} + action: light.turn_{{ trigger.to_state.state }} data: entity_id: light.dinner_area @@ -120,7 +120,7 @@ entity_id: light.dinner_area to: "off" actions: - service: input_boolean.turn_off + action: input_boolean.turn_off entity_id: input_boolean.automatic_dinner_area_light - alias: "Light: reset automatic dinner area lights at 06:00" @@ -128,7 +128,7 @@ trigger: time at: "06:00:00" actions: - service: input_boolean.turn_on + action: input_boolean.turn_on entity_id: input_boolean.automatic_dinner_area_light - alias: "Light: turn on kitchen counter if sleep mode is off" @@ -143,7 +143,7 @@ - "off" - "half" actions: - service: light.turn_on + action: light.turn_on entity_id: light.kitchen_counter - alias: "Light: turn off kitchen counter" @@ -152,7 +152,7 @@ entity_id: binary_sensor.activity_in_kitchen to: "off" actions: - service: light.turn_off + action: light.turn_off entity_id: light.kitchen_counter - alias: "Light: reboot kitchen ceiling Shelly" @@ -160,7 +160,7 @@ trigger: time at: "05:00:00" actions: - service: shell_command.reboot_kitchen_ceiling + action: shell_command.reboot_kitchen_ceiling # ____ _ _ # | __ ) __ _| |_| |__ _ __ ___ ___ _ __ ___ @@ -176,7 +176,7 @@ to: "on" conditions: "{{ states('input_select.sleep_mode') != 'total' }}" actions: - service: light.turn_on + action: light.turn_on data: entity_id: light.bathroom_lights transition: 1 @@ -187,7 +187,7 @@ entity_id: binary_sensor.activity_in_bathroom to: "off" actions: - service: light.turn_off + action: light.turn_off data: entity_id: light.bathroom_lights transition: 1 @@ -224,7 +224,7 @@ repeat: count: "{{ off_lights | length }}" sequence: - service: script.turn_on_lights + action: script.turn_on_lights data: entity_id: "{{ off_lights[repeat.index - 1] }}" @@ -235,7 +235,7 @@ from: "on" to: "off" actions: - service: light.turn_off + action: light.turn_off data: entity_id: - light.stairs_lights @@ -272,10 +272,10 @@ repeat: count: "{{ off_lights | length }}" sequence: - service: script.turn_on_lights + action: script.turn_on_lights data: entity_id: "{{ off_lights[repeat.index - 1] }}" - - service: input_boolean.turn_on + - action: input_boolean.turn_on entity_id: input_boolean.bedroom_lights_automatically_turned_on - alias: "Light: automatically turn off the bedroom" @@ -296,7 +296,7 @@ entity_id: input_boolean.automatic_bedroom_lights state: "on" actions: - service: light.turn_off + action: light.turn_off entity_id: light.bedroom_lights data: transition: 10 @@ -324,7 +324,7 @@ entity_id: input_boolean.bedroom_lights_automatically_turned_on state: "on" actions: - service: input_boolean.turn_off + action: input_boolean.turn_off entity_id: input_boolean.bedroom_lights_automatically_turned_on - alias: "Light: turn on automatic_bedroom_lights switch" @@ -333,7 +333,7 @@ at: "12:00" actions: entity_id: input_boolean.automatic_bedroom_lights - service: input_boolean.turn_on + action: input_boolean.turn_on - alias: "Light: turn off bedroom after 2 hours of inactivity" triggers: @@ -344,7 +344,7 @@ for: "02:00:00" conditions: "{{ is_state('light.bedroom_lights', 'on') }}" actions: - service: light.turn_off + action: light.turn_off data: entity_id: light.bedroom_lights @@ -353,7 +353,7 @@ trigger: time at: "13:00:00" actions: - service: shell_command.reboot_bedroom_ceiling + action: shell_command.reboot_bedroom_ceiling - 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" @@ -362,7 +362,7 @@ entity_id: light.bedroom_lights to: 'off' actions: - service: input_select.select_option + action: input_select.select_option data: entity_id: input_select.last_script_bedroom option: 'script.white_lights_bedroom' @@ -393,7 +393,7 @@ to: "on" entity_id: binary_sensor.activity_outside_garage actions: - - service: light.turn_on + - action: light.turn_on data: entity_id: - light.utility_room @@ -401,12 +401,12 @@ # Only turn on these lights when it is (almost) dark - if: "{{ state_attr('sun.sun', 'elevation') < 6 }}" then: - - service: light.turn_on + - action: light.turn_on data: entity_id: - light.outside_front_door - light.garage_outside - - service: switch.turn_on + - action: switch.turn_on data: entity_id: switch.string_lights_outside @@ -424,16 +424,16 @@ actions: - if: "{{ is_state('binary_sensor.activity_in_utility_room', 'off') }}" then: - - service: light.turn_off + - action: light.turn_off entity_id: light.utility_room - if: "{{ is_state('binary_sensor.activity_outside_house', 'off') }}" then: - - service: light.turn_off + - action: light.turn_off data: entity_id: - light.outside_front_door - light.garage_outside - - service: switch.turn_off + - action: switch.turn_off data: entity_id: switch.string_lights_outside @@ -446,7 +446,7 @@ event: sunrise offset: "-02:00:00" actions: - service: light.turn_on + action: light.turn_on entity_id: light.front_house - alias: "Light: turn off the outside front light" @@ -457,7 +457,7 @@ event: sunrise offset: "+01:00:00" actions: - service: light.turn_off + action: light.turn_off entity_id: light.front_house # _ # __ _ _ _ ___ ___| |_ _ __ ___ ___ _ __ ___ @@ -476,7 +476,7 @@ entity_id: input_boolean.guest_mode state: "off" actions: - service: light.turn_{{ trigger.to_state.state }} + action: light.turn_{{ trigger.to_state.state }} data: entity_id: light.guest_room_lights transition: 1 @@ -493,10 +493,10 @@ trigger: state entity_id: binary_sensor.activity_in_baby_room actions: - - service: light.turn_{{ trigger.to_state.state }} + - action: light.turn_{{ trigger.to_state.state }} data: entity_id: light.baby_sphere - - service: light.turn_{{ trigger.to_state.state }} + - action: light.turn_{{ trigger.to_state.state }} data: entity_id: light.baby_room_lights transition: 1 @@ -519,7 +519,7 @@ entity_id: light.living_room_lights state: "on" actions: - service: light.turn_off + action: light.turn_off entity_id: light.living_room_lights - alias: "Light: turn off guest room (extra check)" @@ -535,7 +535,7 @@ entity_id: light.guest_room_lights state: "on" actions: - service: light.turn_off + action: light.turn_off entity_id: light.guest_room_lights - alias: "Light: turn off baby room (extra check)" @@ -556,7 +556,7 @@ entity_id: light.baby_room_lights state: "on" actions: - service: light.turn_off + action: light.turn_off entity_id: - light.baby_room_lights @@ -576,9 +576,9 @@ entity_id: input_boolean.bedroom_lights_automatically_turned_on state: "on" actions: - - service: light.turn_off + - action: light.turn_off entity_id: light.bedroom_lights - - service: light.turn_off + - action: light.turn_off entity_id: input_boolean.bedroom_lights_automatically_turned_on - alias: "Light: turn off utility room / garage (extra check)" @@ -608,7 +608,7 @@ entity_id: light.outside_front_door state: "on" actions: - service: light.turn_off + action: light.turn_off entity_id: - light.utility_room - light.garage_outside @@ -635,7 +635,7 @@ {% endif %} {% endfor %} {{ ns.lights }} - - service: input_select.set_options + - action: input_select.set_options target: entity_id: input_select.z2m_lights data: @@ -647,5 +647,5 @@ trigger: time_pattern minutes: "/5" actions: - service: script.sync_z2m_to_ha_lights + action: script.sync_z2m_to_ha_lights mode: single diff --git a/automations/lovelace.yaml b/automations/lovelace.yaml index d7ac7ed0..9a364bef 100755 --- a/automations/lovelace.yaml +++ b/automations/lovelace.yaml @@ -14,5 +14,5 @@ trigger: state entity_id: sensor.lovelace actions: - - service: shell_command.convert_lovelace - - service: shell_command.chores # to update the ASCII art + - action: shell_command.convert_lovelace + - action: shell_command.chores # to update the ASCII art diff --git a/automations/mailbox.yaml b/automations/mailbox.yaml index 20b0d751..d25e35a5 100644 --- a/automations/mailbox.yaml +++ b/automations/mailbox.yaml @@ -21,10 +21,10 @@ entity_id: input_boolean.mailbox_full state: "off" actions: - - service: notify.all_iphones + - action: notify.all_iphones data: title: "Mailbox" message: "Received mail in the mailbox!" - - service: input_boolean.turn_on + - action: input_boolean.turn_on data: entity_id: input_boolean.mailbox_full diff --git a/automations/media_player.yaml b/automations/media_player.yaml index 2e957e10..b9f23b4e 100644 --- a/automations/media_player.yaml +++ b/automations/media_player.yaml @@ -34,7 +34,7 @@ {{ not (is_state_attr('media_player.spotify', 'source', 'KEF LS50') and is_state('media_player.spotify', 'playing')) }} actions: - service: media_player.select_source + action: media_player.select_source entity_id: media_player.kef_ls50 data: source: Optical Input 1 @@ -49,13 +49,13 @@ entity_id: media_player.kef_ls50 state: "on" actions: - - service: homeassistant.update_entity + - action: homeassistant.update_entity entity_id: media_player.kef_ls50 - condition: template value_template: > {{ is_state_attr("media_player.kef_ls50", "source", "HDMI ARC") or is_state_attr("media_player.kef_ls50", "source", "Optical Input 1") }} - - service: media_player.turn_off + - action: media_player.turn_off entity_id: media_player.kef_ls50 - alias: "Media player: if speakers off and TV on, turn on the speaker on TV state change" @@ -75,9 +75,9 @@ or trigger.from_state.attributes["volume_level"] != trigger.to_state.attributes["volume_level"] or trigger.from_state.attributes["source"] != trigger.to_state.attributes["source"] }} actions: - - service: media_player.turn_on + - action: media_player.turn_on entity_id: media_player.kef_ls50 - - service: media_player.select_source + - action: media_player.select_source entity_id: media_player.kef_ls50 data: source: Optical Input 1 @@ -94,7 +94,7 @@ entity_id: media_player.tv state: "on" actions: - service: homeassistant.update_entity + action: homeassistant.update_entity entity_id: media_player.spotify - alias: "Media player: sync KEF LS50 and TV volume" @@ -113,7 +113,7 @@ actions: repeat: sequence: - - service: media_player.volume_set + - action: media_player.volume_set data: entity_id: > media_player.{{ "tv" if (trigger.entity_id == "media_player.kef_ls50") else "kef_ls50" }} @@ -133,9 +133,9 @@ to: "off" for: "02:00:00" actions: - - service: media_player.turn_off + - action: media_player.turn_off entity_id: media_player.living_room_xbox - - service: media_player.turn_off + - action: media_player.turn_off entity_id: media_player.tv - alias: "Media player: Turn On Living Room TV with WakeOnLan" @@ -143,6 +143,6 @@ trigger: webostv.turn_on entity_id: media_player.tv actions: - - service: wake_on_lan.send_magic_packet + - action: wake_on_lan.send_magic_packet data: mac: "!secret tv_mac_address" diff --git a/automations/music.yaml b/automations/music.yaml index 8ff16502..83813aab 100644 --- a/automations/music.yaml +++ b/automations/music.yaml @@ -16,9 +16,9 @@ from: "off" to: "on" actions: - - service: input_boolean.turn_off + - action: input_boolean.turn_off entity_id: input_boolean.start_the_music - - service: script.start_spotify_playlist_of_nearest_person + - action: script.start_spotify_playlist_of_nearest_person data: source: KEF LS50 entity_id: media_player.kef_ls50 @@ -43,13 +43,13 @@ entity_id: proximity.home below: 2 actions: - - service: media_player.turn_on + - action: media_player.turn_on entity_id: media_player.kef_ls50 - - service: media_player.select_source + - action: media_player.select_source entity_id: media_player.kef_ls50 data: source: Wifi - - service: media_player.select_source + - action: media_player.select_source entity_id: media_player.spotify data: source: KEF LS50 diff --git a/automations/notifications.yaml b/automations/notifications.yaml index 68cbe114..884e2982 100644 --- a/automations/notifications.yaml +++ b/automations/notifications.yaml @@ -15,7 +15,7 @@ entity_id: device_tracker.marcella_iphone to: rotterdam_centraal actions: - service: notify.iphone_bas + action: notify.iphone_bas data: title: "Arriving" message: "Marcella arrived at Rotterdam Centraal" @@ -30,15 +30,15 @@ entity_id: input_boolean.front_door_open_warning state: "on" actions: - - service: notify.mobile_app_basnijholt_iphone_13 + - action: notify.mobile_app_basnijholt_iphone_13 data: title: Security message: Front door opened! - - service: notify.iphone_bas + - action: notify.iphone_bas data: title: Security message: Front door opened! - - service: input_boolean.turn_off + - action: input_boolean.turn_off entity_id: input_boolean.front_door_open_warning - alias: "Notifications: Daily New Word Notification" @@ -46,7 +46,7 @@ - trigger: time at: "07:30:00" actions: - - service: notify.mobile_app_marcella_iphone_14_pro + - action: notify.mobile_app_marcella_iphone_14_pro data: title: "Daily new word" message: > @@ -98,6 +98,6 @@ timeout: "01:00:00" continue_on_timeout: false - - service: notify.mobile_app_marcella_iphone_14_pro + - action: notify.mobile_app_marcella_iphone_14_pro data: message: "We all love you! ❀️😘πŸ₯°πŸ’–πŸ’•πŸŒ·πŸŒΌπŸŒˆβœ¨πŸŽ‰πŸ€" diff --git a/automations/plant.yaml b/automations/plant.yaml index fa1ba824..c70a00de 100755 --- a/automations/plant.yaml +++ b/automations/plant.yaml @@ -20,7 +20,7 @@ entity_id: plant.calathea state: "problem" actions: - service: notify.all_iphones + action: notify.all_iphones data: title: "Plant in trouble! ⚠️☒️☠️" message: > @@ -38,7 +38,7 @@ entity_id: plant.monstera state: "problem" actions: - service: notify.all_iphones + action: notify.all_iphones data: title: "Plant in trouble! ⚠️☒️☠️" message: > @@ -56,7 +56,7 @@ entity_id: plant.peace_lily state: "problem" actions: - service: notify.all_iphones + action: notify.all_iphones data: title: "Plant in trouble! ⚠️☒️☠️" message: > diff --git a/automations/security.yaml b/automations/security.yaml index 100571b8..39533051 100644 --- a/automations/security.yaml +++ b/automations/security.yaml @@ -22,7 +22,7 @@ entity_id: vacuum.valetudo_vacuum state: "docked" actions: - - service: notify.all_iphones + - action: notify.all_iphones data: message: "Security: motion is detected, but we are not home." data: @@ -39,7 +39,7 @@ actions: SOUND_ALARM timeout: "01:00:00" continue_on_timeout: false - - service: light.turn_on + - action: light.turn_on entity_id: all data: flash: long @@ -53,7 +53,7 @@ to: "on" for: "00:05:00" actions: - service: notify.all_iphones + action: notify.all_iphones data: title: "Security" message: "The front door has been open for more than 5 minutes." @@ -66,7 +66,7 @@ to: "on" for: "00:05:00" actions: - service: notify.all_iphones + action: notify.all_iphones data: title: "Security" message: "The utility room door has been open for more than 5 minutes." @@ -86,7 +86,7 @@ entity_id: sensor.power_consumption above: 0.7 actions: - service: notify.all_iphones + action: notify.all_iphones data: title: "Security" message: > @@ -103,21 +103,21 @@ entity_id: input_boolean.bathroom_door_open_warning state: "on" actions: - - service: notify.bas + - action: notify.bas data: title: Security message: Office door opened! - - service: notify.iphone_bas + - action: notify.iphone_bas data: title: Security message: Office door opened! - - service: light.turn_on + - action: light.turn_on data: entity_id: - light.philips_go - light.desk_led flash: short - - service: input_boolean.turn_off + - action: input_boolean.turn_off entity_id: input_boolean.bathroom_door_open_warning - alias: "Security: activity in master bedroom" @@ -130,19 +130,19 @@ entity_id: input_boolean.bedroom_activity_warning state: "on" actions: - - service: notify.bas + - action: notify.bas data: title: Security message: Activity bedroom! - - service: notify.iphone_bas + - action: notify.iphone_bas data: title: Security message: Activity bedroom! - - service: light.turn_on + - action: light.turn_on data: entity_id: light.desk_led flash: short - - service: input_boolean.turn_off + - action: input_boolean.turn_off entity_id: input_boolean.bedroom_activity_warning - alias: "Security: Door to outside open" @@ -161,7 +161,7 @@ state: 'on' sequence: # First turning off such that the lights stay on - - service: light.turn_off + - action: light.turn_off data: entity_id: - light.garage_outside @@ -170,7 +170,7 @@ - light.utility_room - delay: seconds: 1 - - service: light.turn_on + - action: light.turn_on data: entity_id: - light.garage_outside diff --git a/automations/sleep_mode.yaml b/automations/sleep_mode.yaml index 72227cc9..0192899c 100755 --- a/automations/sleep_mode.yaml +++ b/automations/sleep_mode.yaml @@ -23,7 +23,7 @@ state: "off" actions: entity_id: input_select.sleep_mode - service: input_select.select_option + action: input_select.select_option data: option: "half" @@ -33,7 +33,7 @@ entity_id: input_select.sleep_mode from: "off" actions: - service: input_boolean.turn_off + action: input_boolean.turn_off entity_id: input_boolean.automatic_bedroom_lights - alias: "Night mode: set low temperature when sleep mode turns on" @@ -42,7 +42,7 @@ entity_id: input_select.sleep_mode from: "off" actions: - service: script.set_low_temperature + action: script.set_low_temperature - alias: "Night mode: go from half to total sleeping mode" description: > @@ -58,11 +58,11 @@ entity_id: input_select.sleep_mode state: half actions: - - service: input_select.select_option + - action: input_select.select_option entity_id: input_select.sleep_mode data: option: "total" - - service: notify.iphone_bas + - action: notify.iphone_bas data: title: "Night mode" message: "Automatically switched from 'half' to 'total' sleeping mode! πŸ’€πŸ›Œ" @@ -88,9 +88,9 @@ - condition: state # make sure sleep mode is still on entity_id: input_select.sleep_mode state: "total" - - service: switch.turn_on + - action: switch.turn_on entity_id: switch.adaptive_lighting_sleep_mode_living_room - conditions: "{{ is_state('binary_sensor.activity_in_living_room', 'off') }}" sequence: - service: switch.turn_on + action: switch.turn_on entity_id: switch.adaptive_lighting_sleep_mode_living_room diff --git a/automations/system.yaml b/automations/system.yaml index 92cc6d71..65601928 100644 --- a/automations/system.yaml +++ b/automations/system.yaml @@ -16,7 +16,7 @@ for: hours: 4 actions: - service: notify.iphone_bas + action: notify.iphone_bas data: title: "System" message: "CPU usage has been above 70% for 4 hours! ⚠️πŸ–₯" @@ -29,7 +29,7 @@ for: hours: 4 actions: - service: notify.iphone_bas + action: notify.iphone_bas data: title: "System" message: "CPU temperature has been above 70 Β°C for 4 hours! ⚠️" @@ -40,7 +40,7 @@ entity_id: sensor.temperature_xbox above: 50 actions: - - service: notify.iphone_bas + - action: notify.iphone_bas data: title: "System" message: > @@ -48,7 +48,7 @@ - condition: state entity_id: media_player.tv state: "on" - - service: notify.tv + - action: notify.tv data: message: > Temperature in the Xbox cabinet is {{ states("sensor.temperature_xbox") }} Β°C! ⚠️ @@ -59,7 +59,7 @@ trigger: time_pattern # XXX: trigger on IP change minutes: "/15" actions: - service: script.update_dns + action: script.update_dns - alias: "System: run chores" description: Run shell and Python scripts in utils folder. @@ -67,7 +67,7 @@ trigger: time_pattern minutes: "/15" actions: - service: shell_command.chores + action: shell_command.chores - alias: "System: MQTT sensors are not updating" description: Check whether we are receiving messages over MQTT from my other HA instance. @@ -76,7 +76,7 @@ minutes: "/5" conditions: "{{ (as_timestamp(now()) - as_timestamp(states.sensor.power_consumption.last_changed)) > 20 * 60 }}" actions: - - service: notify.iphone_bas + - action: notify.iphone_bas data: title: "System" message: "Not receiving MQTT updates, maybe reboot the other HA instance! ⚠️" @@ -109,7 +109,7 @@ value_template: "{{ 'iphone' not in current and 'ipad' not in current }}" - condition: template value_template: "{{ 0 < (states(current) | float) < (min_battery_level | float ) }}" - - service: "{{ notify_service }}" + - action: "{{ notify_service }}" data: title: "System" message: "Battery level low of {{ current }}: {{ states(current) }}%! ⚠️" diff --git a/automations/test.yaml b/automations/test.yaml index 089fc528..23f4de2c 100644 --- a/automations/test.yaml +++ b/automations/test.yaml @@ -15,13 +15,13 @@ - trigger: event event_type: call_service event_data: - service: turn_on + action: turn_on domain: light - trigger: event event_type: state_changed conditions: "{{ trigger.event.context.id.startswith('adapt_lgt') }}" actions: - service: system_log.write + action: system_log.write data: message: "{{ trigger.event.data.entity_id }} is changed by AL: {{ trigger.event.data }}" level: debug @@ -34,7 +34,7 @@ actions: - variables: t_start: "{{ as_timestamp(now()) }}" - - service: system_log.write + - action: system_log.write data: message: "took {{ as_timestamp(now()) - t_start | int }}" level: debug @@ -53,11 +53,11 @@ sequence: - variables: light: "{{ lights.split(',')[repeat.index - 1] }}" - - service: light.turn_on + - action: light.turn_on data: entity_id: "{{ light }}" - delay: "00:00:01" - - service: light.turn_off + - action: light.turn_off data: entity_id: "{{ light }}" @@ -68,16 +68,16 @@ - trigger: event event_type: call_service event_data: - service: turn_on + action: turn_on domain: light - trigger: event event_type: call_service event_data: - service: turn_off + action: turn_off domain: light actions: - delay: "00:00:01" - - service: homeassistant.update_entity + - action: homeassistant.update_entity data: entity_id: "{{ trigger.event.entity_id }}" @@ -88,14 +88,14 @@ event: start actions: - condition: "{{ is_state('automation.test_light_baby_room_loop', 'on') }}" - - service: light.turn_on + - action: light.turn_on target: entity_id: light.baby_room - delay: '00:00:10' - - service: light.turn_off + - action: light.turn_off target: entity_id: light.baby_room - delay: '00:00:10' - - service: automation.trigger + - action: automation.trigger target: entity_id: automation.test_light_baby_room_loop diff --git a/automations/utilities.yaml b/automations/utilities.yaml index e5d274ef..cd077530 100755 --- a/automations/utilities.yaml +++ b/automations/utilities.yaml @@ -21,7 +21,7 @@ name: "{{ trigger.entity_id.split('.', 1)[1] }}" conditions: "{{ (to_state == 'on' and from_state == 'off') or (to_state == 'off' and from_state == 'on') }}" actions: - service: input_datetime.set_datetime + action: input_datetime.set_datetime data: entity_id: "input_datetime.{{ name }}_{{ to_state }}" timestamp: "{{ now().timestamp() }}" @@ -33,7 +33,7 @@ from: "off" to: "on" actions: - service: script.utility_notification + action: script.utility_notification data: name: "washing_machine" emojis: "πŸ‘šπŸ‘•" @@ -45,7 +45,7 @@ from: "off" to: "on" actions: - service: script.utility_notification + action: script.utility_notification data: name: "dishwasher" emojis: "🍽🍳" diff --git a/automations/vacation_mode.yaml b/automations/vacation_mode.yaml index 2c3a4dcb..c3d6df8d 100755 --- a/automations/vacation_mode.yaml +++ b/automations/vacation_mode.yaml @@ -21,9 +21,9 @@ entity_id: input_boolean.guest_mode state: "off" actions: - - service: input_boolean.turn_on + - action: input_boolean.turn_on entity_id: input_boolean.vacation_mode - - service: notify.all_iphones + - action: notify.all_iphones data: title: "Vacation mode" message: "No one at home for 24 hours, switching on vacation mode." @@ -43,9 +43,9 @@ entity_id: input_boolean.guest_mode state: "off" actions: - - service: input_boolean.turn_off + - action: input_boolean.turn_off entity_id: input_boolean.vacation_mode - - service: notify.all_iphones + - action: notify.all_iphones data: title: "Vacation mode" message: "Welcome back! Switching off the vacation mode." diff --git a/automations/vacuum.yaml b/automations/vacuum.yaml index 5f584b28..24ae7210 100755 --- a/automations/vacuum.yaml +++ b/automations/vacuum.yaml @@ -15,11 +15,11 @@ from: docked to: cleaning actions: - - service: notify.all_iphones + - action: notify.all_iphones data: title: "Robot" message: "Robot started to clean!" - - service: input_datetime.set_datetime + - action: input_datetime.set_datetime data: entity_id: input_datetime.vacuum_on datetime: "{{ now().isoformat() }}" @@ -31,13 +31,13 @@ from: returning to: docked actions: - - service: input_boolean.turn_on + - action: input_boolean.turn_on entity_id: input_boolean.cleaned_today - - service: input_datetime.set_datetime + - action: input_datetime.set_datetime data: entity_id: input_datetime.vacuum_off datetime: "{{ now().isoformat() }}" - - service: notify.all_iphones + - action: notify.all_iphones data: title: "Robot" message: "Cleanup successful after {{ (states('sensor.robot_vacuum_last_clean_duration') | int / 60) | round }} minutes" @@ -51,7 +51,7 @@ entity_id: binary_sensor.vacuum_day state: "on" actions: - service: notify.all_iphones + action: notify.all_iphones data: title: "Robot" message: "Vacuum will go today, make sure to leave the doors open and leave nothing on the floor!" @@ -84,7 +84,7 @@ entity_id: input_boolean.vacation_mode state: "off" actions: - service: vacuum.start + action: vacuum.start entity_id: vacuum.valetudo_vacuum - alias: "Vacuum: reset cleaned today" @@ -93,7 +93,7 @@ trigger: time at: "00:00:00" actions: - service: input_boolean.turn_off + action: input_boolean.turn_off entity_id: input_boolean.cleaned_today - alias: "Vacuum: reset to standard mode" @@ -102,7 +102,7 @@ entity_id: vacuum.living_room to: docked actions: - service: vacuum.set_fan_speed + action: vacuum.set_fan_speed entity_id: vacuum.valetudo_vacuum data: fan_speed: Standard diff --git a/automations/work.yaml b/automations/work.yaml index 9dc96c72..ae7da72c 100755 --- a/automations/work.yaml +++ b/automations/work.yaml @@ -22,11 +22,11 @@ entity_id: input_boolean.work_hour_notification_sent state: "off" actions: - - service: notify.iphone_bas + - action: notify.iphone_bas data: title: "Work" message: "You have worked 8 hours today, very good! Go home πŸŽ‰" - - service: input_boolean.turn_on + - action: input_boolean.turn_on entity_id: input_boolean.work_hour_notification_sent - alias: "Work: reset input_boolean at midnight" @@ -38,7 +38,7 @@ entity_id: input_boolean.work_hour_notification_sent state: "on" actions: - service: input_boolean.turn_off + action: input_boolean.turn_off entity_id: input_boolean.work_hour_notification_sent - alias: "Work: Bas left work notification for Marcella" @@ -51,8 +51,8 @@ after: "15:00:00" before: "22:00:00" actions: - # service: notify.mobile_app_marcella_iphone - service: notify.all_iphones + # action: notify.mobile_app_marcella_iphone + action: notify.all_iphones data: title: "Work" message: "Bas has left work! β™₯οΈπŸŽ‰"