I’m noticing a very strange behaviour when trying to get notifications on state changes for device_tracker. I’m on v0.91.0 in a python venv under Linux
This is my automation:
- alias: "Stefano Geolocation"
initial_state: 'on'
trigger:
platform: state
entity_id: device_tracker.s8
action:
- service: notify.stefano
data_template:
message: 'Stefano Location has changed from {{ trigger.from_state.state }} to {{ trigger.to_state.state }}'
When I leave my home zone I get the following error
2019-04-13 10:12:23 DEBUG (MainThread) [homeassistant.components.telegram_bot] New telegram message send_message: {‘target’: [XXXXXXXXX], ‘message’: ‘Stefano Location has changed from home to not_home’}
2019-04-13 10:12:23 DEBUG (SyncWorker_2) [homeassistant.components.telegram_bot] Send message in chat ID XXXXXXXXX with params: {‘parse_mode’: ‘Markdown’, ‘disable_notification’: False, ‘disable_web_page_preview’: None, ‘reply_to_message_id’: None, ‘reply_markup’: None, ‘timeout’: None}
2019-04-13 10:12:23 ERROR (SyncWorker_2) [homeassistant.components.telegram_bot] Error sending message: Can’t parse entities: can’t find end of the entity starting at byte offset 45. Args: (XXXXXXXXX, ‘Stefano Location has changed from home to not_home’), kwargs: {‘parse_mode’: ‘Markdown’, ‘disable_notification’: False, ‘disable_web_page_preview’: None, ‘reply_to_message_id’: None, ‘reply_markup’: None, ‘timeout’: None}
Same kind of error when I get back to my home zone
2019-04-13 10:33:03 DEBUG (MainThread) [homeassistant.components.telegram_bot] New telegram message send_message: {‘target’: [XXXXXXXXX], ‘message’: ‘Stefano Location has changed from not_home to home’}
2019-04-13 10:33:03 DEBUG (SyncWorker_2) [homeassistant.components.telegram_bot] Send message in chat ID XXXXXXXXX with params: {‘parse_mode’: ‘Markdown’, ‘disable_notification’: False, ‘disable_web_page_preview’: None, ‘reply_to_message_id’: None, ‘reply_markup’: None, ‘timeout’: None}
2019-04-13 10:33:03 ERROR (SyncWorker_2) [homeassistant.components.telegram_bot] Error sending message: Can’t parse entities: can’t find end of the entity starting at byte offset 37. Args: (XXXXXXXXX, ‘Stefano Location has changed from not_home to home’), kwargs: {‘parse_mode’: ‘Markdown’, ‘disable_notification’: False, ‘disable_web_page_preview’: None, ‘reply_to_message_id’: None, ‘reply_markup’: None, ‘timeout’: None}
But when I’m out of my home zone for some time and the state of device tracker gets updated I get the telegram message saying:
Stefano Location has changed from nothome to nothome
and this is what I find in the log
2019-04-13 10:27:22 DEBUG (MainThread) [homeassistant.components.telegram_bot] New telegram message send_message: {‘target’: [XXXXXXXXX], ‘message’: ‘Stefano Location has changed from not_home to not_home’}
2019-04-13 10:27:22 DEBUG (SyncWorker_0) [homeassistant.components.telegram_bot] Send message in chat ID XXXXXXXXX with params: {‘parse_mode’: ‘Markdown’, ‘disable_notification’: False, ‘disable_web_page_preview’: None, ‘reply_to_message_id’: None, ‘reply_markup’: None, ‘timeout’: None}
Any ideas on why this is happening?
Thanks