Thanks, working perfect in Lovelace UI!
Any Chance to get an Automation working with the Telegram Bot? I just can’t update the input_text.gpt_input entity …
Here is my code:
alias: Telegram-ChatGPT
trigger:
- platform: event
event_type: telegram_command
event_data:
command: /chatgpt
action:
- service: input_text.set_value
data_template:
entity_id: input_text.gpt_input
value: "{{ trigger.event.data.text }}"
- delay: "00:00:05"
- service: telegram_bot.send_message
data_template:
message: "{{ state_attr('sensor.hassio_openai_response', 'response_text') }}"
mode: single
It gets triggered, but doesn’t fill in my text behind the /chatgpt command, the input_text.gpt_input doesn’t update.
I’ve tried nearly everything at the trigger.event.data.text
part.
ChatGPT itself said I should try it with trigger.message.text.split(' ', 1)[1]
but this still doesn’t work. Dunno whats the correct trigger data.
Maybe someone knows the correct way?
The Part of sending the response_text is working fine standalone!