send camera snapshot

Moderator: leecollings

Post Reply
ssk17051980
Posts: 112
Joined: Thursday 08 December 2022 22:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: ROMANIA
Contact:

send camera snapshot

Post by ssk17051980 »

I'm trying to send a notification in Telegram with a snapshot from a camera.
I can't do it at all.
Attachments
domoticz camera.jpg
domoticz camera.jpg (28.96 KiB) Viewed 1319 times
azonneveld
Posts: 157
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: send camera snapshot

Post by azonneveld »

Create a script file and paste code below.
Then call the script from your code

(script must be executable, make it so: sudo chmod +x [scriptfile] )

Code: Select all

#!/bin/sh

#FILE LOCATION
SnapFile="[LOCATION FOR TEMP STORAGE]"

#FETCH SNAPSHOT
wget "[URL TO GET SNAPSHOT]" -O $SnapFile

#SEND SNAPSHOT
curl -s -X POST "https://api.telegram.org/bot[APIKEY]/sendPhoto" -F chat_id=[CHATID] -F photo="@$SnapFile"

#REMOVE FILE
rm $SnapFile
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
ssk17051980
Posts: 112
Joined: Thursday 08 December 2022 22:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: ROMANIA
Contact:

Re: send camera snapshot

Post by ssk17051980 »

thx. i gone try tonight
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest