#initial_state: 'on'
trigger:
- - platform: time
+ - trigger: time
at: '07:00:00'
condition:
mode: single
trigger:
- - platform: state
+ - trigger: state
entity_id: binary_sensor.porta_casa_contact
to: 'on'
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'
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 }})."
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) %}
- 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
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 %}
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:
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 %}
input_boolean.home_mode_night
{% endif %}
- - service: script.volume_manager
+ - action: script.volume_manager
######################################################################
# Home Assistant: Management of Speech Notifications
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 %}
id: "home_assistant_pulitura_settimanale_log"
trigger:
- - platform: time
+ - trigger: time
at: '00:00:00'
condition:
weekday: [mon]
action:
- - service: script.homeassistant_clearlog
+ - action: script.homeassistant_clearlog
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' %}
name: "NFC_1"
trigger:
- platform: event
+ trigger: event
event_type: tag_scanned
action:
- "{{ 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 }}."
- "{{ 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 }})."
- "{{ 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 }})."
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
mode: parallel
trigger:
- - platform: zone
+ - trigger: zone
entity_id:
- person.giorgio
- person.laura
action:
- wait_for_trigger:
- - platform: state
+ - trigger: state
entity_id: binary_sensor.porta_casa_contact
to: "on"
timeout:
- delay: 00:00:05
- - service: script.speech_engine
+ - action: script.speech_engine
data_template:
message: !include ../template_messages/welcome.yaml
enable_greeting: 0
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') %}
id: "home_assistant_startup_restart_on_error"
trigger:
- - platform: homeassistant
+ - trigger: homeassistant
event: start
action:
- condition: state
entity_id: persistent_notification.invalid_config
state: 'notifying'
- - service: script.homeassistant_restart
+ - action: script.homeassistant_restart
######################################################################
# Startup Automation: Google Sync
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
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
######################################################################
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
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') %}
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
######################################################################
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
######################################################################
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
######################################################################
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
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
# 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
| list
}}
sequence:
- - service: update.install
+ - action: update.install
target:
entity_id: '{{ pending_update_list }}'
}}
trigger:
- - platform: state
+ - trigger: state
entity_id: group.bticino
to: 'on'
- - platform: homeassistant
+ - trigger: homeassistant
event: start
condition:
action:
- delay: '00:00:10'
- - service: script.notify_text
+ - action: script.notify_text
data_template:
title: "BTicino - Aggiornamento"
message: >
{%- endfor -%}
notification_id: "update"
enable_persistent: true
- - service: input_boolean.turn_on
+ - action: input_boolean.turn_on
entity_id: input_boolean.update_bticino
id: "allarmi_riconoscimento_allarmi"
trigger:
- platform: state
+ trigger: state
entity_id: group.alarms
to: 'off'
action:
- - service: script.stop_alarm
+ - action: script.stop_alarm
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'
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'
start_alarm:
alias: "Allarmi: Attiva Allarme"
sequence:
- - service: input_boolean.turn_on
+ - action: input_boolean.turn_on
data_template:
entity_id: >
{# Check Null Input #}
{{ entity_id }}
# LEVEL 1
- - service: script.notify_all
+ - action: script.notify_all
data_template:
volume_level: 0.4
language: 'it'
false
{% endif %}
- - service: script.start_alarm_sound
+ - action: script.start_alarm_sound
######################################################################
# Alarm: Stop Alarm
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"
id: "allarmi_porta_casa"
trigger:
- - platform: state
+ - trigger: state
entity_id: group.doors
to: 'on'
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."
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: >
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."
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'
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
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
#initial_state: 'on'
trigger:
- - platform: time
+ - trigger: time
at: '09:00:00'
- - platform: time
+ - trigger: time
at: '18:00:00'
condition:
state: 'on'
action:
- - service: cover.set_cover_position
+ - action: cover.set_cover_position
data_template:
entity_id:
- cover.tapparella_sala
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"
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:
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"
id: "riscaldamneto_centralizzato"
trigger:
- - platform: homeassistant
+ - trigger: homeassistant
event: start
- - platform: time
+ - trigger: time
at: '00:00:00'
condition: []
# 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"
# 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"
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
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
######################################################################
#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
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
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
# 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: >-
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
######################################################################
climate_away_mode_on:
sequence:
- - service: climate.set_preset_mode
+ - action: climate.set_preset_mode
data:
entity_id:
- climate.cucina
######################################################################
climate_away_mode_off:
sequence:
- - service: climate.set_hvac_mode
+ - action: climate.set_hvac_mode
data:
entity_id:
- climate.cucina
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'
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
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
mode: parallel
trigger:
- platform: state
+ trigger: state
entity_id: input_boolean.boost_valvola_cucina,
input_boolean.boost_valvola_sala,
input_boolean.boost_valvola_studio,
{% 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 }}"
mode: parallel
trigger:
- platform: state
+ trigger: state
entity_id: input_boolean.boost_valvola_cucina,
input_boolean.boost_valvola_sala,
input_boolean.boost_valvola_studio,
{% 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 }}"
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
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
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
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
| 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 }}'
shelly_reboot:
alias: "Shelly: Riavvio Dispositivi Collettivo"
sequence:
- - service: shell_command.shelly_reboot
+ - action: shell_command.shelly_reboot
automation:
######################################################################
}}
trigger:
- - platform: state
+ - trigger: state
entity_id: group.shelly
to: 'on'
- - platform: homeassistant
+ - trigger: homeassistant
event: start
condition:
action:
- delay: '00:00:10'
- - service: script.notify_text
+ - action: script.notify_text
data_template:
title: "Shelly - Aggiornamento"
message: >
{%- endfor -%}
notification_id: "update"
enable_persistent: true
- - service: input_boolean.turn_on
+ - action: input_boolean.turn_on
entity_id: input_boolean.update_shelly
######################################################################
}}
trigger:
- - platform: state
+ - trigger: state
entity_id: group.hacs
to: 'on'
- - platform: homeassistant
+ - trigger: homeassistant
event: start
condition:
action:
- delay: '00:00:10'
- - service: script.notify_text
+ - action: script.notify_text
data_template:
title: "HACS - Aggiornamento"
message: >
{%- endfor -%}
notification_id: "update"
enable_persistent: true
- - service: input_boolean.turn_on
+ - action: input_boolean.turn_on
entity_id: input_boolean.update_hacs
######################################################################
id: "update_riconoscimento_aggiornamenti"
trigger:
- platform: state
+ trigger: state
entity_id:
- input_boolean.update_hacs
- input_boolean.update_shelly
to: 'off'
action:
- - service: persistent_notification.dismiss
+ - action: persistent_notification.dismiss
data_template:
notification_id: "update"
| list
}}
sequence:
- - service: update.install
+ - action: update.install
target:
entity_id: '{{ pending_update_list }}'
| list
}}
sequence:
- - service: update.install
+ - action: update.install
target:
entity_id: '{{ pending_update_list }}'
zigbee2mqtt_rename:
alias: "Zigbee2MQTT: Rinomina Device"
sequence:
- service: mqtt.publish
+ action: mqtt.publish
data_template:
topic: zigbee2mqtt/bridge/request/device/rename
payload_template: >-
zigbee2mqtt_remove:
alias: "Zigbee2MQTT: Rimuovi Device"
sequence:
- service: mqtt.publish
+ action: mqtt.publish
data_template:
topic: zigbee2mqtt/bridge/request/device/remove
payload_template: >-
- 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 ) }}"
- 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
######################################################################
- 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}},
- 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
- 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'
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'
- 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'
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'
homeassistant_restart:
alias: "Riavvia Home Assistant"
sequence:
- - service: shell_command.docker_restart
+ - action: shell_command.docker_restart
######################################################################
# Home Assistant: Ricarica Script
homeassistant_reload_scripts:
alias: "Ricarica Script"
sequence:
- - service: script.reload
+ - action: script.reload
######################################################################
# Home Assistant: Ricarica Automazioni
homeassistant_reload_automations:
alias: "Ricarica Automazioni"
sequence:
- - service: automation.reload
+ - action: automation.reload
######################################################################
# Home Assistant: Clear Log
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
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
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') %}
#tv_sala_on:
# alias: "TV Sala: Accendi"
# sequence:
-# - service: shell_command.bravia_tvpower
+# - action: shell_command.bravia_tvpower
######################################################################
# Script: TV Sala Off
#tv_sala_off:
# alias: "TV Sala: Spegni"
# sequence:
-# - service: shell_command.bravia_poweroff
+# - action: shell_command.bravia_poweroff
entity_id: input_boolean.text_notifications
state: 'on'
- - service: notify.mail
+ - action: notify.mail
data_template:
title: "{{ title }}"
message: "{{ message }}"
- 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 }}"
- condition: template
value_template: "{{ enable_persistent }}"
- - service: persistent_notification.create
+ - action: persistent_notification.create
data_template:
title: "{{ title }}"
message: "{{ message }}"
step: 0.05
sequence:
- - service: media_player.volume_set
+ - action: media_player.volume_set
data_template:
entity_id: "{{ media_player }}"
volume_level: >-
- 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 }}"
- wait_template: "{{ not is_state(media_player, 'playing') }}"
- - service: script.volume_manager
+ - action: script.volume_manager
######################################################################
# Script: Global Notification (Text+Voice)
boolean:
sequence:
- - service: script.notify_text
+ - action: script.notify_text
data_template:
title: "{{ title }}"
message: "{{ message }}"
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 }}"
boolean:
sequence:
- - service: script.notify_voice
+ - action: script.notify_voice
data_template:
media_player: "{{ media_player }}"
volume_level: "{{ volume_level }}"
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
alias: Consumo Energetico
description: Riproduce il consumo energetico istantaneo
sequence:
- - service: script.speech_engine
+ - action: script.speech_engine
data:
enable_consumption: true