Hallo,
ich habe ein Problem mit meinem code für das Calendar Modul.
Ich habe es anhand der wiki gemacht:
sub
calstart ($)
{
my ($Ereignis) = @_;
my @Ereignisarray = split(/.*:\s/,$Ereignis);
my $Ereignisteil1 = $Ereignisarray[1];
my @uids=split(/;/,$Ereignisteil1);
foreach my $uid (@uids) {
my $actor = fhem("get cal summary $uid");
my $dtemp= fhem("get cal location $uid");
my $room= fhem("get cal location $uid");
my $oil= fhem("get cal location $uid");
my $fhtmode= ReadingsVal("$actor", "mode","?");
my $end= fhem("get cal end $uid");
my @ends=split(/\./,$end);
my $endd= $ends[0] + 1;
my $endm= $ends[1];
if (($fhtmode !~ /oliday/) && ($actor =~ /fht/)) {
fhem("set $actor desired-temp $dtemp");
};
if (($actor =~ /oliday/) && ($room =~ /fht/)) {
fhem("set $room mode holiday holiday1 $endd holiday2 $endm desired-temp 13");
};
if (($actor =~ /oliday/) && ($room !~ /fht/)) {
fhem("set TYPE=FHT mode holiday holiday1 $endd holiday2 $endm desired-temp 13");
};
if (($actor =~ /uto/) && ($room =~ /fht/)) {
fhem("set $room mode auto");
};
if (($actor =~ /uto/) && ($room !~ /fht/)) {
fhem("set TYPE=FHT mode auto");
};
if ($actor =~ /uest/) {
fhem("set guest yes");
};
if ($actor =~ /oil/) {
$data{tank_level} += $oil ;
fhem("set tanklevel $data{tank_level}");
};
};
}
########################
sub calend ($) {
my ($Ereignis) = @_;
my @Ereignisarray = split(/.*:\s/,$Ereignis);
my $Ereignisteil1 = $Ereignisarray[1];
my @uids=split(/;/,$Ereignisteil1);
foreach my $uid (@uids) {
my $actor = fhem("get cal summary $uid");
my $fhtmode= ReadingsVal("$actor", "mode","?");
my $room= fhem("get cal location $uid");
if (($fhtmode !~ /oliday/) && ($actor =~ /fht/)) {
fhem("set $actor desired-temp 16");
};
if (($actor =~ /oliday/) && ($room =~ /fht/)) {
fhem("set $room mode auto");
};
if (($actor =~ /oliday/) && ($room !~ /fht/)) {
fhem("set TYPE=FHT mode auto");
};
if ($actor =~ /uest/) {
fhem("set guest no");
};
};
}
Allerdings wird mein Log mit folgender Meldung überfüllt:
2014.10.10 22:19:01 1: PERL WARNING: Use of uninitialized value $Ereignisteil1 in split at /opt/fhem/FHEM/99_MyUtils.pm line 58.
Und nochmal in Zeile 100.
Ich denke das müsste hier dann Zeile 5 sein...
Kann mir jemand helfen, wie ich das vermeiden kann?
Danke!
Kann keiner helfen?