50_SSChatBot - Integration des Synology Chat Servers

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

Vorheriges Thema - Nächstes Thema

DS_Starter

Hallo,

ich gehe davon aus, dass es funktioniert wenn du manuell ein

set SynChatBot asyncSendItem FHEM Server wurde soeben neu gestartet

lostritts, oder ?
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

mobiljoe123

Raspi 2; HM; MAX!; RFXtrx

DS_Starter

Hab ich mir gedacht. Nach dem Neustart wurden durch das Modul die auf der Synology verfügbaren Chat-User bzw. deren ID's noch nicht abgerufen.
Das passiert zwar gleich beim Start von FHEM, aber dauert einige Zeit, sodass dein notify vorher bereits ausgeführt wird und dadurch diese Daten noch nicht vorhanden sind.

Ich schaue mal dass ich ein Reading zur Verfügung stelle auf das man triggern kann sobald die User beim Start bezogen wurden.
Du kannst darauf warten und testen oder du verzögerst als Workaround  den Versand der Nachricht bei Start um eine Zeit X bis ich das Reading eingebaut habe.

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

DS_Starter

So, ich habe einen Event (kein Reading) eingebaut auf den man beim Start triggern kann. Damit ist sichergestellt, dass das Device ready to use ist:

2020-11-23 13:44:40.024 SSChatBot SynChatBot Errorcode: none
2020-11-23 13:44:40.024 SSChatBot SynChatBot Error: none
2020-11-23 13:44:40.635 SSChatBot SynChatBot CHAT_INITIALIZED
2020-11-23 13:44:40.647 SSChatBot SynChatBot QueueLength: 0
2020-11-23 13:44:40.661 SSChatBot SynChatBot active

Der Event kommt nur beim Start.

Die Version liegt in meinem Contrib zum Test.
Zum Download in der FHEMWEB Kommandozeile inklusive der Ausführungszeichen angeben und danach FHEM restarten:


"wget -qO ./FHEM/50_SSChatBot.pm https://svn.fhem.de/fhem/trunk/fhem/contrib/DS_Starter/50_SSChatBot.pm"


Probier mal.

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

mobiljoe123

Hoffentlich hab ich alles korrekt gemacht. Bin nicht so bewandert.

Was hab ich gemacht:
1) "wget -qO ./FHEM/50_SSChatBot.pm https://svn.fhem.de/fhem/trunk/fhem/contrib/DS_Starter/50_SSChatBot.pm"
2) restart FHEM
3) defmod notify.sschat.fhem_reload notify SynChatBot:CHAT_INITIALIZED { fhem "set SynChatBot asyncSendItem FHEM Server wurde soeben neu gestartet."}
4) save
5) restart FHEM
6) log
2020.11.23 14:02:58 3: SynChatBot - SSChatBot "SynChatBot" for URL /outchat registered
...
2020.11.23 14:03:07 3: set SynChatBot asyncSendItem FHEM Server wurde soeben neu gestartet. : The registered Synology Chat users are unknown. Please retrieve them first with "get SynChatBot chatUserlist".
2020.11.23 14:03:07 3: notify.sschat.fhem_reload return value: The registered Synology Chat users are unknown. Please retrieve them first with "get SynChatBot chatUserlist".


Irgendwo war anscheinend ein Fehler.
Raspi 2; HM; MAX!; RFXtrx

DS_Starter

Hast du alles richtig gemacht. Hmm, da muss ich nochmal ran.

Das hier:

2020.11.23 14:03:07 3: set SynChatBot asyncSendItem FHEM Server wurde soeben neu gestartet. : The registered Synology Chat users are unknown. Please retrieve them first with "get SynChatBot chatUserlist".
2020.11.23 14:03:07 3: notify.sschat.fhem_reload return value: The registered Synology Chat users are unknown. Please retrieve them first with "get SynChatBot chatUserlist".


kommt von dem notify. Das kannst du mal auf verbose 2 setzen. Dann stört es nicht.
Setze den SynChatBot auf verbose 5, speichere und mache nochmal einen Neustart.

Dann kommt im Log eine Menge vom SynChatBot, Poste mir das bitte dann.
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

mobiljoe123

Auszug vom log

2020.11.23 14:19:31 0: Server shutdown
...
2020.11.23 14:20:48 5: SynChatBot - Add Item to queue - Index 1:
$VAR1 = {
          'attachment' => '',
          'fileUrl' => '',
          'userid' => '',
          'channel' => '',
          'opmode' => 'chatUserlist',
          'retryCount' => 0,
          'text' => '',
          'method' => 'user_list'
        };

2020.11.23 14:20:48 4: SynChatBot - ####################################################
2020.11.23 14:20:48 4: SynChatBot - ###         start Chat operation chatUserlist   
2020.11.23 14:20:48 4: SynChatBot - ####################################################
2020.11.23 14:20:48 5: SynChatBot - HTTP-Call will be done with httptimeout: 20 s
2020.11.23 14:20:48 4: SynChatBot - API imported:
$VAR1 = {
          'INFO' => {
                      'NAME' => 'SYNO.API.Info',
                      'VER' => 1,
                      'PATH' => 'query.cgi'
                    },
          'EXTERNAL' => {
                          'NAME' => 'SYNO.Chat.External'
                        }
        };

2020.11.23 14:20:48 4: SynChatBot - Call-Out: http://192.168.123.62:5000/webapi/query.cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.API.Info,SYNO.Chat.External
2020.11.23 14:20:49 3: SynChatBot - SSChatBot "SynChatBot" for URL /outchat registered
...
2020.11.23 14:20:57 5: SynChatBot - JSON returned: $VAR1 = {
          'success' => bless( do{\(my $o = 1)}, 'JSON::XS::Boolean' ),
          'data' => {
                      'SYNO.API.Info' => {
                                           'maxVersion' => 1,
                                           'path' => 'query.cgi',
                                           'minVersion' => 1
                                         },
                      'SYNO.Chat.External' => {
                                                'requestFormat' => 'JSON',
                                                'maxVersion' => 2,
                                                'path' => 'entry.cgi',
                                                'minVersion' => 1
                                              }
                    }
        };

2020.11.23 14:20:57 4: SynChatBot - API completed:
$VAR1 = {
          'INFO' => {
                      'NAME' => 'SYNO.API.Info',
                      'MOD' => 'no',
                      'VER' => 1,
                      'PATH' => 'query.cgi'
                    },
          'EXTERNAL' => {
                          'NAME' => 'SYNO.Chat.External',
                          'MOD' => 'no',
                          'VER' => 2,
                          'PATH' => 'entry.cgi'
                        },
          'PARSET' => 1
        };

2020.11.23 14:20:57 4: SynChatBot - botToken read from RAM: ********
2020.11.23 14:20:57 4: SynChatBot - start SendQueue entry index "1" (chatUserlist) for operation.
2020.11.23 14:20:57 5: SynChatBot - HTTP-Call will be done with httptimeout: 20 s
2020.11.23 14:20:57 4: SynChatBot - Call-Out: http://192.168.123.62:5000/webapi/entry.cgi?api=SYNO.Chat.External&version=2&method=user_list&token="<secret>"
...
2020.11.23 14:20:58 5: SynChatBot - JSON returned: $VAR1 = {
          'success' => bless( do{\(my $o = 1)}, 'JSON::XS::Boolean' ),
          'data' => {
                      'users' => [
                                   {
                                     'avatar_version' => 0,
                                     'nickname' => '',
                                     'status' => 'offline',
                                     'user_props' => {
                                                       'email' => '',
                                                       'avatar_color' => '#94bf13',
                                                       'timezone' => '',
                                                       'key_pair' => {
                                                                       'public_key' => ''
                                                                     },
                                                       'timezoneUTC' => 'Europe/Amsterdam',
                                                       'description' => 'Plex User'
                                                     },
                                     'dsm_uid' => 1027,
                                     'deleted' => bless( do{\(my $o = 0)}, 'JSON::XS::Boolean' ),
                                     'username' => 'plex',
                                     'is_disabled' => $VAR1->{'data'}{'users'}[0]{'deleted'},
                                     'human_type' => 'dsm',
                                     'user_id' => 4,
                                     'type' => 'human'
                                   },
                                   {
                                     'avatar_version' => 0,
                                     'nickname' => '',
                                     'status' => 'offline',
                                     'user_props' => {
                                                       'email' => '',
                                                       'avatar_color' => '#24bff2',
                                                       'timezone' => '',
                                                       'key_pair' => {
                                                                       'public_key' => ''
                                                                     },
                                                       'timezoneUTC' => 'Europe/Amsterdam',
                                                       'description' => 'Kalenderzugriff'
                                                     },
                                     'dsm_uid' => 1029,
                                     'deleted' => $VAR1->{'data'}{'users'}[0]{'deleted'},
                                     'username' => 'Kalender',
                                     'is_disabled' => $VAR1->{'data'}{'users'}[0]{'deleted'},
                                     'human_type' => 'dsm',
                                     'user_id' => 5,
                                     'type' => 'human'
                                   },
                                   {
                                     'avatar_version' => 1601997991,
                                     'nickname' => "J\x{f6}rg",
                                     'status' => 'offline',
                                     'user_props' => {
                                                       'email' => '',
                                                       'avatar_color' => '#94bf13',
                                                       'timezone' => '',
                                                       'key_pair' => {
                                                                       'public_key' => ''
                                                                     },
                                                       'timezoneUTC' => 'Europe/Amsterdam',
                                                       'description' => 'System default user'
                                                     },
                                     'dsm_uid' => 1024,
                                     'deleted' => $VAR1->{'data'}{'users'}[0]{'deleted'},
                                     'username' => 'admin',
                                     'is_disabled' => $VAR1->{'data'}{'users'}[0]{'deleted'},
                                     'human_type' => 'dsm',
                                     'user_id' => 6,
                                     'type' => 'human'
                                   },
                                   {
                                     'avatar_version' => 0,
                                     'nickname' => '',
                                     'status' => 'offline',
                                     'user_props' => {
                                                       'email' => '',
                                                       'avatar_color' => '#1dbfbf',
                                                       'timezone' => '',
                                                       'key_pair' => {
                                                                       'public_key' => ''
                                                                     },
                                                       'timezoneUTC' => 'Europe/Amsterdam',
                                                       'description' => ''
                                                     },
                                     'dsm_uid' => 1035,
                                     'deleted' => $VAR1->{'data'}{'users'}[0]{'deleted'},
                                     'username' => 'Joerg_chat',
                                     'is_disabled' => $VAR1->{'data'}{'users'}[0]{'deleted'},
                                     'human_type' => 'dsm',
                                     'user_id' => 9,
                                     'type' => 'human'
                                   }
                                 ]
                    }
        };

2020.11.23 14:20:58 3: set SynChatBot asyncSendItem FHEM Server wurde soeben neu gestartet. : The registered Synology Chat users are unknown. Please retrieve them first with "get SynChatBot chatUserlist".
2020.11.23 14:20:58 3: notify.sschat.fhem_reload return value: The registered Synology Chat users are unknown. Please retrieve them first with "get SynChatBot chatUserlist".
2020.11.23 14:20:58 4: SynChatBot - Opmode "chatUserlist" finished successfully, Sendqueue index "1" deleted.
Raspi 2; HM; MAX!; RFXtrx

DS_Starter

Danke, da hatte ich noch einen Denkfehler. Hole dir nochmal die neue Version aus dem contrib.
Jetzt sollte es klappen.

Dein notify kannst du aber besser so schreiben:


defmod notify.sschat.fhem_reload notify SynChatBot:CHAT_INITIALIZED set SynChatBot asyncSendItem FHEM Server wurde soeben neu gestartet.


Das Konstrukt { fhem "..."} ist hier überflüssig.
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

mobiljoe123

Zitat von: DS_Starter am 23 November 2020, 14:43:51
Das Konstrukt { fhem "..."} ist hier überflüssig.
Danke. Habs geändert.

Jetzt hat alles wunderbar funktioniert.  :)

Muss ich jetzt bzgl. Updates etwas beachten?
Raspi 2; HM; MAX!; RFXtrx

DS_Starter

Sehr schön.  :)

Ich werde die neue Version heute noch einchecken, dann ist sie morgen früh mit im Regelupdate enthalten.
D.h. wenn du morge früh ab 8:00 dein FHEM updatest, bekommst du diese Version "offiziell".
Musst also nichts weiter beachten in dem Fall.
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

mobiljoe123

#115
Klasse. Tolle Unterstützung.

Mein nächster Schritt wird die Ablösung der Kamerabilder von Telegramm zu SSChat wenns an der Haustür klingelt.
Da muss ich mich aber erst einmal einlesen. Ggf. komme ich wieder auf Dich zu.
Raspi 2; HM; MAX!; RFXtrx

mobiljoe123

Hallo,

jetzt habe ich m.W. alles nach dem WIKI, mit super Unterstützung!!!, eingerichtet.
Leider kunktioniert der Versand eines Bildes meiner Kamera mittels SynChatBot noch nicht.

ein
set SSam.Home snap

führt zu (log)
2020.11.27 16:41:18 3: SSCam.Home - Snapshot of Camera Home created. ID: 5330
2020.11.27 16:41:19 3: SSCam.Home - Telegram message [0] of transaction "1221" sent to "JXXX_RXXX" by "FHEMstatus"
2020.11.27 16:41:19 3: SSCam.Home - Chat message [0] of transaction "1221" for "admin" added to "SynChatBot" sendqueue
2020.11.27 16:41:19 2: SynChatBot - ERROR - Operation sendItem was not successful. Errorcode: 117 - illegal file name or path
2020.11.27 16:41:19 2: SynChatBot - ERROR - "sendItem" SendQueue index "5" not executed. It seems to be a permanent error. Exclude it from new send attempt !


list Kamera
Internals:
   CAMID      1
   CAMNAME    Home
   COMPATIBILITY 8.2.8
   CREDENTIALS Set
   DEF        Home 192.168.123.62 5000
   FUUID      5ce44486-f33f-95bd-b78c-db65a251dbf6b4d4
   FVERSION   49_SSCam.pm:v9.8.2-s22912/2020-10-04
   MODEL      User Define -
   NAME       SSCam.Home
   NR         409
   OPMODE     getStmUrlPath
   PROTOCOL   http
   SERVERADDR 192.168.123.62
   SERVERPORT 5000
   STATE      off
   TYPE       SSCam
   HELPER:
     ACTIVE     off
     CREDENTIALS \[WzdY5?dKlpipXwlnrA
     HLSSTREAM  inactive
     LOGINRETRIES 0
     OLDPTZHOME
     OLDVALPOLL 210
     OLDVALPOLLNOLOGGING 1
     PACKAGE    FHEM::SSCam
     RECTIME_DEF 15
     SID        RcqxlY5HnuYYX0P4HSBTsO4dnUVOQaAPxRm4YOPdyKcFUqb8JzBp6mOeEJ3LlVabm9Mw7G720GvPSUEBTYjpIM
     SNAPLAG    2
     SNAPLIMIT  3
     SNAPNUMCOUNT 1
     STMKEYMJPEGHTTP http://192.168.123.62:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Stream.VideoStreaming&version=1&method=Stream&format=mjpeg&cameraId=1&StmKey="d35283a43a67bfdd669ba1e6a1b2cbc9"
     STMKEYMXPEGHTTP http://192.168.123.62:5000/webapi/entry.cgi?api=SYNO.SurveillanceStation.Stream.VideoStreaming&version=1&method=Stream&format=mxpeg&cameraId=1&StmKey="d35283a43a67bfdd669ba1e6a1b2cbc9"
     STMKEYUNICST rtsp://syno:d35283a43a67bfdd669ba1e6a1b2cbc9@192.168.123.62:554/Sms=1.unicast
     STMKEYUNICSTOVERHTTP rtsp://192.168.123.62:5000/webman/3rdparty/SurveillanceStation/cgi/rtsp.cgi?Sms=1.unicast&DsId=0&StmKey=d35283a43a67bfdd669ba1e6a1b2cbc9
     TOTALCNT   4007
     VERSION    9.8.2
     VERSION_API 1.2.0
     VERSION_ErrCodes 1.3.4
     VERSION_SMUtils 1.20.6
     API:
       PARSET     1
       AUDIOSTM:
         MOD        no
         NAME       SYNO.SurveillanceStation.AudioStream
         PATH       SurveillanceStation/audioStreaming.cgi
         VER        2
       AUTH:
         MOD        no
         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      6335
       MAJOR      8
       MINOR      2
       SMALL      8
   READINGS:
     2020-11-27 16:43:17   Availability    enabled
     2020-09-27 11:10:37   CamAudioType    6
     2020-11-27 16:43:11   CamEventNum     1145
     2020-11-27 16:43:17   CamExposureControl Unknown
     2020-11-27 16:43:17   CamExposureMode Unknown
     2020-11-27 16:43:17   CamIP           192.168.123.66
     2020-11-27 16:43:11   CamLastRec      20201127PM/Home-20201127-154429-1606488269.mp4
     2020-11-27 16:43:11   CamLastRecId    22261
     2020-11-27 16:43:11   CamLastRecTime  2020-11-27 / 15:44:29 - 15:45:33
     2020-11-27 16:43:17   CamLiveFps     
     2020-11-27 16:43:17   CamLiveMode     Liveview from DS
     2020-11-27 16:43:17   CamLiveQuality 
     2020-11-27 16:43:17   CamLiveResolution 1280x720
     2020-11-27 16:43:17   CamLiveStreamNo 1
     2020-11-27 16:43:17   CamModel       
     2020-11-27 16:43:15   CamMotDetSc     SVS, sensitivity: 80, threshold: 10
     2020-11-27 16:43:17   CamNTPServer   
     2020-11-27 16:43:17   CamPort         554
     2020-11-27 16:43:17   CamPreRecTime   5
     2020-11-27 16:43:17   CamRecShare     surveillance
     2020-11-27 16:43:17   CamRecVolume    /volume1
     2020-11-27 16:43:10   CamStreamFormat HLS
     2020-11-27 16:43:17   CamVendor       User Define
     2020-11-27 16:43:17   CamVideoFlip    true
     2020-11-27 16:43:17   CamVideoMirror  true
     2020-11-27 16:43:17   CamVideoRotate  false
     2020-11-27 16:43:17   CamVideoType    H.264
     2020-11-27 16:43:17   CamblPresetSpeed false
     2020-11-27 16:43:09   CapAudioOut     false
     2020-11-27 16:43:09   CapChangeSpeed  false
     2020-11-27 16:43:17   CapPIR          false
     2020-11-27 16:43:09   CapPTZAbs       false
     2020-11-27 16:43:09   CapPTZAutoFocus false
     2020-11-27 16:43:09   CapPTZDirections 0
     2020-11-27 16:43:09   CapPTZFocus     false
     2020-11-27 16:43:09   CapPTZHome      false
     2020-11-27 16:43:09   CapPTZIris      false
     2020-11-27 16:43:09   CapPTZObjTracking false
     2020-11-27 16:43:09   CapPTZPan       false
     2020-11-27 16:43:09   CapPTZPresetNumber 0
     2020-11-27 16:43:09   CapPTZTilt      false
     2020-11-27 16:43:09   CapPTZZoom      false
     2020-11-27 16:43:17   DeviceType      Camera
     2020-11-27 16:43:19   Error           none
     2020-11-27 16:43:19   Errorcode       none
     2020-11-27 16:43:13   LastSnapFilename Home-20201127-1641179222.jpg
     2020-11-27 16:43:13   LastSnapId      5330
     2020-11-27 16:43:13   LastSnapTime    2020-11-27 / 16:41:17
     2020-11-27 16:43:17   LastUpdateTime  2020-11-27 / 16:43:17
     2020-11-27 16:43:09   PollState       Active - next time: 16:46:39
     2020-11-27 16:43:17   Record          Stop
     2020-11-27 16:43:10   SVSlicenseNumber 2
     2020-11-27 16:43:10   SVSuserPriv     Admin
     2020-11-27 16:43:10   SVSversion      8.2.8-6335
     2020-11-27 16:43:19   StmKey          "d35283a43a67bfdd669ba1e6a1b2cbc9"
     2020-11-27 16:43:17   UsedSpaceMB     14.968
     2020-11-27 16:43:17   VideoFolder     http://192.168.123.62:8081/surveillance
     2020-11-27 16:43:10   compstate       true
     2020-11-27 16:41:19   sendChatState   Chat message [0] of transaction "1221" for "admin" added to "SynChatBot" sendqueue
     2020-11-27 16:41:19   sendTeleState   Telegram message [0] of transaction "1221" sent to "JXXX_RXXX" by "FHEMstatus"
     2020-11-27 16:43:17   state           off
Attributes:
   devStateIcon .*isable.*:set_off .*nap:li_wht_on
   httptimeout 20
   icon       it_camera
   pollcaminfoall 210
   pollnologging 1
   room       SSCam
   session    DSM
   snapChatTxt chatbot => SynChatBot, peers => , subject => Bewegungsalarm bei $CAM. Es wurde $CTIME der Schnappschuss $FILE erstellt
   snapGalleryBoost 1
   snapGalleryHtmlAttr width="325" height="225"
   snapGallerySize Full
   snapTelegramTxt tbot => FHEMstatus, peers => , subject => Bewegungsalarm bei $CAM. Es wurde $CTIME ein Schnappschuss erstellt
   videofolderMap http://192.168.123.62:8081/surveillance
   webCmd     on:off:snap:enable:disable:runView:stopView


list
Internals:
   DEF        192.168.123.62
   FUUID      5f7da29d-f33f-95bd-ef19-84b8a020e87ffc09
   FVERSION   50_SSChatBot.pm:v1.12.0-s23220/2020-11-23
   FW         WEBSSChatBot
   INADDR     192.168.123.62
   INPORT     5000
   INPROT     http
   MODEL      ChatBot
   NAME       SynChatBot
   NR         442
   OPMODE     
   OUTDEF     http://raspberrypi.fritz.box:8082/sschat/outchat?botname=SynChatBot&fwcsrf=5f7da29e
   RESEND     next planned SendQueue start: immediately by next entry
   STATE      Error
   TOKEN      Set
   TYPE       SSChatBot
   HELPER:
     INFIX      outchat
     PACKAGE    main::FHEM::SSChatBot
     TOKEN      g5[KeJizfH|{]Xf7jVg]jsUXe
WX�Pfom6PS>F
     USERFETCHED 1
     VERSION    1.12.0
     VERSION_API 1.2.0
     VERSION_ErrCodes 1.3.4
     VERSION_SMUtils 1.20.6
     API:
       PARSET     1
       EXTERNAL:
         MOD        no
         NAME       SYNO.Chat.External
         PATH       entry.cgi
         VER        2
       INFO:
         MOD        no
         NAME       SYNO.API.Info
         PATH       query.cgi
         VER        1
     USERS:
       Joerg_chat:
         email     
         id         9
         nickname   
         status     offline
       Kalender:
         email     
         id         5
         nickname   
         status     offline
       admin:
         email     
         id         6
         nickname   JXXX
         status     offline
       plex:
         email     
         id         4
         nickname   
         status     offline
   OLDREADINGS:
   READINGS:
     2020-11-27 16:41:19   Error           illegal file name or path
     2020-11-27 16:41:19   Errorcode       117
     2020-11-27 16:41:19   QueueLength     3
     2020-11-20 15:21:00   recActions     
     2020-11-20 15:21:00   recActionsValue
     2020-11-20 15:21:00   recCallbackId   
     2020-11-20 15:21:00   recChannelId   
     2020-11-20 15:21:00   recChannelname 
     2020-11-20 15:21:00   recCommand     
     2020-11-20 15:21:00   recPostId       25769803797
     2020-11-20 15:21:00   recText         set SSCam. Home snap
     2020-11-20 15:21:00   recTimestamp    2020-11-20 15:20:59
     2020-11-20 15:21:00   recTriggerword 
     2020-11-20 15:21:00   recUserId       6
     2020-11-20 15:21:00   recUsername     admin
     2020-11-20 15:21:00   sendCommandReturn
     2020-11-27 09:46:25   sendPostId      25769803955
     2020-11-27 09:46:25   sendUserId      6
   [b]  2020-11-27 16:41:19   state           Error[/b]
Attributes:
   defaultPeer admin
   room       Chat


Das Bild kann ich aber erfolgreich mit
http://192.168.123.62:8081/surveillance/@Snapshot/Home-20201127-1641179222.jpg
aufrufen. Der Pfad sollte also stimmen.

Sorry, hab ich etwas nicht beachtet?

LG Jörg
Raspi 2; HM; MAX!; RFXtrx

DS_Starter

Hallo Jörg,

sieht auf den ersten Blick erstal ok aus.
Wenn du die sendqueue im ChatBot noch nicht gelöscht hast, mach mal ein

set SynChatBot listSendqueue

und poste den Inhalt bitte.
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

Wiesenfreund

#118
Hallo,
leider war ich gezwungen fhem komplett neu aufzusetzen (SSD defekt), da ein Restore nicht funktioniert hat. Nach der Neuinstallation funktionierte SSChatBot bei mir nicht mehr richtig. Im alten System hatte ich nicht das aktuellste Modul verwendet. Jetzt ist auf einem Raspi 4 alles aktuell, d.h., Betriebssystem Raspberry Pi OS Lite (32-bit) gestern heruntergeladen und installiert. Danach fhem (6.0) installiert und aktualisiert. Alle Module komplett neu angelegt.

Problem:
Nach einem Shutdown von fhem funktioniert das Senden sowohl von den Modulen aus als auch über die Kommandozeile. Ein über Chat gesendetes Kommando kommt auch in SSChatBot an, es wird in den Readings angezeigt. Danach ist ein Senden nicht mehr möglich.

Inhalt Log:

2020.11.28 09:51:22.476 4: fhemBot - ####################################################
2020.11.28 09:51:22.476 4: fhemBot - ###          start Chat operation Receive           
2020.11.28 09:51:22.476 4: fhemBot - ####################################################
2020.11.28 09:51:22.476 5: fhemBot - raw data received (urlDecoded):
$VAR1 = 'botname="fhemBot" fwcsrf="5fc1f676" token="4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx9" user_id="4" username="admin" post_id="266287973383" thread_id="0" timestamp="1606553482437" text="Wetter"';

2020.11.28 09:51:22.476 4: fhemBot - received data decoded:
$VAR1 = {
          'botname' => 'fhemBot',
          'fwcsrf' => '5fc1f676',
          'post_id' => '266287973383',
          'text' => 'Wetter',
          'thread_id' => '0',
          'timestamp' => '2020-11-28 09:51:22',
          'token' => '4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx9',
          'user_id' => '4',
          'username' => 'admin'
        };

2020.11.28 09:51:44.206 2: HMCCU: [d_ccu : 2522] Invalid channel CENTRAL
2020.11.28 09:52:37.098 5: fhemBot - Add Item to queue - Index 18:
$VAR1 = {
          'attachment' => '',
          'channel' => '',
          'fileUrl' => '',
          'method' => 'chatbot',
          'opmode' => 'sendItem',
          'retryCount' => 0,
          'text' => 'TestFehler',
          'userid' => 5
        };

2020.11.28 09:52:37.099 5: fhemBot - Add Item to queue - Index 19:
$VAR1 = {
          'attachment' => '',
          'channel' => '',
          'fileUrl' => '',
          'method' => 'chatbot',
          'opmode' => 'sendItem',
          'retryCount' => 0,
          'text' => 'TestFehler',
          'userid' => 11
        };

2020.11.28 09:52:37.099 5: fhemBot - Add Item to queue - Index 20:
$VAR1 = {
          'attachment' => '',
          'channel' => '',
          'fileUrl' => '',
          'method' => 'chatbot',
          'opmode' => 'sendItem',
          'retryCount' => 0,
          'text' => 'TestFehler',
          'userid' => 29
        };

2020.11.28 09:52:37.100 5: fhemBot - Add Item to queue - Index 21:
$VAR1 = {
          'attachment' => '',
          'channel' => '',
          'fileUrl' => '',
          'method' => 'chatbot',
          'opmode' => 'sendItem',
          'retryCount' => 0,
          'text' => 'TestFehler',
          'userid' => 6
        };

2020.11.28 09:52:37.100 5: fhemBot - Add Item to queue - Index 22:
$VAR1 = {
          'attachment' => '',
          'channel' => '',
          'fileUrl' => '',
          'method' => 'chatbot',
          'opmode' => 'sendItem',
          'retryCount' => 0,
          'text' => 'TestFehler',
          'userid' => 4
        };

2020.11.28 09:52:37.101 5: fhemBot - Add Item to queue - Index 23:
$VAR1 = {
          'attachment' => '',
          'channel' => '',
          'fileUrl' => '',
          'method' => 'chatbot',
          'opmode' => 'sendItem',
          'retryCount' => 0,
          'text' => 'TestFehler',
          'userid' => 16
        };

2020.11.28 09:52:37.102 5: fhemBot - Add Item to queue - Index 24:
$VAR1 = {
          'attachment' => '',
          'channel' => '',
          'fileUrl' => '',
          'method' => 'chatbot',
          'opmode' => 'sendItem',
          'retryCount' => 0,
          'text' => 'TestFehler',
          'userid' => 9
        };

2020.11.28 09:52:37.102 5: fhemBot - Add Item to queue - Index 25:
$VAR1 = {
          'attachment' => '',
          'channel' => '',
          'fileUrl' => '',
          'method' => 'chatbot',
          'opmode' => 'sendItem',
          'retryCount' => 0,
          'text' => 'TestFehler',
          'userid' => 30
        };

2020.11.28 09:52:37.103 1: PERL WARNING: Use of uninitialized value in concatenation (.) or string at ./FHEM/50_SSChatBot.pm line 866.
2020.11.28 09:52:37.103 4: fhemBot - Operation "receiveData (idx: )" is still running. Next operation start postponed


List des ChatBot:

Internals:
   DEF        192.168.178.92 5001 https
   FUUID      5fc1f676-f33f-d0e8-649c-f783e07176d8915c
   FVERSION   50_SSChatBot.pm:v1.12.0-s23220/2020-11-23
   FW         WEBSSChatBot
   INADDR     192.168.178.92
   INPORT     5001
   INPROT     https
   MODEL      ChatBot
   NAME       fhemBot
   NR         279
   OPMODE     receiveData
   OUTDEF     http://raspberrypi4.fritz.box:8082/sschat/outchat?botname=fhemBot&fwcsrf=5fc1f676
   RESEND     next planned SendQueue start: immediately by next entry
   STATE      active
   TOKEN      Set
   TYPE       SSChatBot
   HELPER:
     INFIX      outchat
     PACKAGE    FHEM::SSChatBot
     TOKEN      QL[xUxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxV9[[^MTrgkqr\6_}
SX[p]4}ORS>F
     USERFETCHED 1
     VERSION    1.12.0
     VERSION_API 1.2.0
     VERSION_ErrCodes 1.3.4
     VERSION_SMUtils 1.20.6
     API:
       PARSET     1
       EXTERNAL:
         MOD        no
         NAME       SYNO.Chat.External
         PATH       entry.cgi
         VER        2
       INFO:
         MOD        no
         NAME       SYNO.API.Info
         PATH       query.cgi
         VER        1
     USERS:
     
       fhem:
         email      xxxxxxx@online.de
         id         16
         nickname   
         status     offline
       
   OLDREADINGS:
   READINGS:
     2020-11-28 09:51:22   Error           none
     2020-11-28 09:51:22   Errorcode       none
     2020-11-28 09:52:37   QueueLength     8
     2020-11-28 09:51:22   recActions     
     2020-11-28 09:51:22   recActionsValue
     2020-11-28 09:51:22   recCallbackId   
     2020-11-28 09:51:22   recChannelId   
     2020-11-28 09:51:22   recChannelname 
     2020-11-28 09:51:22   recCommand     
     2020-11-28 09:51:22   recPostId       266287973383
     2020-11-28 09:51:22   recText         Wetter
     2020-11-28 09:51:22   recTimestamp    2020-11-28 09:51:22
     2020-11-28 09:51:22   recTriggerword 
     2020-11-28 09:51:22   recUserId       4
     2020-11-28 09:51:22   recUsername     admin
     2020-11-28 09:51:22   sendCommandReturn
     2020-11-28 09:48:29   sendPostId      322122547207
     2020-11-28 09:48:29   sendUserId      30
     2020-11-28 09:51:22   state           active
Attributes:
   defaultPeer pipopa
   room       Nachricht
   verbose    5


Dort, wo ich nicht sicher war, ob ich das öffentlich zeigen soll, habe ich x eingefügt.

Nach einem Shutdown von fhem geht das Senden wieder, bis erneut empfangen wird.

Grüße
Eberhard
Raspberry 4 mit fhem, Raspberry 3 mit fhem (FS20-, MAX-Schnittstellen), RaspiMatic Raspberry 3B, HM und HMW-Geräte (Heizung, Wetterstation, Fensterkontakte), Shellys (Rollladen, MQTT), ESPEasy (Energiezähler, MQTT), MAX-Taster (CUL),  FS20 Taster  (CUL), Synology NAS (Mosquitto,Chat

DS_Starter

Hallo Eberhard,

vermutlich hast du die Datei SMUtils nicht aktuell.
Mach mal ein komplettes FHEM update und wenn es danach immer noch nicht klappen sollte, bitte ein list des devices.
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