diff --git a/fhem/FHEM/20_GUEST.pm b/fhem/FHEM/20_GUEST.pm
index 46e8a174a..f627a95fc 100644
--- a/fhem/FHEM/20_GUEST.pm
+++ b/fhem/FHEM/20_GUEST.pm
@@ -459,8 +459,8 @@ sub GUEST_Set($@) {
: "absent";
# stop any running wakeup-timers in case state changed
- my $wakeupState = AttrVal( $name, "wakeup", 0 );
- if ($wakeupState) {
+ my $wakeupState = ReadingsVal( $name, "wakeup", 0 );
+ if ($wakeupState > 0) {
my $wakeupDeviceList = AttrVal( $name, "rg_wakeupDevice", 0 );
for my $wakeupDevice ( split /,/, $wakeupDeviceList ) {
@@ -471,9 +471,11 @@ sub GUEST_Set($@) {
{
# forced-stop only if resident is not present anymore
if ( $newpresence eq "present" ) {
+ Log3 $name, 4, "ROOMMATE $name: ending wakeup-timer $wakeupDevice";
fhem "set $wakeupDevice:FILTER=running!=0 end";
}
else {
+ Log3 $name, 4, "ROOMMATE $name: stopping wakeup-timer $wakeupDevice";
fhem "set $wakeupDevice:FILTER=running!=0 stop";
}
}
@@ -822,14 +824,14 @@ sub GUEST_Set($@) {
# create new weblink device
fhem "define $locationmapName weblink htmlCode {
-'
'
+'
}";
fhem "attr $locationmapName alias Current Location";
fhem
@@ -1186,15 +1188,11 @@ sub GUEST_StartInternalTimers($$) {
=item helper
=begin html
-
-
-
-
- GUEST
-
-
+
+
GUEST
+
Define
-
+
define <rg_GuestName> GUEST [<device name(s) of resident group(s)>]
Provides a special virtual device to represent a guest of your home.
@@ -1205,7 +1203,7 @@ sub GUEST_StartInternalTimers($$) {
Use comma separated list of resident device names for multi-membership (see example below).
Example:
-
+
# Standalone
define rg_Guest GUEST
@@ -1214,15 +1212,15 @@ sub GUEST_StartInternalTimers($$) {
# 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.
-
+
Set
-
+
set <rg_GuestName> <command> [<parameter>]
Currently, the following commands are defined.
@@ -1246,12 +1244,12 @@ sub GUEST_StartInternalTimers($$) {
Note: If you would like to restrict access to admin set-commands (-> create) you may set your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
-
+
-
+
Possible states and their meaning
-
+
This module differs between 6 states:
@@ -1274,47 +1272,47 @@ sub GUEST_StartInternalTimers($$) {
none - guest device is disabled
-
-
+
+
-
+
Presence correlation to location
-
+
Under specific circumstances, changing state will automatically change reading 'location' as well.
Whenever presence state changes from 'absent' to 'present', the location is set to 'home'. If attribute rg_locationHome was defined, first location from it will be used as home location.
Whenever presence state changes from 'present' to 'absent', the location is set to 'underway'. If attribute rg_locationUnderway was defined, first location from it will be used as underway location.
-
-
+
+
-
+
Auto Gone
-
+
Whenever an individual is set to 'absent', a trigger is started to automatically change state to 'gone' after a specific timeframe.
Default value is 16 hours.
This behaviour can be customized by attribute rg_autoGoneAfter.
-
-
+
+
-
+
Synchronizing presence with other ROOMMATE or GUEST devices
-
+
If you always leave or arrive at your house together with other roommates or guests, you may enable a synchronization of your presence state for certain individuals.
By setting attribute rg_passPresenceTo, those individuals will follow your presence state changes to 'home', 'absent' or 'gone' as you do them with your own device.
Please note that individuals with current state 'none' or 'gone' (in case of roommates) will not be touched.
-
-
+
+
-
+
Location correlation to state
-
+
Under specific circumstances, changing location will have an effect on the actual state as well.
Whenever location is set to 'home', the state is set to 'home' if prior presence state was 'absent'. If attribute rg_locationHome was defined, all of those locations will trigger state change to 'home' as well.
@@ -1329,11 +1327,11 @@ sub GUEST_StartInternalTimers($$) {
define n_rg_Guest.location notify geofancy:currLoc_Guest.* set rg_Guest:FILTER=location!=$EVTPART1 location $EVTPART1
By defining geofencing zones called 'home' and 'wayhome' in the iOS app, you automatically get all the features of automatic state changes described above.
-
-
+
+
Attributes
-
+
-
rg_autoGoneAfter - hours after which state should be auto-set to 'gone' when current state is 'absent'; defaults to 16 hours
@@ -1381,11 +1379,11 @@ sub GUEST_StartInternalTimers($$) {
rg_wakeupDevice - reference to enslaved DUMMY devices used as a wake-up timer (part of RESIDENTS Toolkit's wakeuptimer)
-
+
Generated Readings/Events:
-
+
-
durTimerAbsence - timer to show the duration of absence from home in human readable format (hours:minutes:seconds)
@@ -1481,22 +1479,18 @@ sub GUEST_StartInternalTimers($$) {
lastArrival, lastDurAbsence, lastLocation, lastMood, location, mood
-
-
+
+
=end html
=begin html_DE
-
-
-
-
- GUEST
-
-
+
+
GUEST
+
Define
-
+
define <rg_FirstName> GUEST [<Device Name(n) der Bewohnergruppe(n)>]
Stellt ein spezielles virtuelles Device bereit, welches einen Gast repräsentiert.
@@ -1507,7 +1501,7 @@ sub GUEST_StartInternalTimers($$) {
Bei Mitgliedschaft mehrerer Bewohnergruppen werden diese durch Komma getrennt angegeben (siehe Beispiel unten).
Beispiele:
-
+
# Einzeln
define rg_Guest GUEST
@@ -1516,15 +1510,15 @@ sub GUEST_StartInternalTimers($$) {
# Mitglied in mehreren Gruppen
define rg_Guest GUEST rgr_Residents,rgr_Guests # um Mitglied der Gruppen rgr_Residents und rgr_Guests zu sein
-
-
-
+
+
+
Bitte beachten, dass das RESIDENTS Gruppen Device zunächst angelegt werden muss, bevor ein GUEST Objekt dort Mitglied werden kann.
-
+
Set
-
+
set <rg_FirstName> <command> [<parameter>]
Momentan sind die folgenden Kommandos definiert.
@@ -1548,12 +1542,12 @@ sub GUEST_StartInternalTimers($$) {
Hinweis: Sofern der Zugriff auf administrative set-Kommandos (-> create) eingeschränkt werden soll, kann in einer FHEMWEB Instanz das Attribut allowedCommands ähnlich wie 'set,set-user' erweitert werden.
Die Zeichenfolge 'set-user' stellt dabei sicher, dass beim Zugriff auf FHEM über diese FHEMWEB Instanz nur nicht-administrative set-Kommandos ausgeführt werden können.
-
+
-
+
Mögliche Status und ihre Bedeutung
-
+
Dieses Modul unterscheidet 6 verschiedene Status:
@@ -1576,47 +1570,47 @@ sub GUEST_StartInternalTimers($$) {
none - Gast Device ist deaktiviert
-
-
+
+
-
+
Zusammenhang zwischen Anwesenheit/Presence und Aufenthaltsort/Location
-
+
Unter bestimmten Umständen führt der Wechsel des Status auch zu einer Änderung des Readings 'location'.
Wannimmer die Anwesenheit (bzw. das Reading 'presence') von 'absent' auf 'present' wechselt, wird 'location' auf 'home' gesetzt. Sofern das Attribut rg_locationHome gesetzt ist, wird die erste Lokation daraus anstelle von 'home' verwendet.
Wannimmer die Anwesenheit (bzw. das Reading 'presence') von 'present' auf 'absent' wechselt, wird 'location' auf 'underway' gesetzt. Sofern das Attribut rg_locationUnderway gesetzt ist, wird die erste Lokation daraus anstelle von 'underway' verwendet.
-
-
+
+
-
+
Auto-Status 'gone'
-
+
Immer wenn ein Mitbewohner auf 'absent' gesetzt wird, wird ein Zähler gestartet, der nach einer bestimmten Zeit den Status automatisch auf 'gone' setzt.
Der Standard ist nach 16 Stunden.
Dieses Verhalten kann über das Attribut rg_autoGoneAfter angepasst werden.
-
-
+
+
-
+
Anwesenheit mit anderen GUEST oder ROOMMATE Devices synchronisieren
-
+
Wenn Sie immer zusammen mit anderen Mitbewohnern oder Gästen das Haus verlassen oder erreichen, können Sie ihren Status ganz einfach auf andere Mitbewohner übertragen.
Durch das Setzen des Attributs rg_PassPresenceTo folgen die dort aufgeführten Mitbewohner ihren eigenen Statusänderungen nach 'home', 'absent' oder 'gone'.
Bitte beachten, dass Mitbewohner mit dem aktuellen Status 'none' oder 'gone' (im Falle von ROOMMATE Devices) nicht beachtet werden.
-
-
+
+
-
+
Zusammenhang zwischen Aufenthaltsort/Location und Anwesenheit/Presence
-
+
Unter bestimmten Umständen hat der Wechsel des Readings 'location' auch einen Einfluss auf den tatsächlichen Status.
Immer wenn eine Lokation mit dem Namen 'home' gesetzt wird, wird auch der Status auf 'home' gesetzt, sofern die Anwesenheit bis dahin noch auf 'absent' stand. Sofern das Attribut rg_locationHome gesetzt wurde, so lösen alle dort angegebenen Lokationen einen Statuswechsel nach 'home' aus.
@@ -1631,11 +1625,11 @@ sub GUEST_StartInternalTimers($$) {
define n_rg_Manfred.location notify geofancy:currLoc_Manfred.* set rg_Manfred:FILTER=location!=$EVTPART1 location $EVTPART1
Durch das Anlegen von Geofencing-Zonen mit den Namen 'home' und 'wayhome' in der iOS App werden zukünftig automatisch alle Statusänderungen wie oben beschrieben durchgeführt.
-
-
+
+
Attribute
-
+
-
rg_autoGoneAfter - Anzahl der Stunden, nach denen sich der Status automatisch auf 'gone' ändert, wenn der aktuellen Status 'absent' ist; Standard ist 36 Stunden
@@ -1683,11 +1677,11 @@ sub GUEST_StartInternalTimers($$) {
rg_wakeupDevice - Referenz zu versklavten DUMMY Geräten, welche als Wecker benutzt werden (Teil von RESIDENTS Toolkit's wakeuptimer)
-
+
Generierte Readings/Events:
-
+
-
durTimerAbsence - Timer, der die Dauer der Abwesenheit in normal lesbarem Format anzeigt (Stunden:Minuten:Sekunden)
@@ -1782,8 +1776,8 @@ sub GUEST_StartInternalTimers($$) {
lastArrival, lastDurAbsence, lastLocation, lastMood, location, mood
-
-
+
+
=end html_DE
diff --git a/fhem/FHEM/20_ROOMMATE.pm b/fhem/FHEM/20_ROOMMATE.pm
index 5d7efe3bf..c644574df 100644
--- a/fhem/FHEM/20_ROOMMATE.pm
+++ b/fhem/FHEM/20_ROOMMATE.pm
@@ -461,8 +461,8 @@ sub ROOMMATE_Set($@) {
: "absent";
# stop any running wakeup-timers in case state changed
- my $wakeupState = AttrVal( $name, "wakeup", 0 );
- if ($wakeupState) {
+ my $wakeupState = ReadingsVal( $name, "wakeup", 0 );
+ if ($wakeupState > 0) {
my $wakeupDeviceList = AttrVal( $name, "rr_wakeupDevice", 0 );
for my $wakeupDevice ( split /,/, $wakeupDeviceList ) {
@@ -473,9 +473,11 @@ sub ROOMMATE_Set($@) {
{
# forced-stop only if resident is not present anymore
if ( $newpresence eq "present" ) {
+ Log3 $name, 4, "ROOMMATE $name: ending wakeup-timer $wakeupDevice";
fhem "set $wakeupDevice:FILTER=running!=0 end";
}
else {
+ Log3 $name, 4, "ROOMMATE $name: stopping wakeup-timer $wakeupDevice";
fhem "set $wakeupDevice:FILTER=running!=0 stop";
}
}
@@ -804,14 +806,14 @@ sub ROOMMATE_Set($@) {
# create new weblink device
fhem "define $locationmapName weblink htmlCode {
-''
+'
}";
fhem "attr $locationmapName alias Current Location";
fhem
@@ -1168,15 +1170,11 @@ sub ROOMMATE_StartInternalTimers($$) {
=item helper
=begin html
-
-
-
-
- ROOMMATE
-
-
+
+
ROOMMATE
+
Define
-
+
define <rr_FirstName> ROOMMATE [<device name(s) of resident group(s)>]
Provides a special virtual device to represent a resident of your home.
@@ -1187,7 +1185,7 @@ sub ROOMMATE_StartInternalTimers($$) {
Use comma separated list of resident device names for multi-membership (see example below).
Example:
-
+
# Standalone
define rr_Manfred ROOMMATE
@@ -1202,15 +1200,15 @@ sub ROOMMATE_StartInternalTimers($$) {
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.
-
+
Set
-
+
set <rr_FirstName> <command> [<parameter>]
Currently, the following commands are defined.
@@ -1234,12 +1232,12 @@ sub ROOMMATE_StartInternalTimers($$) {
Note: If you would like to restrict access to admin set-commands (-> create) you may set your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
-
+
-
+
Possible states and their meaning
-
+
This module differs between 6 states:
@@ -1262,47 +1260,47 @@ sub ROOMMATE_StartInternalTimers($$) {
gone - individual is away from home for longer period
-
-
+
+
-
+
Presence correlation to location
-
+
Under specific circumstances, changing state will automatically change reading 'location' as well.
Whenever presence state changes from 'absent' to 'present', the location is set to 'home'. If attribute rr_locationHome was defined, first location from it will be used as home location.
Whenever presence state changes from 'present' to 'absent', the location is set to 'underway'. If attribute rr_locationUnderway was defined, first location from it will be used as underway location.
-
-
+
+
-
+
Auto Gone
-
+
Whenever an individual is set to 'absent', a trigger is started to automatically change state to 'gone' after a specific timeframe.
Default value is 36 hours.
This behaviour can be customized by attribute rr_autoGoneAfter.
-
-
+
+
-
+
Synchronizing presence with other ROOMMATE or GUEST devices
-
+
If you always leave or arrive at your house together with other roommates or guests, you may enable a synchronization of your presence state for certain individuals.
By setting attribute rr_passPresenceTo, those individuals will follow your presence state changes to 'home', 'absent' or 'gone' as you do them with your own device.
Please note that individuals with current state 'gone' or 'none' (in case of guests) will not be touched.
-
-
+
+
-
+
Location correlation to state
-
+
Under specific circumstances, changing location will have an effect on the actual state as well.
Whenever location is set to 'home', the state is set to 'home' if prior presence state was 'absent'. If attribute rr_locationHome was defined, all of those locations will trigger state change to 'home' as well.
@@ -1317,11 +1315,11 @@ sub ROOMMATE_StartInternalTimers($$) {
define n_rr_Manfred.location notify geofancy:currLoc_Manfred.* set rr_Manfred:FILTER=location!=$EVTPART1 location $EVTPART1
By defining geofencing zones called 'home' and 'wayhome' in the iOS app, you automatically get all the features of automatic state changes described above.
-
-
+
+
Attributes
-
+
-
rr_autoGoneAfter - hours after which state should be auto-set to 'gone' when current state is 'absent'; defaults to 36 hours
@@ -1369,11 +1367,11 @@ sub ROOMMATE_StartInternalTimers($$) {
rr_wakeupDevice - reference to enslaved DUMMY devices used as a wake-up timer (part of RESIDENTS Toolkit's wakeuptimer)
-
+
Generated Readings/Events:
-
+
-
durTimerAbsence - timer to show the duration of absence from home in human readable format (hours:minutes:seconds)
@@ -1463,22 +1461,18 @@ sub ROOMMATE_StartInternalTimers($$) {
wayhome - depending on current location, it can become '1' if individual is on his/her way back home
-
-
+
+
=end html
=begin html_DE
-
-
-
-
- ROOMMATE
-
-
+
+
ROOMMATE
+
Define
-
+
define <rr_FirstName> ROOMMATE [<Device Name(n) der Bewohnergruppe(n)>]
Stellt ein spezielles virtuelles Device bereit, welches einen Mitbewohner repräsentiert.
@@ -1489,7 +1483,7 @@ sub ROOMMATE_StartInternalTimers($$) {
Bei Mitgliedschaft mehrerer Bewohnergruppen werden diese durch Komma getrennt angegeben (siehe Beispiel unten).
Beispiele:
-
+
# Einzeln
define rr_Manfred ROOMMATE
@@ -1504,15 +1498,15 @@ sub ROOMMATE_StartInternalTimers($$) {
define rr_Lisa ROOMMATE rgr_Residents,rgr_Parents # Elternteil
define rr_Rick ROOMMATE rgr_Residents,rgr_Children # Kind1
define rr_Alex ROOMMATE rgr_Residents,rgr_Children # Kind2
-
-
-
+
+
+
Bitte beachten, dass das RESIDENTS Gruppen Device zunächst angelegt werden muss, bevor ein ROOMMATE Objekt dort Mitglied werden kann.
-
+
Set
-
+
set <rr_FirstName> <command> [<parameter>]
Momentan sind die folgenden Kommandos definiert.
@@ -1536,12 +1530,12 @@ sub ROOMMATE_StartInternalTimers($$) {
Hinweis: Sofern der Zugriff auf administrative set-Kommandos (-> create) eingeschränkt werden soll, kann in einer FHEMWEB Instanz das Attribut allowedCommands ähnlich wie 'set,set-user' erweitert werden.
Die Zeichenfolge 'set-user' stellt dabei sicher, dass beim Zugriff auf FHEM über diese FHEMWEB Instanz nur nicht-administrative set-Kommandos ausgeführt werden können.
-
+
-
+
Mögliche Status und ihre Bedeutung
-
+
Dieses Modul unterscheidet 6 verschiedene Status:
@@ -1564,47 +1558,47 @@ sub ROOMMATE_StartInternalTimers($$) {
gone - Mitbewohner ist für längere Zeit verreist
-
-
+
+
-
+
Zusammenhang zwischen Anwesenheit/Presence und Aufenthaltsort/Location
-
+
Unter bestimmten Umständen führt der Wechsel des Status auch zu einer Änderung des Readings 'location'.
Wannimmer die Anwesenheit (bzw. das Reading 'presence') von 'absent' auf 'present' wechselt, wird 'location' auf 'home' gesetzt. Sofern das Attribut rr_locationHome gesetzt ist, wird die erste Lokation daraus anstelle von 'home' verwendet.
Wannimmer die Anwesenheit (bzw. das Reading 'presence') von 'present' auf 'absent' wechselt, wird 'location' auf 'underway' gesetzt. Sofern das Attribut rr_locationUnderway gesetzt ist, wird die erste Lokation daraus anstelle von 'underway' verwendet.
-
-
+
+
-
+
Auto-Status 'gone'
-
+
Immer wenn ein Mitbewohner auf 'absent' gesetzt wird, wird ein Zähler gestartet, der nach einer bestimmten Zeit den Status automatisch auf 'gone' setzt.
Der Standard ist nach 36 Stunden.
Dieses Verhalten kann über das Attribut rr_autoGoneAfter angepasst werden.
-
-
+
+
-
+
Anwesenheit mit anderen ROOMMATE oder GUEST Devices synchronisieren
-
+
Wenn Sie immer zusammen mit anderen Mitbewohnern oder Gästen das Haus verlassen oder erreichen, können Sie ihren Status ganz einfach auf andere Mitbewohner übertragen.
Durch das Setzen des Attributs rr_PassPresenceTo folgen die dort aufgeführten Mitbewohner ihren eigenen Statusänderungen nach 'home', 'absent' oder 'gone'.
Bitte beachten, dass Mitbewohner mit dem aktuellen Status 'gone' oder 'none' (im Falle von Gästen) nicht beachtet werden.
-
-
+
+
-
+
Zusammenhang zwischen Aufenthaltsort/Location und Anwesenheit/Presence
-
+
Unter bestimmten Umständen hat der Wechsel des Readings 'location' auch einen Einfluss auf den tatsächlichen Status.
Immer wenn eine Lokation mit dem Namen 'home' gesetzt wird, wird auch der Status auf 'home' gesetzt, sofern die Anwesenheit bis dahin noch auf 'absent' stand. Sofern das Attribut rr_locationHome gesetzt wurde, so lösen alle dort angegebenen Lokationen einen Statuswechsel nach 'home' aus.
@@ -1619,11 +1613,11 @@ sub ROOMMATE_StartInternalTimers($$) {
define n_rr_Manfred.location notify geofancy:currLoc_Manfred.* set rr_Manfred:FILTER=location!=$EVTPART1 location $EVTPART1
Durch das Anlegen von Geofencing-Zonen mit den Namen 'home' und 'wayhome' in der iOS App werden zukünftig automatisch alle Statusänderungen wie oben beschrieben durchgeführt.
-
-
+
+
Attribute
-
+
-
rr_autoGoneAfter - Anzahl der Stunden, nach denen sich der Status automatisch auf 'gone' ändert, wenn der aktuellen Status 'absent' ist; Standard ist 36 Stunden
@@ -1671,11 +1665,11 @@ sub ROOMMATE_StartInternalTimers($$) {
rr_wakeupDevice - Referenz zu versklavten DUMMY Geräten, welche als Wecker benutzt werden (Teil von RESIDENTS Toolkit's wakeuptimer)
-
+
Generierte Readings/Events:
-
+
-
durTimerAbsence - Timer, der die Dauer der Abwesenheit in normal lesbarem Format anzeigt (Stunden:Minuten:Sekunden)
@@ -1765,8 +1759,8 @@ sub ROOMMATE_StartInternalTimers($$) {
wayhome - abhängig vom aktullen Aufenthaltsort, kann der Wert '1' werden, wenn die Person auf dem weg zurück nach Hause ist
-
-
+
+
=end html_DE