50_SSChatBot - Integration des Synology Chat Servers

Begonnen von DS_Starter, 25 November 2019, 07:56:56

Vorheriges Thema - Nächstes Thema

DS_Starter

#165
Hallo Wiesel,

du schreibst:
ZitatJetzt ist dauern die anfragen an Synology immer noch ca 30-45 sekunden. Vorher war das innerhalb 5 sekunden da.
Ich glaube aber du meinst nicht die Anfragen sondern dass die Antwort der Synology solange dauert, was dann zu einem timeout führte.

Ich kann dir momentan nicht sagen wie man auf der Syno die Performance von Webrequests verfolgen kann, evtl. könnte der Syno Support helfen.
Aber wie reagiert deine Syno generell ? Also z.B. wenn du dich beim DSM anmeldest. Dannn könntest du mal die CPU-Belastung prüfen (top auf Linux) oder das Swap-Verhalten. Das sieht man im DSM im Ressourcenmonitor.
Ich tippe jetzt ganz stark darauf dass dein Synology Hauptspeicher nach einer gewissen Zeit aufgebraucht ist und deshalb der Speicher auf die Platte ausgelagert wird was zum Swap führt. Das dauert sehr lange und führt dann zu solchem Verhalten.

Hier noch zum Vergleich ein Protokoll bei mir:


2021.11.27 22:52:23.161 5: SynChatBot - Add Item to queue - Index 85:
{
  'attachment' => '',
  'opmode' => 'sendItem',
  'userid' => 4,
  'method' => 'chatbot',
  'text' => 'test',
  'fileUrl' => '',
  'channel' => '',
  'retryCount' => 0
}

2021.11.27 22:52:23.162 4: SynChatBot - ####################################################
2021.11.27 22:52:23.162 4: SynChatBot - ###         start Chat operation sendItem   
2021.11.27 22:52:23.162 4: SynChatBot - ####################################################
2021.11.27 22:52:23.163 4: SynChatBot - API hashvalues already set - ignore get apisites
2021.11.27 22:52:23.163 4: SynChatBot - botToken read from RAM: ********
2021.11.27 22:52:23.164 4: SynChatBot - start SendQueue entry index "85" (sendItem) for operation.
2021.11.27 22:52:23.164 5: SynChatBot - HTTP-Call will be done with httptimeout: 20 s
2021.11.27 22:52:23.165 4: SynChatBot - Call-Out: http://192.168.2.10:5000/webapi/entry.cgi?api=SYNO.Chat.External&version=2&method=chatbot&token="<secret>"&payload={"text": "test","user_ids": [4]}
2021.11.27 22:52:23.351 5: SynChatBot - JSON returned: {
  'success' => bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ),
  'data' => {
              'succ' => {
                          'user_id_post_map' => {
                                                  '4' => '68719495441'
                                                }
                        },
              'fail' => undef
            }
}

2021.11.27 22:52:23.359 4: SynChatBot - Opmode "sendItem" finished successfully, Sendqueue index "85" deleted.


Die Antwort kommt innerhalb von ca. 200 Millisekunden.

LG,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

Wiesel

#166
Hallo Heiko,
Ja die Antwort meine ich natürlich.
Das DS-Verhalten würde ich sonst als normal bezeichnen. Drive, Mail Plus, Surveillance, VM's, Chat (app/browser) laufen ohne Verzögerung.
Eine Antwort zu dem httprequest wie http://192.168.186.51:5000/webapi/entry.cgi?api=SYNO.API.Info&version=1&method=query&query=SYNO.API.Auth,SYNO.Chat.External bekomme ich innerhalb von Millisekunden
sobald ich jedoch spezifische requests an einen Bot sende (mit token) dauern die Anworten wieder lange.

Also CPU last und RAM Auslastung sollten kein Problem sein. Siehe Anhang für Details.
Hab noch ~3GB freier RAM und swap ist so gut wie nicht benutzt. Wenn ich ein httprequest stelle ist auch kein Ausschlag im Swap Ressourcen-Monitor.
Die lange Antwortzeit ist jetzt auch direkt nach einem Neustart der Synology ... hmmmpf.

Habe mal ein Support Ticket bei Synology erstellt.

Werde als nächstes mal Synology Chat neu installieren.

Update folgt.

Update 1:
Neuinstallation des Chat Servers hat nicht zum Erfolg geführt.

LG
Tobias
Raspi 4 mit FHEM und CUL / Conbee2

DS_Starter

Hallo Tobias,

ja dann war meine Vermutung eher der Holzweg.
Du könntest noch testen wie das Zeitverhalten ist wenn du mit der Chatapplikation eine Message an FHEM sendest.
Vorher stellst du verbose 5 bei dem Web-Device ein welches mit installiert wurde (default ist WEBSSChatBot).

Du siehst dann so etwas im Log und kannst die Zeiten abschätzen die von der Syno zu FHEM benötigt werden wenn eine Message gesendet wird.


2021.11.28 22:15:06.632 4: Connection accepted from WEBSSChatBot_192.168.2.10_40398
2021.11.28 22:15:06.634 5: POST /sschat/outchat?botname=SynChatBot&fwcsrf=5de4ebe4 HTTP/1.1
Host: fhem.myds.me:8086
User-Agent: SynologyChatBot/1.0
Accept: */*
Content-Length: 161
Content-Type: application/x-www-form-urlencoded
2021.11.28 22:15:06.634 4: WEBSSChatBot_192.168.2.10_40398 POST /sschat/outchat?botname=SynChatBot&fwcsrf=5de4ebe4&token=0kXmkpfoz76zJZ7TtGa1ga2HCDFPI63kD4Prrmr1mNr6MoXGcO1huAGTOjk4Iiqv&user_id=4&username=Heiko&post_id=68719495474&thread_id=0&timestamp=1638134106515&text=Test; BUFLEN:0
2021.11.28 22:15:06.643 4: WEBSSChatBot: /sschat/outchat?botname=SynChatBot&fwcsrf=5de4ebe4&token=0kXmkpfoz76zJZ7TtGa1ga2HCDFPI63kD4Prrmr1mNr6MoXGcO1huAGTOjk4Iiqv&user_id=4&username=Heiko&post_id=68719495474&thread_id=0&timestamp=1638134106515&text=Test / RL:7 / text/plain; charset=utf-8 /  / Cache-Control: no-cache, no-store, must-revalidate


Grüße,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

Wiesel

Hallo Heiko,

Zeitverhalten ist ähnlich wie bei dir.

2021.11.28 22:25:31.952 4: Connection accepted from WEBSSChatBot_192.168.186.51_38492
2021.11.28 22:25:31.953 5: POST /sschat/outchat?botname=SSChatBot&fwcsrf=5ff8469c HTTP/1.1
Host: 192.168.186.59:8082
User-Agent: SynologyChatBot/1.0
Accept: */*
Content-Length: 163
Content-Type: application/x-www-form-urlencoded
2021.11.28 22:25:31.954 4: WEBSSChatBot_192.168.186.51_38492 POST /sschat/outchat?botname=SSChatBot&fwcsrf=5ff8469c&token=sqavgL6ZeUKdl4Tga47PXOCwtaNmsDiw3U9oqCq1tOdyFwY3n2A1R3P9rTCVgenX&user_id=4&username=TobiasE&post_id=21474836490&thread_id=0×tamp=1638134731888&text=test; BUFLEN:0
2021.11.28 22:25:32.011 4: WEBSSChatBot: /sschat/outchat?botname=SSChatBot&fwcsrf=5ff8469c&token=sqavgL6ZeUKdl4Tga47PXOCwtaNmsDiw3U9oqCq1tOdyFwY3n2A1R3P9rTCVgenX&user_id=4&username=TobiasE&post_id=21474836490&thread_id=0×tamp=1638134731888&text=test / RL:7 / text/plain; charset=utf-8 /  / Cache-Control: no-cache, no-store, must-revalidate


Grüße
Tobias
Raspi 4 mit FHEM und CUL / Conbee2

DS_Starter

Scheint tatsächlich ein Zeitproblem bei der Tokenprüfung zu sein. Mal schauen was der Support sagt.
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

Wiesel

#170
Hallo,

Support Ticket noch offen, aber war in der Zwischenzeit nicht untätig.

Ich habe mir ein Script geschrieben welches mir die Antwortzeit jede Minute aufzeichnet und dann die Synology gestartet.
Glücklicherweise bin ich um /var/log/ Verzeichnis der Synology auf eine Synochat.log gestoßen.

Die Lange Antwortzeiten treten ab ca 12:16 auf


.
.
.
2021-11-29T12:15:55+01:00 DS918Plus synoscgi_SYNO.Chat.User.Avatar_1_get[10267]: user_avatar_get.hpp:52 (pid:10267, euid:119664) [err: (2)No such file or directory]avatar oripath empty with type!=S, throw exception, user nickname=, type=S
2021-11-29T12:15:55+01:00 DS918Plus synoscgi_SYNO.Chat.User.Avatar_1_get[10267]: Fatal Error: (user_avatar_get.hpp:53)[100] icon orig path is empty
2021-11-29T12:16:02+01:00 DS918Plus synoscgi_SYNO.Chat.External_2_chatbot[10269]: chatapi.cpp:48 (pid:10269, euid:119664) [err: (2)No such file or directory](192.168.186.72)(u:0)(a:0)webapi param={"api":"SYNO.Chat.External","method":"chatbot","payload":{"text":"curl time test","user_ids":[4]},"token":"UMDRznEC0yJ2V4NR7S8QiEd0IsaSWkzAVSdYhTpyLe0CGC5xY1AOdxqaxqV7t7eQ","version":2}
2021-11-29T12:17:32+01:00 DS918Plus synoscgi_SYNO.Chat.External_2_chatbot[10269]: autoblock_file_open.c:66 Open and lock [/tmp/login_fail.list] failed exceeds try count for 13(Permission denied)
2021-11-29T12:17:32+01:00 DS918Plus synoscgi_SYNO.Chat.External_2_chatbot[10269]: chatapi.cpp:48 (pid:10269, euid:119664) [err: (13)Permission denied](192.168.186.72)(u:0)(a:0)webapi param={"api":"SYNO.Chat.External","method":"chatbot","payload":{"text":"curl time test","user_ids":[4]},"token":"UMDRznEC0yJ2V4NR7S8QiEd0IsaSWkzAVSdYhTpyLe0CGC5xY1AOdxqaxqV7t7eQ","version":2}
2021-11-29T12:18:01+01:00 DS918Plus synoscgi_SYNO.Chat.User.Avatar_1_get[10932]: user_avatar_get.hpp:52 (pid:10932, euid:119664) [err: (2)No such file or directory]avatar oripath empty with type!=S, throw exception, user nickname=, type=S
.
.
.



der Übeltäter scheint das "permission denied" zu sein. In der Datei "/tmp/login_fail.list" ist meine öffentliche IP (+ kryptische zeichen) enthalten.

root@DS918Plus:~# cat /tmp/login_fail.list
fפa95.89.xxx.64co|wqפa95.89.xxx.6▒V▒▒05▒▒

Leere ich die Datei werden die Anfragen wieder innerhalb von Millisekunden beantwortet.

Automatische Blockierung + DoS-Schutz in den Synology Einstellungen ist aktiviert. Meine öffentliche IP ist aber nicht in der blockierten Listen enthalten. Erreiche auch alle meine Dienste über meine externe IP.

Weiß jemand eine Idee welcher Dienst getriggert wird damit etwas in die  "/tmp/login_fail.list" geschrieben wird ?

Synology Chat ist als App auf zwei Android-Smartphone installiert über die ich mittels dyndns zugreife.
Ansonsten alles nur im lokalen Netzwerk.



EDIT:

Auch wenn die Antwortzeiten im Millisekunden Bereich liegen bekomme ich trotzdem eine ERR: 2 Fehlermeldung im Log.
Kann jemand mal das bei sich überprüfen ?

2021-11-29T15:10:01+01:00 DS918Plus synoscgi_SYNO.Chat.External_2_chatbot[17423]: chatapi.cpp:48 (pid:17423, euid:119664) [err: (2)No such file or directory](192.168.186.72)(u:0)(a:0)webapi param={"api":"SYNO.Chat.External","method":"chatbot","payload":{"text":"curl time test","user_ids":[4]},"token":"UMDRznEC0yJ2V4NR7S8QiEd0IsaSWkzAVSdYhTpyLe0CGC5xY1AOdxqaxqV7t7eQ","version":2}


Grüße
Tobias

Raspi 4 mit FHEM und CUL / Conbee2

DS_Starter

Hallo Tobias,

in meiner  /var/log/synochat.log stehen nur solche Meldungen:


2021-11-29T07:59:30+01:00 SDS1 synoscgi_SYNO.Chat.User.Avatar_1_get[10586]: user_avatar_get.hpp:52 (pid:10586, euid:119664) [err: (2)No such file or directory]avatar oripath empty with type!=S, throw exception, user nickname=, type=S
2021-11-29T07:59:30+01:00 SDS1 synoscgi_SYNO.Chat.User.Avatar_1_get[10586]: Fatal Error: (user_avatar_get.hpp:53)[100] icon orig path is empty
2021-11-29T10:30:02+01:00 SDS1 synoscgi_SYNO.Chat.Post_4_batch_delete[10600]: post_batch_delete.hpp:43 (pid:10600, euid:119664) [err: (0)]clean post by batch delete config
2021-11-29T10:30:02+01:00 SDS1 synoscgi_SYNO.Chat.Post_4_batch_delete[10600]: post.cpp:491 (pid:10600, euid:119664) [err: (0)]clean post by batch delete config, iDayCount=5
2021-11-29T10:30:02+01:00 SDS1 synoscgi_SYNO.Chat.Post_4_batch_delete[10600]: post.cpp:509 (pid:10600, euid:119664) [err: (0)]clean post before timestamp = 1637746202
2021-11-29T10:30:02+01:00 SDS1 synoscgi_SYNO.Chat.Post_4_batch_delete[10600]: post.cpp:690 (pid:10600, euid:119664) [err: (0)]fork, run unlink files, forkFlag=187
2021-11-29T10:30:02+01:00 SDS1 synoscgi_SYNO.Chat.Post_4_batch_delete[10600]: post.cpp:704 (pid:10600, euid:119664) [err: (0)]watpid pid=4079
2021-11-29T10:30:02+01:00 SDS1 synoscgi_SYNO.Chat.Post_4_batch_delete[4079]: background_job_model.cpp:58 (pid:4079, euid:119664) [err: (0)]create job run ok, job_id=706, pid=4079, job_type=DELETE_POST_TYPE_BATCH, cmd_name=SYNO.Chat.Post_
2021-11-29T10:30:02+01:00 SDS1 synoscgi_SYNO.Chat.Post_4_batch_delete[4079]: background_job_model.cpp:130 (pid:4079, euid:119664) [err: (0)]delete job run ok, job_id list=[ 706 ]
2021-11-29T10:30:02+01:00 SDS1 synoscgi_SYNO.Chat.Post_4_batch_delete[4079]: post.cpp:695 (pid:4079, euid:119664) [err: (0)]process exit


Der einzige Fehler den ich sehe bezieht sich auf SYNO.Chat.User.Avatar.
Eine /tmp/login_fail.list gibt es bei mir überhaupt nicht.
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

DS_Starter

Meine Synology ist übrigens nicht im Internet zu erreichen, sondern auschließlich via VPN.
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

Wiesel

Also ich habe jetzt mal den Mail Server deinstalliert. War eh nur mehr Spielerei als produktiv genutzt   ;D
Portfreigabe für HTTPS vorerst deaktiviert. Einzig VPN Ports bleiben jetzt offen.

Bis jetzt läuft alles einwandfrei. Ich gehe davon aus, dass es mit dem Mail Server zusammengehangen hat.

Vielen Dank für die Unterstützung auch wenn es weniger um das FHEM Modul ging.

Grüße
Tobias
Raspi 4 mit FHEM und CUL / Conbee2

Wiesel

Hallo,

Der Vollständigkeit halber hier die Antwort vom Synology Support

Dear customer,

Thank you for contacting Synology Technical Support.


Your concern is known to our development department and a solution is already being worked on. This will be fixed in the following DSM7.1 version.
When exactly the version will be released, I can not tell you from our side, because we have no insight into the development processes.


You can follow news and changes in our newsletter.
This you can subscribe to via your Synology account.








Sincerely yours




Jason Hartmann
Technical Support Engineer


Grüße Tobias
Raspi 4 mit FHEM und CUL / Conbee2

DS_Starter

ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

rohlande

Hallo Experten,

kann mir jemand sagen, warum ich immer um 1 Timestamp versetzt die vorletzte Snapshot Aufnahme erhalte, sobald ich diese via notify anfrage?
Im DOIF habe ich mir mit einem "wait" Timer geholfen. Das funktioniert auch aber im Notify welches aus dem Beispiel der Doku stammt, will es nicht laufen.

Vg Denny
HostSystem: Synology DS918 | FHEM im Docker Version: 6.0-s22528_v2.2.4 (dedizierte IP Adresse) | MQTT_Broker auf DS918 NAS | MQTT_FHEM | TASMOTA_DEVICE | SSChatBot | SSCam | LaMetric | FBAHAHTTP | CUL | SONOS | HUEBridge (deCONZ) Zigbee | FB_CALLMONITOR | InfluxDBLogger

DS_Starter

Hallo Denny,

du müsstest uns ein paar mehr Angaben zu dem verwendeten notify (nicht DOIF) und dem verwendeten Kameramodul machen.
Gibt da ja verschiedene Möglichkeiten.
D.h. ein List der Devices wäre schon gut. Zur Zeit sind die Infos einfach zu wenig.

Grüße,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

rohlande

#178
Hallo Heiko
Sorry... ja woher sollst Du sonst die Infos bekommen.
Mein Fehler...
hier die LIST der beiden CAM welche auch laufen aber bei Verwendung von

  • DOIF
  • NOTIFY
immer um 1 Zeitstempel versetzt das vorletzte Bild vom Chat Bot das Bild versendet wird.

1. CAM
Internals:
   CAMID      1
   CAMNAME    Lutec-Light
   COMPATIBILITY 8.2.10
   CREDENTIALS Set
   DEF        Lutec-Light 192.168.178.44 5001 https
   FUUID      61b1c6ee-f33f-cb6b-1ce5-1f6e33fe626095a5
   FVERSION   49_SSCam.pm:v9.10.2-s25176/2021-11-03
   MODEL      User Define -
   NAME       SSCam.Lutec_Light
   NR         442
   OPMODE     getStmUrlPath
   PROTOCOL   https
   SERVERADDR 192.168.178.44
   SERVERPORT 5001
   STATE      on
   TYPE       SSCam
   HELPER:
     ACTIVE     off
     CREDENTIALS ]K[{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX>
     HLSSTREAM  inactive
     LOGINRETRIES 0
     OLDPTZHOME
     OLDVALPOLL 210
     OLDVALPOLLNOLOGGING 1
     PACKAGE    FHEM::SSCam
     RECTIME_DEF 15
     SID        edlbe7TFTG9i8m4hBYttQ0nOEEB2wTIpTRRWl0tfC9Mg6yXGm-enXs8NgVwfVOTYQyGAtkm_juMG3akVlNoTPc
     SNAPLIMIT  1
     STMKEYMJPEGHTTP http://192.168.178.44:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Stream.VideoStreaming&version=1&method=Stream&format=mjpeg&cameraId=1&StmKey="5872ef0cc490710c10a6daed67e6dd69"
     STMKEYMXPEGHTTP http://192.168.178.44:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Stream.VideoStreaming&version=1&method=Stream&format=mxpeg&cameraId=1&StmKey="5872ef0cc490710c10a6daed67e6dd69"
     STMKEYUNICST rtsp://syno:5872ef0cc490710c10a6daed67e6dd69@192.168.178.44:554/Sms=1.unicast
     STMKEYUNICSTOVERHTTP rtsp://192.168.178.44:5000/webman/3rdparty/SurveillanceStation/cgi/rtsp.cgi?Sms=1.unicast&DsId=0&StmKey=5872ef0cc490710c10a6daed67e6dd69
     TOTALCNT   160
     VERSION    9.10.2
     VERSION_API 1.2.0
     VERSION_ErrCodes 1.3.4
     VERSION_SMUtils 1.23.1
     API:
       PARSET     1
       AUDIOSTM:
         MOD        no
         NAME       SYNO.SurveillanceStation.AudioStream
         PATH       SurveillanceStation/audioStreaming.cgi
         VER        2
       AUTH:
         MOD        yes
         NAME       SYNO.API.Auth
         PATH       auth.cgi
         VER        6
       CAM:
         MOD        no
         NAME       SYNO.SurveillanceStation.Camera
         PATH       entry.cgi
         VER        9
       CAMEVENT:
         MOD        no
         NAME       SYNO.SurveillanceStation.Camera.Event
         PATH       entry.cgi
         VER        1
       EVENT:
         MOD        no
         NAME       SYNO.SurveillanceStation.Event
         PATH       entry.cgi
         VER        5
       EXTEVT:
         MOD        no
         NAME       SYNO.SurveillanceStation.ExternalEvent
         PATH       entry.cgi
         VER        1
       EXTREC:
         MOD        no
         NAME       SYNO.SurveillanceStation.ExternalRecording
         PATH       entry.cgi
         VER        3
       HMODE:
         MOD        no
         NAME       SYNO.SurveillanceStation.HomeMode
         PATH       entry.cgi
         VER        1
       INFO:
         MOD        no
         NAME       SYNO.API.Info
         PATH       query.cgi
         VER        1
       LOG:
         MOD        no
         NAME       SYNO.SurveillanceStation.Log
         PATH       entry.cgi
         VER        3
       PRESET:
         MOD        no
         NAME       SYNO.SurveillanceStation.PTZ.Preset
         PATH       entry.cgi
         VER        1
       PTZ:
         MOD        no
         NAME       SYNO.SurveillanceStation.PTZ
         PATH       entry.cgi
         VER        6
       REC:
         MOD        no
         NAME       SYNO.SurveillanceStation.Recording
         PATH       entry.cgi
         VER        6
       SNAPSHOT:
         MOD        no
         NAME       SYNO.SurveillanceStation.SnapShot
         PATH       entry.cgi
         VER        1
       STM:
         MOD        no
         NAME       SYNO.SurveillanceStation.Stream
         PATH       entry.cgi
         VER        1
       SVSINFO:
         MOD        no
         NAME       SYNO.SurveillanceStation.Info
         PATH       entry.cgi
         VER        8
       VIDEOSTM:
         MOD        no
         NAME       SYNO.SurveillanceStation.VideoStreaming
         PATH       entry.cgi
         VER        1
       VIDEOSTMS:
         MOD        no
         NAME       SYNO.SurveillanceStation.VideoStream
         PATH       SurveillanceStation/videoStreaming.cgi
         VER        1
     SVSVERSION:
       BUILD      6468
       MAJOR      8
       MINOR      2
       SMALL      10
   READINGS:
     2021-12-12 11:17:55   Availability    enabled
     2021-12-12 11:17:51   CamEventNum     177
     2021-12-12 11:17:55   CamExposureControl Unknown
     2021-12-12 11:17:55   CamExposureMode Unknown
     2021-12-12 11:17:55   CamIP           192.168.178.59
     2021-12-12 11:17:51   CamLastRec      20211212AM/Lutec-Light-20211212-111405-1639304045.mp4
     2021-12-12 11:17:51   CamLastRecId    16819
     2021-12-12 11:17:51   CamLastRecTime  12.12.2021 / 11:14:05 - 11:17:45
     2021-12-12 11:17:55   CamLiveFps     
     2021-12-12 11:17:55   CamLiveMode     Liveview from DS
     2021-12-12 11:17:55   CamLiveQuality 
     2021-12-12 11:17:55   CamLiveResolution 1280x720
     2021-12-12 11:17:55   CamLiveStreamNo 1
     2021-12-12 11:17:55   CamModel       
     2021-12-12 11:17:53   CamMotDetSc     SVS, sensitivity: 50, threshold: 10
     2021-12-12 11:17:55   CamNTPServer   
     2021-12-12 11:17:55   CamPort         554
     2021-12-12 11:17:55   CamPreRecTime   5
     2021-12-12 11:17:55   CamRecShare     surveillance
     2021-12-12 11:17:55   CamRecVolume    /volume1
     2021-12-12 11:17:50   CamStreamFormat HLS
     2021-12-12 11:17:55   CamVendor       User Define
     2021-12-12 11:17:55   CamVideoFlip    true
     2021-12-12 11:17:55   CamVideoMirror  true
     2021-12-12 11:17:55   CamVideoRotate  false
     2021-12-12 11:17:55   CamVideoType    H.264
     2021-12-12 11:17:55   CamblPresetSpeed false
     2021-12-12 11:17:49   CapAudioOut     false
     2021-12-12 11:17:49   CapChangeSpeed  false
     2021-12-12 11:17:55   CapPIR          false
     2021-12-12 11:17:49   CapPTZAbs       false
     2021-12-12 11:17:49   CapPTZAutoFocus false
     2021-12-12 11:17:49   CapPTZDirections 0
     2021-12-12 11:17:49   CapPTZFocus     false
     2021-12-12 11:17:49   CapPTZHome      false
     2021-12-12 11:17:49   CapPTZIris      false
     2021-12-12 11:17:49   CapPTZObjTracking false
     2021-12-12 11:17:49   CapPTZPan       false
     2021-12-12 11:17:49   CapPTZPresetNumber 0
     2021-12-12 11:17:49   CapPTZTilt      false
     2021-12-12 11:17:49   CapPTZZoom      false
     2021-12-12 11:17:55   DeviceType      Camera
     2021-12-12 11:17:57   Error           none
     2021-12-12 11:17:57   Errorcode       none
     2021-12-12 11:17:50   LastSnapFilename Lutec-Light-20211211-1756160254.jpg
     2021-12-12 11:17:50   LastSnapId      393
     2021-12-12 11:17:50   LastSnapTime    11.12.2021 / 17:56:15
     2021-12-12 11:17:55   LastUpdateTime  12.12.2021 / 11:17:55
     2021-12-12 11:17:48   PollState       Active - next time: 11:21:18
     2021-12-12 11:17:55   Record          Start
     2021-12-12 11:17:50   SVSlicenseNumber 2
     2021-12-12 11:17:50   SVSuserPriv     Manager
     2021-12-12 11:17:50   SVSversion      8.2.10-6468
     2021-12-12 11:17:57   StmKey          "5872ef0cc490710c10a6daed67e6dd69"
     2021-12-12 11:17:55   UsedSpaceMB     9.880
     2021-12-12 11:17:55   VideoFolder     http://192.168.178.44:8081/surveillance
     2021-12-12 11:17:50   compstate       true
     2021-12-12 11:17:55   state           on
Attributes:
   DbLogExclude .*
   alias      SSCam.Lutec_Light
   cacheType  internal
   devStateIcon .*isable.*:set_off .*nap:li_wht_on
   htmlattr   width=500 height=325
   httptimeout 20
   icon       it_camera
   pollcaminfoall 210
   pollnologging 1
   room       System
   session    SurveillanceStation
   snapGallerySize Full
   videofolderMap http://192.168.178.44:8081/surveillance
   webCmd     on:off:snap:enable:disable:runView:stopView


2. CAM
Internals:
   CAMID      2
   CAMNAME    Reolink520A
   COMPATIBILITY 8.2.10
   CREDENTIALS Set
   DEF        Reolink520A 192.168.178.44 5001 https
   FUUID      61b1c6ee-f33f-cb6b-09ee-6d35f43709042198
   FVERSION   49_SSCam.pm:v9.10.2-s25176/2021-11-03
   MODEL      Reolink - RLC-520
   NAME       SSCam.Reolink520A
   NR         443
   OPMODE     getStmUrlPath
   PROTOCOL   https
   SERVERADDR 192.168.178.44
   SERVERPORT 5001
   STATE      on
   TYPE       SSCam
   HELPER:
     ACTIVE     off
     CREDENTIALS ]K[{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX>
     HLSSTREAM  inactive
     LOGINRETRIES 0
     OLDPTZHOME
     OLDVALPOLL 210
     OLDVALPOLLNOLOGGING 1
     PACKAGE    FHEM::SSCam
     RECTIME_DEF 15
     SID        5HfxOpsdM6oQEnmjcTNOg78RtNcT6xlIBHtUwA7N9eERakCPIBFd2AQzdqTSOO_C7wC1nsueNRoZ862trBbXhc
     SNAPLIMIT  1
     STMKEYMJPEGHTTP http://192.168.178.44:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Stream.VideoStreaming&version=1&method=Stream&format=mjpeg&cameraId=2&StmKey="7605b644d2935ca75fbd91c856c3d416"
     STMKEYMXPEGHTTP http://192.168.178.44:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Stream.VideoStreaming&version=1&method=Stream&format=mxpeg&cameraId=2&StmKey="7605b644d2935ca75fbd91c856c3d416"
     STMKEYUNICST rtsp://syno:7605b644d2935ca75fbd91c856c3d416@192.168.178.44:554/Sms=2.unicast
     STMKEYUNICSTOVERHTTP rtsp://192.168.178.44:5000/webman/3rdparty/SurveillanceStation/cgi/rtsp.cgi?Sms=2.unicast&DsId=0&StmKey=7605b644d2935ca75fbd91c856c3d416
     TOTALCNT   237
     VERSION    9.10.2
     VERSION_API 1.2.0
     VERSION_ErrCodes 1.3.4
     VERSION_SMUtils 1.23.1
     API:
       PARSET     1
       AUDIOSTM:
         MOD        no
         NAME       SYNO.SurveillanceStation.AudioStream
         PATH       SurveillanceStation/audioStreaming.cgi
         VER        2
       AUTH:
         MOD        yes
         NAME       SYNO.API.Auth
         PATH       auth.cgi
         VER        6
       CAM:
         MOD        no
         NAME       SYNO.SurveillanceStation.Camera
         PATH       entry.cgi
         VER        9
       CAMEVENT:
         MOD        no
         NAME       SYNO.SurveillanceStation.Camera.Event
         PATH       entry.cgi
         VER        1
       EVENT:
         MOD        no
         NAME       SYNO.SurveillanceStation.Event
         PATH       entry.cgi
         VER        5
       EXTEVT:
         MOD        no
         NAME       SYNO.SurveillanceStation.ExternalEvent
         PATH       entry.cgi
         VER        1
       EXTREC:
         MOD        no
         NAME       SYNO.SurveillanceStation.ExternalRecording
         PATH       entry.cgi
         VER        3
       HMODE:
         MOD        no
         NAME       SYNO.SurveillanceStation.HomeMode
         PATH       entry.cgi
         VER        1
       INFO:
         MOD        no
         NAME       SYNO.API.Info
         PATH       query.cgi
         VER        1
       LOG:
         MOD        no
         NAME       SYNO.SurveillanceStation.Log
         PATH       entry.cgi
         VER        3
       PRESET:
         MOD        no
         NAME       SYNO.SurveillanceStation.PTZ.Preset
         PATH       entry.cgi
         VER        1
       PTZ:
         MOD        no
         NAME       SYNO.SurveillanceStation.PTZ
         PATH       entry.cgi
         VER        6
       REC:
         MOD        no
         NAME       SYNO.SurveillanceStation.Recording
         PATH       entry.cgi
         VER        6
       SNAPSHOT:
         MOD        no
         NAME       SYNO.SurveillanceStation.SnapShot
         PATH       entry.cgi
         VER        1
       STM:
         MOD        no
         NAME       SYNO.SurveillanceStation.Stream
         PATH       entry.cgi
         VER        1
       SVSINFO:
         MOD        no
         NAME       SYNO.SurveillanceStation.Info
         PATH       entry.cgi
         VER        8
       VIDEOSTM:
         MOD        no
         NAME       SYNO.SurveillanceStation.VideoStreaming
         PATH       entry.cgi
         VER        1
       VIDEOSTMS:
         MOD        no
         NAME       SYNO.SurveillanceStation.VideoStream
         PATH       SurveillanceStation/videoStreaming.cgi
         VER        1
     SVSVERSION:
       BUILD      6468
       MAJOR      8
       MINOR      2
       SMALL      10
   READINGS:
     2021-12-12 11:21:27   Availability    enabled
     2021-12-12 11:21:27   CamAudioType    AAC
     2021-12-12 11:21:23   CamEventNum     249
     2021-12-12 11:21:27   CamExposureControl Auto
     2021-12-12 11:21:27   CamExposureMode Auto
     2021-12-12 11:21:27   CamIP           192.168.178.41
     2021-12-12 11:21:23   CamLastRec      20211212AM/Reolink520A-20211212-111941-1639304381.mp4
     2021-12-12 11:21:23   CamLastRecId    16822
     2021-12-12 11:21:23   CamLastRecTime  12.12.2021 / 11:19:41 - 11:21:21
     2021-12-12 11:21:27   CamLiveFps      10
     2021-12-12 11:21:27   CamLiveMode     Liveview from DS
     2021-12-12 11:21:27   CamLiveQuality 
     2021-12-12 11:21:27   CamLiveResolution 640x480
     2021-12-12 11:21:27   CamLiveStreamNo 2
     2021-12-12 11:21:27   CamModel        RLC-520
     2021-12-12 11:21:25   CamMotDetSc     SVS, sensitivity: 50, threshold: 10
     2021-12-12 11:21:27   CamNTPServer    Surveillance Station
     2021-12-12 11:21:27   CamPort         80
     2021-12-12 11:21:27   CamPreRecTime   5
     2021-12-12 11:21:27   CamRecShare     surveillance
     2021-12-12 11:21:27   CamRecVolume    /volume1
     2021-12-12 11:21:20   CamStreamFormat HLS
     2021-12-12 11:21:27   CamVendor       Reolink
     2021-12-12 11:21:27   CamVideoFlip    false
     2021-12-12 11:21:27   CamVideoMirror  false
     2021-12-12 11:21:27   CamVideoRotate  false
     2021-12-12 11:21:27   CamVideoType    H.264
     2021-12-12 11:21:27   CamblPresetSpeed false
     2021-12-12 11:21:19   CapAudioOut     false
     2021-12-12 11:21:19   CapChangeSpeed  false
     2021-12-12 11:21:27   CapPIR          false
     2021-12-12 11:21:19   CapPTZAbs       false
     2021-12-12 11:21:19   CapPTZAutoFocus false
     2021-12-12 11:21:19   CapPTZDirections 0
     2021-12-12 11:21:19   CapPTZFocus     false
     2021-12-12 11:21:19   CapPTZHome      false
     2021-12-12 11:21:19   CapPTZIris      false
     2021-12-12 11:21:19   CapPTZObjTracking false
     2021-12-12 11:21:19   CapPTZPan       false
     2021-12-12 11:21:19   CapPTZPresetNumber 0
     2021-12-12 11:21:19   CapPTZTilt      false
     2021-12-12 11:21:19   CapPTZZoom      false
     2021-12-12 11:21:27   DeviceType      Camera
     2021-12-12 11:21:29   Error           none
     2021-12-12 11:21:29   Errorcode       none
     2021-12-12 11:21:21   LastSnapFilename Reolink520A-20211211-1808447076.jpg
     2021-12-12 11:21:21   LastSnapId      403
     2021-12-12 11:21:21   LastSnapTime    11.12.2021 / 18:08:44
     2021-12-12 11:21:27   LastUpdateTime  12.12.2021 / 11:21:27
     2021-12-12 11:21:18   PollState       Active - next time: 11:24:48
     2021-12-12 11:21:27   Record          Start
     2021-12-12 11:21:20   SVSlicenseNumber 2
     2021-12-12 11:21:20   SVSuserPriv     Manager
     2021-12-12 11:21:20   SVSversion      8.2.10-6468
     2021-12-12 11:21:29   StmKey          "7605b644d2935ca75fbd91c856c3d416"
     2021-12-12 11:21:27   UsedSpaceMB     9.969
     2021-12-12 11:21:27   VideoFolder     http://192.168.178.44:8081/surveillance
     2021-12-12 11:21:20   compstate       true
     2021-12-11 17:59:37   sendChatState   Missing at least one required parameter or attribute: subject, chatbot
     2021-12-12 11:21:27   state           on
Attributes:
   DbLogExclude .*
   alias      SSCam.Reolink520A
   cacheType  internal
   devStateIcon .*isable.*:set_off .*nap:li_wht_on
   htmlattr   width=500 height=325
   httptimeout 20
   icon       it_camera
   pollcaminfoall 210
   pollnologging 1
   room       System
   session    SurveillanceStation
   snapGallerySize Full
   verbose    5
   videofolderMap http://192.168.178.44:8081/surveillance
   webCmd     on:off:snap:enable:disable:runView:stopView


und hier noch das NOTIFY:
Internals:
   DEF        SSCam.Reolink520A:snap set DS918_ChatBot asyncSendItem text="Ein Schnappschuss vom Hof wurde ausgelöst" fileUrl="[SSCam.Reolink520A:VideoFolder]/@Snapshot/[SSCam.Reolink520A:LastSnapFilename]"
   FUUID      61b32ca1-f33f-cb6b-e1f1-6d677b69017e3b92
   FVERSION   91_notify.pm:0.252310/2021-11-15
   NAME       get_Reolink520A_pic_ntfy
   NOTIFYDEV  SSCam.Reolink520A
   NR         447
   NTFY_ORDER 50-get_Reolink520A_pic_ntfy
   REGEXP     SSCam.Reolink520A:snap
   STATE      2021-12-11 18:08:44
   TYPE       notify
   READINGS:
     2021-12-12 11:10:36   state           active
     2021-12-11 18:08:44   triggeredByDev  SSCam.Reolink520A
     2021-12-11 18:08:44   triggeredByEvent snap
Attributes:
   DbLogExclude .*
   alias      get_Reolink520A_pic_ntfy
   event-on-change-reading .*
   room       Logik


Und hier in DOIF behelfe ich mir mit dem "wait" Attribut, was ich auch nicht unbedingt schön finde aber es funktioniert.
Internals:
   DEF        ([MS_Klingel_Tor:relay_0] eq "on")
(set get_Reolink520A_pic_ntfy inactive)
(set get_Lutec_Light_pic_ntfy inactive)
(set SSCam.Reolink520A snap)
(set SSCam.Lutec_Light snap)
(set DS918_ChatBot asyncSendItem  text= *"Es hat an der Tür im Obergeschoss geklingelt."*)
(set DS918_ChatBot asyncSendItem text="Hier ist das Bild der Hofeinfahrt!" fileUrl="[SSCam.Reolink520A:VideoFolder]/@Snapshot/[SSCam.Reolink520A:LastSnapFilename]")
(set DS918_ChatBot asyncSendItem text="Wer steht vor der Tür?" fileUrl="[SSCam.Lutec_Light:VideoFolder]/@Snapshot/[SSCam.Lutec_Light:LastSnapFilename]")

DOELSEIF ([MS_Klingel_Tor:relay_1] eq "on")
(set get_Reolink520A_pic_ntfy inactive)
(set get_Lutec_Light_pic_ntfy inactive)
(set SSCam.Reolink520A snap) (set SSCam.Lutec_Light snap)
(set DS918_ChatBot asyncSendItem  text= *"Es hat an der Tür im Erdgeschoss geklingelt."*)
(set DS918_ChatBot asyncSendItem text="Hier ist das Bild der Hofeinfahrt!" fileUrl="[SSCam.Reolink520A:VideoFolder]/@Snapshot/[SSCam.Reolink520A:LastSnapFilename]")
(set DS918_ChatBot asyncSendItem text="Wer steht vor der Tür?" fileUrl="[SSCam.Lutec_Light:VideoFolder]/@Snapshot/[SSCam.Lutec_Light:LastSnapFilename]")

DOELSE
(set get_Reolink520A_pic_ntfy active)
(set get_Lutec_Light_pic_ntfy active)

   FUUID      61b1bf95-f33f-cb6b-8283-54c61fa9e1307f29
   FVERSION   98_DOIF.pm:0.252950/2021-12-04
   MODEL      FHEM
   NAME       Klingel_Tor
   NOTIFYDEV  global,MS_Klingel_Tor
   NR         440
   NTFY_ORDER 50-Klingel_Tor
   STATE      cmd_3
   TYPE       DOIF
   VERSION    25295 2021-12-04 18:13:39
   READINGS:
     2021-12-12 11:32:49   Device          MS_Klingel_Tor
     2021-12-11 17:56:25   cmd             3.2
     2021-12-11 17:56:25   cmd_event       MS_Klingel_Tor
     2021-12-11 17:56:25   cmd_nr          3
     2021-12-11 17:56:25   cmd_seqnr       2
     2021-12-12 11:32:49   e_MS_Klingel_Tor_relay_0 off
     2021-12-12 11:32:49   e_MS_Klingel_Tor_relay_1 off
     2021-12-11 17:54:09   mode            enabled
     2021-12-11 17:56:25   state           cmd_3
   Regex:
     accu:
     collect:
     cond:
       MS_Klingel_Tor:
         0:
           relay_0    ^MS_Klingel_Tor$:^relay_0:
         1:
           relay_1    ^MS_Klingel_Tor$:^relay_1:
   attr:
     wait:
       0:
         0
         0
         0
         0
         0
         1.5
         0.5
       1:
         0
         0
         0
         0
         0
         1.5
         0.5
     waitdel:
   condition:
     0          ::ReadingValDoIf($hash,'MS_Klingel_Tor','relay_0') eq "on"
     1          ::ReadingValDoIf($hash,'MS_Klingel_Tor','relay_1') eq "on"
   do:
     0:
       0          set get_Reolink520A_pic_ntfy inactive
       1          set get_Lutec_Light_pic_ntfy inactive
       2          set SSCam.Reolink520A snap
       3          set SSCam.Lutec_Light snap
       4          set DS918_ChatBot asyncSendItem  text= *"Es hat an der Tür im Obergeschoss geklingelt."*
       5          set DS918_ChatBot asyncSendItem text="Hier ist das Bild der Hofeinfahrt!" fileUrl="[SSCam.Reolink520A:VideoFolder]/@Snapshot/[SSCam.Reolink520A:LastSnapFilename]"
       6          set DS918_ChatBot asyncSendItem text="Wer steht vor der Tür?" fileUrl="[SSCam.Lutec_Light:VideoFolder]/@Snapshot/[SSCam.Lutec_Light:LastSnapFilename]"
     1:
       0          set get_Reolink520A_pic_ntfy inactive
       1          set get_Lutec_Light_pic_ntfy inactive
       2          set SSCam.Reolink520A snap
       3          set SSCam.Lutec_Light snap
       4          set DS918_ChatBot asyncSendItem  text= *"Es hat an der Tür im Erdgeschoss geklingelt."*
       5          set DS918_ChatBot asyncSendItem text="Hier ist das Bild der Hofeinfahrt!" fileUrl="[SSCam.Reolink520A:VideoFolder]/@Snapshot/[SSCam.Reolink520A:LastSnapFilename]"
       6          set DS918_ChatBot asyncSendItem text="Wer steht vor der Tür?" fileUrl="[SSCam.Lutec_Light:VideoFolder]/@Snapshot/[SSCam.Lutec_Light:LastSnapFilename]"
     2:
       0          set get_Reolink520A_pic_ntfy active
       1          set get_Lutec_Light_pic_ntfy active
   helper:
     DEVFILTER  ^global$|^MS_Klingel_Tor$
     NOTIFYDEV  global|MS_Klingel_Tor
     event      relay_1: off
     globalinit 1
     last_timer 0
     sleeptimer -1
     timerdev   MS_Klingel_Tor
     timerevent relay_1: off
     triggerDev MS_Klingel_Tor
     timerevents:
       relay_1: off
     timereventsState:
       relay_1: off
     triggerEvents:
       relay_1: off
     triggerEventsState:
       relay_1: off
   internals:
   perlblock:
   readings:
     all         MS_Klingel_Tor:relay_0 MS_Klingel_Tor:relay_1
   trigger:
   uiState:
   uiTable:
Attributes:
   DbLogExclude .*
   alias      Klingel_Tor
   event-on-change-reading .*
   room       Logik
   wait       0,0,0,0,0,1.5,0.5:0,0,0,0,0,1.5,0.5


Gruss Denny
HostSystem: Synology DS918 | FHEM im Docker Version: 6.0-s22528_v2.2.4 (dedizierte IP Adresse) | MQTT_Broker auf DS918 NAS | MQTT_FHEM | TASMOTA_DEVICE | SSChatBot | SSCam | LaMetric | FBAHAHTTP | CUL | SONOS | HUEBridge (deCONZ) Zigbee | FB_CALLMONITOR | InfluxDBLogger

DS_Starter

#179
Hi Denny,

das Problem ist das Triggern auf "snap" im notify.
Hintergrund: technisch bedingt wird erst der Schnappschuss ausgeführt und danach der dazu gehörende Filename etc. ermittelt.

Du musst also auf "LastSnapFilename" triggern, dann klappt das. Es ist auch so im SSCam Wiki beschrieben. Das wait im DOIF funktioniert deswegen weil du dem Modul Zeit gibst, ist aber technisch nicht korrekt und u.U. unzuverlässig je nach Länge des wait.

Mittlerweile kannst du den Versand mit SSChatBot auch direkt im SSCam-Modul hinterlegen und brauchst kein notify mehr.Siehe hier.

Grüße,Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter