As the topic states, I have an automation that once triggered sends a picture via telegram, the automation triggers, picture gets sent, but I notice the following error in the log repeated multiple times.
2018-03-07 12:01:05 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback SendfilePayloadWriter._sendfile_cb(<Future cancelled>, 47, 40, 856680, 1473296, <_UnixSelecto...e debug=False>, True)
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/events.py", line 126, in _run
self._callback(*self._args)
File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_fileresponse.py", line 38, in _sendfile_cb
loop.remove_writer(out_fd)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 351, in remove_writer
self._ensure_fd_no_transport(fd)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 258, in _ensure_fd_no_transport
fd, transport))
RuntimeError: File descriptor 47 is used by transport <_SelectorSocketTransport fd=47 read=polling write=<polling, bufsize=0>>
Can anyone provide some insight?
Automation:
- alias: Living Room Motion
trigger:
- platform: state
to: 'on'
entity_id: binary_sensor.living_room_sensor_motion
action:
- service: script.living_room
- service: notify.telegram
data:
title: Living Room Alert!
message: Someone is in the house.
data:
photo:
- file: /home/homeassistant/.homeassistant/cameraimages/living_room.jpg
I also notice on the receiving side, there is no title or message, just the picture, is this normal behavior when sending photo?
action:
# Actions are scripts so can also be a list of actions
- service: notify.notify
data:
message: Beautiful sunset!
- delay: 0:35
- service: notify.notify
data:
message: Oh wow you really missed something great.
Have you tried using debug for the logger? This error could be unrelated to your automation.
Good to know, Iāve always wanted to do that but created a script for it. I donāt know why that isnāt covered under the normal automation sectionā¦ Seems like the docs are too segmented.
Itās ironic, I rebooted just after my initial post and the error hasnāt showed up since, but i have seen the same error some time ago prior to this, I will debug and report back.
Looks like its a bug in the telegram component. This is basically saying that the response from telegram is crap. There may be nothing you can do.
For some reason, the component doesnāt like the arguments or keyword arguments. The component must be looking for a specific number of arguments or a specific keyword argument that is missing.
Youāre only options are to debug the component and find out why it doesnāt like the arguments or keyword arguments.
After commenting, I did some reading on your postās and recomendationās, and ended up adding parse_mode: html which seems to be keeping it quite for the moment, will update on any changes.
Hmm, maybe it was returning a string instead of the actual objects needed. I did find it odd that āArgsā was capitalized. This leads me to believe that they printed a string and assumed it was a sentence and capitalized the first letter of the string. This is all conjecture though.
Itās probably not worth it. I debugged down all the way to the errors and their meaning and both point to connection issues. Both errors inherit from NetworkError.
To the telegram bot Iām guessing. I have no idea what this device is. If its internal to your network, then you are having network issues. If its external from your network, then itās having trouble sending or receiving a āconfirmationā from the send.
I just looked it up, its a cloud based service. So most likely, your network isnāt routing the telegram bot responses back to HA properly. This may be caused by your router/network configuration.