pw44
(Paulo Ven)
February 26, 2024, 6:18pm
1
Hya,
i have the following automation and it’s allways asking for a text to speak.
I guess i have a text (entered or left).
Anyone able to help me find out what the problem is?
service: notify.mobile_app_pxs10e
data:
message: TTS
language: en
title: |
{% if trigger.event == "leave" %}
{{ trigger.from_state.name }} left {{ trigger.zone.attributes.friendly_name }}
{% else %}
{{ trigger.from_state.name }} entered {{ trigger.zone.attributes.friendly_name }}
{% endif %}
Thx!
kbrown01
(Kbrown01)
February 29, 2024, 6:14pm
2
See this I just answered for another person.
message is the content (unless you intended on posting “TTS”.
I know how to get my Alexa devices to say the time:
service: media_player.play_media
target:
entity_id: media_player.zeide_bedroom
data:
media_content_id: time
media_content_type: custom
But how, instead of time, can I get Alexa to say a custom statement like there is someone at the door ? (#)
.
(#) In the automation this would be triggered by a motion sensor.
(##) Currently I have this by using a Helper and in the Alexa App I created a Routine to act on that Helper. However, I am tr…
NOTE: notify
to a mobile app sends a notification
So this sends a message to my phone:
service: notify.mobile_app_kevin_phone
data:
message: The BBQ timer is finshed
title: Thermometer Timer
pw44
(Paulo Ven)
February 29, 2024, 8:16pm
3
this works for me. TTS does not. it asks for a message to speak.
kbrown01
(Kbrown01)
February 29, 2024, 9:58pm
4
I do not understand your question I guess. Please be more clear. Are you wishing to send something to a phone and have spoken outloud? Then (for Android phones) this works:
service: notify.mobile_app_kevin_phone
data:
message: "TTS"
data:
tts_text: "I am a message sent from Home Assistant."
Of course use your own phone …
But if your question is about changing the language, refer to Introduction | Home Assistant Companion Docs
Where it states “Current support is limited to the current Text To Speech locale set on the device.”
pw44
(Paulo Ven)
March 5, 2024, 9:58pm
5
This is my entire automation. For data: message: , it works, for data: message TTS, it does not works. It speaks nothing.
id: '802391001'
alias: Zone Notifications
trigger:
- platform: zone
entity_id: device_tracker.pxs10e
zone: zone.home
event: enter
- platform: zone
entity_id: device_tracker.pxs10e
zone: zone.home
event: leave
- platform: zone
entity_id: device_tracker.pxs10e
zone: zone.meia_laranja
event: enter
- platform: zone
entity_id: device_tracker.pxs10e
zone: zone.meia_laranja
event: leave
- platform: zone
entity_id: device_tracker.pxs10e
zone: zone.psilu_home
event: enter
- platform: zone
entity_id: device_tracker.pxs10e
zone: zone.psilu_home
event: leave
action:
- service: notify.mobile_app_pxs10e
data:
message: |
{% if trigger.event == "leave" %}
{{ trigger.from_state.name }} left {{ trigger.zone.attributes.friendly_name }}
{% else %}
{{ trigger.from_state.name }} entered {{ trigger.zone.attributes.friendly_name }}
{% endif %}
- service: notify.mobile_app_pxs10e
data:
message: TTS
tts_text: |
{% if trigger.event == "leave" %}
{{ trigger.from_state.name }} left {{ trigger.zone.attributes.friendly_name }}
{% else %}
{{ trigger.from_state.name }} entered {{ trigger.zone.attributes.friendly_name }}
{% endif %}
mode: single
kbrown01
(Kbrown01)
March 5, 2024, 10:03pm
6
Please look at that example and compare to yours:
service: notify.mobile_app_kevin_phone
data:
message: "TTS"
data:
tts_text: "I am a message sent from Home Assistant."
It is:
-----> data:
----------> message: “TTS”
----------> data:
---------------> tts_text: “whatever you wish to say”
This is not the structure you show. You are missing the data:
key under the data:
key and also tts_text
then is improperly indented.
This (untested) it what it should be:
- service: notify.mobile_app_pxs10e
data:
message: "TTS"
data:
tts_text: |
{% if trigger.event == "leave" %}
{{ trigger.from_state.name }} left {{ trigger.zone.attributes.friendly_name }}
{% else %}
{{ trigger.from_state.name }} entered {{ trigger.zone.attributes.friendly_name }}
{% endif %}
1 Like
pw44
(Paulo Ven)
March 5, 2024, 11:15pm
7
thank you for pointing it out. i really was misreading it. solved.