Closed JABeaver closed 1 year ago
Based on your trace it looks like the script was called and the variables injected, check your home-assistant.log
for telegram errors, also verify the correct data that the telegram service needs to send a message.
I cleared the log, restarted HA and then unlocked and locked the door lock via HA dashboard. here is the result of the home-assistant.log
2023-01-23 02:43:59.016 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration keymaster which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-01-23 02:43:59.017 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration frigate which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-01-23 02:43:59.017 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration nodered which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-01-23 02:43:59.017 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-01-23 02:44:32.048 ERROR (SyncWorker_1) [homeassistant.components.telegram_bot] Error sending message: Can't parse entities: can't find end of the entity starting at byte offset 5. Args: (chat id redacted, 'front_door\nRF unlock operation'), kwargs: {'parse_mode': 'Markdown', 'disable_web_page_preview': None, 'disable_notification': False, 'reply_to_message_id': None, 'reply_markup': None, 'timeout': None} 2023-01-23 02:44:33.699 ERROR (SyncWorker_4) [homeassistant.components.telegram_bot] Error sending message: Can't parse entities: can't find end of the entity starting at byte offset 5. Args: (chat id redacted, 'front_door\nRF lock operation'), kwargs: {'parse_mode': 'Markdown', 'disable_web_page_preview': None, 'disable_notification': False, 'reply_to_message_id': None, 'reply_markup': None, 'timeout': None}
I don't know if it helps but I turned on debug logging for telegram and keymaster and got this additional entry
2023-01-23 03:08:29.141 DEBUG (MainThread) [homeassistant.components.telegram_bot] New telegram message send_message: {'target': [chat_id_redacted], 'title': 'front_door', 'message': 'RF lock operation'} 2023-01-23 03:08:29.141 DEBUG (SyncWorker_0) [homeassistant.components.telegram_bot] Send message in chat ID chat_id_redacted with params: {'parse_mode': 'Markdown', 'disable_notification': False, 'disable_web_page_preview': None, 'reply_to_message_id': None, 'reply_markup': None, 'timeout': None, 'message_tag': None} 2023-01-23 03:08:30.207 ERROR (SyncWorker_0) [homeassistant.components.telegram_bot] Error sending message: Can't parse entities: can't find end of the entity starting at byte offset 5. Args: (chat_id_redacted, 'front_door\nRF lock operation'), kwargs: {'parse_mode': 'Markdown', 'disable_web_page_preview': None, 'disable_notification': False, 'reply_to_message_id': None, 'reply_markup': None, 'timeout': None}
Review the format for the service call for telegram notifications and update your script accordingly.
I found the fix on some other page. this is some sort of issue between the telegram_bot integration and third-party integrations. you need to insert parse_mode: html into the bot config in configuration.yaml
telegram_bot:
- platform: polling
parse_mode: html
api_key: !secret telegram_bot_api_key
allowed_chat_ids:
- !secret telegram_bot_chat_id
I don't understand why the integrations have issues with the telegram_bot when you can call it manually and when you create an automation. I assume it has something to do with the way the variables are passed. perhaps you can shed some light on this for me.
No idea, never used telegram.
Describe the bug Notifications are not working properly. it appears to be called but does not work. I have the notification set up in other automations and those work. I can call it manually through the developer tools and that also works but for some reason when it's called from keymaster it won't work.
Environment (please complete the following information):
Logs
Screenshots
Additional context relevant sections of files... scripts.yaml
configuration.yaml
I'm sure it's something simple because I had an SMPT notify working previously in keymaster but it was unreliable so I am trying to use telegram. and as I said in the beginning I can call notify.telegram manually and it works fine so it must be something to do with the automation in keymaster.