#Notify via TTS

1 messages · Page 1 of 1 (latest)

crude vale
#

Hello,

Hope this is the right section!
I am looking to make something like the google Broadcast feature. Which allows you to broadcast a custom message via TTS (or recorded by voice) over your google devices.

I want to do something similar but then on media devices within home assistant. I am not sure it is even possible to define a custom message everytime so I would like to request some help from you guys! Setting up a pre set message works with the tts.cloud_say action but I would like it to use a custom set message whenever running the automation (or script?)

crude vale
#

Managed to make it. Can be closed

old delta
#

Would be nice if you shared your solution, maybe others can use it as well 🙂

crude vale
#
description: ""
triggers:
  - trigger: state
    entity_id:
      - input_text.broadcast_tekst
conditions: []
actions:
  - alias: Zolder
    if:
      - condition: state
        entity_id: input_boolean.zolder_notificatie
        state: "on"
    then:
      - action: media_player.turn_on
        metadata: {}
        data: {}
        target:
          entity_id: media_player.zolder
        enabled: true
      - action: input_number.set_value
        metadata: {}
        data:
          value: "{{ state_attr('media_player.zolder', 'volume_level') | float }}"
        target:
          entity_id: input_number.volume_zolder_origineel
      - action: media_player.volume_set
        metadata: {}
        data:
          volume_level: "{{ states('input_number.volume_zolder') }}"
        target:
          device_id: 755be3d1050030f9f0077a5e8003f276
        enabled: true
      - action: tts.cloud_say
        data:
          cache: false
          entity_id: media_player.zolder
          message: "Home Assistent bericht: {{ states('input_text.broadcast_tekst') }}"
      - wait_for_trigger:
          - trigger: state
            entity_id:
              - media_player.zolder
            from: playing
            to: idle
      - action: media_player.volume_set
        metadata: {}
        data:
          volume_level: "{{ states('input_number.volume_zolder_origineel') }}"
        target:
          device_id: 755be3d1050030f9f0077a5e8003f276
        enabled: true
mode: single```
#

Make a input text helper and add an automation trigger on that, then handle the tts.cloud_say on any media device

#

I added 3 different speaker with toggle switches to turn them on or off