Telegram bot text template as trigger

Hello!

So currently we can easily trigger automation with:

  trigger:
    platform: event
    event_type: telegram_text
    event_data:
      text: 'bing'

Is it possible to trigger an automation if the input text is “bing hello” or “bing welcome home”?
Maybe with template triggers?

This is the path i was thinkering with…
{% if 'bing' in telegram_bot.event.data.text %} (this ofc aint working tho :slight_smile: )

Basicly i want an automation trigger word, like “TTS:” and anything after that word (but still in the same msg/sentence) should be processed by tts.amazon_polly_say.

Example: "TTS: I see you!"

1 Like

See this thread…

Thats not exactly what i asked in my OP :confused:

“Basicly i want an automation trigger word, like “TTS:” and anything after that word (but still in the same msg/sentence) should be processed by tts.amazon_polly_say.”

Trigger = /TTS
Args = sentence after

Automation = on trigger, say args.

How does it it not answer your question?

Sorry for reviving this topic…
But I just came across this and thought I’d share my solution.

- alias: Speak to the home
  trigger:
  - platform: event
    event_type: telegram_command
    event_data:
      command: /say
  action:
  - service: tts.google_say
    data_template:
      entity_id: media_player.family_room_speaker
      message: "{{ ' '.join(trigger.event.data.args) }}"
4 Likes

Holy… It works!

Thanks!! :grin:

Protokolldetails ( ERROR )
Thu Jan 16 2020 17:31:04 GMT+0100 (Mitteleuropäische Normalzeit)
Error 404 on load URL https://translate.google.com/translate_tts?ie=UTF-8&tl=de&q=&tk=888707.736779&total=1&idx=0&client=tw-ob&textlen=0
Protokolldetails ( ERROR )
Thu Jan 16 2020 17:31:04 GMT+0100 (Mitteleuropäische Normalzeit)
Error on init TTS: No TTS from google_translate for ''

Can me where Help?

thanks for this.