From d071d23e714360cc62657e5dd1d983482fecba0a Mon Sep 17 00:00:00 2001 From: neumann <> Date: Fri, 8 Sep 2017 19:52:45 +0000 Subject: [PATCH] 31_Nello: updated to new api specifications git-svn-id: https://svn.fhem.de/fhem/trunk@15028 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/31_Nello.pm | 41 +++++++++++------------------------------ 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 35b059571..e3428a543 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 31_Nello: updated to new api specifications - feature: 49_SSCam: V2.8.0, switch Surveillance Station HomeMode available - bugfix: 73_GardenaSmartBridge: code clean, update german tranlation - feature: 74_AMADDevice: add ttsMsgVol, sets automatically a preset volume diff --git a/fhem/FHEM/31_Nello.pm b/fhem/FHEM/31_Nello.pm index 0c96bfc51..b0f7972f1 100644 --- a/fhem/FHEM/31_Nello.pm +++ b/fhem/FHEM/31_Nello.pm @@ -9,7 +9,6 @@ ############################################################################## # required packets -# libcrypt-pbkdf2-perl # Net::MQTT # libcpan-meta-yaml-perl @@ -181,24 +180,11 @@ sub Nello_login { my $name = $hash->{NAME}; return 'wrong syntax: set login ' if(!defined $username || !defined $password); - Nello_authenticate($hash, $username, Nello_passwordHash($username, $password)); + Nello_authenticate($hash, $username, $password); return undef; } -sub Nello_passwordHash { - my ($username, $password) = @_; - my $salt = sha256($username . $password); - - my $pbkdf2 = Crypt::PBKDF2->new( - hash_class => 'HMACSHA1', - iterations => 4000, - output_len => 32 - ); - - return uc $pbkdf2->PBKDF2_hex($salt, $password); -} - sub Nello_authenticate { my ($hash, $username, $authhash) = @_; my $name = $hash->{NAME}; @@ -433,11 +419,10 @@ sub Nello_open { } sub Nello_recoverPassword { - my ($hash, $username, $temppw) = @_; - return 'wrong syntax: set recoverPassword [ ]' if(!defined $username); + my ($hash, $username) = @_; + return 'wrong syntax: set recoverPassword ' if(!defined $username); - return Nello_apiRequest($hash, 'recover-password', {username => $username}, 'POST', 0) if(!defined $temppw); - return Nello_authenticate($hash, $username, $temppw); + return Nello_apiRequest($hash, 'recover-password', {username => $username}, 'POST', 0); } sub Nello_poll { @@ -506,13 +491,11 @@ sub Nello_detectExecute { The Nello module enables you to control your intercom using the nello one module.
To set it up, you need to add a new user via the nello app just for use with fhem. You cannot use your main account since only one session at a time is possible.
After that, you can define the device and continue with login.
- ATTENTION: If the new account was created on an iOS device you need to call the recover function and do the login through set <name> recoverPassword <username> <temporary_password>. - Android users can use the default login function.
+ ATTENTION: If the login fails, try resetting your password using the recoverPassword function.
Recommendation: To receive instant events, call the detectDeviceID function after login.

Required Packages

- sudo apt-get install libcrypt-pbkdf2-perl
sudo apt-get install libcpan-meta-yaml-perl
sudo cpan -i Net::MQTT::Simple
@@ -538,8 +521,8 @@ sub Nello_detectExecute { login to your created account
  • - recoverPassword <username> [ <temporary_password> ]
    - recovers the password or executes the login using a temporary password + recoverPassword <username>
    + recovers the password
  • @@ -582,13 +565,11 @@ sub Nello_detectExecute { Das Nello Modul ermöglicht die Steuerung des nello one Chips.
    Um es aufzusetzen, muss zunächst ein neuer Nutzer in der Nello-App angelegt werden, der nur für FHEM verwendet wird - eine Nutzung per App ist mit diesem Account dann nicht mehr möglich.
    Anschließend kann das Gerät angelegt werden. Sobald das Gerät erstellt wurde, kann der Login durchgeführt werden.
    - ACHTUNG: Wurde der Account auf einem iOS-Gerät erstellt muss wegen eines Bugs das Passwort über die recoverPassword Funktion zurückgesetzt und anschließend der Login mit set <name> recoverPassword <username> <temporary_password> durchgeführt werden. - Ansonsten wird der Login fehlschlagen. Android-Nutzer können das normale login verwenden.
    + ACHTUNG: Sollte der Login fehlschlagen, versuche das Passwort über die recoverPassword Funktion zurückzusetzen.
    Dringend empfohlen: Für verzögerungsfreie Events die detectDeviceID Funktion nach dem Login aufrufen.

    Benötigte Pakete

    - sudo apt-get install libcrypt-pbkdf2-perl
    sudo apt-get install libcpan-meta-yaml-perl
    sudo cpan -i Net::MQTT::Simple
    @@ -610,11 +591,11 @@ sub Nello_detectExecute {
    • login <username> <password>
      - Login in einen Android-Account + Login
    • - recoverPassword <username> [ <temporary_password> ]
      - setzt das Passwort zurück oder führt den Login mit temporären Passwort durch + recoverPassword <username>
      + setzt das Passwort zurück