2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

add lastRain timestamp

git-svn-id: https://svn.fhem.de/fhem/trunk@3620 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2013-08-08 15:26:09 +00:00
parent 577098b0a0
commit 829676ccb6
2 changed files with 10 additions and 7 deletions

View File

@ -898,11 +898,15 @@ sub CUL_HM_Parse($$) {##############################
$val = hex($val)/2;
}
push @event, "state:$val";
if ($val eq "dry"){
CUL_HM_UpdtReadSingle($shash,'lastRain',
ReadingsTimestamp($shash,'state',""),0)
if (ReadingsVal($shash,'state',"") eq "rain");
}
if ($val eq "rain"){#--- handle lastRain---
$shash->{helper}{lastRain} = $tn;
}
elsif ($val eq "dry" && $shash->{helper}{lastRain}){
CUL_HM_UpdtReadSingle($shash,'lastRain',$shash->{helper}{lastRain},0);
delete $shash->{helper}{lastRain};
}
CUL_HM_UpdtReadSingle($shash,'.level',#store level invisible
($val eq "off"?"0 %":"100 %"),0);
@ -986,7 +990,6 @@ sub CUL_HM_Parse($$) {##############################
push @event,"deviceMsg:$vs$target" if($chn ne "00");
push @event,"state:".(($physLvl ne $val." %")?"chn:$vs phys:$physLvl":
$vs);
my $eventName = "unknown"; # different names for events
$eventName = "switch" if($st eq "switch");
$eventName = "motor" if($st eq "blindActuator");

View File

@ -201,7 +201,7 @@ sub HMinfo_SetFn($$) {#########################################################
$filter = shift @a;
}
if ($cmd eq "?" ) {##actionImmediate: clear parameter--------------
if (!$cmd ||$cmd eq "?" ) {##actionImmediate: clear parameter--------------
return "autoReadReg clear configCheck param peerCheck peerXref protoEvents models regCheck register rssi saveConfig update";
}
elsif($cmd eq "clear" ) {##actionImmediate: clear parameter--------------