mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-26 10:34:52 +00:00
22_HOMEMODE: v1.4.10 - add support for PET
git-svn-id: https://svn.fhem.de/fhem/trunk@19955 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
3a381918ee
commit
d1b28b51df
@ -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.
|
||||||
|
- feature: 22_HOMEMODE: v1.4.10 add support for PET
|
||||||
- change: 98_DOIFtools: remove unessesary code due to changes in console.js
|
- change: 98_DOIFtools: remove unessesary code due to changes in console.js
|
||||||
- bugfix: 70_ZoneMinder: fixed JSON-parsing bug
|
- bugfix: 70_ZoneMinder: fixed JSON-parsing bug
|
||||||
- feature: 57_Calendar: get ...events include:... returnType:...
|
- feature: 57_Calendar: get ...events include:... returnType:...
|
||||||
|
@ -16,7 +16,7 @@ use Time::HiRes qw(gettimeofday);
|
|||||||
use HttpUtils;
|
use HttpUtils;
|
||||||
use vars qw{%attr %defs %modules $FW_CSRF};
|
use vars qw{%attr %defs %modules $FW_CSRF};
|
||||||
|
|
||||||
my $HOMEMODE_version = "1.4.9";
|
my $HOMEMODE_version = "1.4.10";
|
||||||
my $HOMEMODE_Daytimes = "05:00|morning 10:00|day 14:00|afternoon 18:00|evening 23:00|night";
|
my $HOMEMODE_Daytimes = "05:00|morning 10:00|day 14:00|afternoon 18:00|evening 23:00|night";
|
||||||
my $HOMEMODE_Seasons = "03.01|spring 06.01|summer 09.01|autumn 12.01|winter";
|
my $HOMEMODE_Seasons = "03.01|spring 06.01|summer 09.01|autumn 12.01|winter";
|
||||||
my $HOMEMODE_UserModes = "gotosleep,awoken,asleep";
|
my $HOMEMODE_UserModes = "gotosleep,awoken,asleep";
|
||||||
@ -82,8 +82,8 @@ sub HOMEMODE_Define($$)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$trans = $HOMEMODE_de?
|
$trans = $HOMEMODE_de?
|
||||||
"Kein RESIDENTS Gerät gefunden! Bitte erst ein RESIDENTS Gerät anlegen und ein paar ROOMMATE/GUEST und ihre korrespondierenden PRESENCE Geräte hinzufügen um Spaß mit diesem Modul zu haben!":
|
"Kein RESIDENTS Gerät gefunden! Bitte erst ein RESIDENTS Gerät anlegen und ein paar ROOMMATE/GUEST/PET und ihre korrespondierenden PRESENCE Geräte hinzufügen um Spaß mit diesem Modul zu haben!":
|
||||||
"No RESIDENTS device found! Please define a RESIDENTS device first and add some ROOMMATE/GUEST and their PRESENCE device(s) to have fun with this module!";
|
"No RESIDENTS device found! Please define a RESIDENTS device first and add some ROOMMATE/GUEST/PET and their PRESENCE device(s) to have fun with this module!";
|
||||||
return $trans;
|
return $trans;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ sub HOMEMODE_Notify($$)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($devtype =~ /^(RESIDENTS|ROOMMATE|GUEST)$/ && grep /^(state|wayhome|presence):\s/,@{$events})
|
if ($devtype =~ /^(RESIDENTS|ROOMMATE|GUEST|PET)$/ && grep /^(state|wayhome|presence):\s/,@{$events})
|
||||||
{
|
{
|
||||||
HOMEMODE_RESIDENTS($hash,$devname);
|
HOMEMODE_RESIDENTS($hash,$devname);
|
||||||
}
|
}
|
||||||
@ -375,7 +375,7 @@ sub HOMEMODE_Notify($$)
|
|||||||
foreach (split /,/,$hash->{RESIDENTS})
|
foreach (split /,/,$hash->{RESIDENTS})
|
||||||
{
|
{
|
||||||
my $regex = lc($_);
|
my $regex = lc($_);
|
||||||
$regex =~ s/^(rr_|rg_)//;
|
$regex =~ s/^(rr_|rg_|rp_)//;
|
||||||
next unless (lc($devname) =~ /$regex/);
|
next unless (lc($devname) =~ /$regex/);
|
||||||
$resident = $_;
|
$resident = $_;
|
||||||
$residentregex = $regex;
|
$residentregex = $regex;
|
||||||
@ -517,11 +517,12 @@ sub HOMEMODE_updateInternals($;$$)
|
|||||||
my @residents;
|
my @residents;
|
||||||
push @residents,$defs{$resdev}->{ROOMMATES} if ($defs{$resdev}->{ROOMMATES});
|
push @residents,$defs{$resdev}->{ROOMMATES} if ($defs{$resdev}->{ROOMMATES});
|
||||||
push @residents,$defs{$resdev}->{GUESTS} if ($defs{$resdev}->{GUESTS});
|
push @residents,$defs{$resdev}->{GUESTS} if ($defs{$resdev}->{GUESTS});
|
||||||
|
push @residents,$defs{$resdev}->{PETS} if ($defs{$resdev}->{PETS});
|
||||||
if (@residents < 1)
|
if (@residents < 1)
|
||||||
{
|
{
|
||||||
$trans = $HOMEMODE_de?
|
$trans = $HOMEMODE_de?
|
||||||
"Keine verfügbaren ROOMMATE/GUEST im RESIDENTS Gerät $resdev":
|
"Keine verfügbaren ROOMMATE/GUEST/PET im RESIDENTS Gerät $resdev":
|
||||||
"No available ROOMMATE/GUEST in RESIDENTS device $resdev";
|
"No available ROOMMATE/GUEST/PET in RESIDENTS device $resdev";
|
||||||
Log3 $name,2,$trans;
|
Log3 $name,2,$trans;
|
||||||
readingsSingleUpdate($hash,"HomeInfo",$trans,1);
|
readingsSingleUpdate($hash,"HomeInfo",$trans,1);
|
||||||
return;
|
return;
|
||||||
@ -542,7 +543,7 @@ sub HOMEMODE_updateInternals($;$$)
|
|||||||
{
|
{
|
||||||
push @allMonitoredDevices,$resident;
|
push @allMonitoredDevices,$resident;
|
||||||
my $short = lc($resident);
|
my $short = lc($resident);
|
||||||
$short =~ s/^(rr_|rg_)//;
|
$short =~ s/^(rr_|rg_|rp_)//;
|
||||||
push @residentsshort,$short;
|
push @residentsshort,$short;
|
||||||
if ($autopresence)
|
if ($autopresence)
|
||||||
{
|
{
|
||||||
@ -1196,7 +1197,7 @@ sub HOMEMODE_RESIDENTS($;$)
|
|||||||
$mode = $mode eq "home" && AttrNum($name,"HomeAutoDaytime",1) ? HOMEMODE_DayTime($hash) : $mode;
|
$mode = $mode eq "home" && AttrNum($name,"HomeAutoDaytime",1) ? HOMEMODE_DayTime($hash) : $mode;
|
||||||
CommandSet(undef,"$name:FILTER=mode!=$mode mode $mode");
|
CommandSet(undef,"$name:FILTER=mode!=$mode mode $mode");
|
||||||
}
|
}
|
||||||
elsif ($devtype =~ /^ROOMMATE|GUEST$/)
|
elsif ($devtype =~ /^ROOMMATE|GUEST|PET$/)
|
||||||
{
|
{
|
||||||
readingsBeginUpdate($hash);
|
readingsBeginUpdate($hash);
|
||||||
readingsBulkUpdateIfChanged($hash,"lastActivityByResident",$dev);
|
readingsBulkUpdateIfChanged($hash,"lastActivityByResident",$dev);
|
||||||
@ -1492,12 +1493,12 @@ sub HOMEMODE_userattr($)
|
|||||||
}
|
}
|
||||||
foreach my $resident (split /,/,$hash->{RESIDENTS})
|
foreach my $resident (split /,/,$hash->{RESIDENTS})
|
||||||
{
|
{
|
||||||
my $devtype = HOMEMODE_ID($resident,"ROOMMATE|GUEST") ? $defs{$resident}->{TYPE} : "";
|
my $devtype = HOMEMODE_ID($resident,"ROOMMATE|GUEST|PET") ? $defs{$resident}->{TYPE} : "";
|
||||||
next unless ($devtype);
|
next unless ($devtype);
|
||||||
if ($adv)
|
if ($adv)
|
||||||
{
|
{
|
||||||
my $states = "absent";
|
my $states = "absent";
|
||||||
$states .= ",$HOMEMODE_UserModesAll" if ($devtype eq "ROOMMATE");
|
$states .= ",$HOMEMODE_UserModesAll" if ($devtype =~ /^ROOMMATE|PET$/);
|
||||||
$states .= ",home,$HOMEMODE_UserModes" if ($devtype eq "GUEST");
|
$states .= ",home,$HOMEMODE_UserModes" if ($devtype eq "GUEST");
|
||||||
foreach (split /,/,$states)
|
foreach (split /,/,$states)
|
||||||
{
|
{
|
||||||
@ -3570,8 +3571,8 @@ sub HOMEMODE_Details($$$)
|
|||||||
|
|
||||||
=pod
|
=pod
|
||||||
=item helper
|
=item helper
|
||||||
=item summary home device with ROOMMATE/GUEST integration
|
=item summary home device with ROOMMATE/GUEST/PET integration
|
||||||
=item summary_DE Zuhause Gerät mit ROOMMATE/GUEST Integration
|
=item summary_DE Zuhause Gerät mit ROOMMATE/GUEST/PET Integration
|
||||||
=begin html
|
=begin html
|
||||||
|
|
||||||
<a name="HOMEMODE"></a>
|
<a name="HOMEMODE"></a>
|
||||||
@ -3582,7 +3583,7 @@ sub HOMEMODE_Details($$$)
|
|||||||
It has been optimized for usage with homebridge as GUI.<br>
|
It has been optimized for usage with homebridge as GUI.<br>
|
||||||
You can also configure CMDs to be executed on specific events.<br>
|
You can also configure CMDs to be executed on specific events.<br>
|
||||||
There is no need to create notify(s) or DOIF(s) to achieve common tasks depending on the home state(s).<br>
|
There is no need to create notify(s) or DOIF(s) to achieve common tasks depending on the home state(s).<br>
|
||||||
It's also possible to control ROOMMATE/GUEST devices states depending on their associated presence device.<br>
|
It's also possible to control ROOMMATE/GUEST/PET devices states depending on their associated presence device.<br>
|
||||||
If the RESIDENTS device is on state home, the HOMEMODE device can automatically change its mode depending on the local time (morning,day,afternoon,evening,night)<br>
|
If the RESIDENTS device is on state home, the HOMEMODE device can automatically change its mode depending on the local time (morning,day,afternoon,evening,night)<br>
|
||||||
There is also a daytime reading and associated HomeCMD attributes that will execute the HOMEMODE state CMDs independend of the presence of any RESIDENT.<br>
|
There is also a daytime reading and associated HomeCMD attributes that will execute the HOMEMODE state CMDs independend of the presence of any RESIDENT.<br>
|
||||||
A lot of placeholders are available for usage within the HomeCMD or HomeText attributes (see Placeholders).<br>
|
A lot of placeholders are available for usage within the HomeCMD or HomeText attributes (see Placeholders).<br>
|
||||||
@ -4065,12 +4066,12 @@ sub HOMEMODE_Details($$$)
|
|||||||
default:
|
default:
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><i>HomePresenceDeviceAbsentCount-<ROOMMATE/GUEST></i></b><br>
|
<b><i>HomePresenceDeviceAbsentCount-<ROOMMATE/GUEST/PET></i></b><br>
|
||||||
number of resident associated presence device to turn resident to absent<br>
|
number of resident associated presence device to turn resident to absent<br>
|
||||||
default: maximum number of available presence device for each resident
|
default: maximum number of available presence device for each resident
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><i>HomePresenceDevicePresentCount-<ROOMMATE/GUEST></i></b><br>
|
<b><i>HomePresenceDevicePresentCount-<ROOMMATE/GUEST/PET></i></b><br>
|
||||||
number of resident associated presence device to turn resident to home<br>
|
number of resident associated presence device to turn resident to home<br>
|
||||||
default: 1
|
default: 1
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user