Modul: todoist - Task-/Listenverwaltung in FHEM (Bsp. Einkaufsliste) + Frontend

Begonnen von marvin78, 27 Oktober 2017, 16:26:48

Vorheriges Thema - Nächstes Thema

devien

hier noch das verbose 5:
2019.01.15 21:38:06 4: todoist (Wartung): set getTasks manually. Timer restartet.
2019.01.15 21:38:07 5: Wartung: hash: $VAR1 = {
          '.attreour' => [
                           'state'
                         ],
          '.attrminint' => [],
          'DEF' => '2203523604',
          'Helper' => {
                        'DBLOG' => {
                                     'state' => {
                                                  'myDbLog' => {
                                                                 'TIME' => '1547584686.17139',
                                                                 'VALUE' => 'getTasks'
                                                               }
                                                }
                                   }
                      },
          'INTERVAL' => 1800,
          'MID' => 'da39a3ee5e634fdss43434bf3457bdbfef95601890afd80709',
          'NAME' => 'Wartung',
          'NOTIFYDEV' => 'global',
          'NR' => 675,
          'NTFY_ORDER' => '64-Wartung',
          'PID' => '2203523604',
          'READINGS' => {
                          'error' => {
                                       'TIME' => '2019-01-15 21:31:36',
                                       'VAL' => 'no data'
                                     },
                          'lastError' => {
                                           'TIME' => '2019-01-15 21:31:36',
                                           'VAL' => 'no data'
                                         },
                          'state' => {
                                       'TIME' => '2019-01-14 23:26:09',
                                       'VAL' => 'active'
                                     }
                        },
          'STATE' => 'active',
          'TYPE' => 'todoist',
          'VERSION' => '1.2.0.1',
          'helper' => {
                        'TIDS' => [],
                        'errorData' => '',
                        'errorMessage' => ''
                      },
          'mayBeVisible' => 1
        };

2019.01.15 21:38:07 4: todoist (Wartung): Curl Data: $VAR1 = {
          'project_id' => '2203523604',
          'token' => '9642c38e4ee7cc7923c267e2f3ab64acc01245e7'
        };

2019.01.15 21:38:07 5: todoist (Wartung): Param: $VAR1 = {
          'callback' => sub { "DUMMY" },
          'completed' => 0,
          'data' => {
                      'project_id' => '2203523604',
                      'token' => '9642c38e4ee7cc7923c267e2f3ab64acc01245e7'
                    },
          'hash' => {
                      '.attreour' => [
                                       'state'
                                     ],
                      '.attrminint' => [],
                      'DEF' => '2203523604',
                      'Helper' => {
                                    'DBLOG' => {
                                                 'state' => {
                                                              'myDbLog' => {
                                                                             'TIME' => '1547584686.17139',
                                                                             'VALUE' => 'getTasks'
                                                                           }
                                                            }
                                               }
                                  },
                      'INTERVAL' => 1800,
                      'MID' => 'da39a3ee5e634fdss43434bf3457bdbfef95601890afd80709',
                      'NAME' => 'Wartung',
                      'NOTIFYDEV' => 'global',
                      'NR' => 675,
                      'NTFY_ORDER' => '64-Wartung',
                      'PID' => '2203523604',
                      'READINGS' => {
                                      'error' => {
                                                   'TIME' => '2019-01-15 21:31:36',
                                                   'VAL' => 'no data'
                                                 },
                                      'lastError' => {
                                                       'TIME' => '2019-01-15 21:31:36',
                                                       'VAL' => 'no data'
                                                     },
                                      'state' => {
                                                   'TIME' => '2019-01-14 23:26:09',
                                                   'VAL' => 'active'
                                                 }
                                    },
                      'STATE' => 'active',
                      'TYPE' => 'todoist',
                      'VERSION' => '1.2.0.1',
                      'helper' => {
                                    'TIDS' => [],
                                    'errorData' => '',
                                    'errorMessage' => ''
                                  },
                      'mayBeVisible' => 1
                    },
          'header' => 'Content-Type: application/x-www-form-urlencoded',
          'method' => 'POST',
          'timeout' => 7,
          'url' => 'https://todoist.com/api/v7/projects/get_data'
        };

2019.01.15 21:38:07 5: todoist (Wartung):  Task Callback data-raw: $VAR1 = '';

2019.01.15 21:38:07 5: todoist (Wartung):  Task Callback param: $VAR1 = {
          'NAME' => '',
          'addr' => 'https://todoist.com:443',
          'auth' => 0,
          'callback' => sub { "DUMMY" },
          'completed' => 0,
          'compress' => 1,
          'conn' => undef,
          'data' => {
                      'project_id' => '2203523604',
                      'token' => '9642c38e4ee7cc7923c267e2f3ab64acc01245e7'
                    },
          'displayurl' => 'https://todoist.com/api/v7/projects/get_data',
          'hash' => {
                      '.attreour' => [
                                       'state'
                                     ],
                      '.attrminint' => [],
                      'DEF' => '2203523604',
                      'Helper' => {
                                    'DBLOG' => {
                                                 'state' => {
                                                              'myDbLog' => {
                                                                             'TIME' => '1547584686.17139',
                                                                             'VALUE' => 'getTasks'
                                                                           }
                                                            }
                                               }
                                  },
                      'INTERVAL' => 1800,
                      'MID' => 'da39a3ee5e634fdss43434bf3457bdbfef95601890afd80709',
                      'NAME' => 'Wartung',
                      'NOTIFYDEV' => 'global',
                      'NR' => 675,
                      'NTFY_ORDER' => '64-Wartung',
                      'PID' => '2203523604',
                      'READINGS' => {
                                      'error' => {
                                                   'TIME' => '2019-01-15 21:31:36',
                                                   'VAL' => 'no data'
                                                 },
                                      'lastError' => {
                                                       'TIME' => '2019-01-15 21:31:36',
                                                       'VAL' => 'no data'
                                                     },
                                      'state' => {
                                                   'TIME' => '2019-01-14 23:26:09',
                                                   'VAL' => 'active'
                                                 }
                                    },
                      'STATE' => 'active',
                      'TYPE' => 'todoist',
                      'VERSION' => '1.2.0.1',
                      'helper' => {
                                    'TIDS' => [],
                                    'errorData' => '',
                                    'errorMessage' => ''
                                  },
                      'mayBeVisible' => 1
                    },
          'header' => 'Content-Type: application/x-www-form-urlencoded',
          'host' => 'todoist.com',
          'hu_blocking' => 0,
          'hu_port' => 443,
          'hu_portSfx' => '',
          'loglevel' => 4,
          'method' => 'POST',
          'path' => '/api/v7/projects/get_data',
          'protocol' => 'https',
          'redirects' => 0,
          'sslargs' => {},
          'timeout' => 7,
          'url' => 'https://todoist.com/api/v7/projects/get_data'
        };

2019.01.15 21:38:07 2: todoist (Wartung): Error Message: no data
2019.01.15 21:38:07 4: todoist (Wartung): Api-Error Callback-data: https://todoist.com/api/v7/projects/get_data: Can't connect(2) to https://todoist.com:443:  SSL connect attempt failed with unknown error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
2019.01.15 21:38:07 1: readingsUpdate(Wartung,listText,-) missed to call readingsBeginUpdate first.
2019.01.15 21:38:07 1: stacktrace:
2019.01.15 21:38:07 1:     main::readingsBulkUpdate            called by ./FHEM/98_todoist.pm (996)
2019.01.15 21:38:07 1:     main::todoist_GetTasksCallback      called by FHEM/HttpUtils.pm (420)
2019.01.15 21:38:07 1:     main::__ANON__                      called by fhem.pl (740)
2019.01.15 21:38:09 5: Wartung: hash: $VAR1 = {
          '.attreour' => [
                           'state'
                         ],
          '.attrminint' => [],
          'CHANGED' => undef,
          'DEF' => '2203523604',
          'Helper' => {
                        'DBLOG' => {
                                     'state' => {
                                                  'myDbLog' => {
                                                                 'TIME' => '1547584686.17139',
                                                                 'VALUE' => 'getTasks'
                                                               }
                                                }
                                   }
                      },
          'INTERVAL' => 1800,
          'MID' => 'da39a3ee5e634fdss43434bf3457bdbfef95601890afd80709',
          'NAME' => 'Wartung',
          'NOTIFYDEV' => 'global',
          'NR' => 675,
          'NTFY_ORDER' => '64-Wartung',
          'PID' => '2203523604',
          'READINGS' => {
                          'error' => {
                                       'TIME' => '2019-01-15 21:38:07',
                                       'VAL' => 'no data'
                                     },
                          'lastError' => {
                                           'TIME' => '2019-01-15 21:38:07',
                                           'VAL' => 'no data'
                                         },
                          'state' => {
                                       'TIME' => '2019-01-14 23:26:09',
                                       'VAL' => 'active'
                                     }
                        },
          'STATE' => 'active',
          'TYPE' => 'todoist',
          'VERSION' => '1.2.0.1',
          'helper' => {
                        'TIDS' => [],
                        'errorData' => '',
                        'errorMessage' => ''
                      },
          'mayBeVisible' => 1
        };

2019.01.15 21:38:09 5: todoist (Wartung): Param: $VAR1 = {
          'callback' => sub { "DUMMY" },
          'data' => {
                      'resource_types' => '["collaborators"]',
                      'sync_token' => '*',
                      'token' => '9642c38e4ee7cc7923c267e2f3ab64acc01245e7'
                    },
          'hash' => {
                      '.attreour' => [
                                       'state'
                                     ],
                      '.attrminint' => [],
                      'CHANGED' => undef,
                      'DEF' => '2203523604',
                      'Helper' => {
                                    'DBLOG' => {
                                                 'state' => {
                                                              'myDbLog' => {
                                                                             'TIME' => '1547584686.17139',
                                                                             'VALUE' => 'getTasks'
                                                                           }
                                                            }
                                               }
                                  },
                      'INTERVAL' => 1800,
                      'MID' => 'da39a3ee5e634fdss43434bf3457bdbfef95601890afd80709',
                      'NAME' => 'Wartung',
                      'NOTIFYDEV' => 'global',
                      'NR' => 675,
                      'NTFY_ORDER' => '64-Wartung',
                      'PID' => '2203523604',
                      'READINGS' => {
                                      'error' => {
                                                   'TIME' => '2019-01-15 21:38:07',
                                                   'VAL' => 'no data'
                                                 },
                                      'lastError' => {
                                                       'TIME' => '2019-01-15 21:38:07',
                                                       'VAL' => 'no data'
                                                     },
                                      'state' => {
                                                   'TIME' => '2019-01-14 23:26:09',
                                                   'VAL' => 'active'
                                                 }
                                    },
                      'STATE' => 'active',
                      'TYPE' => 'todoist',
                      'VERSION' => '1.2.0.1',
                      'helper' => {
                                    'TIDS' => [],
                                    'errorData' => '',
                                    'errorMessage' => ''
                                  },
                      'mayBeVisible' => 1
                    },
          'header' => 'Content-Type: application/x-www-form-urlencoded',
          'method' => 'POST',
          'timeout' => 7,
          'url' => 'https://todoist.com/api/v7/sync'
        };

2019.01.15 21:38:10 5: todoist (Wartung): User Callback data: $VAR1 = '';

2019.01.15 21:38:10 2: todoist (Wartung): Error Message: no data
2019.01.15 21:38:10 4: todoist (Wartung): Api-Error Callback-data: https://todoist.com/api/v7/sync: Can't connect(2) to https://todoist.com:443:  SSL connect attempt failed with unknown error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
FHEM + UniPi + Arduino = gute Lösung

marvin78


devien

Zitat von: marvin78 am 15 Januar 2019, 21:39:11
Schau mal hier: https://forum.fhem.de/index.php/topic,78572.msg723052.html#msg723052

und lösche mal deinen API Token aus deinem Beitrag.

ich hab die Vorraussetzungen gemäß erstem Thread installiert
check:
root@unipi:~# apt-get install libio-socket-ssl-perl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libio-socket-ssl-perl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@unipi:~#


musste extra Perl manuell kompilieren und installieren um auf eine Supportette Version zu kommen dafür.
Ich glaub daran liegts nicht.

bzgl. Token, den erneuere ich sobald es funktioniert ohnehin, aktuell ist nur bisl Testfüllung im todoist, habe keine Sorge das mir da wichtige daten wegkommen.
FHEM + UniPi + Arduino = gute Lösung

marvin78

Ich glaube aber, dass hier das Problem liegt. Der Fehler deutet auf Probleme mit der SSL Verbindung hin, hier vermutlich aufgrund einer veralteten Version. Sag mal etwas über dein System.

devien

unipi unter raspberrypi v2b+
betriebssystem unipian v 0.3 (Debian wheezy)

root@unipi:~# perl -v

This is perl 5, version 14, subversion 2 (v5.14.2) built for arm-linux-gnueabihf-thread-multi-64int
(with 89 registered patches, see perl -V for more detail)

Platform:
    osname=linux, osvers=3.0.90, archname=arm-linux-gnueabihf-thread-multi-64int


apt-get update und upgrade laufen sauber durch ohne fehlermeldung ( aber die ziehen wohl auch nur über port 80)

wie kann ich ssl funktionalität via Komandozeile checken, ein grafisches Interface ist nicht drauf?
FHEM + UniPi + Arduino = gute Lösung

marvin78

Ich müsste mal genauer schauen. Der erste Test, der mir einfällt: httpmod und eine SSL geschützte Seite.

Hast du ggf. ein weiteres System, auf dem du testen kannst?

marvin78

@devien: Ich habe ins git (nicht im FHEM SVN) eine Version mit dem Attribut sslVersion eingecheckt. Mit dem könntest du mal ein wenig rumspielen und testen, ob man damit das Verhalten beeinflussen kann. httpUtils (Grundlage der Verbindung im todoist Modul) verwendet default "SSLv23:!SSLv3:!SSLv2".

Ich würde aber gerne auch mal ein Ergebnis eines Tests mit httpmod sehen.

define testSSL HTTPMOD https://todoist.com/api/v7/projects/get_data 60


devien

hab gestern noch ein httpmod mit sparkasse.de gesetzt, da konnte fhem sogar den body laden. die Antwort von todoist.com sah hingegen nicht so toll aus:

2019.01.16 09:14:19 3: thtpspk: Defined with URL https://www.sparkasse.de/ and interval 120
2019.01.16 09:14:21 3: thtpspk: Read response to update didn't match any Reading
2019.01.16 09:16:21 3: thtpspk: Read response to update didn't match any Reading
2019.01.16 09:18:21 3: thtpspk: Read response to update didn't match any Reading
2019.01.16 09:20:32 3: thtpspk: Read response to update didn't match any Reading
2019.01.16 09:22:32 3: thtpspk: Read response to update didn't match any Reading
2019.01.16 09:24:32 3: thtpspk: Read response to update didn't match any Reading
2019.01.16 09:26:32 3: thtpspk: Read response to update didn't match any Reading
2019.01.16 09:27:28 3: testSSL: Defined with URL https://todoist.com/api/v7/projects/get_data and interval 60
2019.01.16 09:27:30 3: testSSL: Read callback: Error: https://todoist.com/api/v7/projects/get_data: Can't connect(2) to https://todoist.com:443:  SSL connect attempt failed with unknown error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
2019.01.16 09:28:30 3: testSSL: Read callback: Error: https://todoist.com/api/v7/projects/get_data: Can't connect(2) to https://todoist.com:443:  SSL connect attempt failed with unknown error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
2019.01.16 09:28:32 3: thtpspk: Read response to update didn't match any Reading
2019.01.16 09:29:30 3: testSSL: Read callback: Error: https://todoist.com/api/v7/projects/get_data: Can't connect(2) to https://todoist.com:443:  SSL connect attempt failed with unknown error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure


hier ein List vom testSSL mit show error:
Internals:
   BUSY       0
   CFGFN     
   DEF        https://todoist.com/api/v7/projects/get_data 60
   Interval   60
   LASTSEND   1547627610.76735
   MainURL    https://todoist.com/api/v7/projects/get_data
   ModuleVersion 3.5.4 - 9.11.2018
   NAME       testSSL
   NR         1043
   STATE      ???
   TRIGGERTIME 1547627670.76524
   TRIGGERTIME_FMT 2019-01-16 09:34:30
   TYPE       HTTPMOD
   addr       https://todoist.com:443
   auth       0
   compress   1
   conn       
   data       
   displayurl https://todoist.com/api/v7/projects/get_data
   header     
   host       todoist.com
   httpbody   
   httpversion 1.0
   hu_blocking 0
   hu_port    443
   hu_portSfx
   ignoreredirects 0
   loglevel   4
   path       /api/v7/projects/get_data
   protocol   https
   redirects  0
   timeout    2
   url        https://todoist.com/api/v7/projects/get_data
   value      0
   Helper:
     DBLOG:
       LAST_ERROR:
         myDbLog:
           TIME       1547627610.95441
           VALUE      https://todoist.com/api/v7/projects/get_data: Can't connect(2) to https://todoist.com:443:  SSL connect attempt failed with unknown error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
   QUEUE:
   READINGS:
     2019-01-16 09:33:30   LAST_ERROR      https://todoist.com/api/v7/projects/get_data: Can't connect(2) to https://todoist.com:443:  SSL connect attempt failed with unknown error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
   REQUEST:
     data       
     header     
     ignoreredirects 0
     retryCount 0
     type       update
     url        https://todoist.com/api/v7/projects/get_data
     value      0
   sslargs:
Attributes:
   enableControlSet 0
   enableCookies 0
   room       Wohnzimmer
   showBody   1
   showError  1


google sagt Openssl aktualisieren und net::SSLLeay neu kompilieren..
ich schau mal wie ich das hinbekomme ohne meine ganze Haussteuerung abzuschießen.

aktuell hab ich
root@unipi:~# openssl version
OpenSSL 1.0.1t  3 May 2016

FHEM + UniPi + Arduino = gute Lösung

marvin78

Ich besitze kein System, mit dem ich das nachstellen kann. Ich kann dir nur einmal empfehlen, verschiedene sslVersion Einträge in HTTPMOD auszuprobieren oder die Testversion von todoist aus dem git zu laden und direkt dort das Attribut sslVersion auszutesten.

Edit: Ach und poste hier mal ein list vom global Device.

devien

hab Net::SSLeay neu installiert, lief sauber durch
cpan[1]> install Net::SSLeay
.
.
Appending installation info to /usr/lib/perl/5.14/perllocal.pod
  MIKEM/Net-SSLeay-1.85.tar.gz
  make install  -- OK


ich checke mal wie ich verschiedene sslVersionen in httpmod testen kann...
FHEM + UniPi + Arduino = gute Lösung

devien

so, habe nun OpenSSL 1.1.0f  25 May 2017
installiert um TLSv1.3 Unterstützung zu bekommen.
der Eintrag vom httpmod Test ist nun sauber im Log

2019.01.16 12:52:57 3: testSSL: Read response to update didn't match any Reading
2019.01.16 12:53:45 1: PERL WARNING: Argument " >40" isn't numeric in numeric lt (<) at fhem.pl line 4712.
2019.01.16 12:53:57 3: testSSL: Read response to update didn't match any Reading
2019.01.16 12:54:49 1: PERL WARNING: Use of uninitialized value $eo in concatenation (.) or string at ./FHEM/98_todoist.pm line 2122.
2019.01.16 12:54:57 3: testSSL: Read response to update didn't match any Reading


und auch todoist funktioniert nun nach der reaktivierung.

Es war also die OpenSSL version an der es lag weil hier nicht TLS1.3 unterstützt wurde.

Vielen Dank für eure Unterstützung.
FHEM + UniPi + Arduino = gute Lösung

marvin78

Sehr gut. Mich hätte noch interessiert, ob das Attribut sslVersion auch schon hätte Besserung bringen können. Denke aber, dass das nicht der Fall ist.

Viel Spaß mit dem Modul.

devien

Zitat von: marvin78 am 16 Januar 2019, 13:09:27
Sehr gut. Mich hätte noch interessiert, ob das Attribut sslVersion auch schon hätte Besserung bringen können. Denke aber, dass das nicht der Fall ist.

Viel Spaß mit dem Modul.

hatte ich gecheckt, hatte jedoch weder bei v23 , v2 noch bei v3 einen Unterschied gemacht, naja bei v2 besagte die errormeldung das v2 nicht unterstützt wird....
FHEM + UniPi + Arduino = gute Lösung

FoChris

Hallo Marvin,

mein Update Prozess läuft leider nicht durch, erhalte folgende Meldung:
2019.01.28 18:41:59 1 : todoist
2019.01.28 18:41:59 1 : UPD FHEM/98_todoist.pm
2019.01.28 18:41:59 1 : Got 85905 bytes for FHEM/98_todoist.pm, expected 85747
2019.01.28 18:41:59 1 : aborting.


Mache ich hier etwas falsch?

Gruß Christian

marvin78

Das Modul gibt es mittlerweile per FHEM Update. Das Update aus dem git ist nicht mehr nötig und auch nicht empfohlen.