From 2064a5b1dcde924beabd4137bd332e0e394a3097 Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Thu, 10 Oct 2024 02:52:48 +0200 Subject: [PATCH] Replaced platform with trigger and service with action --- automations/day.yaml | 2 +- automations/doors.yaml | 4 +-- automations/energy.yaml | 6 ++--- automations/home_assistant.yaml | 28 ++++++++++----------- automations/media_player.yaml | 6 ++--- automations/nfc.yaml | 10 ++++---- automations/night.yaml | 6 ++--- automations/speech.yaml | 10 ++++---- automations/startup.yaml | 8 +++--- automations/test_mode.yaml | 12 ++++----- automations/themes.yaml | 10 ++++---- automations/zigbee_buttons.yaml.disabled | 16 ++++++------ packages/BTicino/300eos.yaml | 12 ++++----- packages/BTicino/bticino_operations.yaml | 10 ++++---- packages/alarm/alarm_engine.yaml | 4 +-- packages/alarm/alarm_notifications.yaml | 20 +++++++-------- packages/alarm/alarm_triggers.yaml | 12 ++++----- packages/away_mode/away_mode_climate.yaml | 8 +++--- packages/away_mode/away_mode_covers.yaml | 6 ++--- packages/away_mode/away_mode_engine.yaml | 14 +++++------ packages/central_heating.yaml | 12 ++++----- packages/errors.yaml | 12 ++++----- packages/fritz.yaml | 12 ++++----- packages/guard_mode.yaml | 12 ++++----- packages/mercedes/mercedes_lock.yaml | 8 +++--- packages/netatmo/netatmo_away.yaml | 12 ++++----- packages/netatmo/netatmo_boost.yaml | 16 ++++++------ packages/qnap.yaml | 8 +++--- packages/shelly/shelly_operations.yaml | 14 +++++------ packages/update/update_engine.yaml | 16 ++++++------ packages/zigbee2mqtt.yaml | 26 ++++++++++---------- scripts/audio.yaml | 30 +++++++++++------------ scripts/home_assistant.yaml | 14 +++++------ scripts/media_player.yaml | 8 +++--- scripts/notify.yaml | 20 +++++++-------- scripts/speech_engine.yaml | 6 ++--- 36 files changed, 215 insertions(+), 215 deletions(-) diff --git a/automations/day.yaml b/automations/day.yaml index d487fb7d..64030fc6 100644 --- a/automations/day.yaml +++ b/automations/day.yaml @@ -8,7 +8,7 @@ #initial_state: 'on' trigger: - - platform: time + - trigger: time at: '07:00:00' condition: diff --git a/automations/doors.yaml b/automations/doors.yaml index 221d447d..402ebda6 100644 --- a/automations/doors.yaml +++ b/automations/doors.yaml @@ -13,7 +13,7 @@ mode: single trigger: - - platform: state + - trigger: state entity_id: binary_sensor.porta_casa_contact to: 'on' @@ -30,7 +30,7 @@ action: - delay: 00:00:01 - - service: light.turn_on + - action: light.turn_on entity_id: light.luce_corridoio #entity:id: light.luce_zona_giorno - delay: '00:05:00' diff --git a/automations/energy.yaml b/automations/energy.yaml index 84d9aac0..ba30c2c3 100644 --- a/automations/energy.yaml +++ b/automations/energy.yaml @@ -6,15 +6,15 @@ id: "allarmi_consumo_energetico_elevato" trigger: - - platform: numeric_state + - trigger: numeric_state entity_id: sensor.shelly_em_channel_1_power above: 3200 - - platform: numeric_state + - trigger: numeric_state entity_id: sensor.shelly_em_old_channel_1_power above: 3200 action: - service: script.notify_all + action: script.notify_all data_template: title: "Home Assistant - Consumo Energetico Elevato" message: "Consumo energetico elevato ({{ states.sensor.shelly_em_channel_1_power.state }})." diff --git a/automations/home_assistant.yaml b/automations/home_assistant.yaml index ce013fb6..d5fc1987 100644 --- a/automations/home_assistant.yaml +++ b/automations/home_assistant.yaml @@ -6,14 +6,14 @@ id: "home_assistant_cambio_modalita_on" trigger: - platform: state + trigger: state entity_id: input_boolean.home_mode_day, input_boolean.home_mode_night, input_boolean.home_mode_away to: 'on' action: - - service: input_boolean.turn_off + - action: input_boolean.turn_off data_template: entity_id: > {% set booleans = [ 'input_boolean.home_mode_day', 'input_boolean.home_mode_night', 'input_boolean.home_mode_away' ] | reject('equalto', trigger.entity_id) %} @@ -22,7 +22,7 @@ - alias: "Home Assistant: Cambio modalità Off" trigger: - platform: state + trigger: state entity_id: input_boolean.home_mode_day, input_boolean.home_mode_night, input_boolean.home_mode_away @@ -42,7 +42,7 @@ state: 'off' action: - - service: input_boolean.turn_on + - action: input_boolean.turn_on data_template: entity_id: > {% if now().strftime('%H')|int >= 8 and now().strftime('%H')|int < 23 %} @@ -59,11 +59,11 @@ id: "home_assistant_modalita_giorno_notte" trigger: - - platform: time + - trigger: time at: '08:00:00' - - platform: time + - trigger: time at: '23:00:00' - - platform: homeassistant + - trigger: homeassistant event: start condition: @@ -72,7 +72,7 @@ state: 'off' action: - - service: input_boolean.turn_on + - action: input_boolean.turn_on data_template: entity_id: >- {% if now().strftime('%H')|int >= 8 and now().strftime('%H')|int < 23 %} @@ -81,7 +81,7 @@ input_boolean.home_mode_night {% endif %} - - service: script.volume_manager + - action: script.volume_manager ###################################################################### # Home Assistant: Management of Speech Notifications @@ -91,15 +91,15 @@ id: "home_assistant_gestione_notifiche_vocali" trigger: - - platform: state + - trigger: state entity_id: input_boolean.home_mode_night to: 'on' - - platform: state + - trigger: state entity_id: input_boolean.home_mode_night to: 'off' action: - - service: >- + - action: >- {% if trigger.to_state.state == 'on' %} input_boolean.turn_off {% else %} @@ -117,7 +117,7 @@ id: "home_assistant_pulitura_settimanale_log" trigger: - - platform: time + - trigger: time at: '00:00:00' condition: @@ -125,4 +125,4 @@ weekday: [mon] action: - - service: script.homeassistant_clearlog + - action: script.homeassistant_clearlog diff --git a/automations/media_player.yaml b/automations/media_player.yaml index 0e0dede7..550ddd86 100644 --- a/automations/media_player.yaml +++ b/automations/media_player.yaml @@ -7,15 +7,15 @@ id: "google_home_pronuncia_testo" trigger: - - platform: state + - trigger: state entity_id: input_text.google_home_speak - - platform: state + - trigger: state entity_id: input_text.google_anna_speak condition: [] action: - - service: script.speech_engine + - action: script.speech_engine data_template: media_player: > {% if trigger.entity_id == 'input_text.google_anna_speak' %} diff --git a/automations/nfc.yaml b/automations/nfc.yaml index 12fbfbfc..1f7ddad4 100644 --- a/automations/nfc.yaml +++ b/automations/nfc.yaml @@ -18,7 +18,7 @@ name: "NFC_1" trigger: - platform: event + trigger: event event_type: tag_scanned action: @@ -31,7 +31,7 @@ - "{{ detected_tag in allowed_tags }}" - "{{ detected_device in allowed_devices }}" sequence: - - service: script.notify_text + - action: script.notify_text data_template: title: "Home Assistant - Lettura NFC" message: "Letto tag NFC {{ allowed_tags[detected_tag].name }} dal dispositivo {{ allowed_devices[detected_device].name }}." @@ -41,7 +41,7 @@ - "{{ detected_tag in allowed_tags }}" - "{{ detected_device not in allowed_devices }}" sequence: - - service: script.notify_text + - action: script.notify_text data_template: title: "Home Assistant - Lettura NFC" message: "Letto tag NFC {{ allowed_tags[detected_tag].name }} da dispositivo non valido ({{ detected_device }})." @@ -51,14 +51,14 @@ - "{{ detected_tag not in allowed_tags }}" - "{{ detected_device in allowed_devices }}" sequence: - - service: script.notify_text + - action: script.notify_text data_template: title: "Home Assistant - Lettura NFC" message: "Letto tag NFC non riconosciuto ({{ detected_tag }}) dal dispositivo {{ allowed_devices[detected_device].name }}." enable_telegram: false default: - - service: script.notify_text + - action: script.notify_text data_template: title: "Home Assistant - Lettura NFC" message: "Letto tag NFC non valido ({{ detected_tag }}) da dispositivo non valido ({{ detected_device }})." diff --git a/automations/night.yaml b/automations/night.yaml index a2847780..1e3f05ea 100644 --- a/automations/night.yaml +++ b/automations/night.yaml @@ -8,19 +8,19 @@ initial_state: false trigger: - - platform: state + - trigger: state entity_id: input_boolean.home_mode_night to: 'on' condition: [] action: - - service: cover.set_cover_position + - action: cover.set_cover_position data: entity_id: cover.tapparella_globale position: 15 - - service: cover.set_cover_position + - action: cover.set_cover_position data: entity_id: cover.tapparella_camera position: 0 diff --git a/automations/speech.yaml b/automations/speech.yaml index 9a82c356..dad8b2ca 100644 --- a/automations/speech.yaml +++ b/automations/speech.yaml @@ -10,7 +10,7 @@ mode: parallel trigger: - - platform: zone + - trigger: zone entity_id: - person.giorgio - person.laura @@ -22,7 +22,7 @@ action: - wait_for_trigger: - - platform: state + - trigger: state entity_id: binary_sensor.porta_casa_contact to: "on" timeout: @@ -31,7 +31,7 @@ - delay: 00:00:05 - - service: script.speech_engine + - action: script.speech_engine data_template: message: !include ../template_messages/welcome.yaml enable_greeting: 0 @@ -47,13 +47,13 @@ initial_state: false trigger: - - platform: time + - trigger: time at: '12:00:00' condition: [] action: - - service: script.speech_engine + - action: script.speech_engine data_template: message: >- {% set hour = now().strftime('%H') %} diff --git a/automations/startup.yaml b/automations/startup.yaml index 0d5def8e..7b7c75a4 100644 --- a/automations/startup.yaml +++ b/automations/startup.yaml @@ -6,7 +6,7 @@ id: "home_assistant_startup_restart_on_error" trigger: - - platform: homeassistant + - trigger: homeassistant event: start action: @@ -14,7 +14,7 @@ - condition: state entity_id: persistent_notification.invalid_config state: 'notifying' - - service: script.homeassistant_restart + - action: script.homeassistant_restart ###################################################################### # Startup Automation: Google Sync @@ -24,8 +24,8 @@ id: "home_assistant_startup_google_sync" trigger: - - platform: homeassistant + - trigger: homeassistant event: start action: - - service: script.homeassistant_google_home_sync + - action: script.homeassistant_google_home_sync diff --git a/automations/test_mode.yaml b/automations/test_mode.yaml index 71efd9c0..c6a4afbd 100644 --- a/automations/test_mode.yaml +++ b/automations/test_mode.yaml @@ -6,16 +6,16 @@ id: "home_assistant_modalita_test_azione_on" trigger: - - platform: state + - trigger: state entity_id: input_boolean.test_mode to: 'on' action: - - service: automation.turn_off + - action: automation.turn_off entity_id: automation.home_assistant_startup_restart_on_error - - service: automation.turn_off + - action: automation.turn_off entity_id: automation.home_assistant_startup_google_sync ###################################################################### @@ -26,13 +26,13 @@ id: "home_assistant_modalita_test_azione_off" trigger: - - platform: state + - trigger: state entity_id: input_boolean.test_mode to: 'off' action: - - service: automation.turn_on + - action: automation.turn_on entity_id: automation.home_assistant_startup_restart_on_error - - service: automation.turn_on + - action: automation.turn_on entity_id: automation.home_assistant_startup_google_sync diff --git a/automations/themes.yaml b/automations/themes.yaml index 3d8fd536..175462d4 100644 --- a/automations/themes.yaml +++ b/automations/themes.yaml @@ -6,22 +6,22 @@ id: "home_assistant_temi_modalita_giorno_notte" trigger: - - platform: homeassistant + - trigger: homeassistant event: start - - platform: state + - trigger: state entity_id: input_boolean.home_mode_day to: 'on' - - platform: state + - trigger: state entity_id: input_boolean.home_mode_night to: 'on' - - platform: state + - trigger: state entity_id: input_boolean.home_mode_away to: 'on' action: - delay: milliseconds: 50 - - service: frontend.set_theme + - action: frontend.set_theme data_template: name: >- {% if is_state('sensor.home_mode', 'giorno') %} diff --git a/automations/zigbee_buttons.yaml.disabled b/automations/zigbee_buttons.yaml.disabled index fc3c7ba3..4a354680 100644 --- a/automations/zigbee_buttons.yaml.disabled +++ b/automations/zigbee_buttons.yaml.disabled @@ -6,14 +6,14 @@ trigger: - domain: mqtt - platform: device + trigger: device device_id: 438f9a7754246f4c5b02f7560706eb59 discovery_id: 0x00158d0004081917 single type: action subtype: single action: - - service: light.toggle + - action: light.toggle entity_id: light.luce_corridoio ###################################################################### @@ -24,14 +24,14 @@ trigger: - domain: mqtt - platform: device + trigger: device device_id: 438f9a7754246f4c5b02f7560706eb59 discovery_id: 0x00158d0004081917 action_double type: action subtype: action_double action: - - service: light.toggle + - action: light.toggle entity_id: light.luce_sala ###################################################################### @@ -42,14 +42,14 @@ trigger: - domain: mqtt - platform: device + trigger: device device_id: 438f9a7754246f4c5b02f7560706eb59 discovery_id: 0x00158d0004081917 action_triple type: action subtype: action_triple action: - - service: light.toggle + - action: light.toggle entity_id: light.luce_studio ###################################################################### @@ -60,12 +60,12 @@ trigger: - domain: mqtt - platform: device + trigger: device device_id: 438f9a7754246f4c5b02f7560706eb59 discovery_id: 0x00158d0004081917 hold type: action subtype: hold action: - - service: light.toggle + - action: light.toggle entity_id: light.luci_casa diff --git a/packages/BTicino/300eos.yaml b/packages/BTicino/300eos.yaml index 8792e4d5..6308b333 100644 --- a/packages/BTicino/300eos.yaml +++ b/packages/BTicino/300eos.yaml @@ -44,15 +44,15 @@ switch: value_template: "{{ is_state('input_boolean.portone', 'on') }}" icon_template: mdi:door turn_on: - - service: input_boolean.turn_on + - action: input_boolean.turn_on target: entity_id: input_boolean.portone - delay: 1 - - service: input_boolean.turn_off + - action: input_boolean.turn_off target: entity_id: input_boolean.portone turn_off: - service: input_boolean.turn_off + action: input_boolean.turn_off target: entity_id: input_boolean.portone @@ -65,15 +65,15 @@ switch: # name: Portone # value_template: "{{ is_state('input_boolean.portone', 'off') }}" # lock: -# service: input_boolean.turn_off +# action: input_boolean.turn_off # target: # entity_id: input_boolean.portone # unlock: -# - service: input_boolean.turn_on +# - action: input_boolean.turn_on # target: # entity_id: input_boolean.portone # - delay: 1 -# - service: input_boolean.turn_off +# - action: input_boolean.turn_off # target: # entity_id: input_boolean.portone diff --git a/packages/BTicino/bticino_operations.yaml b/packages/BTicino/bticino_operations.yaml index b38b6268..3a6aab88 100644 --- a/packages/BTicino/bticino_operations.yaml +++ b/packages/BTicino/bticino_operations.yaml @@ -17,7 +17,7 @@ script: | list }} sequence: - - service: update.install + - action: update.install target: entity_id: '{{ pending_update_list }}' @@ -38,10 +38,10 @@ automation: }} trigger: - - platform: state + - trigger: state entity_id: group.bticino to: 'on' - - platform: homeassistant + - trigger: homeassistant event: start condition: @@ -51,7 +51,7 @@ automation: action: - delay: '00:00:10' - - service: script.notify_text + - action: script.notify_text data_template: title: "BTicino - Aggiornamento" message: > @@ -61,5 +61,5 @@ automation: {%- endfor -%} notification_id: "update" enable_persistent: true - - service: input_boolean.turn_on + - action: input_boolean.turn_on entity_id: input_boolean.update_bticino diff --git a/packages/alarm/alarm_engine.yaml b/packages/alarm/alarm_engine.yaml index b38721f7..6b91ac82 100644 --- a/packages/alarm/alarm_engine.yaml +++ b/packages/alarm/alarm_engine.yaml @@ -32,9 +32,9 @@ automation: id: "allarmi_riconoscimento_allarmi" trigger: - platform: state + trigger: state entity_id: group.alarms to: 'off' action: - - service: script.stop_alarm + - action: script.stop_alarm diff --git a/packages/alarm/alarm_notifications.yaml b/packages/alarm/alarm_notifications.yaml index e409d672..fd989387 100644 --- a/packages/alarm/alarm_notifications.yaml +++ b/packages/alarm/alarm_notifications.yaml @@ -13,12 +13,12 @@ script: start_alarm_sound: alias: "Allarmi: Avvia Suono" sequence: - - service: media_player.volume_set + - action: media_player.volume_set data_template: entity_id: 'media_player.google_home' volume_level: 0.4 - - service: media_player.play_media + - action: media_player.play_media data_template: entity_id: 'media_player.google_home' media_content_type: 'audio/mp4' @@ -34,11 +34,11 @@ script: stop_alarm_sound: alias: "Allarmi: Interrompi Suono" sequence: - - service: media_player.media_stop + - action: media_player.media_stop data_template: entity_id: 'media_player.google_home' - - service: script.volume_manager + - action: script.volume_manager data_template: media_player: 'media_player.google_home' @@ -58,7 +58,7 @@ script: start_alarm: alias: "Allarmi: Attiva Allarme" sequence: - - service: input_boolean.turn_on + - action: input_boolean.turn_on data_template: entity_id: > {# Check Null Input #} @@ -68,7 +68,7 @@ script: {{ entity_id }} # LEVEL 1 - - service: script.notify_all + - action: script.notify_all data_template: volume_level: 0.4 language: 'it' @@ -108,7 +108,7 @@ script: false {% endif %} - - service: script.start_alarm_sound + - action: script.start_alarm_sound ###################################################################### # Alarm: Stop Alarm @@ -120,11 +120,11 @@ script: stop_alarm: alias: "Allarmi: Disattiva Allarme" sequence: - - service: homeassistant.turn_off + - action: homeassistant.turn_off entity_id: group.alarms - - service: script.stop_alarm_sound + - action: script.stop_alarm_sound - - service: persistent_notification.dismiss + - action: persistent_notification.dismiss data_template: notification_id: "alarm" diff --git a/packages/alarm/alarm_triggers.yaml b/packages/alarm/alarm_triggers.yaml index c273afe9..a73a225f 100644 --- a/packages/alarm/alarm_triggers.yaml +++ b/packages/alarm/alarm_triggers.yaml @@ -13,7 +13,7 @@ automation: id: "allarmi_porta_casa" trigger: - - platform: state + - trigger: state entity_id: group.doors to: 'on' @@ -23,7 +23,7 @@ automation: state: 'on' action: - - service: script.start_alarm + - action: script.start_alarm data_template: entity_id: input_boolean.door_alarm message: "È stata rilevata una presenza non autorizzata." @@ -39,12 +39,12 @@ automation: id: "allarmi_perdita_acqua" trigger: - - platform: state + - trigger: state entity_id: group.water to: 'on' action: - - service: script.start_alarm + - action: script.start_alarm data_template: entity_id: input_boolean.water_alarm message: > @@ -61,12 +61,12 @@ automation: id: "allarmi_auto" trigger: - - platform: state + - trigger: state entity_id: group.car_alarm to: 'on' action: - - service: script.start_alarm + - action: script.start_alarm data_template: entity_id: input_boolean.car_alarm message: "Si è attivato un allarme sull'auto." diff --git a/packages/away_mode/away_mode_climate.yaml b/packages/away_mode/away_mode_climate.yaml index 5c0a7fd1..7ada6b45 100644 --- a/packages/away_mode/away_mode_climate.yaml +++ b/packages/away_mode/away_mode_climate.yaml @@ -10,10 +10,10 @@ automation: id: "modalita_vacanza_gestione_termosifoni" trigger: - - platform: state + - trigger: state entity_id: input_boolean.home_mode_away to: 'on' - - platform: state + - trigger: state entity_id: input_boolean.home_mode_away to: 'off' @@ -27,7 +27,7 @@ automation: entity_id: input_boolean.home_mode_away state: "on" sequence: - - service: script.turn_on + - action: script.turn_on data: entity_id: script.climate_away_mode_on # Switch Off @@ -41,6 +41,6 @@ automation: entity_id: input_boolean.central_heating state: 'on' sequence: - - service: script.turn_on + - action: script.turn_on data: entity_id: script.climate_away_mode_off diff --git a/packages/away_mode/away_mode_covers.yaml b/packages/away_mode/away_mode_covers.yaml index aa8cdeb0..8a3a9f7a 100644 --- a/packages/away_mode/away_mode_covers.yaml +++ b/packages/away_mode/away_mode_covers.yaml @@ -11,9 +11,9 @@ automation: #initial_state: 'on' trigger: - - platform: time + - trigger: time at: '09:00:00' - - platform: time + - trigger: time at: '18:00:00' condition: @@ -22,7 +22,7 @@ automation: state: 'on' action: - - service: cover.set_cover_position + - action: cover.set_cover_position data_template: entity_id: - cover.tapparella_sala diff --git a/packages/away_mode/away_mode_engine.yaml b/packages/away_mode/away_mode_engine.yaml index e97d52ac..b9b2dc0d 100644 --- a/packages/away_mode/away_mode_engine.yaml +++ b/packages/away_mode/away_mode_engine.yaml @@ -10,12 +10,12 @@ automation: id: "modalita_vacanza_azione_on" trigger: - - platform: state + - trigger: state entity_id: input_boolean.home_mode_away to: 'on' action: - - service: script.notify_voice + - action: script.notify_voice data_template: message: "Modalità vacanza abilitata" @@ -27,15 +27,15 @@ automation: trigger: # Manual Disable - - platform: state + - trigger: state entity_id: input_boolean.home_mode_away to: 'off' # Back home - - platform: state + - trigger: state entity_id: group.residents to: 'home' # End of Away Period - - platform: time + - trigger: time at: input_datetime.away_mode_end condition: @@ -53,9 +53,9 @@ automation: state: 'on' action: - - service: input_boolean.turn_off + - action: input_boolean.turn_off data: entity_id: input_boolean.home_mode_away - - service: script.notify_voice + - action: script.notify_voice data_template: message: "Modalità vacanza disabilitata" diff --git a/packages/central_heating.yaml b/packages/central_heating.yaml index 84779fbb..4ee14d23 100644 --- a/packages/central_heating.yaml +++ b/packages/central_heating.yaml @@ -65,9 +65,9 @@ automation: id: "riscaldamneto_centralizzato" trigger: - - platform: homeassistant + - trigger: homeassistant event: start - - platform: time + - trigger: time at: '00:00:00' condition: [] @@ -77,10 +77,10 @@ automation: # Switch on - conditions: "{{ now().month == 11 and now().day == 1 and is_state('input_boolean.central_heating', 'off') }}" sequence: - - service: input_boolean.turn_on + - action: input_boolean.turn_on data_template: entity_id: input_boolean.central_heating - - service: script.notify_text + - action: script.notify_text data_template: title: "Home Assistant - Riscaldamento Centralizzato" message: "Il riscaldamento centralizzato è stato acceso" @@ -88,10 +88,10 @@ automation: # Switch off - conditions: "{{ now().month == 4 and now().day == 15 and is_state('input_boolean.central_heating', 'on')}}" sequence: - - service: input_boolean.turn_off + - action: input_boolean.turn_off data_template: entity_id: input_boolean.central_heating - - service: script.notify_text + - action: script.notify_text data_template: title: "Home Assistant - Riscaldamento Centralizzato" message: "Il riscaldamento centralizzato è stato spento" diff --git a/packages/errors.yaml b/packages/errors.yaml index 1d2b1193..ea33586d 100644 --- a/packages/errors.yaml +++ b/packages/errors.yaml @@ -71,17 +71,17 @@ automation: domain: persistent_notification service: create event_type: call_service - platform: event + trigger: event - event_data: domain: persistent_notification service: dimiss event_type: call_service - platform: event + trigger: event condition: [] action: - - service: input_boolean.turn_on + - action: input_boolean.turn_on data_template: entity_id: input_boolean.home_assistant_error @@ -97,17 +97,17 @@ automation: domain: persistent_notification service: create event_type: call_service - platform: event + trigger: event - event_data: domain: persistent_notification service: dimiss event_type: call_service - platform: event + trigger: event condition: [] action: - - service: input_boolean.turn_off + - action: input_boolean.turn_off data_template: entity_id: input_boolean.home_assistant_error diff --git a/packages/fritz.yaml b/packages/fritz.yaml index 8ae7089f..41bd9826 100644 --- a/packages/fritz.yaml +++ b/packages/fritz.yaml @@ -52,21 +52,21 @@ homeassistant: ###################################################################### #switch: -# - platform: template +# - trigger: template # switches: # fritz_led: # turn_on: -# service: shell_command.fritz_led_on +# action: shell_command.fritz_led_on # turn_off: -# service: shell_command.fritz_led_off +# action: shell_command.fritz_led_off -# - platform: template +# - trigger: template # switches: # ap1_led: # turn_on: -# service: shell_command.ap1_led_on +# action: shell_command.ap1_led_on # turn_off: -# service: shell_command.ap1_led_off +# action: shell_command.ap1_led_off ###################################################################### # Fritz Package - Fritz Command diff --git a/packages/guard_mode.yaml b/packages/guard_mode.yaml index 65959cd4..3b5cf3bf 100644 --- a/packages/guard_mode.yaml +++ b/packages/guard_mode.yaml @@ -67,16 +67,16 @@ automation: id: "modalita_guardia_attivazione" trigger: - - platform: state + - trigger: state entity_id: group.residents from: 'home' - - platform: homeassistant + - trigger: homeassistant event: start condition: "{{ not is_state('group.residents', 'home') }}" action: - - service: input_boolean.turn_on + - action: input_boolean.turn_on data_template: entity_id: input_boolean.guard_mode @@ -87,15 +87,15 @@ automation: id: "modalita_guardia_disattivazione" trigger: - - platform: state + - trigger: state entity_id: group.residents to: 'home' - - platform: homeassistant + - trigger: homeassistant event: start condition: "{{ is_state('group.residents', 'home') }}" action: - - service: input_boolean.turn_off + - action: input_boolean.turn_off data_template: entity_id: input_boolean.guard_mode diff --git a/packages/mercedes/mercedes_lock.yaml b/packages/mercedes/mercedes_lock.yaml index fee3d4a7..1f05042d 100644 --- a/packages/mercedes/mercedes_lock.yaml +++ b/packages/mercedes/mercedes_lock.yaml @@ -9,11 +9,11 @@ # friendly_name: Blocco Auto # value_template: "{{ is_state('binary_sensor.ff590mr_locked', 'off') }}" # turn_on: -# - service: mbapi2020.doors_lock +# - action: mbapi2020.doors_lock # data: # vin: !secret mb_vin # turn_off: -# - service: mbapi2020.doors_unlock +# - action: mbapi2020.doors_unlock # data: # vin: !secret mb_vin # icon_template: >- @@ -29,10 +29,10 @@ lock: value_template: "{{ is_state('binary_sensor.ff590mr_locked', 'off') }}" optimistic: true lock: - - service: mbapi2020.doors_lock + - action: mbapi2020.doors_lock data: vin: !secret mb_vin unlock: - - service: mbapi2020.doors_unlock + - action: mbapi2020.doors_unlock data: vin: !secret mb_vin diff --git a/packages/netatmo/netatmo_away.yaml b/packages/netatmo/netatmo_away.yaml index 3992ba5e..b0c82399 100644 --- a/packages/netatmo/netatmo_away.yaml +++ b/packages/netatmo/netatmo_away.yaml @@ -8,7 +8,7 @@ script: ###################################################################### climate_away_mode_on: sequence: - - service: climate.set_preset_mode + - action: climate.set_preset_mode data: entity_id: - climate.cucina @@ -23,7 +23,7 @@ script: ###################################################################### climate_away_mode_off: sequence: - - service: climate.set_hvac_mode + - action: climate.set_hvac_mode data: entity_id: - climate.cucina @@ -45,10 +45,10 @@ automation: id: "termosifoni_sincronizzazione_con_riscaldamento_centralizzato" trigger: - - platform: state + - trigger: state entity_id: input_boolean.central_heating to: 'on' - - platform: state + - trigger: state entity_id: input_boolean.central_heating to: 'off' @@ -62,7 +62,7 @@ automation: entity_id: input_boolean.central_heating state: "off" sequence: - - service: script.turn_on + - action: script.turn_on data: entity_id: script.climate_away_mode_on # Switch Off @@ -76,6 +76,6 @@ automation: entity_id: input_boolean.home_mode_away state: 'off' sequence: - - service: script.turn_on + - action: script.turn_on data: entity_id: script.climate_away_mode_off diff --git a/packages/netatmo/netatmo_boost.yaml b/packages/netatmo/netatmo_boost.yaml index da90e47d..a080713b 100644 --- a/packages/netatmo/netatmo_boost.yaml +++ b/packages/netatmo/netatmo_boost.yaml @@ -37,7 +37,7 @@ automation: mode: parallel trigger: - platform: state + trigger: state entity_id: input_boolean.boost_valvola_cucina, input_boolean.boost_valvola_sala, input_boolean.boost_valvola_studio, @@ -60,19 +60,19 @@ automation: {% endif %} action: - #- service: climate.set_preset_mode + #- action: climate.set_preset_mode # data_template: # entity_id: "{{ entity_id }}" # preset_mode: boost - - service: climate.set_temperature + - action: climate.set_temperature data_template: entity_id: "{{ entity_id }}" temperature: 30 - delay: 300 - - service: climate.turn_on + - action: climate.turn_on data_template: entity_id: "{{ entity_id }}" - - service: input_boolean.turn_off + - action: input_boolean.turn_off data_template: entity_id: "{{ trigger.entity_id }}" @@ -84,7 +84,7 @@ automation: mode: parallel trigger: - platform: state + trigger: state entity_id: input_boolean.boost_valvola_cucina, input_boolean.boost_valvola_sala, input_boolean.boost_valvola_studio, @@ -107,9 +107,9 @@ automation: {% endif %} action: - - service: climate.turn_on + - action: climate.turn_on data_template: entity_id: "{{ entity_id }}" - - service: input_boolean.turn_off + - action: input_boolean.turn_off data_template: entity_id: "{{ trigger.entity_id }}" diff --git a/packages/qnap.yaml b/packages/qnap.yaml index d10b8e82..ea2237dc 100644 --- a/packages/qnap.yaml +++ b/packages/qnap.yaml @@ -53,7 +53,7 @@ switch: name: NAS host: !secret nas_host turn_off: - service: shell_command.nas_turn_off + action: shell_command.nas_turn_off data: nas_host: !secret nas_host nas_username: !secret nas_username @@ -76,7 +76,7 @@ script: plex_start: alias: "Avvia Plex" sequence: - - service: shell_command.plex_start + - action: shell_command.plex_start data: nas_host: !secret nas_host nas_username: !secret nas_username @@ -84,7 +84,7 @@ script: plex_restart: alias: "Riavvia Plex" sequence: - - service: shell_command.plex_restart + - action: shell_command.plex_restart data: nas_host: !secret nas_host nas_username: !secret nas_username @@ -92,7 +92,7 @@ script: plex_stop: alias: "Ferma Plex" sequence: - - service: shell_command.plex_stop + - action: shell_command.plex_stop data: nas_host: !secret nas_host nas_username: !secret nas_username diff --git a/packages/shelly/shelly_operations.yaml b/packages/shelly/shelly_operations.yaml index e9fd681b..75302fb3 100644 --- a/packages/shelly/shelly_operations.yaml +++ b/packages/shelly/shelly_operations.yaml @@ -17,13 +17,13 @@ script: | list }} sequence: - #- service: mqtt.publish + #- action: mqtt.publish # data: # topic: 'shellies/command' # payload: 'update_fw' # qos: 0 # retain: false - - service: update.install + - action: update.install target: entity_id: '{{ pending_update_list }}' @@ -33,7 +33,7 @@ script: shelly_reboot: alias: "Shelly: Riavvio Dispositivi Collettivo" sequence: - - service: shell_command.shelly_reboot + - action: shell_command.shelly_reboot automation: ###################################################################### @@ -52,10 +52,10 @@ automation: }} trigger: - - platform: state + - trigger: state entity_id: group.shelly to: 'on' - - platform: homeassistant + - trigger: homeassistant event: start condition: @@ -65,7 +65,7 @@ automation: action: - delay: '00:00:10' - - service: script.notify_text + - action: script.notify_text data_template: title: "Shelly - Aggiornamento" message: > @@ -75,7 +75,7 @@ automation: {%- endfor -%} notification_id: "update" enable_persistent: true - - service: input_boolean.turn_on + - action: input_boolean.turn_on entity_id: input_boolean.update_shelly ###################################################################### diff --git a/packages/update/update_engine.yaml b/packages/update/update_engine.yaml index 911ae025..5ca460b2 100644 --- a/packages/update/update_engine.yaml +++ b/packages/update/update_engine.yaml @@ -27,10 +27,10 @@ automation: }} trigger: - - platform: state + - trigger: state entity_id: group.hacs to: 'on' - - platform: homeassistant + - trigger: homeassistant event: start condition: @@ -40,7 +40,7 @@ automation: action: - delay: '00:00:10' - - service: script.notify_text + - action: script.notify_text data_template: title: "HACS - Aggiornamento" message: > @@ -50,7 +50,7 @@ automation: {%- endfor -%} notification_id: "update" enable_persistent: true - - service: input_boolean.turn_on + - action: input_boolean.turn_on entity_id: input_boolean.update_hacs ###################################################################### @@ -63,7 +63,7 @@ automation: id: "update_riconoscimento_aggiornamenti" trigger: - platform: state + trigger: state entity_id: - input_boolean.update_hacs - input_boolean.update_shelly @@ -71,7 +71,7 @@ automation: to: 'off' action: - - service: persistent_notification.dismiss + - action: persistent_notification.dismiss data_template: notification_id: "update" @@ -91,7 +91,7 @@ script: | list }} sequence: - - service: update.install + - action: update.install target: entity_id: '{{ pending_update_list }}' @@ -110,6 +110,6 @@ script: | list }} sequence: - - service: update.install + - action: update.install target: entity_id: '{{ pending_update_list }}' diff --git a/packages/zigbee2mqtt.yaml b/packages/zigbee2mqtt.yaml index 965b56a7..f2a917f0 100644 --- a/packages/zigbee2mqtt.yaml +++ b/packages/zigbee2mqtt.yaml @@ -136,7 +136,7 @@ script: zigbee2mqtt_rename: alias: "Zigbee2MQTT: Rinomina Device" sequence: - service: mqtt.publish + action: mqtt.publish data_template: topic: zigbee2mqtt/bridge/request/device/rename payload_template: >- @@ -152,7 +152,7 @@ script: zigbee2mqtt_remove: alias: "Zigbee2MQTT: Rimuovi Device" sequence: - service: mqtt.publish + action: mqtt.publish data_template: topic: zigbee2mqtt/bridge/request/device/remove payload_template: >- @@ -228,11 +228,11 @@ automation: - alias: "Zigbee2MQTT: Abilita Join" id: "zigbee2mqtt_abilita_join" trigger: - platform: state + trigger: state entity_id: switch.zigbee2mqtt_bridge_permit_join to: "on" action: - service: timer.start + action: timer.start entity_id: timer.zigbee_permit_join data_template: duration: "{{ '00:0%i:00' % (states('input_number.zigbee2mqtt_join_minutes') | int ) }}" @@ -243,18 +243,18 @@ automation: - alias: "Zigbee2MQTT: Disabilita Join" id: "zigbee2mqtt_disabilita_join" trigger: - - platform: event + - trigger: event event_type: timer.finished event_data: entity_id: timer.zigbee_permit_join - - platform: state + - trigger: state entity_id: switch.zigbee2mqtt_bridge_permit_join to: "off" action: - - service: timer.cancel + - action: timer.cancel data: entity_id: timer.zigbee_permit_join - - service: switch.turn_off + - action: switch.turn_off entity_id: switch.zigbee2mqtt_bridge_permit_join ###################################################################### @@ -263,13 +263,13 @@ automation: - alias: "Zigbee2MQTT: Device aggiunto alla rete Zigbee2mqtt" id: "zigbee2mqtt_device_aggiunto_alla_rete_zigbee2mqtt" trigger: - platform: mqtt + trigger: mqtt topic: 'zigbee2mqtt/bridge/event' condition: condition: template value_template: '{{trigger.payload_json.type == "device_interview" and trigger.payload_json.data.status == "successful" and trigger.payload_json.data.supported}}' action: - - service: persistent_notification.create + - action: persistent_notification.create data_template: title: "Device aggiunto alla rete Zigbee2mqtt" message: "Name: {{trigger.payload_json.data.friendly_name}}, @@ -283,14 +283,14 @@ automation: - alias: "Zigbee2MQTT: Restart Automation" id: "zigbee2mqtt_restart_automation" trigger: - - platform: homeassistant + - trigger: homeassistant event: start - - platform: state + - trigger: state entity_id: binary_sensor.zigbee2mqtt_bridge_connection_state to: "off" for: "00:01:00" action: - - service: shell_command.zigbee2mqtt_restart + - action: shell_command.zigbee2mqtt_restart data: docker_host: !secret docker_host docker_username: !secret docker_username diff --git a/scripts/audio.yaml b/scripts/audio.yaml index 0b9484fb..2eb8c934 100644 --- a/scripts/audio.yaml +++ b/scripts/audio.yaml @@ -41,12 +41,12 @@ laura_voice: - wait_template: "{{ not is_state(media_player, 'playing') }}" - - service: script.volume_manager + - action: script.volume_manager data_template: media_player: "{{media_player}}" volume_level: "{{ volume_level }}" - - service: media_player.play_media + - action: media_player.play_media data_template: entity_id: "{{ media_player }}" media_content_type: 'audio/mp4' @@ -62,63 +62,63 @@ laura_voice: laura_voice_1: alias: Voce Laura 1 sequence: - - service: script.laura_voice + - action: script.laura_voice data: type: '1' laura_voice_2: alias: Voce Laura 2 sequence: - - service: script.laura_voice + - action: script.laura_voice data: type: '2' laura_voice_3: alias: Voce Laura 3 sequence: - - service: script.laura_voice + - action: script.laura_voice data: type: '3' laura_voice_4: alias: Voce Laura 4 sequence: - - service: script.laura_voice + - action: script.laura_voice data: type: '4' laura_voice_5: alias: Voce Laura 5 sequence: - - service: script.laura_voice + - action: script.laura_voice data: type: '5' laura_voice_6: alias: Voce Laura 6 sequence: - - service: script.laura_voice + - action: script.laura_voice data: type: '6' laura_voice_7: alias: Voce Laura 7 sequence: - - service: script.laura_voice + - action: script.laura_voice data: type: '7' laura_voice_8: alias: Voce Laura 8 sequence: - - service: script.laura_voice + - action: script.laura_voice data: type: '8' laura_voice_9: alias: Voce Laura 9 sequence: - - service: script.laura_voice + - action: script.laura_voice data: type: '9' @@ -159,12 +159,12 @@ babu_voice: - wait_template: "{{ not is_state(media_player, 'playing') }}" - - service: script.volume_manager + - action: script.volume_manager data_template: media_player: "{{media_player}}" volume_level: "{{ volume_level }}" - - service: media_player.play_media + - action: media_player.play_media data_template: entity_id: "{{ media_player }}" media_content_type: 'audio/mp4' @@ -177,13 +177,13 @@ babu_voice: babu_voice_1: alias: Voce Babu 1 sequence: - - service: script.babu_voice + - action: script.babu_voice data: type: '1' babu_voice_2: alias: Voce Babu 2 sequence: - - service: script.babu_voice + - action: script.babu_voice data: type: '2' diff --git a/scripts/home_assistant.yaml b/scripts/home_assistant.yaml index ef1a42aa..958ea376 100644 --- a/scripts/home_assistant.yaml +++ b/scripts/home_assistant.yaml @@ -6,7 +6,7 @@ homeassistant_restart: alias: "Riavvia Home Assistant" sequence: - - service: shell_command.docker_restart + - action: shell_command.docker_restart ###################################################################### # Home Assistant: Ricarica Script @@ -16,7 +16,7 @@ homeassistant_restart: homeassistant_reload_scripts: alias: "Ricarica Script" sequence: - - service: script.reload + - action: script.reload ###################################################################### # Home Assistant: Ricarica Automazioni @@ -26,7 +26,7 @@ homeassistant_reload_scripts: homeassistant_reload_automations: alias: "Ricarica Automazioni" sequence: - - service: automation.reload + - action: automation.reload ###################################################################### # Home Assistant: Clear Log @@ -38,9 +38,9 @@ homeassistant_reload_automations: homeassistant_clearlog: alias: "Pulisci Log" sequence: - - service: tts.clear_cache - - service: system_log.clear - - service: recorder.purge + - action: tts.clear_cache + - action: system_log.clear + - action: recorder.purge data: keep_days: 6 @@ -52,6 +52,6 @@ homeassistant_clearlog: homeassistant_google_home_sync: alias: "Sincronizza Google Home" sequence: - - service: google_assistant.request_sync + - action: google_assistant.request_sync data: agent_user_id: !secret google_agent diff --git a/scripts/media_player.yaml b/scripts/media_player.yaml index 06db8d0b..c3a3d0a9 100644 --- a/scripts/media_player.yaml +++ b/scripts/media_player.yaml @@ -11,9 +11,9 @@ tv_sala_toggle: alias: "TV Sala: Accendi/Spegni" sequence: - - service: media_player.toggle + - action: media_player.toggle entity_id: media_player.sony_kd_55xf8596 -# - service: script.turn_on +# - action: script.turn_on # data_template: # entity_id: >- # {% if is_state('media_player.sony_kd_55xf8596', 'on') %} @@ -34,7 +34,7 @@ tv_sala_toggle: #tv_sala_on: # alias: "TV Sala: Accendi" # sequence: -# - service: shell_command.bravia_tvpower +# - action: shell_command.bravia_tvpower ###################################################################### # Script: TV Sala Off @@ -48,4 +48,4 @@ tv_sala_toggle: #tv_sala_off: # alias: "TV Sala: Spegni" # sequence: -# - service: shell_command.bravia_poweroff +# - action: shell_command.bravia_poweroff diff --git a/scripts/notify.yaml b/scripts/notify.yaml index 794cf7fa..4ff94291 100644 --- a/scripts/notify.yaml +++ b/scripts/notify.yaml @@ -80,7 +80,7 @@ notify_text: entity_id: input_boolean.text_notifications state: 'on' - - service: notify.mail + - action: notify.mail data_template: title: "{{ title }}" message: "{{ message }}" @@ -90,13 +90,13 @@ notify_text: - condition: template value_template: "{{ enable_telegram }}" sequence: - - service: notify.telegram + - action: notify.telegram data_template: title: "{{ title }}" message: "{{ message | regex_replace(find='_', replace='-', ignorecase=False) }}" default: [] - - service: notify.html5 + - action: notify.html5 data_template: title: "{{ title }}" message: "{{ message }}" @@ -104,7 +104,7 @@ notify_text: - condition: template value_template: "{{ enable_persistent }}" - - service: persistent_notification.create + - action: persistent_notification.create data_template: title: "{{ title }}" message: "{{ message }}" @@ -160,7 +160,7 @@ volume_manager: step: 0.05 sequence: - - service: media_player.volume_set + - action: media_player.volume_set data_template: entity_id: "{{ media_player }}" volume_level: >- @@ -257,12 +257,12 @@ notify_voice: - wait_template: "{{ not is_state(media_player, 'playing') }}" - - service: script.volume_manager + - action: script.volume_manager data_template: media_player: "{{ media_player }}" volume_level: "{{ volume_level }}" - - service: tts.google_say + - action: tts.google_say data_template: entity_id: "{{ media_player }}" language: "{{ language }}" @@ -272,7 +272,7 @@ notify_voice: - wait_template: "{{ not is_state(media_player, 'playing') }}" - - service: script.volume_manager + - action: script.volume_manager ###################################################################### # Script: Global Notification (Text+Voice) @@ -401,7 +401,7 @@ notify_all: boolean: sequence: - - service: script.notify_text + - action: script.notify_text data_template: title: "{{ title }}" message: "{{ message }}" @@ -409,7 +409,7 @@ notify_all: enable_persistent: "{{ enable_persistent }}" enable_telegram: "{{ enable_telegram }}" - - service: script.notify_voice + - action: script.notify_voice data_template: media_player: "{{ media_player }}" volume_level: "{{ volume_level }}" diff --git a/scripts/speech_engine.yaml b/scripts/speech_engine.yaml index f9893928..5d5d476a 100644 --- a/scripts/speech_engine.yaml +++ b/scripts/speech_engine.yaml @@ -96,7 +96,7 @@ speech_engine: boolean: sequence: - - service: script.notify_voice + - action: script.notify_voice data_template: media_player: "{{ media_player }}" volume_level: "{{ volume_level }}" @@ -113,7 +113,7 @@ speech_status: alias: Stato Casa description: Riproduce le informazioni principali sullo stato della casa sequence: - - service: script.speech_engine + - action: script.speech_engine data: enable_greeting: true enable_status: true @@ -129,6 +129,6 @@ speech_consumption: alias: Consumo Energetico description: Riproduce il consumo energetico istantaneo sequence: - - service: script.speech_engine + - action: script.speech_engine data: enable_consumption: true -- 2.47.3