Telegram we współpr...
 
Powiadomienia
Wyczyść wszystko

Telegram we współpracy z Domoticzem i nie tylko z nim

25 Wpisów
8 Użytkownicy
7 Likes
6,039 Wyświetleń
(@szmydu)
Wpisów: 68
Kontrybutor
 

Działa, musiałem tak zmienić linię:

local domoReq = 'http://192.168.8.106:8081/shot.jpg'

gdzie /shot.jpg mam wpisane w konfiguracji kamery w domoticzu w kolumnie adres url do grafiki.

 
Dodane : 04/03/2021 9:42 pm
isom reacted
(@muchac35)
Wpisów: 443
Ekspert
 

Witajcie

Mój system trochę się rozrasta i teraz chciałbym w jednym skrypcie umieścić aby domoticz przesyłał mi zdjęcie z 4 kamer

#!/bin/sh
SnapFile="/var/tmp/image.jpg"

# Get snapshot via Domoticz server
wget -O $SnapFile "http://adresIP kamery/cgi-bin/snapshot.cgi"

# Send Telegram message with image
curl -s -X POST "https://api.telegram.org/bot[TOKEN]/sendMessage?chat_id=12345678&text=zdjecie Kam1"
curl -s -X POST "https://api.telegram.org/bot[TOKEN]/sendPhoto?chat_id=12345678" -F photo="@$SnapFile"

# Remove Image
/bin/rm $SnapFile

 

jak zmodyfikować ten skrypt zapisywał z 4 kamer zdjęcie i je przesyłał na telegram bo jeśli dodaje 4 dodatkowe linie ze zmienionymi tylko danymi kamer to przesyła i tak 4x to samo zdj z pierwszej kamery.

 
Dodane : 23/08/2021 11:08 am
isom
 isom
(@isom)
Wpisów: 5079
Szef wszystkich szefów Moderator Zasłużony dla Forum, Donator 2K19, Donator 2K20
Autor tematu
 

Dwie kamery 

#!/bin/sh
SnapFile1="/var/tmp/image1.jpg"
SnapFile2="/var/tmp/image2.jpg"
# Get snapshot via Domoticz server
wget -O $SnapFile1 "http://adresIP kamery/cgi-bin/snapshot.cgi"
wget -O $SnapFile2 "http://adresIP kamery/cgi-bin/snapshot.cgi"
# Send Telegram message with image
curl -s -X POST "https://api.telegram.org/bot[TOKEN]/sendMessage?chat_id=12345678&text=zdjecie Kam1"
curl -s -X POST "https://api.telegram.org/bot[TOKEN]/sendPhoto?chat_id=12345678" -F photo="@$SnapFile1"
curl -s -X POST "https://api.telegram.org/bot[TOKEN]/sendMessage?chat_id=12345678&text=zdjecie Kam2"
curl -s -X POST "https://api.telegram.org/bot[TOKEN]/sendPhoto?chat_id=12345678" -F photo="@$SnapFile2"
# Remove Image
/bin/rm $SnapFile1
/bin/rm $SnapFile2

 

albo 

#!/bin/sh
SnapFile1="/var/tmp/image1.jpg"
SnapFile2="/var/tmp/image2.jpg"
DomoUrl="192.168.x.xxx:8082"
# Get snapshot via Domoticz server
wget -O $SnapFile1 $DomoUrl"/camsnapshot.jpg?idx=1"
wget -O $SnapFile2 $DomoUrl"/camsnapshot.jpg?idx=2"
# Send Telegram message with image

curl -s -X POST "https://api.telegram.org/botxxxxxxxxxxxxxxxxxxxxxxxxxxyyy/sendMessage?chat_id=12345678&text=Coś tam"
curl -s -X POST "https://api.telegram.org/botxxxxxxxxxxxxxxxxxxxxxxxxxxyyy/sendPhoto?chat_id=12345678" -F photo="@$SnapFile1"
curl -s -X POST "https://api.telegram.org/botxxxxxxxxxxxxxxxxxxxxxyyyyyyy/sendMessage?chat_id=12345678&text=Inna wiadomość"
curl -s -X POST "https://api.telegram.org/botxxxxxxxxxxxxxxxxxxxxxyyyyyyy/sendPhoto?chat_id=12345678" -F photo="@$SnapFile2"

# Remove Image
/bin/rm $SnapFile1
/bin/rm $SnapFile2
 
Dodane : 23/08/2021 1:31 pm
muchac35 and wojtek_gtx reacted
(@muchac35)
Wpisów: 443
Ekspert
 

@isom 

jak zwykle szybko zwięźle i na temat bardzo dziękuję

 

 
Dodane : 23/08/2021 2:40 pm
(@muchac35)
Wpisów: 443
Ekspert
 

Jeszcze mam takie pytanie w jakiej rozdzielczości telegram otrzymuje zdjęcia z kamer bo u mnie jest to 1280x720 natomiast  kamera ma ustawione 1920x1080 ale telegram otrzymuje zmniejszone

Da się aby telegram wyświetlał takie jaką ma rozdzielczość ustawiona kamera?

Podpowiedział by mi ktoś jaki trzeba napisać skrypt aby domoticz wysyłał zdjęcia z kamery na serwer FTP?

 
Dodane : 25/08/2021 12:11 pm
Strona 2 / 2
Udostępnij: