-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send a jpeg as part of the message? #16
Comments
Did you manage to fix this? I have the same question at this moment... |
@JohnF87 , I ended up switching to a different plugin (https://github.com/pponce/homebridge-script2) and then using a script to send the picture. You can easily send a picture via a bash script (Google is your friend here... curl -X POST....) |
Can you give me some help? I found this, but the JSON is invalid. #!/bin/sh $1 = Chat ID$2 = Caption$3 = Disable Notification (true or false)TelegramToken="12345678:AABBCCDDEEFFasdfjasdhfkashdf" Get snapshot via Domoticz serverwget -O $SnapFile "http://192.168.123.100:8080/camsnapshot.jpg?idx=1" Send Telegram message with imagecurl -s -X POST "https://api.telegram.org/bot$TelegramToken/sendPhoto" -F chat_id=$1 -F caption="$2" -F disable_notification=$3 -F photo="@$SnapFile" Remove SnapFile/bin/rm $SnapFile |
The exact code is below. Obviously you need to change the wget command (line 6) to point to where your image is and also change the "bot ID" and "chat ID" to match your circumstances. This will send a photo via the bot each time the doorbell script is activated. `#!/bin/sh current_time=$(date "+%Y.%m.%d-%H.%M.%S") curl -X POST "https://api.telegram.org/bot1111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/sendPhoto" -F chat_id=111111111 -F parse_mode="MarkdownV2" -F text="${new_message} \- 🔔Doorbell Ring🔔" curl -X POST "https://api.telegram.org/bot1111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/sendPhoto" -F chat_id=1111111111 -F photo="@snap.jpeg" rm snap.jpeg ` |
Thanks for the code. Can you help me one more time. I have zero experience with scripting. |
@JohnF87 , the code above needs to be placed into a separate file, not within the JSON. The JSON config is simply to call the file to execute when certain triggers are met. |
My doorbell produces a static small .jpeg file at http://192.168.xx.xx/snap.jpeg ... would it be possible to embed that image (not a link to the image, but the actual image?)
The text was updated successfully, but these errors were encountered: