Since the upgrade from HA 0.82.1 to HA 0.83.2 I have noticed that Telegram messages with a Unicode in it are not being sent anymore. I use this method to send emoticons.
This is the part of the automation that was always working before. Anyone know how to make this working again? I already tried to change the quoting of the unicode, but that give me other errors.
action:
- service: notify.telegram
data_template:
title: "{{ '\uD83D\uDE98' }}"
message: |
a-h: {{ states.sensor.google_maps_amf2home.state }}
d-h: {{ states.sensor.google_maps_dh2home.state }}
Error message in the log
Error executing service <ServiceCall telegram_bot.send_message (c:51c0881692c149088abf9488b8e2df49): target=[-179900310], title=<homeassistant.helpers.template.Template object at 0x7f9f67892390>, message=<homeassistant.helpers.template.Template object at 0x7f9f6852aa90>>
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1177, in _event_to_service_call
await service_handler.func(service_call)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/telegram_bot/__init__.py", line 275, in async_send_telegram_message
partial(notify_service.send_message, **kwargs))
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/telegram_bot/__init__.py", line 469, in send_message
chat_id, text, **params)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/telegram_bot/__init__.py", line 445, in _send_msg
out = func_send(*args_msg, **kwargs_msg)
File "/usr/local/lib/python3.6/site-packages/telegram/bot.py", line 65, in decorator
result = func(self, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/telegram/bot.py", line 90, in decorator
result = self._request.post(url, data, timeout=kwargs.get('timeout'))
File "/usr/local/lib/python3.6/site-packages/telegram/utils/request.py", line 308, in post
body=json.dumps(data).encode('utf-8'),
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 0-1: surrogates not allowed