diff --git a/FHEM/10_RESIDENTS.pm b/FHEM/10_RESIDENTS.pm
index c7633dd96..f20c7b105 100644
--- a/FHEM/10_RESIDENTS.pm
+++ b/FHEM/10_RESIDENTS.pm
@@ -23,7 +23,7 @@
# along with fhem. If not, see .
#
#
-# Version: 1.0.0
+# Version: 1.0.1
#
# Major Version History:
# - 1.0.0 - 2014-02-08
@@ -899,7 +899,7 @@ sub RESIDENTS_TimeDiff($$) {
Example:
- # Standalone
+ # Standalone
define rgr_Residents RESIDENTS
@@ -909,27 +909,30 @@ sub RESIDENTS_TimeDiff($$) {
Set
- set <rg_FirstName> <command> [<parameter>]
+ set <rgr_ResidentsName> <command> [<parameter>]
Currently, the following commands are defined.
- - location - sets reading 'location'; see attribute rg_locations to adjust list shown in FHEMWEB
- - mood - sets reading 'mood'; see attribute rg_moods to adjust list shown in FHEMWEB
- - state home,gotosleep,asleep,awoken,absent,gone switch between states; see attribute rg_states to adjust list shown in FHEMWEB
+ - addGuest - creates a new GUEST device and adds it to the current RESIDENTS group. Just enter the dummy name and there you go.
+ - addRoommate - creates a new ROOMMATE device and adds it to the current RESIDENTS group. Just enter the first name and there you go.
+ - removeGuest - shows all GUEST members and allows to delete their dummy devices easily.
+ - removeRoommate - shows all ROOMMATE members and allows to delete their dummy devices easily.
+ - state home,gotosleep,asleep,awoken,absent,gone switch between states for all group members at once; see attribute rgr_states to adjust list shown in FHEMWEB
+
Possible states and their meaning
- This module differs 7 states:
+ This module differs between 7 states:
- - home - residents are present at home and awake
- - gotosleep - all present residents are on it's way to bed
+ - home - residents are present at home and at least one of them is not asleep
+ - gotosleep - present residents are on their way to bed (if they are not asleep already)
- asleep - all present residents are currently sleeping
- - awoken - all present residents just woke up from sleep
- - absent - no resident is currently at home but will be back shortly
+ - awoken - at least one resident just woke up from sleep
+ - absent - no resident is currently at home but at least one will be back shortly
- gone - all residents left home for longer period
- none - no active member
@@ -953,6 +956,8 @@ sub RESIDENTS_TimeDiff($$) {
Generated Readings/Events:
+ - lastActivity - the last state change of one of the group members
+ - lastActivityBy - the realname of the last group member with changed state
- lastArrival - timestamp of last arrival at home
- lastAwake - timestamp of last sleep cycle end
- lastDeparture - timestamp of last departure from home
@@ -967,7 +972,7 @@ sub RESIDENTS_TimeDiff($$) {
- residentsAwoken - number of residents with state 'awoken'
- residentsGone - number of residents with state 'gone'
- residentsGotosleep - number of residents with state 'gotosleep'
- - residentsGuests - number of active guests who are currently threated as part of the residents scope
+ - residentsGuests - number of active guests who are currently treated as part of the residents scope
- residentsHome - number of residents with state 'home'
- residentsTotal - total number of all active residents despite their current state
- residentsTotalAbsent - number of all residents who are currently underway
@@ -981,10 +986,16 @@ sub RESIDENTS_TimeDiff($$) {
=end html
=begin html_DE
+
+
+RESIDENTS
+
Eine deutsche Version der Dokumentation ist derzeit nicht vorhanden.
Die englische Version ist hier zu finden:
-
- RESIDENTS
+
+
=end html_DE
diff --git a/FHEM/20_GUEST.pm b/FHEM/20_GUEST.pm
index 6448b89ee..07920efe4 100644
--- a/FHEM/20_GUEST.pm
+++ b/FHEM/20_GUEST.pm
@@ -23,7 +23,7 @@
# along with fhem. If not, see .
#
#
-# Version: 1.0.0
+# Version: 1.0.1
#
# Major Version History:
# - 1.0.0 - 2014-02-08
@@ -202,8 +202,8 @@ sub GUEST_Define($$) {
readingsEndUpdate( $hash, 1 );
- # run AutoGone timer
- InternalTimer( gettimeofday() + 10, "ROOMMATE_AutoGone", $hash, 1 );
+ # run timers
+ InternalTimer( gettimeofday() + 15, "GUEST_StartInternalTimers", $hash, 0 );
return undef;
}
@@ -754,7 +754,7 @@ sub GUEST_DurationTimer($;$) {
$diff =
$timestampNow -
GUEST_Datetime2Timestamp( $hash->{READINGS}{lastArrival}{VAL} );
- $durPresence = ( $diff / 60 ) % 60;
+ $durPresence = int( $diff / 60 );
}
}
@@ -770,7 +770,7 @@ sub GUEST_DurationTimer($;$) {
$diff =
$timestampNow -
GUEST_Datetime2Timestamp( $hash->{READINGS}{lastDeparture}{VAL} );
- $durAbsence = ( $diff / 60 ) % 60;
+ $durAbsence = int( $diff / 60 );
}
}
@@ -784,7 +784,7 @@ sub GUEST_DurationTimer($;$) {
$diff =
$timestampNow -
GUEST_Datetime2Timestamp( $hash->{READINGS}{lastSleep}{VAL} );
- $durSleep = ( $diff / 60 ) % 60;
+ $durSleep = int( $diff / 60 );
}
}
@@ -883,6 +883,14 @@ sub GUEST_RemoveInternalTimer($$) {
}
}
+###################################
+sub GUEST_StartInternalTimers($$) {
+ my ($hash) = @_;
+
+ GUEST_AutoGone($hash);
+ GUEST_DurationTimer($hash);
+}
+
1;
=pod
@@ -904,38 +912,39 @@ sub GUEST_RemoveInternalTimer($$) {
Example:
- # Standalone
+ # Standalone
define rg_Guest GUEST
- # Typical group member
+ # Typical group member
define rg_Guest GUEST rgr_Residents # to be member of resident group rgr_Residents
- # Member of multiple groups
+ # Member of multiple groups
define rg_Guest GUEST rgr_Residents,rgr_Guests # to be member of resident group rgr_Residents and rgr_Guests
- Please note the RESIDENTS group device needs to be existing before a GUEST device can become a member of it.
+ Please note the RESIDENTS group device needs to be existing before a GUEST device can become a member of it.
Set
- set <rg_FirstName> <command> [<parameter>]
+ set <rg_GuestName> <command> [<parameter>]
Currently, the following commands are defined.
- location - sets reading 'location'; see attribute rg_locations to adjust list shown in FHEMWEB
- mood - sets reading 'mood'; see attribute rg_moods to adjust list shown in FHEMWEB
- - state home,gotosleep,asleep,awoken,absent,gone switch between states; see attribute rg_states to adjust list shown in FHEMWEB
+ - state home,gotosleep,asleep,awoken,absent,none switch between states; see attribute rg_states to adjust list shown in FHEMWEB
+
Possible states and their meaning
- This module differs 6 states:
+ This module differs between 6 states:
- home - individual is present at home and awake
@@ -998,7 +1007,15 @@ sub GUEST_RemoveInternalTimer($$) {
Whenever location is set to 'underway', the state is set to 'absent' if prior presence state was 'present'. If attribute rg_locationUnderway was defined, all of those locations will trigger state change to 'absent' as well. Those locations won't appear in reading 'lastLocation'.
Whenever location is set to 'wayhome', the reading 'wayhome' is set to '1' if current presence state is 'absent'. If attribute rg_locationWayhome was defined, LEAVING one of those locations will set reading 'wayhome' to '1' as well. So you actually have implicit and explicit options to trigger wayhome.
- Arriving at home will reset the value of 'wayhome' to '0'.
+ Arriving at home will reset the value of 'wayhome' to '0'.
+
+ If you are using the GEOFANCY module, you can easily have your location updated with GEOFANCY events by defining a simple NOTIFY-trigger like this:
+
+
+ define n_rg_Guest.location notify geofancy:currLoc_Guest.* set rg_Guest location $EVTPART1
+
+
+ By defining geofencing zones called 'home', 'underway' and 'wayhome' in the iOS app, you automatically get all the features of automatic state changes described above.
@@ -1008,7 +1025,7 @@ sub GUEST_RemoveInternalTimer($$) {
Attributes
- rg_autoGoneAfter - hours after which state should be auto-set to 'gone' when current state is 'absent'; defaults to 16 hours
- - rg_locationHome - locations matching these will be treated as being at home; first entry reflects default value to be used with state correlation; separate entries by space; defaults to "home"
+ - rg_locationHome - locations matching these will be treated as being at home; first entry reflects default value to be used with state correlation; separate entries by space; defaults to 'home'
- rg_locationUnderway - locations matching these will be treated as being underway; first entry reflects default value to be used with state correlation; separate entries by comma or space; defaults to "underway"
- rg_locationWayhome - leaving a location matching these will set reading wayhome to 1; separate entries by space; defaults to "wayhome"
- rg_locations - list of locations ot be shown in FHEMWEB; separate entries by comma only and do NOT use spaces
@@ -1054,10 +1071,16 @@ sub GUEST_RemoveInternalTimer($$) {
=end html
=begin html_DE
+
+
+GUEST
+
Eine deutsche Version der Dokumentation ist derzeit nicht vorhanden.
Die englische Version ist hier zu finden:
-
- GUEST
+
+
=end html_DE
diff --git a/FHEM/20_ROOMMATE.pm b/FHEM/20_ROOMMATE.pm
index 3ae027571..33155afae 100644
--- a/FHEM/20_ROOMMATE.pm
+++ b/FHEM/20_ROOMMATE.pm
@@ -23,7 +23,7 @@
# along with fhem. If not, see .
#
#
-# Version: 1.0.0
+# Version: 1.0.1
#
# Major Version History:
# - 1.0.0 - 2014-02-08
@@ -195,8 +195,12 @@ sub ROOMMATE_Define($$) {
readingsEndUpdate( $hash, 1 );
- # run AutoGone timer
- InternalTimer( gettimeofday() + 10, "ROOMMATE_AutoGone", $hash, 1 );
+ # run timers
+ InternalTimer(
+ gettimeofday() + 15,
+ "ROOMMATE_StartInternalTimers",
+ $hash, 0
+ );
return undef;
}
@@ -742,7 +746,7 @@ sub ROOMMATE_DurationTimer($;$) {
$timestampNow -
ROOMMATE_Datetime2Timestamp(
$hash->{READINGS}{lastArrival}{VAL} );
- $durPresence = ( $diff / 60 ) % 60;
+ $durPresence = int( $diff / 60 );
}
}
@@ -757,7 +761,7 @@ sub ROOMMATE_DurationTimer($;$) {
$timestampNow -
ROOMMATE_Datetime2Timestamp(
$hash->{READINGS}{lastDeparture}{VAL} );
- $durAbsence = ( $diff / 60 ) % 60;
+ $durAbsence = int( $diff / 60 );
}
}
@@ -771,7 +775,7 @@ sub ROOMMATE_DurationTimer($;$) {
$diff =
$timestampNow -
ROOMMATE_Datetime2Timestamp( $hash->{READINGS}{lastSleep}{VAL} );
- $durSleep = ( $diff / 60 ) % 60;
+ $durSleep = int( $diff / 60 );
}
}
@@ -869,6 +873,14 @@ sub ROOMMATE_RemoveInternalTimer($$) {
}
}
+###################################
+sub ROOMMATE_StartInternalTimers($$) {
+ my ($hash) = @_;
+
+ ROOMMATE_AutoGone($hash);
+ ROOMMATE_DurationTimer($hash);
+}
+
1;
=pod
@@ -890,24 +902,24 @@ sub ROOMMATE_RemoveInternalTimer($$) {
Example:
- # Standalone
+ # Standalone
define rr_Manfred ROOMMATE
- # Typical group member
+ # Typical group member
define rr_Manfred ROOMMATE rgr_Residents # to be member of resident group rgr_Residents
- # Member of multiple groups
+ # Member of multiple groups
define rr_Manfred ROOMMATE rgr_Residents,rgr_Parents # to be member of resident group rgr_Residents and rgr_Parents
- # Complex family structure
- define rr_Manfred ROOMMATE rgr_Residents,rgr_Parents # Parent
- define rr_Lisa ROOMMATE rgr_Residents,rgr_Parents # Parent
- define rr_Rick ROOMMATE rgr_Residents,rgr_Children # Child1
+ # Complex family structure
+ define rr_Manfred ROOMMATE rgr_Residents,rgr_Parents # Parent
+ define rr_Lisa ROOMMATE rgr_Residents,rgr_Parents # Parent
+ define rr_Rick ROOMMATE rgr_Residents,rgr_Children # Child1
define rr_Alex ROOMMATE rgr_Residents,rgr_Children # Child2
- Please note the RESIDENTS group device needs to be existing before a ROOMMATE device can become a member of it.
+ Please note the RESIDENTS group device needs to be existing before a ROOMMATE device can become a member of it.
@@ -924,10 +936,11 @@ sub ROOMMATE_RemoveInternalTimer($$) {
+
Possible states and their meaning
- This module differs 6 states:
+ This module differs between 6 states:
- home - individual is present at home and awake
@@ -990,7 +1003,15 @@ sub ROOMMATE_RemoveInternalTimer($$) {
Whenever location is set to 'underway', the state is set to 'absent' if prior presence state was 'present'. If attribute rr_locationUnderway was defined, all of those locations will trigger state change to 'absent' as well. Those locations won't appear in reading 'lastLocation'.
Whenever location is set to 'wayhome', the reading 'wayhome' is set to '1' if current presence state is 'absent'. If attribute rr_locationWayhome was defined, LEAVING one of those locations will set reading 'wayhome' to '1' as well. So you actually have implicit and explicit options to trigger wayhome.
- Arriving at home will reset the value of 'wayhome' to '0'.
+ Arriving at home will reset the value of 'wayhome' to '0'.
+
+ If you are using the GEOFANCY module, you can easily have your location updated with GEOFANCY events by defining a simple NOTIFY-trigger like this:
+
+
+ define n_rr_Manfred.location notify geofancy:currLoc_Manfred.* set rr_Manfred location $EVTPART1
+
+
+ By defining geofencing zones called 'home', 'underway' and 'wayhome' in the iOS app, you automatically get all the features of automatic state changes described above.
@@ -1000,7 +1021,7 @@ sub ROOMMATE_RemoveInternalTimer($$) {
Attributes
- rr_autoGoneAfter - hours after which state should be auto-set to 'gone' when current state is 'absent'; defaults to 36 hours
- - rr_locationHome - locations matching these will be treated as being at home; first entry reflects default value to be used with state correlation; separate entries by space; defaults to "home"
+ - rr_locationHome - locations matching these will be treated as being at home; first entry reflects default value to be used with state correlation; separate entries by space; defaults to 'home'
- rr_locationUnderway - locations matching these will be treated as being underway; first entry reflects default value to be used with state correlation; separate entries by comma or space; defaults to "underway"
- rr_locationWayhome - leaving a location matching these will set reading wayhome to 1; separate entries by space; defaults to "wayhome"
- rr_locations - list of locations ot be shown in FHEMWEB; separate entries by comma only and do NOT use spaces
@@ -1043,10 +1064,16 @@ sub ROOMMATE_RemoveInternalTimer($$) {
=end html
=begin html_DE
+
+
+ROOMMATE
+
Eine deutsche Version der Dokumentation ist derzeit nicht vorhanden.
Die englische Version ist hier zu finden:
-
- ROOMMATE
+
+
=end html_DE