2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-23 20:52:13 +00:00

PRESENCE: new reading "presence" which contains the current (or last known) presence state, which can be just "absent" or "present" (Forum: #29334)

git-svn-id: https://svn.fhem.de/fhem/trunk@7485 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch 2015-01-09 16:16:07 +00:00
parent 2661c359f8
commit da241c665a
2 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,7 @@
# 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.
- feature: PRESENCE: new reading "presence" which contains the current (or last known)
presence state (can be "absent" or "present")
- bugfix: 70_Jabber.pm: hardening XML::Stream Process() call and fix of ssl_verify - bugfix: 70_Jabber.pm: hardening XML::Stream Process() call and fix of ssl_verify
- feature: readingsGroup: allow devspec :FILTER= expressions in device selection - feature: readingsGroup: allow devspec :FILTER= expressions in device selection
- added: 73_km200.pm for the Buderus KM200 heating controller (Sailor) - added: 73_km200.pm for the Buderus KM200 heating controller (Sailor)

View File

@ -423,10 +423,12 @@ PRESENCE_Read($)
if($buf eq "absence") if($buf eq "absence")
{ {
readingsBulkUpdate($hash, "state", "absent"); readingsBulkUpdate($hash, "state", "absent");
readingsBulkUpdate($hash, "presence", "absent");
} }
elsif($buf =~ /present;(.+?)$/) elsif($buf =~ /present;(.+?)$/)
{ {
readingsBulkUpdate($hash, "state", "present"); readingsBulkUpdate($hash, "state", "present");
readingsBulkUpdate($hash, "presence", "present");
if($1 =~ /^(.*);(.+)$/) if($1 =~ /^(.*);(.+)$/)
{ {
@ -941,6 +943,7 @@ PRESENCE_ProcessLocalScan($)
if($a[2] eq "present") if($a[2] eq "present")
{ {
readingsBulkUpdate($hash, "state", "present"); readingsBulkUpdate($hash, "state", "present");
readingsBulkUpdate($hash, "presence", "present");
readingsBulkUpdate($hash, "device_name", $a[3]) if(defined($a[3]) and $hash->{MODE} =~ /^(lan-bluetooth|local-bluetooth)$/ ); readingsBulkUpdate($hash, "device_name", $a[3]) if(defined($a[3]) and $hash->{MODE} =~ /^(lan-bluetooth|local-bluetooth)$/ );
if($hash->{MODE} eq "fritzbox" and defined($a[4])) if($hash->{MODE} eq "fritzbox" and defined($a[4]))
@ -951,7 +954,7 @@ PRESENCE_ProcessLocalScan($)
elsif($a[2] eq "absent") elsif($a[2] eq "absent")
{ {
readingsBulkUpdate($hash, "state", "absent"); readingsBulkUpdate($hash, "state", "absent");
readingsBulkUpdate($hash, "presence", "absent");
if($hash->{MODE} eq "fritzbox" and defined($a[4])) if($hash->{MODE} eq "fritzbox" and defined($a[4]))
{ {
readingsBulkUpdate($hash, "speed", $a[4]); readingsBulkUpdate($hash, "speed", $a[4]);
@ -1243,7 +1246,8 @@ Options:
<ul> <ul>
<u>General Events:</u><br><br> <u>General Events:</u><br><br>
<ul> <ul>
<li><b>state</b>: $state (absent|present|disabled|error|timeout) - The state of the device or "disabled" when the disable attribute is enabled</li> <li><b>state</b>: (absent|present|disabled|error|timeout) - The state of the device or "disabled" when the disable attribute is enabled</li>
<li><b>presence</b>: (absent|present) - The state of the device</li>
<li><b>powerCmd</b>: (executed|failed) - power command was executed or has failed</li> <li><b>powerCmd</b>: (executed|failed) - power command was executed or has failed</li>
</ul><br><br> </ul><br><br>
<u>Bluetooth specific events:</u><br><br> <u>Bluetooth specific events:</u><br><br>
@ -1488,7 +1492,8 @@ Options:
<ul> <ul>
<u>Generelle Events:</u><br><br> <u>Generelle Events:</u><br><br>
<ul> <ul>
<li><b>state</b>: $state (absent|present|disabled|error|timeout) - Der Anwesenheitsstatus eine Ger&auml;tes (absent = abwesend; present = anwesend) oder "disabled" wenn das disable-Attribut aktiviert ist</li> <li><b>state</b>: (absent|present|disabled|error|timeout) - Der Anwesenheitsstatus eine Ger&auml;tes (absent = abwesend; present = anwesend) oder "disabled" wenn das disable-Attribut aktiviert ist</li>
<li><b>presence</b>: (absent|present) - Der Anwesenheitsstatus eine Ger&auml;tes (absent = abwesend; present = anwesend)</li>
<li><b>powerCmd</b>: (executed|failed) - Ausf&uuml;hrung des power-Befehls war erfolgreich.</li> <li><b>powerCmd</b>: (executed|failed) - Ausf&uuml;hrung des power-Befehls war erfolgreich.</li>
</ul><br><br> </ul><br><br>
<u>Bluetooth-spezifische Events:</u><br><br> <u>Bluetooth-spezifische Events:</u><br><br>