mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
74_Unifi: fixes für new UC-Version
git-svn-id: https://svn.fhem.de/fhem/trunk@17015 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
0ddd9e79fc
commit
b07b2894b1
@ -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.
|
||||||
|
- change: 74_Unifi: changed readings -UC_newClients and -AP_utilization
|
||||||
- bugfix: 36_WMBUS: fix decryption for AES CBC mode
|
- bugfix: 36_WMBUS: fix decryption for AES CBC mode
|
||||||
- feature: 42_AptToDate: add dist-upgrade available with Attribut
|
- feature: 42_AptToDate: add dist-upgrade available with Attribut
|
||||||
- change: 74_XiaomiBTLESens: more debug messages, delete old batteryreadings
|
- change: 74_XiaomiBTLESens: more debug messages, delete old batteryreadings
|
||||||
|
@ -35,10 +35,13 @@
|
|||||||
# - fixed: 74_Unifi: Minor bugfix in notify-function
|
# - fixed: 74_Unifi: Minor bugfix in notify-function
|
||||||
# V 3.0.3
|
# V 3.0.3
|
||||||
# - fixed: 74_Unifi: Minor loglevel-bugfix
|
# - fixed: 74_Unifi: Minor loglevel-bugfix
|
||||||
|
# V 3.0.4
|
||||||
|
# - fixed: 74_Unifi: Readingname -UC_newClients with leading -
|
||||||
|
# - changed: 74_Unifi: Reading(name) for Utilization of APs with UC V 5.7/8.x
|
||||||
|
|
||||||
|
|
||||||
package main;
|
package main;
|
||||||
my $version="3.0.3";
|
my $version="3.0.4";
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use HttpUtils;
|
use HttpUtils;
|
||||||
@ -1249,7 +1252,7 @@ sub Unifi_SetClientReadings($) {
|
|||||||
readingsBulkUpdate($hash,$clientName,'disconnected');
|
readingsBulkUpdate($hash,$clientName,'disconnected');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
readingsBulkUpdate($hash,"UC_newClients",$newClients);
|
readingsBulkUpdate($hash,"-UC_newClients",$newClients);
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
@ -1275,8 +1278,10 @@ sub Unifi_SetAccesspointReadings($) {
|
|||||||
Log3 $name, 5, "$name ($self) - executed.";
|
Log3 $name, 5, "$name ($self) - executed.";
|
||||||
|
|
||||||
my ($apName,$apRef,$essid);
|
my ($apName,$apRef,$essid);
|
||||||
|
my $utiliz;
|
||||||
for my $apID (keys %{$hash->{accespoints}}) {
|
for my $apID (keys %{$hash->{accespoints}}) {
|
||||||
$essid = '';
|
$essid = '';
|
||||||
|
$utiliz = '';
|
||||||
$apRef = $hash->{accespoints}->{$apID};
|
$apRef = $hash->{accespoints}->{$apID};
|
||||||
$apName = ($apRef->{name}) ? $apRef->{name} : $apRef->{ip};
|
$apName = ($apRef->{name}) ? $apRef->{name} : $apRef->{ip};
|
||||||
|
|
||||||
@ -1289,10 +1294,21 @@ sub Unifi_SetAccesspointReadings($) {
|
|||||||
my $essid = 'none';
|
my $essid = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#nochmal genauer ins json schauen, ob hier wirklich eine Schleife notwendig ist. (cu_total mehrfach vorhanden?
|
||||||
|
if (defined $apRef->{'radio_table_stats'} ) {
|
||||||
|
for my $rts (@{$apRef->{'radio_table_stats'}}) {
|
||||||
|
$utiliz .= makeReadingName($rts->{'cu_total'}).','; # TODO: hier nicht unbedingt notwendig, aufgrund des funktionierenden schnellen fixes wegen neuer controller-Version bleibt es aber erstmal so drin.
|
||||||
|
}
|
||||||
|
$utiliz =~ s/.$//;
|
||||||
|
} else {
|
||||||
|
my $utiliz = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
readingsBulkUpdate($hash,'-AP_'.$apName.'_state',($apRef->{state} == 1) ? 'ok' : 'error');
|
readingsBulkUpdate($hash,'-AP_'.$apName.'_state',($apRef->{state} == 1) ? 'ok' : 'error');
|
||||||
readingsBulkUpdate($hash,'-AP_'.$apName.'_clients',$apRef->{'num_sta'});
|
readingsBulkUpdate($hash,'-AP_'.$apName.'_clients',$apRef->{'num_sta'});
|
||||||
if( $apRef->{type} eq 'uap' ) {
|
if( $apRef->{type} eq 'uap' ) {
|
||||||
readingsBulkUpdate($hash,'-AP_'.$apName.'_essid',$essid);
|
readingsBulkUpdate($hash,'-AP_'.$apName.'_essid',$essid);
|
||||||
|
readingsBulkUpdate($hash,'-AP_'.$apName.'_utilization',$utiliz) if ($utiliz ne '');
|
||||||
readingsBulkUpdate($hash,'-AP_'.$apName.'_utilizationNA',$apRef->{'na_cu_total'}) if( defined($apRef->{'na_cu_total'}) );
|
readingsBulkUpdate($hash,'-AP_'.$apName.'_utilizationNA',$apRef->{'na_cu_total'}) if( defined($apRef->{'na_cu_total'}) );
|
||||||
readingsBulkUpdate($hash,'-AP_'.$apName.'_utilizationNG',$apRef->{'ng_cu_total'}) if( defined($apRef->{'ng_cu_total'}) );
|
readingsBulkUpdate($hash,'-AP_'.$apName.'_utilizationNG',$apRef->{'ng_cu_total'}) if( defined($apRef->{'ng_cu_total'}) );
|
||||||
}
|
}
|
||||||
@ -2370,8 +2386,8 @@ Or you can use the other readings or set and get features to control your unifi-
|
|||||||
<ul>
|
<ul>
|
||||||
Note: All readings generate events. You can control this with <a href="#readingFnAttributes">these global attributes</a>.
|
Note: All readings generate events. You can control this with <a href="#readingFnAttributes">these global attributes</a>.
|
||||||
<li>Each client has 7 readings for connection-state, SNR, uptime, last_seen-time, connected-AP, essid and hostname.</li>
|
<li>Each client has 7 readings for connection-state, SNR, uptime, last_seen-time, connected-AP, essid and hostname.</li>
|
||||||
<li><code>UC_newClients</code> shows nameof a new client, could be a comma-separated list. Will be set to empty at next interval.</li>
|
<li><code>-UC_newClients</code> shows nameof a new client, could be a comma-separated list. Will be set to empty at next interval.</li>
|
||||||
<li>Each AP has 3 readings for state (can be 'ok' or 'error'), essid's and count of connected-clients.</li>
|
<li>Each AP has 5 readings for state (can be 'ok' or 'error'), essid's, utilization, locate and count of connected-clients.</li>
|
||||||
<li>The unifi-controller has 6 readings for event-count in configured 'timePeriod', unarchived-alert count, accesspoint count, overall wlan-state (can be 'ok', 'warning', or other?), connected user count and connected guest count. </li>
|
<li>The unifi-controller has 6 readings for event-count in configured 'timePeriod', unarchived-alert count, accesspoint count, overall wlan-state (can be 'ok', 'warning', or other?), connected user count and connected guest count. </li>
|
||||||
<li>The Unifi-device reading 'state' represents the connection-state to the unifi-controller (can be 'connected', 'disconnected', 'initialized' and 'disabled').</li>
|
<li>The Unifi-device reading 'state' represents the connection-state to the unifi-controller (can be 'connected', 'disconnected', 'initialized' and 'disabled').</li>
|
||||||
<li>Each voucher-cache has a reading with the next free voucher code.</li>
|
<li>Each voucher-cache has a reading with the next free voucher code.</li>
|
||||||
|
@ -17,9 +17,11 @@
|
|||||||
# V 0.91
|
# V 0.91
|
||||||
# - fixed: 74_UnififSwitch: fixed wording in commandref
|
# - fixed: 74_UnififSwitch: fixed wording in commandref
|
||||||
# added new state-mappings
|
# added new state-mappings
|
||||||
|
# V 0.92
|
||||||
|
# - fixed: 74_UnififSwitch: fixed possible log-error in eq in line 135
|
||||||
#
|
#
|
||||||
# TODOs:
|
# TODOs:
|
||||||
# - state des USW korrekt setzen (aktuell nur connected und provisioning)
|
# - state des USW für weiter state-Numbers korrekt in Worte übersetzen
|
||||||
|
|
||||||
package main;
|
package main;
|
||||||
my $version="0.92";
|
my $version="0.92";
|
||||||
@ -132,7 +134,7 @@ sub UnifiSwitch_Set($@){
|
|||||||
my $idx;
|
my $idx;
|
||||||
my $i = 0;
|
my $i = 0;
|
||||||
for my $entry (@{$port_overrides}) {
|
for my $entry (@{$port_overrides}) {
|
||||||
if( $entry->{port_idx} eq $setVal ) {
|
if( defined $entry->{port_idx} && ($entry->{port_idx} eq $setVal) ) {
|
||||||
$idx = $i;
|
$idx = $i;
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user