Select and play iOs sounds

----edit----

i checked the iOS.conf file, and no [pushsounds] were displayed. Which is strange since Morgan Freeman was already welcoming me home…

anyways, rebooted the device, and after an initial error all files are playing fine now with the below code…

----endedit----

btw, is there no way of striking through text on this forum? might be easier to show progress bing made without deleting the post completely.

HI,
need some help here, can’t find any documentation on selecting a built-in Hassio speech sound, and playing it automatically.

the example only shows a direct coded .wav file, while i would like to be able to do something like below. All is going fine, up to the playing of the actual sound. I do receive the message Sound is playing. So only that bit must be erroneous:

script:
  play_sound:
    alias: Play Sound
    sequence:
      - service: notify.ios_telefoonmhb
        data_template:
          title: "Play Sound"
          message: "Sound is playing"
          data:
            push:
              sound: "{{ states.input_select.speech_sound.state }}"

input_select:
  speech_sound:
    name: Speech sound selection
    icon: mdi:text-to-speech
    options:
      - US-EN-Alexa-Daughter-Is-Arriving.wav
      - US-EN-Alexa-Girlfriend-Is-Arriving.wav
      - US-EN-Alexa-Good-Morning.wav
      - US-EN-Alexa-Good-Night.wav
      - US-EN-Alexa-Husband-Is-Arriving.wav
      - US-EN-Alexa-Motion-Detected-Generic.wav
      - US-EN-Alexa-Motion-In-Back-Yard.wav
      - US-EN-Alexa-Motion-In-Basement.wav
      - US-EN-Alexa-Welcome-Home.wav
      - US-EN-Alexa-Wife-Is-Arriving.wav
      - US-EN-Morgan-Freeman-Boss-Is-Arriving.wav
      - US-EN-Morgan-Freeman-Daughter-Is-Arriving.wav
      - US-EN-Morgan-Freeman-Girlfriend-Is-Arriving.wav
      - US-EN-Morgan-Freeman-Good-Morning.wav
      - US-EN-Morgan-Freeman-Good-Night.wav
      - US-EN-Morgan-Freeman-Motion-In-Basement.wav
      - US-EN-Morgan-Freeman-Motion-In-Bedroom.wav
      - US-EN-Morgan-Freeman-Motion-In-Game-Room.wav
      - US-EN-Morgan-Freeman-Motion-In-Garage.wav
      - US-EN-Morgan-Freeman-Motion-In-Kitchen.wav
      - US-EN-Morgan-Freeman-Motion-In-Living-Room.wav
      - US-EN-Morgan-Freeman-Motion-In-Theater.wav
      - US-EN-Morgan-Freeman-Searching-For-Car-Keys.wav
      - US-EN-Morgan-Freeman-Setting-The-Mood.wav
      - US-EN-Morgan-Freeman-Someone-Is-Arriving.wav
      - US-EN-Morgan-Freeman-Starting-Movie-Mode.wav
      - US-EN-Morgan-Freeman-Starting-Party-Mode.wav
      - US-EN-Morgan-Freeman-Starting-Romance-Mode.wav
      - US-EN-Morgan-Freeman-Turning-Off-All-The-Lights.wav
      - US-EN-Morgan-Freeman-Turning-Off-The-Hallway-Lights.wav
      - US-EN-Morgan-Freeman-Turning-Off-The-Light.wav
      - US-EN-Morgan-Freeman-Turning-Off-The-Lights.wav
      - US-EN-Morgan-Freeman-Turning-Off-The-Mood-Lights.wav
      - US-EN-Morgan-Freeman-Turning-Off-The-TV.wav
      - US-EN-Morgan-Freeman-Turning-On-The-Hallway-Lights.wav
      - US-EN-Morgan-Freeman-Turning-On-The-Light.wav
      - US-EN-Morgan-Freeman-Turning-On-The-Lights.wav
      - US-EN-Morgan-Freeman-Turning-On-The-Mood-Lights.wav
      - US-EN-Morgan-Freeman-Turning-On-The-TV.wav
      - US-EN-Morgan-Freeman-Vacate-The-Premises.wav
      - US-EN-Morgan-Freeman-Welcome-Home.wav
      - US-EN-Morgan-Freeman-Wife-Is-Arriving.wav
    initial: US-EN-Morgan-Freeman-Welcome-Home.wav

@lolouk44
HI Laurent,

Any thoughts on why this isnt playing, the template itself shows the correct file on the selected input:

  - service: notify.ios_phone
    data_template:
      title: "Activity Speech"
      message: "Please listen"
      data:
        push:
          sound: >
           {% if is_state ('input_select.activity','Opstart') %} "US-EN-Morgan-Freeman-Welcome-Home.wav"
           {% elif is_state ('input_select.activity', 'Opstaan') %} "US-EN-Morgan-Freeman-Good-Morning.wav"
           {% elif is_state ('input_select.activity','Aan de slag') %} "US-EN-Morgan-Freeman-Turning-On-The-Lights.wav"
           {% elif is_state ('input_select.activity', 'Home theater') %} "US-EN-Morgan-Freeman-Starting-Movie-Mode.wav"
           {% elif is_state ('input_select.activity','Gym') %} "US-EN-Morgan-Freeman-Motion-In-Game-Room.wav"
           {% elif is_state ('input_select.activity', 'Selamat makan') %} "US-EN-Morgan-Freeman-Motion-In-Kitchen.wav"
           {% elif is_state ('input_select.activity', 'Uit huis') %} "US-EN-Morgan-Freeman-Vacate-The-Premises.wav"
           {% elif is_state ('input_select.activity', 'Naar bed') %} "US-EN-Morgan-Freeman-Good-Night.wav"
           {% endif %}

Please have a look would you?

do you get any errors in the log when you try to play them?

also have you got more than 1 iphone? Your script shows notify.ios_telefoonmhb but your 2nd one shows notify.ios_phone

LOL

No, No errors, 1 iPhone

Slip of the c&p…

made it work, just some fun when an automation is run, to hear MF comment it. as always it was about the parenthesis and apostrophes:

data_template:
          title: "Activity Speech"
          message: "Please listen"
          data:
            push:
              sound: >
                {% if is_state ('input_select.activity','Opstart') %} US-EN-Morgan-Freeman-Welcome-Home.wav
                {% elif is_state ('input_select.activity', 'Opstaan') %} US-EN-Morgan-Freeman-Good-Morning.wav
                {% elif is_state ('input_select.activity','Aan de slag') %} US-EN-Morgan-Freeman-Turning-On-The-Lights.wav
                {% elif is_state ('input_select.activity', 'Home theater') %} US-EN-Morgan-Freeman-Starting-Movie-Mode.wav
                {% elif is_state ('input_select.activity','Gym') %} US-EN-Morgan-Freeman-Motion-In-Game-Room.wav
                {% elif is_state ('input_select.activity', 'Selamat makan') %} US-EN-Morgan-Freeman-Motion-In-Kitchen.wav
                {% elif is_state ('input_select.activity', 'Uit huis') %} US-EN-Morgan-Freeman-Vacate-The-Premises.wav
                {% elif is_state ('input_select.activity', 'Naar bed') %} US-EN-Morgan-Freeman-Good-Night.wav
                {% endif %}
1 Like