Telegram Bot, Bild mit Text

Begonnen von mergat, 19 Januar 2020, 11:41:21

Vorheriges Thema - Nächstes Thema

mergat

Hi all,

seit einiger Zeit nutze ich das Telegram Modul um mir mit "sendPhoto" per FHEM ein Bild zusenden zu lassen wenn ein Ereignis eintritt. Zu jedem Foto sende ich vorher einen kleinen String. Mich stört aber schon länger, dass dies immer zwei Nachrichten (inkl. Latenzen) sind. Besteht die Möglichkeit, das Bild direkt mit dem Text zu versenden? So wäre dies nur eine Nachricht...

Eigentlich für den Client kein Problem aber ich weiss nicht, ob das Modul das unterstützt welches die API bedient...

VG,
Mergat   

andies

Da musst Du wohl mal den Modulautor fragen. Es könnte sein, dass es im API dafür einen Platzhalter gibt:
caption String Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters
FHEM 6.1 auf RaspPi3 (Raspbian:  6.1.21-v8+; Perl: v5.32.1)
SIGNALduino (433 MHz) und HM-UART (868 MHz), Sonoff, Blitzwolf, Somfy RTS, CAME-Gartentor, Volkszähler, Keyence-Sensor, Homematic-Sensoren und -thermostat, Ferraris-Zähler für Wasseruhr, Openlink-Nachbau Viessmann

MKeY

bei sendImage kannst du einen Text einfügen
fhem("set teleBot sendImage ./www/snapshots/WZ_3DDrucker_MK2_CAM_snapshot.jpg Fortschritt: $progressPercent2 % | Fertig in $progressTimeLeft2 Minuten");
kommt in einer nachricht mit image und text und zeilenumbruch beim |

ZitatsendImage|image [ @<peer1> ... @<peerN>] <file> [<caption>]
Sends a photo to the given peer(s) or if ommitted to the default peer. File is specifying a filename and path to the image file to be send. Local paths should be given local to the root directory of fhem (the directory of fhem.pl e.g. /opt/fhem). Filenames with special characters (especially spaces) need to be given with url escaping (i.e. spaces need to be replaced by %20). Rules for specifying peers are the same as for messages. Multiple peers are to be separated by space. Captions can also contain multiple words and do not need to be quoted.
Wer Fehler findet, darf sie behalten!
RPi's, D1Mini
Homematic, Hue, Sonoff, Alexa, Xiaomi, ConBee
Prusa MK2.5, Prusa MK3S (MMU2S vorhanden, aber nervtötend)
Lowrider 2CNC

StephanFHEM

genau das hab ich auch gesucht und umgesetzt. Jetzt fehlt nur noch die Einbindung von "sendLocation".

Hintergrund: hab vorher immer ein Bild, ein Text (Status) und die Location gesendet und hätte das gerne in einer anstatt 3 Nachrichten.

Vielleicht weiß ja jemand wie ich die Location bzw. das Bild der Karte auch noch in die Bild/Text-Message bekomme