|
楼主 |
发表于 2022-6-16 15:26:53
|
显示全部楼层
本帖最后由 sephrioth 于 2022-6-16 15:28 编辑
input_text:
tts_say:
name: Say
input_select:
tts_say:
name: TTS Speaker
options:
- Amazon Echo
- Google Home
- Sonos
initial: 'Amazon Echo'
script:
tts_say:
alias: 'TTS say'
sequence:
- service: script.turn_on
data_template:
entity_id: >
{% if is_state('input_select.tts_say', 'Amazon Echo') %}
script.tts_say_echo
{% elif is_state('input_select.tts_say', 'Google Home') %}
script.tts_say_googlehome
{% elif is_state('input_select.tts_say', 'Sonos') %}
script.tts_say_sonos
{% endif %}
tts_say_sonos:
alias: 'Sonos Say'
sequence:
- service: sonos.snapshot
data_template:
entity_id: media_player.sonos
- service: tts.baidu_say
data_template:
entity_id: media_player.sonos
message: "{{ states('input_text.tts_say') }}"
- delay: 00:00:10
- service: sonos.restore
data_template:
entity_id: media_player.sonos
tts_say_echo:
alias: 'Echo Say'
sequence:
- service: notify.alexa_media
data_template:
data:
type: tts
target: media_player.sephrioth_s_echo_dot
message: "{{ states('input_text.tts_say') }}"
tts_say_googlehome:
alias: 'GoogleHome Say'
sequence:
- service: media_player.turn_on
entity_id: media_player.bedroom_speaker
- delay: 00:00:01
- service: tts.google_translate_say
data_template:
entity_id: media_player.bedroom_speaker
message: "{{ states('input_text.tts_say') }}"
|
|