diff --git a/fhem/CHANGED b/fhem/CHANGED
index 5a7151979..3c5e870a0 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.
+ - feature: 22_HOMEMODE: v1.4.10 add support for PET
- change: 98_DOIFtools: remove unessesary code due to changes in console.js
- bugfix: 70_ZoneMinder: fixed JSON-parsing bug
- feature: 57_Calendar: get ...events include:... returnType:...
diff --git a/fhem/FHEM/22_HOMEMODE.pm b/fhem/FHEM/22_HOMEMODE.pm
index f2039fd6b..9138aa26f 100644
--- a/fhem/FHEM/22_HOMEMODE.pm
+++ b/fhem/FHEM/22_HOMEMODE.pm
@@ -16,7 +16,7 @@ use Time::HiRes qw(gettimeofday);
use HttpUtils;
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_Seasons = "03.01|spring 06.01|summer 09.01|autumn 12.01|winter";
my $HOMEMODE_UserModes = "gotosleep,awoken,asleep";
@@ -82,8 +82,8 @@ sub HOMEMODE_Define($$)
else
{
$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!":
- "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!";
+ "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/PET and their PRESENCE device(s) to have fun with this module!";
return $trans;
}
}
@@ -182,7 +182,7 @@ sub HOMEMODE_Notify($$)
}
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);
}
@@ -375,7 +375,7 @@ sub HOMEMODE_Notify($$)
foreach (split /,/,$hash->{RESIDENTS})
{
my $regex = lc($_);
- $regex =~ s/^(rr_|rg_)//;
+ $regex =~ s/^(rr_|rg_|rp_)//;
next unless (lc($devname) =~ /$regex/);
$resident = $_;
$residentregex = $regex;
@@ -517,11 +517,12 @@ sub HOMEMODE_updateInternals($;$$)
my @residents;
push @residents,$defs{$resdev}->{ROOMMATES} if ($defs{$resdev}->{ROOMMATES});
push @residents,$defs{$resdev}->{GUESTS} if ($defs{$resdev}->{GUESTS});
+ push @residents,$defs{$resdev}->{PETS} if ($defs{$resdev}->{PETS});
if (@residents < 1)
{
$trans = $HOMEMODE_de?
- "Keine verfügbaren ROOMMATE/GUEST im RESIDENTS Gerät $resdev":
- "No available ROOMMATE/GUEST in RESIDENTS device $resdev";
+ "Keine verfügbaren ROOMMATE/GUEST/PET im RESIDENTS Gerät $resdev":
+ "No available ROOMMATE/GUEST/PET in RESIDENTS device $resdev";
Log3 $name,2,$trans;
readingsSingleUpdate($hash,"HomeInfo",$trans,1);
return;
@@ -542,7 +543,7 @@ sub HOMEMODE_updateInternals($;$$)
{
push @allMonitoredDevices,$resident;
my $short = lc($resident);
- $short =~ s/^(rr_|rg_)//;
+ $short =~ s/^(rr_|rg_|rp_)//;
push @residentsshort,$short;
if ($autopresence)
{
@@ -1196,7 +1197,7 @@ sub HOMEMODE_RESIDENTS($;$)
$mode = $mode eq "home" && AttrNum($name,"HomeAutoDaytime",1) ? HOMEMODE_DayTime($hash) : $mode;
CommandSet(undef,"$name:FILTER=mode!=$mode mode $mode");
}
- elsif ($devtype =~ /^ROOMMATE|GUEST$/)
+ elsif ($devtype =~ /^ROOMMATE|GUEST|PET$/)
{
readingsBeginUpdate($hash);
readingsBulkUpdateIfChanged($hash,"lastActivityByResident",$dev);
@@ -1492,12 +1493,12 @@ sub HOMEMODE_userattr($)
}
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);
if ($adv)
{
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");
foreach (split /,/,$states)
{
@@ -3570,8 +3571,8 @@ sub HOMEMODE_Details($$$)
=pod
=item helper
-=item summary home device with ROOMMATE/GUEST integration
-=item summary_DE Zuhause Gerät mit ROOMMATE/GUEST Integration
+=item summary home device with ROOMMATE/GUEST/PET integration
+=item summary_DE Zuhause Gerät mit ROOMMATE/GUEST/PET Integration
=begin html
@@ -3582,7 +3583,7 @@ sub HOMEMODE_Details($$$)
It has been optimized for usage with homebridge as GUI.
You can also configure CMDs to be executed on specific events.
There is no need to create notify(s) or DOIF(s) to achieve common tasks depending on the home state(s).
- It's also possible to control ROOMMATE/GUEST devices states depending on their associated presence device.
+ It's also possible to control ROOMMATE/GUEST/PET devices states depending on their associated presence device.
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)
There is also a daytime reading and associated HomeCMD attributes that will execute the HOMEMODE state CMDs independend of the presence of any RESIDENT.
A lot of placeholders are available for usage within the HomeCMD or HomeText attributes (see Placeholders).
@@ -4065,12 +4066,12 @@ sub HOMEMODE_Details($$$)
default: