diff --git a/fhem/CHANGED b/fhem/CHANGED index fad6098c2..58e616b54 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. + - change: 10_RESIDENTS: renamed reading residentsGuests to residentsTotalGuests - change: SYSMON: warnings, docu - bugfix: 73_km200: Bugfix for fullResponse - feature: 73_km200: New services found diff --git a/fhem/FHEM/10_RESIDENTS.pm b/fhem/FHEM/10_RESIDENTS.pm index 51a7bba57..6dd9089d9 100644 --- a/fhem/FHEM/10_RESIDENTS.pm +++ b/fhem/FHEM/10_RESIDENTS.pm @@ -628,19 +628,21 @@ sub RESIDENTS_UpdateReadings (@) { : "undefined"; my $name = $hash->{NAME}; - my $state_home = 0; - my $state_gotosleep = 0; - my $state_asleep = 0; - my $state_awoken = 0; - my $state_absent = 0; - my $state_gone = 0; - my $state_total = 0; - my $state_totalPresent = 0; - my $state_totalAbsent = 0; - my $state_totalGuests = 0; - my $state_guestDev = 0; - my $wayhome = 0; - my $wakeup = 0; + my $state_home = 0; + my $state_gotosleep = 0; + my $state_asleep = 0; + my $state_awoken = 0; + my $state_absent = 0; + my $state_gone = 0; + my $state_total = 0; + my $state_totalPresent = 0; + my $state_totalAbsent = 0; + my $state_totalGuests = 0; + my $state_totalGuestsPresent = 0; + my $state_totalGuestsAbsent = 0; + my $state_guestDev = 0; + my $wayhome = 0; + my $wakeup = 0; my $newstate; my $presence = "absent"; @@ -707,6 +709,7 @@ sub RESIDENTS_UpdateReadings (@) { if ( $defs{$guest}{READINGS}{state}{VAL} eq "home" ) { $state_home++; $state_totalPresent++; + $state_totalGuestsPresent++; $state_totalGuests++; $state_total++; } @@ -714,6 +717,7 @@ sub RESIDENTS_UpdateReadings (@) { if ( $defs{$guest}{READINGS}{state}{VAL} eq "gotosleep" ) { $state_gotosleep++; $state_totalPresent++; + $state_totalGuestsPresent++; $state_totalGuests++; $state_total++; } @@ -721,6 +725,7 @@ sub RESIDENTS_UpdateReadings (@) { if ( $defs{$guest}{READINGS}{state}{VAL} eq "asleep" ) { $state_asleep++; $state_totalPresent++; + $state_totalGuestsPresent++; $state_totalGuests++; $state_total++; } @@ -728,6 +733,7 @@ sub RESIDENTS_UpdateReadings (@) { if ( $defs{$guest}{READINGS}{state}{VAL} eq "awoken" ) { $state_awoken++; $state_totalPresent++; + $state_totalGuestsPresent++; $state_totalGuests++; $state_total++; } @@ -735,6 +741,7 @@ sub RESIDENTS_UpdateReadings (@) { if ( $defs{$guest}{READINGS}{state}{VAL} eq "absent" ) { $state_absent++; $state_totalAbsent++; + $state_totalGuestsAbsent++; $state_totalGuests++; $state_total++; } @@ -756,9 +763,21 @@ sub RESIDENTS_UpdateReadings (@) { if ( !defined( $hash->{READINGS}{residentsTotal}{VAL} ) || $hash->{READINGS}{residentsTotal}{VAL} ne $state_total ); - readingsBulkUpdate( $hash, "residentsGuests", $state_totalGuests ) - if ( !defined( $hash->{READINGS}{residentsGuests}{VAL} ) - || $hash->{READINGS}{residentsGuests}{VAL} ne $state_totalGuests ); + readingsBulkUpdate( $hash, "residentsTotalGuests", $state_totalGuests ) + if ( !defined( $hash->{READINGS}{residentsTotalGuests}{VAL} ) + || $hash->{READINGS}{residentsTotalGuests}{VAL} ne $state_totalGuests ); + + readingsBulkUpdate( $hash, "residentsTotalGuestsPresent", + $state_totalGuestsPresent ) + if ( !defined( $hash->{READINGS}{residentsTotalGuestsPresent}{VAL} ) + || $hash->{READINGS}{residentsTotalGuestsPresent}{VAL} ne + $state_totalGuestsPresent ); + + readingsBulkUpdate( $hash, "residentsTotalGuestsAbsent", + $state_totalGuestsAbsent ) + if ( !defined( $hash->{READINGS}{residentsTotalGuestsAbsent}{VAL} ) + || $hash->{READINGS}{residentsTotalGuestsAbsent}{VAL} ne + $state_totalGuestsAbsent ); readingsBulkUpdate( $hash, "residentsTotalPresent", $state_totalPresent ) if ( !defined( $hash->{READINGS}{residentsTotalPresent}{VAL} ) @@ -886,7 +905,7 @@ sub RESIDENTS_UpdateReadings (@) { && $newstate ne "absent" ); Log3 $name, 4, -"RESIDENTS $name: calculation result - residentsTotal:$state_total residentsGuests:$state_totalGuests residentsTotalPresent:$state_totalPresent residentsTotalAbsent:$state_totalAbsent residentsHome:$state_home residentsGotosleep:$state_gotosleep residentsAsleep:$state_asleep residentsAwoken:$state_awoken residentsAbsent:$state_absent residentsGone:$state_gone presence:$presence state:$newstate"; +"RESIDENTS $name: calculation result - residentsTotal:$state_total residentsTotalGuests:$state_totalGuests residentsTotalGuestsPresent:$state_totalGuestsPresent residentsTotalGuestsAbsent:$state_totalGuestsAbsent residentsTotalPresent:$state_totalPresent residentsTotalAbsent:$state_totalAbsent residentsHome:$state_home residentsGotosleep:$state_gotosleep residentsAsleep:$state_asleep residentsAwoken:$state_awoken residentsAbsent:$state_absent residentsGone:$state_gone presence:$presence state:$newstate"; # safe current time my $datetime = FmtDateTime(time); @@ -1150,9 +1169,6 @@ sub RESIDENTS_UpdateReadings (@) {
  • residentsGotosleep - number of residents with state 'gotosleep'
  • -
  • - residentsGuests - number of active guests who are currently treated as part of the residents scope -
  • residentsHome - number of residents with state 'home'
  • @@ -1162,6 +1178,15 @@ sub RESIDENTS_UpdateReadings (@) {
  • residentsTotalAbsent - number of all residents who are currently underway
  • +
  • + residentsTotalGuests - number of active guests who are currently treated as part of the residents scope +
  • +
  • + residentsTotalGuestsAbsent - number of all active guests who are currently underway +
  • +
  • + residentsTotalGuestsPresent - number of all active guests who are currently at home +
  • residentsTotalPresent - number of all residents who are currently at home
  • @@ -1385,9 +1410,6 @@ sub RESIDENTS_UpdateReadings (@) {
  • residentsGotosleep - Anzahl der Bewohner mit Status 'gotosleep'
  • -
  • - residentsGuests - Anzahl der aktiven Gäste, welche momentan du den Bewohnern dazugezählt werden -
  • residentsHome - Anzahl der Bewohner mit Status 'home'
  • @@ -1397,6 +1419,15 @@ sub RESIDENTS_UpdateReadings (@) {
  • residentsTotalAbsent - Summe aller aktiven Bewohner, die unterwegs sind
  • +
  • + residentsTotalGuests - Anzahl der aktiven Gäste, welche momentan du den Bewohnern dazugezählt werden +
  • +
  • + residentsTotalGuestsAbsent - Anzahl der aktiven Gäste, die momentan unterwegs sind +
  • +
  • + residentsTotalGuestsPresent - Anzahl der aktiven Gäste, die momentan zu Hause sind +
  • residentsTotalPresent - Summe aller aktiven Bewohner, die momentan zu Hause sind
  • diff --git a/fhem/HISTORY b/fhem/HISTORY index e3bc9c96b..7db2fb384 100644 --- a/fhem/HISTORY +++ b/fhem/HISTORY @@ -623,3 +623,7 @@ - Tue Mar 17 2015 (wzut) - added two new modules at contrib/Infratec/* for Infratec Power Modules + +- Sat Mar 21 2015 (loredo) + - reading residentsGuests in module 10_RESIDENTS was renamed to residentsTotalGuests + - introducing new readings in module 10_RESIDENTS: residentsTotalGuestsAbsent and residentsTotalGuestsPresent