Telegram_bot component "read timed out"

I’m trying to use the telegram bot to send a video from a camera. Getting the video from the camera takes quite a long time (up to 90 seconds), and it times out most of the times.
I’m getting these errors:

2020-03-28 11:57:32 ERROR (SyncWorker_12) [homeassistant.components.telegram_bot] Can't load data into ByteIO: HTTPConnectionPool(host='192.168.xx.xx', port=8080): Read timed out. (read timeout=15)

2020-03-28 11:57:34 ERROR (SyncWorker_4) [homeassistant.components.telegram_bot] Can't send file with kwargs: {'message': 'New video', 'caption': 'New video', 'url': 'http://192.168.xx.xx:8080/cgi-bin/getlastrecordedvideo.sh?oldness=-2'}

2020-03-28 11:58:57 ERROR (SyncWorker_13) [homeassistant.components.telegram_bot] Error sending file: urllib3 HTTPError ('Connection aborted.', timeout('The write operation timed out')). Args: (2635854, <_io.BytesIO object at 0xad3740f0>), kwargs: {'caption': 'New video', 'parse_mode': 'Markdown', 'disable_notification': False, 'disable_web_page_preview': None, 'reply_to_message_id': None, 'reply_markup': None, 'timeout': None}

How could I increase the timeout to avoid getting this error?
Camera is quite slow, and, in addition, the script from the camera waits until the video is recorded. Thus the maximum up to 75 seconds.

Is there a way to bypass this error?

PS. I’m using Home Assistant (former hassio) installation in the RPi 4.

No one can help?

Please post your configuration YAML, might get some more responses :+1:

It is quite simple, actually.

Call Service --> “notify.telegram_myuser_notifier”

data:
  document:
    - caption: Movement video
      url: >-
        http://CAMERAIP:PORT/cgi-bin/getlastrecordedvideo.sh?oldness=newvideo
message: Movement video

The URL basically waits a new video to be recorded and then sends it as a mp4, as said in the first post. Maximum wait: 75 seconds.

Did you ever get it working? Have you tried telegram_bot.send_video

url: 'http://example.org/path/to/the/video.mp4'
file: /path/to/the/video.mp4
caption: My video
username: myuser
password: myuser_pwd
target: '[12345, 67890] or 12345'
disable_notification: true
timeout: 1000
keyboard:
  - '/command1, /command2'
  - /command3
inline_keyboard: >-
  ["/button1, /button2", "/button3"] or [[["Text button1", "/button1"], ["Text
  button2", "/button2"]], [["Text button3", "/button3"]]]

You don’t need all that, but those are all the parameters you can use with that service. If you are using telegram I am guessing you have that service already. Seems you can set the timeout to your likings

1 Like