mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
73_NUKIBridge: 74_NUKIDevice 0.6.0 Support for API v1.5
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@13228 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e6abafcb89
commit
98d237ca16
1
CHANGED
1
CHANGED
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- update: 73_NUKIBridge/74_NUKIDevice 0.6.0 Support for API v1.5
|
||||||
- update: 98_DOIFtools.pm: new attribute DOIFtoolsEventOnDeleted generates
|
- update: 98_DOIFtools.pm: new attribute DOIFtoolsEventOnDeleted generates
|
||||||
events for stat_ Readings before deletion
|
events for stat_ Readings before deletion
|
||||||
remove add... button in DOIFtools event monitor
|
remove add... button in DOIFtools event monitor
|
||||||
|
@ -46,7 +46,8 @@ use JSON;
|
|||||||
|
|
||||||
use HttpUtils;
|
use HttpUtils;
|
||||||
|
|
||||||
my $version = "0.4.7";
|
my $version = "0.6.0";
|
||||||
|
my $bridgeapi = "1.5";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -135,6 +136,7 @@ sub NUKIBridge_Define($$) {
|
|||||||
$hash->{PORT} = $port;
|
$hash->{PORT} = $port;
|
||||||
$hash->{TOKEN} = $token;
|
$hash->{TOKEN} = $token;
|
||||||
$hash->{VERSION} = $version;
|
$hash->{VERSION} = $version;
|
||||||
|
$hash->{BRIDGEAPI} = $bridgeapi;
|
||||||
$hash->{helper}{aliveCount} = 0;
|
$hash->{helper}{aliveCount} = 0;
|
||||||
|
|
||||||
|
|
||||||
@ -245,6 +247,11 @@ sub NUKIBridge_Set($@) {
|
|||||||
|
|
||||||
NUKIBridge_CallBlocking($hash,"clearlog",undef) if( !IsDisabled($name) );
|
NUKIBridge_CallBlocking($hash,"clearlog",undef) if( !IsDisabled($name) );
|
||||||
|
|
||||||
|
} elsif($cmd eq 'factoryReset') {
|
||||||
|
return "usage: clearLog" if( @args != 0 );
|
||||||
|
|
||||||
|
NUKIBridge_CallBlocking($hash,"factoryReset",undef) if( !IsDisabled($name) );
|
||||||
|
|
||||||
} elsif($cmd eq 'callbackRemove') {
|
} elsif($cmd eq 'callbackRemove') {
|
||||||
return "usage: callbackRemove" if( @args != 1 );
|
return "usage: callbackRemove" if( @args != 1 );
|
||||||
my $id = "id=" . join( " ", @args );
|
my $id = "id=" . join( " ", @args );
|
||||||
@ -259,7 +266,7 @@ sub NUKIBridge_Set($@) {
|
|||||||
} else {
|
} else {
|
||||||
my $list = "";
|
my $list = "";
|
||||||
$list .= "info:noArg autocreate:noArg callbackRemove:0,1,2 ";
|
$list .= "info:noArg autocreate:noArg callbackRemove:0,1,2 ";
|
||||||
$list .= "clearLog:noArg fwUpdate:noArg reboot:noArg" if( ReadingsVal($name,'bridgeType','Software') eq 'Hardware' );
|
$list .= "clearLog:noArg fwUpdate:noArg reboot:noArg factoryReset:noArg" if( ReadingsVal($name,'bridgeType','Software') eq 'Hardware' );
|
||||||
return "Unknown argument $cmd, choose one of $list";
|
return "Unknown argument $cmd, choose one of $list";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -439,7 +446,7 @@ sub NUKIBridge_Distribution($$$) {
|
|||||||
# zum testen da ich kein Nuki Smartlock habe
|
# zum testen da ich kein Nuki Smartlock habe
|
||||||
#$json = '[{"nukiId": 1,"name": "Home","lastKnownState": {"state": 1,"stateName": "locked","batteryCritical": false,"timestamp": "2016-10-03T06:49:00+00:00"}},{"nukiId": 2,"name": "Grandma","lastKnownState": {"state": 3,"stateName": "unlocked","batteryCritical": false,"timestamp": "2016-10-03T06:49:00+00:00"}}]' if( $param->{endpoint} eq "list" );
|
#$json = '[{"nukiId": 1,"name": "Home","lastKnownState": {"state": 1,"stateName": "locked","batteryCritical": false,"timestamp": "2016-10-03T06:49:00+00:00"}},{"nukiId": 2,"name": "Grandma","lastKnownState": {"state": 3,"stateName": "unlocked","batteryCritical": false,"timestamp": "2016-10-03T06:49:00+00:00"}}]' if( $param->{endpoint} eq "list" );
|
||||||
|
|
||||||
#$json= '{"bridgeType":2,"ids":{"serverId":142667440},"versions":{"appVersion":"0.2.14"},"uptime":1527,"currentTime":"2017-01-17T04:55:58Z","serverConnected":true,"scanResults":[{"nukiId": 1,"name": "Home","rssi": -87,"paired": true},{"nukiId": 2,"name": "Grandma","rssi": -93,"paired": false}]}';
|
#$json= '{"bridgeType":2,"ids":{"serverId":142667440},"versions":{"appVersion":"0.2.14"},"uptime":1527,"currentTime":"2017-01-17T04:55:58Z","serverConnected":true,"scanResults":[{"nukiId": 1,"name": "Home","rssi": -87,"paired": true},{"nukiId": 2,"name": "Grandma","rssi": -93,"paired": false}]}' if( $param->{endpoint} eq "info" );
|
||||||
|
|
||||||
NUKIBridge_ResponseProcessing($hash,$json,$param->{endpoint});
|
NUKIBridge_ResponseProcessing($hash,$json,$param->{endpoint});
|
||||||
|
|
||||||
@ -809,10 +816,11 @@ sub NUKIBridge_CallBlocking($$$) {
|
|||||||
<ul>
|
<ul>
|
||||||
<li>autocreate - Prompts to re-read all Smartlocks from the bridge and if not already present in FHEM, create the autimatic.</li>
|
<li>autocreate - Prompts to re-read all Smartlocks from the bridge and if not already present in FHEM, create the autimatic.</li>
|
||||||
<li>callbackRemove - Removes a previously added callback</li>
|
<li>callbackRemove - Removes a previously added callback</li>
|
||||||
<li>clearLog - Clears the log of the Bridge</li>
|
<li>clearLog - Clears the log of the Bridge (only hardwarebridge)</li>
|
||||||
<li>fwUpdate - Immediately checks for a new firmware update and installs it</li>
|
<li>factoryReset - Performs a factory reset (only hardwarebridge)</li>
|
||||||
|
<li>fwUpdate - Immediately checks for a new firmware update and installs it (only hardwarebridge)</li>
|
||||||
<li>info - Returns all Smart Locks in range and some device information of the bridge itself</li>
|
<li>info - Returns all Smart Locks in range and some device information of the bridge itself</li>
|
||||||
<li>reboot - reboots the bridge</li>
|
<li>reboot - reboots the bridge (only hardwarebridge)</li>
|
||||||
<br>
|
<br>
|
||||||
</ul>
|
</ul>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
@ -33,7 +33,7 @@ use warnings;
|
|||||||
use JSON;
|
use JSON;
|
||||||
|
|
||||||
|
|
||||||
my $version = "0.4.7";
|
my $version = "0.6.0";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -306,9 +306,13 @@ sub NUKIDevice_Set($$@) {
|
|||||||
} elsif( $cmd eq 'locknGoWithUnlatch' ) {
|
} elsif( $cmd eq 'locknGoWithUnlatch' ) {
|
||||||
$lockAction = $cmd;
|
$lockAction = $cmd;
|
||||||
|
|
||||||
|
} elsif( $cmd eq 'unpair' ) {
|
||||||
|
|
||||||
|
NUKIDevice_ReadFromNUKIBridge($hash,"$cmd",undef,$hash->{NUKIID} ) if( !IsDisabled($name) );
|
||||||
|
return undef;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
my $list = "statusRequest:noArg unlock:noArg lock:noArg unlatch:noArg locknGo:noArg locknGoWithUnlatch:noArg";
|
my $list = "statusRequest:noArg unlock:noArg lock:noArg unlatch:noArg locknGo:noArg locknGoWithUnlatch:noArg unpair:noArg";
|
||||||
return "Unknown argument $cmd, choose one of $list";
|
return "Unknown argument $cmd, choose one of $list";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -601,6 +605,9 @@ sub NUKIDevice_CGI() {
|
|||||||
<ul>
|
<ul>
|
||||||
<li>state - Status of the Smartlock or error message if any error.</li>
|
<li>state - Status of the Smartlock or error message if any error.</li>
|
||||||
<li>lockState - current lock status uncalibrated, locked, unlocked, unlocked (lock ‘n’ go), unlatched, locking, unlocking, unlatching, motor blocked, undefined.</li>
|
<li>lockState - current lock status uncalibrated, locked, unlocked, unlocked (lock ‘n’ go), unlatched, locking, unlocking, unlatching, motor blocked, undefined.</li>
|
||||||
|
<li>name - name of the device</li>
|
||||||
|
<li>paired - paired information false/true</li>
|
||||||
|
<li>rssi - value of rssi</li>
|
||||||
<li>succes - true, false Returns the status of the last closing command. Ok or not Ok.</li>
|
<li>succes - true, false Returns the status of the last closing command. Ok or not Ok.</li>
|
||||||
<li>batteryCritical - Is the battery in a critical state? True, false</li>
|
<li>batteryCritical - Is the battery in a critical state? True, false</li>
|
||||||
<li>battery - battery status, ok / low</li>
|
<li>battery - battery status, ok / low</li>
|
||||||
@ -613,6 +620,7 @@ sub NUKIDevice_CGI() {
|
|||||||
<li>lock - lock</li>
|
<li>lock - lock</li>
|
||||||
<li>unlock - unlock</li>
|
<li>unlock - unlock</li>
|
||||||
<li>unlatch - unlock / open Door</li>
|
<li>unlatch - unlock / open Door</li>
|
||||||
|
<li>unpair - Removes the pairing with a given Smart Lock</li>
|
||||||
<li>locknGo - lock when gone</li>
|
<li>locknGo - lock when gone</li>
|
||||||
<li>locknGoWithUnlatch - lock after the door has been opened</li>
|
<li>locknGoWithUnlatch - lock after the door has been opened</li>
|
||||||
<br>
|
<br>
|
||||||
@ -658,6 +666,9 @@ sub NUKIDevice_CGI() {
|
|||||||
<ul>
|
<ul>
|
||||||
<li>state - Status des Smartlock bzw. Fehlermeldung von Fehler vorhanden.</li>
|
<li>state - Status des Smartlock bzw. Fehlermeldung von Fehler vorhanden.</li>
|
||||||
<li>lockState - aktueller Schließstatus uncalibrated, locked, unlocked, unlocked (lock ‘n’ go), unlatched, locking, unlocking, unlatching, motor blocked, undefined.</li>
|
<li>lockState - aktueller Schließstatus uncalibrated, locked, unlocked, unlocked (lock ‘n’ go), unlatched, locking, unlocking, unlatching, motor blocked, undefined.</li>
|
||||||
|
<li>name - Name des Smart Locks</li>
|
||||||
|
<li>paired - pairing Status des Smart Locks</li>
|
||||||
|
<li>rssi - rssi Wert des Smart Locks</li>
|
||||||
<li>succes - true, false Gibt des Status des letzten Schließbefehles wieder. Geklappt oder nicht geklappt.</li>
|
<li>succes - true, false Gibt des Status des letzten Schließbefehles wieder. Geklappt oder nicht geklappt.</li>
|
||||||
<li>batteryCritical - Ist die Batterie in einem kritischen Zustand? true, false</li>
|
<li>batteryCritical - Ist die Batterie in einem kritischen Zustand? true, false</li>
|
||||||
<li>battery - Status der Batterie, ok/low</li>
|
<li>battery - Status der Batterie, ok/low</li>
|
||||||
@ -670,6 +681,7 @@ sub NUKIDevice_CGI() {
|
|||||||
<li>lock - verschließen</li>
|
<li>lock - verschließen</li>
|
||||||
<li>unlock - aufschließen</li>
|
<li>unlock - aufschließen</li>
|
||||||
<li>unlatch - entriegeln/Falle öffnen.</li>
|
<li>unlatch - entriegeln/Falle öffnen.</li>
|
||||||
|
<li>unpair - entfernt das pairing mit dem Smart Lock</li>
|
||||||
<li>locknGo - verschließen wenn gegangen</li>
|
<li>locknGo - verschließen wenn gegangen</li>
|
||||||
<li>locknGoWithUnlatch - verschließen nach dem die Falle geöffnet wurde.</li>
|
<li>locknGoWithUnlatch - verschließen nach dem die Falle geöffnet wurde.</li>
|
||||||
<br>
|
<br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user