Frage zum TelegramBot-Modul

Begonnen von wowogiengen, 15 Mai 2023, 19:21:14

Vorheriges Thema - Nächstes Thema

wowogiengen

Hallo,
ich habe das TelegramBot-Modul erfolgreich im Einsatz, und kann damit Bilder meiner IP-Haustürkamera an die Teilnehmer der Chatgruppe schicken, wenn jemand über die fritzbox an der Tür klingelt..

Jetzt habe ich mir gedacht, ich probiere einmal die Überwachungssoftware von synology aus (Surveillance-Station) und sende von dort aus eine entsprechende Chat-Nachricht...

Soviel zum Hintergrund.
Ein Nachricht mit dem TelegramBot kann ich ja auf diese Art und Weise losschicken:
http://fhem2:8088/fhem?cmd=set%20teleBot%20_msg%20Kamera%20hat%20Bewegung%20erkannt!!

Der TelegramBot sendet mir dann auch "Kamera hat Bewegung erkannt" aufs Handy.Und im Browser werde ich dann auf die Seite http://fhem2:8088/fhem?fw_id= weitergeleitet.

Die Synology-Software jedoch scheint mehrfach die Adresse aufzurufen, wie man im Log sehen kann (persönliche Informationen habe ich mit @@@ unkenntlich gemacht):

2023.05.15 18:58:15 5: TelegramBot_Callback teleBot: called from Polling
2023.05.15 18:58:15 5: TelegramBot_Callback teleBot: data returned :{"ok":true,"result":[]}:
2023.05.15 18:58:15 5: TelegramBot_Deepencode teleBot: encoded a String from :1: to :1:
2023.05.15 18:58:15 5: TelegramBot_Deepencode teleBot: found an ARRAY
2023.05.15 18:58:15 5: TelegramBot_Deepencode teleBot: found a HASH
2023.05.15 18:58:15 5: TelegramBot_Callback teleBot: after encoding
2023.05.15 18:58:15 5: TelegramBot_Callback teleBot: polling returned result? 0
2023.05.15 18:58:15 5: UpdatePoll teleBot: number of results 0
2023.05.15 18:58:15 5: TelegramBot_UpdatePoll teleBot: called
2023.05.15 18:58:15 5: TelegramBot_UpdatePoll teleBot: - Initiate non blocking polling - With callback set
2023.05.15 18:58:15 5: TelegramBot_readToken: Read Telegram API token from file
2023.05.15 18:58:15 4: TelegramBot_UpdatePoll teleBot: initiate polling with nonblockingGet with 60s
2023.05.15 18:58:15 5: TelegramBot_UpdatePoll teleBot: - Ende > next polling started
2023.05.15 18:58:15 4: TelegramBot_Callback teleBot: resulted in SUCCESS from Polling
2023.05.15 18:58:15 5: TelegramBot_Callback teleBot: - Ende > Control back to FHEM
2023.05.15 18:58:19 5: TelegramBot_Set teleBot: called
2023.05.15 18:58:29 5: TelegramBot_Set teleBot: called
2023.05.15 18:58:39 5: TelegramBot_Set teleBot: called
2023.05.15 18:58:40 5: TelegramBot_Set teleBot: called
2023.05.15 18:58:40 4: TelegramBot_Set teleBot: Processing TelegramBot_Set( _msg )
2023.05.15 18:58:40 5: TelegramBot_Set teleBot: start send for cmd :_msg: and sendType :0:
2023.05.15 18:58:40 5: TelegramBot_SendIt teleBot: called
2023.05.15 18:58:40 5: TelegramBot_SendIt teleBot: try to send message to :-@@@@@@@@@@: -:Kamera hat Bewegung erkannt!!: - add :<undef>: - replyid :<undef>::    options ::
2023.05.15 18:58:40 4: TelegramBot_GetFullnameForContact # Contacts is -@@@@@@@@@@::#@@@@@@@@@@:
2023.05.15 18:58:40 4: TelegramBot_GetFullnameForContact # name is #@@@@@@@@@@
2023.05.15 18:58:40 5: TelegramBot_readToken: Read Telegram API token from file
2023.05.15 18:58:40 4: TelegramBot_SendIt parseMode 0
2023.05.15 18:58:40 4: TelegramBot_SendIt teleBot: Message for sending :--TelegramBot_boundary-x0123
Content-Disposition: form-data; name="chat_id"

-@@@@@@@@@@
--TelegramBot_boundary-x0123
Content-Disposition: form-data; name="text"

Kamera hat Bewegung erkannt!!
--TelegramBot_boundary-x0123--:
2023.05.15 18:58:40 4: TelegramBot_SendIt teleBot: timeout for sent :30:
2023.05.15 18:58:40 5: TelegramBot_Set teleBot: _msg done succesful:
2023.05.15 18:58:40 5: TelegramBot_Set teleBot: called
2023.05.15 18:58:40 5: TelegramBot_Set teleBot: called
2023.05.15 18:58:40 4: TelegramBot_Set teleBot: Processing TelegramBot_Set( _msg )
2023.05.15 18:58:40 5: TelegramBot_Set teleBot: start send for cmd :_msg: and sendType :0:
2023.05.15 18:58:40 5: TelegramBot_SendIt teleBot: called
2023.05.15 18:58:40 4: TelegramBot_SendIt teleBot: add send to queue :-@@@@@@@@@@: -:Kamera hat Bewegung erkannt!!: - :<undef>:
2023.05.15 18:58:40 5: TelegramBot_Set teleBot: _msg done succesful:
2023.05.15 18:58:40 5: TelegramBot_Set teleBot: called
2023.05.15 18:58:40 5: TelegramBot_Callback teleBot: called from SendIt
2023.05.15 18:58:40 5: TelegramBot_Callback teleBot: data returned :{"ok":true,"result":{"message_id":1837,"from":{"id":@@@@@@@@@@,"is_bot":true,"first_name":"@@@@@@@@@@","username":"@@@@@@@@@@"},"chat":{"id":-@@@@@@@@@@,"title":"@@@@@@@@@@","type":"supergroup"},"date":@@@@@@@@@@,"text":"Kamera hat Bewegung erkannt!!"}}:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :1: to :1:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :Kamera hat Bewegung erkannt!!: to :Kamera hat Bewegung erkannt!!:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :1837: to :1837:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :@@@@@@@@@@: to :@@@@@@@@@@:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :@@@@@@@@@@: to :@@@@@@@@@@:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :@@@@@@@@@@: to :@@@@@@@@@@:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :1: to :1:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: found a HASH
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :@@@@@@@@@@: to :@@@@@@@@@@:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :@@@@@@@@@@: to :@@@@@@@@@@:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :supergroup: to :supergroup:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: found a HASH
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :@@@@@@@@@@: to :@@@@@@@@@@:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: found a HASH
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: found a HASH
2023.05.15 18:58:40 5: TelegramBot_Callback teleBot: after encoding
2023.05.15 18:58:40 5: TelegramBot_Callback teleBot: resulted in SUCCESS from SendIt
2023.05.15 18:58:40 5: TelegramBot_Set teleBot: called
2023.05.15 18:58:40 5: TelegramBot_Callback teleBot: handle queued send with :-@@@@@@@@@@: -:Kamera hat Bewegung erkannt!!:
2023.05.15 18:58:40 5: TelegramBot_SendIt teleBot: called
2023.05.15 18:58:40 5: TelegramBot_SendIt teleBot: try to send message to :-@@@@@@@@@@: -:Kamera hat Bewegung erkannt!!: - add :<undef>: - replyid :<undef>::    options ::
2023.05.15 18:58:40 4: TelegramBot_GetFullnameForContact # Contacts is -@@@@@@@@@@::#@@@@@@@@@@:
2023.05.15 18:58:40 4: TelegramBot_GetFullnameForContact # name is #@@@@@@@@@@
2023.05.15 18:58:40 5: TelegramBot_readToken: Read Telegram API token from file
2023.05.15 18:58:40 4: TelegramBot_SendIt parseMode 0
2023.05.15 18:58:40 4: TelegramBot_SendIt teleBot: Message for sending :--TelegramBot_boundary-x0123
Content-Disposition: form-data; name="chat_id"

-@@@@@@@@@@
--TelegramBot_boundary-x0123
Content-Disposition: form-data; name="text"

Kamera hat Bewegung erkannt!!
--TelegramBot_boundary-x0123--:
2023.05.15 18:58:40 4: TelegramBot_SendIt teleBot: timeout for sent :30:
2023.05.15 18:58:40 5: TelegramBot_Callback teleBot: - Ende > Control back to FHEM
2023.05.15 18:58:40 5: TelegramBot_Callback teleBot: called from SendIt
2023.05.15 18:58:40 5: TelegramBot_Callback teleBot: data returned :{"ok":true,"result":{"message_id":1838,"from":{"id":@@@@@@@@@@,"is_bot":true,"first_name":"@@@@@@@@@@","username":"@@@@@@@@@@"},"chat":{"id":-@@@@@@@@@@,"title":"@@@@@@@@@@","type":"supergroup"},"date":@@@@@@@@@@,"text":"Kamera hat Bewegung erkannt!!"}}:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :Kamera hat Bewegung erkannt!!: to :Kamera hat Bewegung erkannt!!:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :@@@@@@@@@@: to :@@@@@@@@@@:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :-@@@@@@@@@@: to :-@@@@@@@@@@:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :supergroup: to :supergroup:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: found a HASH
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :@@@@@@@@@@: to :@@@@@@@@@@:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :1838: to :1838:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :1: to :1:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :@@@@@@@@@@: to :@@@@@@@@@@:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :@@@@@@@@@@: to :@@@@@@@@@@:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :@@@@@@@@@@: to :@@@@@@@@@@:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: found a HASH
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: found a HASH
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: encoded a String from :1: to :1:
2023.05.15 18:58:40 5: TelegramBot_Deepencode teleBot: found a HASH
2023.05.15 18:58:40 5: TelegramBot_Callback teleBot: after encoding
2023.05.15 18:58:40 5: TelegramBot_Callback teleBot: resulted in SUCCESS from SendIt
2023.05.15 18:58:40 5: TelegramBot_Set teleBot: called
2023.05.15 18:58:40 5: TelegramBot_Callback teleBot: - Ende > Control back to FHEM
2023.05.15 18:58:49 5: TelegramBot_Set teleBot: called
2023.05.15 18:58:59 5: TelegramBot_Set teleBot: called
2023.05.15 18:59:05 5: TelegramBot_Callback teleBot: called from Polling
2023.05.15 18:59:05 5: TelegramBot_Callback teleBot: data returned :{"ok":true,"result":[]}:
2023.05.15 18:59:05 5: TelegramBot_Deepencode teleBot: encoded a String from :1: to :1:
2023.05.15 18:59:05 5: TelegramBot_Deepencode teleBot: found an ARRAY
2023.05.15 18:59:05 5: TelegramBot_Deepencode teleBot: found a HASH
2023.05.15 18:59:05 5: TelegramBot_Callback teleBot: after encoding
2023.05.15 18:59:05 5: TelegramBot_Callback teleBot: polling returned result? 0
2023.05.15 18:59:05 5: UpdatePoll teleBot: number of results 0
2023.05.15 18:59:05 5: TelegramBot_UpdatePoll teleBot: called
2023.05.15 18:59:05 5: TelegramBot_UpdatePoll teleBot: - Initiate non blocking polling - With callback set
2023.05.15 18:59:05 5: TelegramBot_readToken: Read Telegram API token from file
2023.05.15 18:59:05 4: TelegramBot_UpdatePoll teleBot: initiate polling with nonblockingGet with 60s
2023.05.15 18:59:05 5: TelegramBot_UpdatePoll teleBot: - Ende > next polling started
2023.05.15 18:59:05 4: TelegramBot_Callback teleBot: resulted in SUCCESS from Polling
2023.05.15 18:59:05 5: TelegramBot_Callback teleBot: - Ende > Control back to FHEM

Meine Vermutung ist die, dass durch den Status 302, den der originale Link als Antwort zurückliefert, die Surveillance-Software annimmt, die Übertragung wäre fehlgeschlagen, und es deswegen nochmals versucht. Das sieht man auch daran, dass im Webbrowser die Webseite nach dem Aufruf dann http://fhem2:8088/fhem?fw_id= ist.

Frage: Gibt es eine Möglichkeit, dass immer der Status 200 ausgegeben wird?