Replies: 11 comments 1 reply
-
|
Hi, have you tried this endpoint https://github.com/gajosu/ha-whatsapp-web-rest-api?tab=readme-ov-file#send-media-message? This endpoint theoretically sends any type of file, whether it's an image or a video. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your feedback. It is possible to send a video as an attachment with the "sendMediaAsDocument" option, but not as media file to be watched within whatsapp, similar to a standard video or gif that i would send from my mobile gallery |
Beta Was this translation helpful? Give feedback.
-
|
Here is the script response if I dont use the "asdociment" option, trying an .mp4 file as url: EDIT: after further testing the error above may not be caused by the video file itself but because of API server timeout due to large file size. I tested with a small gif file and it s sent correctly, but in whatsapp the gif shows as a static image instead of an animation. |
Beta Was this translation helpful? Give feedback.
-
|
I'm preparing an update with improvements to file downloads. As for GIFs, I believe the package does not allow animated GIFs to be sent, but what you can do is send a video as a GIF or sticker in the following way: {
"url": "https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExaGZicDg1NnA4aDNnaDZ1cjRzbDVzMzU2anZxZTJsY21pbmgyZzRseCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/OhRRABiZEf6URNJVLR/giphy.mp4",
"options":{
"sendVideoAsGif": true
}
}Docs: |
Beta Was this translation helpful? Give feedback.
-
|
Check out the latest version and PR #192. I've improved file downloads and set a configurable size limit in the env, but I don't recommend exceeding 60 MB because WhatsApp gives an error when sending it. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you gajosu. Would you mind to update as well the HA-addon repository with the new version so I can test it ? Thanks |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I just updated the add-on! |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the update. I just tested it with one of the mp4 video generated by Frigate and unfortunately it still does not work for me :/ the file is only 36Ko so it should not be a problem. I would be happy to share the external link of such cctv video with you but I would rather not post it here, maybe I can send you an email ? Here is the error from the add-on : Note that with such link Frigate generates an mp4 video based on the gif, so it's not sending a gif unlike the link name may suggest |
Beta Was this translation helpful? Give feedback.
-
|
I think Frigate is not generating a download file for you, but rather a video stream, which may be why it is giving an error when sending it. I suggest you use the Frigate events API to send the video |
Beta Was this translation helpful? Give feedback.
-
|
I have tried with the clip.mp4 from the event, but unfortunately I have exactly the same error. The clip is 24Mb. Strange enough, if I replace the clip.mp4 from frigate with your sample mp4 above, it works fine. By the way I forgot to post the result from the the rest_command itself : I hope this can help 🤞 |
Beta Was this translation helpful? Give feedback.
-
|
It looks like the timeout for the video upload is set to 5 seconds by default, is there any chance to increase that ? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear gajosu,
Thanks again for your nice Whatsapp integration. At the moment it seems not possible to send videos or gif via your home assistant addon. I dug a bit the API documentation and I found this explanation : https://wwebjs.dev/guide/creating-your-bot/handling-attachments.html#sending-files-from-a-url . Is there a way to implement something like that with your addon ?
Thank you !
Beta Was this translation helpful? Give feedback.
All reactions