Google home say something when i enter home

Hi all I am trying to configure Google Home mini to say something when I arrive home and my door sensor opens.
In the configuration.yaml

device_tracker:

  • platform: nmap_tracker
    hosts: 192.168.1.0/24
    track_new_devices: yes
    interval_seconds: 30
  • platform: owntracks
    max_gps_accuracy: 100

Text to speech

tts:

  • platform: google_translate
    service_name: google_say
    language: ‘it’

input_boolean:
ale_arriva:
name: Ale sta arrivando

In the automation.yaml

  • alias: Ale arriva
    initial_state: true
    trigger:

    • platform: state
      entity_id: device_tracker.50_01_d9_31_11_c9
      to: ‘home’
      action:
    • service: input_boolean.turn_on
      entity_id: input_boolean.ale_arriva
    • delay: “00:03:00”
    • service: input_boolean.turn_off
      entity_id: input_boolean.ale_arriva
  • alias: benvenuto ale
    initial_state: true
    trigger:

    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d00033a9289
      to: ‘on’
      condition:
    • condition: state
      entity_id: input_boolean.ale_arriva
      state: ‘on’
      action:
    • service: input_boolean.turn_off
      entity_id: input_boolean.ale_arriva
    • service: tts.google_say
      entity_id: media_player.google_home_mini
      data_template:
      message: >-
      {{ [
      "bentornato Ale, ai tuoi ordini " ,
      "bentornato a casa mio maestro " ,
      "che la forza sia con te " ,
      "Ciao Ale è stata una giornata faticosa? " ,
      "non vedevo l’ora tu tornassi a casa " ,
      "quando non ci sei la mia vita è vuota " ,
      "al tuo servizio mio lord " ,
      "memento audere semper mio signore " ,
      "ben tornato sono impazziente di eseguire i tuoi comandi "
      ] |random }}

But nothing seems to happen…thanks

1 Like