2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

Automatic reset for the EM1010PC

git-svn-id: https://svn.fhem.de/fhem/trunk@152 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2008-01-27 17:13:45 +00:00
parent 6639069718
commit 371a3d92b1
3 changed files with 22 additions and 6 deletions

View File

@ -380,6 +380,7 @@
and energy_kWh_w (Boris, 06.01.08)
- feature: global attr allowfrom, as wished by Holger (8.1.2008)
- feature: FHT: multiple commands, softbuffer changes, cmd rename, doc
- feature: EM1010PC: automatic reset
- TODO
emem -2.5kW / getDevData for emwz -1

View File

@ -11,6 +11,11 @@ sub EmCrcCheck($$);
sub EmEsc($);
sub EmGetData($$);
sub EmMakeMsg($);
sub EM_Set($@);
# Following one-byte commands are trange, as they cause a timeout:
# 124 127 150 153 155 156
#####################################
sub
@ -93,7 +98,7 @@ EM_Set($@)
" set <name> time [YYYY-MM-DD HH:MM:SS]";
return $u1 if(int(@a) < 2);
my $msg;
my $name = $hash->{DeviceName};
if($a[1] eq "time") {
@ -106,22 +111,29 @@ EM_Set($@)
}
my @d = split("-", $a[2]);
my @t = split(":", $a[3]);
$msg = sprintf("73%02x%02x%02x00%02x%02x%02x",
my $msg = sprintf("73%02x%02x%02x00%02x%02x%02x",
$d[2],$d[1],$d[0]-2000+0xd0, $t[0],$t[1],$t[2]);
my $d = EmGetData($name, $msg);
return "Read error" if(!defined($d));
return b($d,0);
} elsif($a[1] eq "reset") {
$msg = "4545";
my $d = EmGetData($name, "4545"); # Reset
return "Read error" if(!defined($d));
sleep(5);
EM_Set($hash, ($a[0], "time")); # Set the time
sleep(1);
$d = EmGetData($name, "67"); # "Push the button", we don't want usesr interaction
return "Read error" if(!defined($d));
} else {
return "Unknown argument $a[1], choose one of reset,time"
}
return undef;
my $d = EmGetData($hash->{DeviceName}, $msg);
return "Read error" if(!defined($d));
return b($d,0);
}
#########################

View File

@ -211,3 +211,6 @@
- lime-protection changed, as it is an actuator subcommand. Further actuator
commands added.
- Rudi Sun Jan 27 18:12:42 MET 2008
- em1010PC: sending a "67" after a reset skips the manual interaction:
automatic reset is now possible.