I have been using the facebook
notify integration for a long time to receive camera snapshots. However, a while ago, the images simply stopped arriving.
Strangely enough, I can still send some random image from the web by using a call like this:
service: notify.messenger
data:
message: Test message
data:
attachment:
type: image
payload:
url: https://i.imgur.com/hm54HiQ.jpeg
target:
- my_user_id
The image shows up in my Messenger instantly.
But if I try to use this with an image from the local system (like this), the message never arrives:
service: notify.messenger
data:
message: Test message
data:
attachment:
type: image
payload:
url: https://external.hass.url/local/snap-image.png
target:
- my_user_id
What I have checked:
- the image does exist in HAss/config/www
- the external URL is valid, and reachable from the outside (I open the URL with a browser, I see the image)
- the HTTPS certificate for the external URL is valid and trusted
In the logs, all I see are messages like this:
Logger: homeassistant.components.facebook.notify
Source: components/facebook/notify.py:98
integration: facebook (documentation, issues)
First occurred: April 17, 2024 at 11:06:14 AM (40 occurrences)
Last logged: 8:04:36 PM
Error 400 : (#100) Upload attachment failure. (Code 100)
[ Editing to add additional info: when sending the same request directly to the FB API (via curl
), I get a somewhat more detailed error message:
{"error":{"message":"(#100) Upload attachment failure.","type":"OAuthException","code":100,"error_subcode":2018047,"fbtrace_id":"A7yf..."}}
According to the documentation, “a common way to trigger this error is that the provided media type does not match type of file provided int the URL”. However, if I access the external URL from my browser, the response header of “Content-Type: image/png
” seems correct. ]
[ One more update: if I upload the .png file to another web server, I can send it using the exact same request just fine. The problem seems to be with the way the internal web server in Home Assistant is serving the files - somehow it is serving them in a way that the Facebook servers will not accept… ]
Also, I can send text messages without any issues.
Anyone who could point me in the right direction for troubleshooting this?
Thank you!