Getting Thingino webhooks to play nice with ntfy
A quick fix for anyone else who's got a Thingino firmware'd camera and wants to send notifications with screenshots to ntfy via Thingino's 'webhook' option.
By default it won't work, because behind the scenes Thingingo calls curl -F 'image=@$attachment'
and sends the image as form data. You will receive an attachment.bin
file which won't open:
To play nicely with ntfy
you need to change this to -F
to a -T
for "upload file". And while you're in there you might as well add a nice title and icon too:
You'll need to:
ssh root@ip_address
to log into the camera, andvi /usr/sbin/send2webhook
to edit the webhook code
Change line 36 from build_cmd "-F 'image=@$attachment'"
to something like:
build_cmd "-T '$attachment' -H 'Filename: camera.jpg'" -H 'Tag: camera_flash' -H 'Title: Front door motion detected'
Save and you're done. Easy!