mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-28 11:01:59 +00:00
Set some HM-CC-TC parameters
git-svn-id: https://svn.fhem.de/fhem/trunk@866 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
dcd4d93d0c
commit
437afb7646
@ -31,6 +31,7 @@ HMLAN_Initialize($)
|
|||||||
$hash->{ReadFn} = "HMLAN_Read";
|
$hash->{ReadFn} = "HMLAN_Read";
|
||||||
$hash->{WriteFn} = "HMLAN_Write";
|
$hash->{WriteFn} = "HMLAN_Write";
|
||||||
$hash->{ReadyFn} = "HMLAN_Ready";
|
$hash->{ReadyFn} = "HMLAN_Ready";
|
||||||
|
$hash->{SetFn} = "HMLAN_Set";
|
||||||
$hash->{Clients} = ":CUL_HM:";
|
$hash->{Clients} = ":CUL_HM:";
|
||||||
my %mc = (
|
my %mc = (
|
||||||
"1:CUL_HM" => "^A......................",
|
"1:CUL_HM" => "^A......................",
|
||||||
|
@ -14,6 +14,7 @@ sub CUL_HM_PushCmdStack($$);
|
|||||||
sub CUL_HM_SendCmd($$$$);
|
sub CUL_HM_SendCmd($$$$);
|
||||||
sub CUL_HM_Set($@);
|
sub CUL_HM_Set($@);
|
||||||
sub CUL_HM_DumpProtocol($$@);
|
sub CUL_HM_DumpProtocol($$@);
|
||||||
|
sub CUL_HM_convTemp($);
|
||||||
|
|
||||||
my %culHmDevProps=(
|
my %culHmDevProps=(
|
||||||
"10" => { st => "switch", cl => "receiver" }, # Parse,Set
|
"10" => { st => "switch", cl => "receiver" }, # Parse,Set
|
||||||
@ -75,7 +76,7 @@ my %culHmModel=(
|
|||||||
"0036" => "HM-PB-2-WM",
|
"0036" => "HM-PB-2-WM",
|
||||||
"0037" => "HM-RC-19",
|
"0037" => "HM-RC-19",
|
||||||
"0038" => "HM-RC-19-B",
|
"0038" => "HM-RC-19-B",
|
||||||
"0039" => "HM-CC-TC", # Parse only
|
"0039" => "HM-CC-TC", # Selected commands
|
||||||
"003A" => "HM-CC-VD", # Actuator, battery/etc missing
|
"003A" => "HM-CC-VD", # Actuator, battery/etc missing
|
||||||
"003B" => "HM-RC-4-B",
|
"003B" => "HM-RC-4-B",
|
||||||
"003C" => "HM-WDS20-TH-O",
|
"003C" => "HM-WDS20-TH-O",
|
||||||
@ -402,22 +403,32 @@ CUL_HM_Parse($$)
|
|||||||
push @event, "state:T: $t H: $h";
|
push @event, "state:T: $t H: $h";
|
||||||
push @event, "temperature:$t";
|
push @event, "temperature:$t";
|
||||||
push @event, "humidity:$h";
|
push @event, "humidity:$h";
|
||||||
}
|
|
||||||
|
|
||||||
|
# If we have something to tell:
|
||||||
|
CUL_HM_SendCmd($shash, "++A112$id$src", 1, 1) if($shash->{cmdStack});
|
||||||
|
}
|
||||||
|
|
||||||
if($cmd eq "A258" && $p =~ m/^(..)(..)/) {
|
if($cmd eq "A258" && $p =~ m/^(..)(..)/) {
|
||||||
my ( $d1, $vp) =
|
my ( $d1, $vp) =
|
||||||
(hex($1), hex($2));
|
(hex($1), hex($2));
|
||||||
$vp = int($vp/2.56+0.5); # Ventil position in %
|
$vp = int($vp/2.56+0.5); # valve position in %
|
||||||
push @event, "actuator:$vp %";
|
push @event, "actuator:$vp %";
|
||||||
|
|
||||||
if($dhash) { # Wont trigger
|
# Set the valve state too, without an extra trigger
|
||||||
|
if($dhash) {
|
||||||
$dhash->{STATE} = "$vp %";
|
$dhash->{STATE} = "$vp %";
|
||||||
$dhash->{READINGS}{STATE}{TIME} = $tn;
|
$dhash->{READINGS}{STATE}{TIME} = $tn;
|
||||||
$dhash->{READINGS}{STATE}{VAL} = "$vp %";
|
$dhash->{READINGS}{STATE}{VAL} = "$vp %";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($cmd eq "A410" && $p =~ m/^0602(..)........$/) {
|
||||||
|
push @event, "desired-temp: " .hex($1)/2;
|
||||||
|
}
|
||||||
|
|
||||||
|
CUL_HM_SendCmd($shash, "++8002$id${src}00",1,0) # Send Ack
|
||||||
|
if($id eq $dst && $cmd ne "8002");
|
||||||
|
|
||||||
|
|
||||||
} elsif($st eq "KFM" && $model eq "KFM-Sensor") {
|
} elsif($st eq "KFM" && $model eq "KFM-Sensor") {
|
||||||
|
|
||||||
@ -488,6 +499,19 @@ my %culHmSubTypeSets = (
|
|||||||
remote =>
|
remote =>
|
||||||
{ text => "<btn> [on|off] <txt1> <txt2>" },
|
{ text => "<btn> [on|off] <txt1> <txt2>" },
|
||||||
);
|
);
|
||||||
|
my %culHmModelSets = (
|
||||||
|
"HM-CC-TC"=>
|
||||||
|
{ "day-temp" => "temp",
|
||||||
|
"night-temp" => "temp",
|
||||||
|
"tempListSat"=> "HH:MM temp ...",
|
||||||
|
"tempListSun"=> "HH:MM temp ...",
|
||||||
|
"tempListMon"=> "HH:MM temp ...",
|
||||||
|
"tempListTue"=> "HH:MM temp ...",
|
||||||
|
"tempListThu"=> "HH:MM temp ...",
|
||||||
|
"tempListWed"=> "HH:MM temp ...",
|
||||||
|
"tempListFri"=> "HH:MM temp ...",
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
sub
|
sub
|
||||||
@ -501,6 +525,7 @@ CUL_HM_Set($@)
|
|||||||
|
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my $st = AttrVal($name, "subType", "");
|
my $st = AttrVal($name, "subType", "");
|
||||||
|
my $md = AttrVal($name, "model", "");
|
||||||
my $cmd = $a[1];
|
my $cmd = $a[1];
|
||||||
my $dst = $hash->{DEF};
|
my $dst = $hash->{DEF};
|
||||||
my $chn = "01";
|
my $chn = "01";
|
||||||
@ -514,6 +539,7 @@ CUL_HM_Set($@)
|
|||||||
|
|
||||||
my $h = $culHmGlobalSets{$cmd};
|
my $h = $culHmGlobalSets{$cmd};
|
||||||
$h = $culHmSubTypeSets{$st}{$cmd} if(!defined($h) && $culHmSubTypeSets{$st});
|
$h = $culHmSubTypeSets{$st}{$cmd} if(!defined($h) && $culHmSubTypeSets{$st});
|
||||||
|
$h = $culHmModelSets{$md}{$cmd} if(!defined($h) && $culHmModelSets{$md});
|
||||||
my @h;
|
my @h;
|
||||||
@h = split(" ", $h) if($h);
|
@h = split(" ", $h) if($h);
|
||||||
|
|
||||||
@ -525,6 +551,8 @@ CUL_HM_Set($@)
|
|||||||
join(" ",sort keys %culHmGlobalSets);
|
join(" ",sort keys %culHmGlobalSets);
|
||||||
$usg .= " ". join(" ",sort keys %{$culHmSubTypeSets{$st}})
|
$usg .= " ". join(" ",sort keys %{$culHmSubTypeSets{$st}})
|
||||||
if($culHmSubTypeSets{$st});
|
if($culHmSubTypeSets{$st});
|
||||||
|
$usg .= " ". join(" ",sort keys %{$culHmModelSets{$md}})
|
||||||
|
if($culHmModelSets{$md});
|
||||||
my $pct = join(" ", (0..100));
|
my $pct = join(" ", (0..100));
|
||||||
$usg =~ s/ pct/ $pct/;
|
$usg =~ s/ pct/ $pct/;
|
||||||
return $usg;
|
return $usg;
|
||||||
@ -533,7 +561,7 @@ CUL_HM_Set($@)
|
|||||||
return "$cmd requires no parameters";
|
return "$cmd requires no parameters";
|
||||||
|
|
||||||
} elsif($h !~ m/\.\.\./ && @h != @a-2) {
|
} elsif($h !~ m/\.\.\./ && @h != @a-2) {
|
||||||
return "$cmd requires parameters: $h";
|
return "$cmd requires parameter: $h";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -559,21 +587,13 @@ CUL_HM_Set($@)
|
|||||||
$shash->{hmPairSerial} = $serialNr;
|
$shash->{hmPairSerial} = $serialNr;
|
||||||
|
|
||||||
} elsif($cmd eq "unpair") { ###########################################
|
} elsif($cmd eq "unpair") { ###########################################
|
||||||
$sndcmd =
|
CUL_HM_pushConfig($shash, $id, $dst, 0, 0, "02010A000B000C00");
|
||||||
sprintf("++A001%s%s00050000000000", $id,$dst);
|
$sndcmd = shift @{$shash->{cmdStack}};
|
||||||
CUL_HM_PushCmdStack($shash,
|
|
||||||
sprintf("++A001%s%s000802000A000B000C00",$id,$dst));
|
|
||||||
CUL_HM_PushCmdStack($shash,
|
|
||||||
sprintf("++A001%s%s0006",$id,$dst));
|
|
||||||
|
|
||||||
} elsif($cmd eq "sign") { ############################################
|
} elsif($cmd eq "sign") { ############################################
|
||||||
$sndcmd =
|
CUL_HM_pushConfig($shash, $id, $dst, $chn, $chn,
|
||||||
sprintf("++A001%s%s%s0500000000%s", $id,$dst,$chn,$chn);
|
"08" . ($a[2] eq "on" ? "01":"02"));
|
||||||
CUL_HM_PushCmdStack($shash,
|
$sndcmd = shift @{$shash->{cmdStack}};
|
||||||
sprintf("++A001%s%s%s0808%s",$id,$dst,$chn,
|
|
||||||
($a[2] eq "on" ? "01" : "02")));
|
|
||||||
CUL_HM_PushCmdStack($shash,
|
|
||||||
sprintf("++A001%s%s%s06",$id,$dst,$chn));
|
|
||||||
|
|
||||||
} elsif($cmd eq "statusRequest") { ####################################
|
} elsif($cmd eq "statusRequest") { ####################################
|
||||||
$sndcmd = sprintf("++A001%s%s%s0E", $id,$dst, $chn);
|
$sndcmd = sprintf("++A001%s%s%s0E", $id,$dst, $chn);
|
||||||
@ -594,7 +614,7 @@ CUL_HM_Set($@)
|
|||||||
$sndcmd = sprintf("++A03E%s%s%s40%s%02X", $id, $dst,
|
$sndcmd = sprintf("++A03E%s%s%s40%s%02X", $id, $dst,
|
||||||
$dst, $chn, $shash->{toggleIndex});
|
$dst, $chn, $shash->{toggleIndex});
|
||||||
|
|
||||||
} elsif($st eq "pct") { ##############################################
|
} elsif($cmd eq "pct") { ##############################################
|
||||||
$a[1] = 100 if ($a[1] > 100);
|
$a[1] = 100 if ($a[1] > 100);
|
||||||
$sndcmd = sprintf("++A011%s%s02%s%02X0000", $id, $dst, $chn, $a[1]*2);
|
$sndcmd = sprintf("++A011%s%s02%s%02X0000", $id, $dst, $chn, $a[1]*2);
|
||||||
if(@a > 2) {
|
if(@a > 2) {
|
||||||
@ -602,17 +622,14 @@ CUL_HM_Set($@)
|
|||||||
$sndcmd .= $tval;
|
$sndcmd .= $tval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} elsif($cmd eq "text") { #############################################
|
||||||
} elsif($st eq "text") { #############################################
|
|
||||||
$state = "";
|
$state = "";
|
||||||
return "$a[2] is not a button number" if($a[2] !~ m/^\d$/);
|
return "$a[2] is not a button number" if($a[2] !~ m/^\d$/);
|
||||||
return "$a[3] is not on or off" if($a[3] !~ m/^(on|off)$/);
|
return "$a[3] is not on or off" if($a[3] !~ m/^(on|off)$/);
|
||||||
my $bn = $a[2]*2-($a[3] eq "on" ? 0 : 1);
|
my $bn = $a[2]*2-($a[3] eq "on" ? 0 : 1);
|
||||||
|
|
||||||
CUL_HM_PushCmdStack($shash,
|
|
||||||
sprintf("++A001%s%s%02d050000000001", $id, $dst, $bn));
|
|
||||||
|
|
||||||
my ($l1, $l2, $s, $tl); # Create CONFIG_WRITE_INDEX string
|
my ($l1, $l2, $s); # Create CONFIG_WRITE_INDEX string
|
||||||
$l1 = $a[4] . "\x00";
|
$l1 = $a[4] . "\x00";
|
||||||
$l1 = substr($l1, 0, 13);
|
$l1 = substr($l1, 0, 13);
|
||||||
$s = 54;
|
$s = 54;
|
||||||
@ -624,24 +641,47 @@ CUL_HM_Set($@)
|
|||||||
$l2 =~ s/(.)/sprintf("%02X%02X",$s++,ord($1))/ge;
|
$l2 =~ s/(.)/sprintf("%02X%02X",$s++,ord($1))/ge;
|
||||||
$l1 .= $l2;
|
$l1 .= $l2;
|
||||||
|
|
||||||
$tl = length($l1);
|
CUL_HM_pushConfig($hash, $id, $dst, $bn, 1, $l1);
|
||||||
for(my $l = 0; $l < $tl; $l+=28) {
|
|
||||||
my $ml = $tl-$l < 28 ? $tl-$l : 28;
|
|
||||||
CUL_HM_PushCmdStack($shash, sprintf("++A001%s%s%02d08%s",
|
|
||||||
$id, $dst, $bn, substr($l1,$l,$ml)));
|
|
||||||
}
|
|
||||||
|
|
||||||
CUL_HM_PushCmdStack($shash,
|
|
||||||
sprintf("++A001%s%s%02d06", $id, $dst, $bn));
|
|
||||||
return "Set your remote in learning mode to transmit the data";
|
return "Set your remote in learning mode to transmit the data";
|
||||||
|
|
||||||
|
} elsif($cmd =~ m/^(day|night)-temp$/) { ###############################
|
||||||
|
my $temp = CUL_HM_convTemp($a[2]);
|
||||||
|
return $temp if(length($temp) > 2);
|
||||||
|
CUL_HM_pushConfig($hash, $id, $dst, 2, 5,
|
||||||
|
$st eq "day-temp" ? "03$temp" : "04$temp");
|
||||||
|
return;
|
||||||
|
|
||||||
|
} elsif($cmd =~ m/^tempList(...)/) { ##################################
|
||||||
|
my %day2off = ( "Sat"=>"5 0B", "Sun"=>"5 3B", "Mon"=>"5 6B",
|
||||||
|
"Tue"=>"5 9B", "Thu"=>"5 CB", "Wed"=>"6 01",
|
||||||
|
"Fri"=>"6 31");
|
||||||
|
my ($list,$addr) = split(" ", $day2off{$1});
|
||||||
|
|
||||||
|
return "To few arguments" if(@a < 4);
|
||||||
|
return "To many arguments, max is 24 pairs" if(@a > 50);
|
||||||
|
return "Bad format, use HH:MM TEMP ..." if(@a % 2);
|
||||||
|
return "Last time spec must be 24:00" if($a[@a-2] ne "24:00");
|
||||||
|
|
||||||
|
my $data = "";
|
||||||
|
for(my $idx = 2; $idx < @a; $idx += 2) {
|
||||||
|
return "$a[$idx] is not in HH:MM format"
|
||||||
|
if($a[$idx] !~ m/^([0-2]\d):([0-5]\d)/);
|
||||||
|
my ($h, $m) = ($1, $2);
|
||||||
|
my $temp = CUL_HM_convTemp($a[$idx+1]);
|
||||||
|
return $temp if(length($temp) > 2);
|
||||||
|
$data .= sprintf("%02X%02X%02X%s", $addr, $h*6+($m/10), $addr+1, $temp);
|
||||||
|
$addr += 2;
|
||||||
|
}
|
||||||
|
CUL_HM_pushConfig($hash, $id, $dst, 2, $list, $data);
|
||||||
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($state) {
|
if($state) {
|
||||||
$hash->{STATE} = $state;
|
$hash->{STATE} = $state;
|
||||||
$hash->{cmdSent} = $state;
|
$hash->{cmdSent} = $state;
|
||||||
}
|
}
|
||||||
CUL_HM_SendCmd($shash, $sndcmd, 0, 1);
|
CUL_HM_SendCmd($shash, $sndcmd, 0, 1) if($sndcmd);
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -710,9 +750,8 @@ CUL_HM_Pair(@)
|
|||||||
delete($hash->{cmdStack});
|
delete($hash->{cmdStack});
|
||||||
|
|
||||||
if($stn ne "remote") {
|
if($stn ne "remote") {
|
||||||
CUL_HM_SendCmd ($hash, "++A001$id${src}00050000000000", 1, 1);
|
CUL_HM_pushConfig($hash, $id, $src, 0, 0, "0201$idstr");
|
||||||
CUL_HM_PushCmdStack($hash, "++A001$id${src}00080201$idstr");
|
CUL_HM_SendCmd($hash, shift @{$hash->{cmdStack}}, 1, 1);
|
||||||
CUL_HM_PushCmdStack($hash, "++A001$id${src}0006");
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
# remotes are AES per default, so the method above does not work. the
|
# remotes are AES per default, so the method above does not work. the
|
||||||
@ -727,6 +766,7 @@ CUL_HM_Pair(@)
|
|||||||
CUL_HM_PushCmdStack($hash, "++A001$id${src}0106");
|
CUL_HM_PushCmdStack($hash, "++A001$id${src}0106");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create shadow device for multi-channel
|
# Create shadow device for multi-channel
|
||||||
if($stn eq "switch" &&
|
if($stn eq "switch" &&
|
||||||
$attr{$name}{devInfo} =~ m,(..)(..)(..), ) {
|
$attr{$name}{devInfo} =~ m,(..)(..)(..), ) {
|
||||||
@ -817,6 +857,7 @@ CUL_HM_Id($)
|
|||||||
return AttrVal($io->{NAME}, "hmId", "F1$fhtid");
|
return AttrVal($io->{NAME}, "hmId", "F1$fhtid");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#############################
|
||||||
my %culHmBits = (
|
my %culHmBits = (
|
||||||
"8000" => { txt => "DEVICE_INFO", params => {
|
"8000" => { txt => "DEVICE_INFO", params => {
|
||||||
FIRMWARE => '00,2',
|
FIRMWARE => '00,2',
|
||||||
@ -908,7 +949,7 @@ CUL_HM_DumpProtocol($$@)
|
|||||||
|
|
||||||
my $p01 = substr($p,0,2);
|
my $p01 = substr($p,0,2);
|
||||||
my $p02 = substr($p,0,4);
|
my $p02 = substr($p,0,4);
|
||||||
my $p11 = substr($p,2,2);
|
my $p11 = (length($p) > 2 ? substr($p,2,2) : "");
|
||||||
|
|
||||||
$cmd = "0A$1" if($cmd =~ m/0B(..)/);
|
$cmd = "0A$1" if($cmd =~ m/0B(..)/);
|
||||||
$cmd = "A4$1" if($cmd =~ m/84(..)/);
|
$cmd = "A4$1" if($cmd =~ m/84(..)/);
|
||||||
@ -939,6 +980,7 @@ CUL_HM_DumpProtocol($$@)
|
|||||||
DoTrigger($iname, $msg) if($ev);
|
DoTrigger($iname, $msg) if($ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#############################
|
||||||
my @culHmTimes8 = ( 0.1, 1, 5, 10, 60, 300, 600, 3600 );
|
my @culHmTimes8 = ( 0.1, 1, 5, 10, 60, 300, 600, 3600 );
|
||||||
sub
|
sub
|
||||||
CUL_HM_encodeTime8($)
|
CUL_HM_encodeTime8($)
|
||||||
@ -957,6 +999,7 @@ CUL_HM_encodeTime8($)
|
|||||||
return "FF";
|
return "FF";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#############################
|
||||||
sub
|
sub
|
||||||
CUL_HM_decodeTime8($)
|
CUL_HM_decodeTime8($)
|
||||||
{
|
{
|
||||||
@ -967,6 +1010,7 @@ CUL_HM_decodeTime8($)
|
|||||||
return $v2 * $culHmTimes8[$v1];
|
return $v2 * $culHmTimes8[$v1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#############################
|
||||||
sub
|
sub
|
||||||
CUL_HM_encodeTime16($)
|
CUL_HM_encodeTime16($)
|
||||||
{
|
{
|
||||||
@ -987,6 +1031,16 @@ CUL_HM_encodeTime16($)
|
|||||||
return ($ret, "");
|
return ($ret, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub
|
||||||
|
CUL_HM_convTemp($)
|
||||||
|
{
|
||||||
|
my ($in) = @_;
|
||||||
|
return "$in is not a number" if($in !~ m/^\d+$/ && $in !~ m/\d+\.\d+$/);
|
||||||
|
return "$in is out of bounds (6 .. 30)" if($in < 6 || $in > 30);
|
||||||
|
return sprintf("%02X", $in*2);
|
||||||
|
}
|
||||||
|
|
||||||
|
#############################
|
||||||
sub
|
sub
|
||||||
CUL_HM_decodeTime16($)
|
CUL_HM_decodeTime16($)
|
||||||
{
|
{
|
||||||
@ -1000,4 +1054,22 @@ CUL_HM_decodeTime16($)
|
|||||||
return $mul*$m;
|
return $mul*$m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#############################
|
||||||
|
sub
|
||||||
|
CUL_HM_pushConfig($$$$$$)
|
||||||
|
{
|
||||||
|
my ($hash,$src,$dst,$chn,$list,$content) = @_;
|
||||||
|
|
||||||
|
CUL_HM_PushCmdStack($hash,
|
||||||
|
sprintf("++A001%s%s%02X0500000000%02X",$src,$dst,$chn,$list));
|
||||||
|
my $tl = length($content);
|
||||||
|
for(my $l = 0; $l < $tl; $l+=28) {
|
||||||
|
my $ml = $tl-$l < 28 ? $tl-$l : 28;
|
||||||
|
CUL_HM_PushCmdStack($hash,
|
||||||
|
sprintf("++A001%s%s%02X08%s", $src,$dst,$chn, substr($content,$l,$ml)));
|
||||||
|
}
|
||||||
|
CUL_HM_PushCmdStack($hash,
|
||||||
|
sprintf("++A001%s%s%02X06",$src,$dst,$chn));
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -70,11 +70,12 @@
|
|||||||
<a href="http://localhost:8083/fhem">http://localhost:8083/fhem</a>
|
<a href="http://localhost:8083/fhem">http://localhost:8083/fhem</a>
|
||||||
or
|
or
|
||||||
<a href="http://localhost:8084/fhem">http://localhost:8084/fhem</a> if
|
<a href="http://localhost:8084/fhem">http://localhost:8084/fhem</a> if
|
||||||
you are using a small-screen browser (e.g a smartphone).<br><br>
|
you are using a a smartphone.<br><br>
|
||||||
|
|
||||||
Attach the USB device (CUL, FHZ1000PC/FHZ1300, EM1010PC) to your
|
Attach the USB device (CUL, FHZ1000PC/FHZ1300, EM1010PC) to your
|
||||||
computer, and look for the corresponding device in the /dev
|
computer, and look for the corresponding device in the /dev
|
||||||
directory.<br> For CUL a file named /dev/ttyACM* will be created under
|
directory. For <a href="commandref.html#CUL">CUL</a> a file named
|
||||||
|
/dev/ttyACM* will be created under
|
||||||
Linux and /dev/cu.usbmodem* under OS X. Note the exact name of the device.
|
Linux and /dev/cu.usbmodem* under OS X. Note the exact name of the device.
|
||||||
Define it for fhem (by typing it in the "Fhem cmd" input field in the
|
Define it for fhem (by typing it in the "Fhem cmd" input field in the
|
||||||
browser):<pre>
|
browser):<pre>
|
||||||
@ -94,10 +95,10 @@
|
|||||||
<br><br>
|
<br><br>
|
||||||
<b>Note:</b> Don't forget to type "save" in the "Fhem cmd" input field of
|
<b>Note:</b> Don't forget to type "save" in the "Fhem cmd" input field of
|
||||||
the browser after defining a device or setting its attribute. Otherwise
|
the browser after defining a device or setting its attribute. Otherwise
|
||||||
the changes will disappear after the next start.<br><br> </ul>
|
the changes will disappear after the next start.</ul>
|
||||||
|
|
||||||
<a name="autocreate"></a>
|
<a name="autocreate"></a>
|
||||||
<h3>Automatically creating transmitters</h3>
|
<h3>Configuring transmitter devices</h3>
|
||||||
<ul>
|
<ul>
|
||||||
The sample configuration file installed via "make install-pgm2" has
|
The sample configuration file installed via "make install-pgm2" has
|
||||||
configured an <a href="commandref.html#autocreate">autocreate</a>
|
configured an <a href="commandref.html#autocreate">autocreate</a>
|
||||||
@ -108,33 +109,34 @@
|
|||||||
rename</a> to rename the automatically created device, e.g. type in the
|
rename</a> to rename the automatically created device, e.g. type in the
|
||||||
input field of the web frontend:<pre>
|
input field of the web frontend:<pre>
|
||||||
rename FHT_1234 fht.kitchen</pre>
|
rename FHT_1234 fht.kitchen</pre>
|
||||||
<b>NOTE</b>: you have to rename the device itself, the attached FileLog
|
|
||||||
|
<b>Note</b>: if you rename the device itself, the attached FileLog
|
||||||
and weblink will be renamed automatically. The other way round (renaming
|
and weblink will be renamed automatically. The other way round (renaming
|
||||||
the FileLog or weblink) does not work correctly right now.
|
the FileLog or weblink) will not rename the associated devices
|
||||||
</ul>
|
automatically.<br><br>
|
||||||
|
|
||||||
|
|
||||||
<a name="FS20tx"></a>
|
|
||||||
<h3>Misc. RF transmitters (FS20/EM/S300 etc.)</h3>
|
|
||||||
<ul>
|
|
||||||
<a href="commandref.html#autocreate">autocreate</a> will create
|
|
||||||
automatically fhem FS20/EM/S300/HMS devices, the following description is
|
|
||||||
for doing it manually.<br><br>
|
|
||||||
|
|
||||||
|
If you want to do the same manually:<br>
|
||||||
Wait a while, until the transmitter sent some data. In the logfile
|
Wait a while, until the transmitter sent some data. In the logfile
|
||||||
(Browser window: "All together" -> Logs:Logfile:text) a line
|
(Browser window: "All together" -> Logs:Logfile:text) a line
|
||||||
will appear:<pre>
|
will appear:<pre>
|
||||||
FS20 Unknown device <HOUSECODE, Button <BTN> Code <CDE>, please define it</pre>
|
FS20 Unknown device <HOUSECODE>, Button <BTN> Code <CDE>, please define it</pre>
|
||||||
|
|
||||||
Now define a device:<pre>
|
Now define the fhem device:<pre>
|
||||||
define piri1 FS20 <HOUSECODE> <BTN></pre>
|
define piri1 FS20 <HOUSECODE> <BTN></pre>
|
||||||
|
|
||||||
Set the model attribute of the device:<pre>
|
Set the model attribute of the device:<pre>
|
||||||
attr lamp1 model fs20piri</pre>
|
attr piri1 model fs20piri</pre>
|
||||||
|
|
||||||
to get only the commands available for this device.
|
to get only the commands available for this device.
|
||||||
<a href="commandref.html#model">Here</a> is a complete list of FS20
|
<a href="commandref.html#model">Here</a> is a complete list of FS20
|
||||||
models.<br> For other device-types similar messages should appear.
|
models.<br> For other device types similar messages should appear.<br><br>
|
||||||
|
|
||||||
|
<b>Note:</b> Creating a fhem FHT device automatically or manually does
|
||||||
|
not imply that the CUL or the FHZ is paired with it. For this purpose you
|
||||||
|
have to set the FHT to accept new devices (Prog:Cent:N/A), and send a command to
|
||||||
|
it (e.g. set fht.kitchen desired-temp 20).
|
||||||
|
If there is no signal for a while, then check <a href="faq.html#faq6">
|
||||||
|
this</a> FAQ entry.
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="FS20rx"></a>
|
<a name="FS20rx"></a>
|
||||||
@ -144,7 +146,7 @@
|
|||||||
fhem first with:<pre>
|
fhem first with:<pre>
|
||||||
define lamp1 FS20 1234 56</pre>
|
define lamp1 FS20 1234 56</pre>
|
||||||
|
|
||||||
Now press the button on the device for a while until its LED starts to
|
Now press the button on the real device for a while until its LED starts to
|
||||||
blink. Click on the "on" link in the fhem window to send a command. The
|
blink. Click on the "on" link in the fhem window to send a command. The
|
||||||
LED should terminate blinking, the device is programmed to housecode
|
LED should terminate blinking, the device is programmed to housecode
|
||||||
1234, device code 56. You can also use the 4-base ELV notation.
|
1234, device code 56. You can also use the 4-base ELV notation.
|
||||||
@ -152,48 +154,16 @@
|
|||||||
attr lamp1 model fs20st</pre>
|
attr lamp1 model fs20st</pre>
|
||||||
|
|
||||||
to get only the commands available for this device.
|
to get only the commands available for this device.
|
||||||
<a href="commandref.html#model">Here</a> is a complete list of models.
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<a name="FHT"></a>
|
|
||||||
<h3>Configuring FHT devices</h3>
|
|
||||||
<ul>
|
|
||||||
<b>Note:</b> Creating a fhem FHT device automatically or manually does
|
|
||||||
not imply that the CUL or the FHZ is paired with it. For this purpose you
|
|
||||||
have to set the FHT to accept new "Cent" devices, and send a command to
|
|
||||||
it (e.g. set fht.kitchen desired-temp 20)<br><br>
|
|
||||||
|
|
||||||
<a href="commandref.html#autocreate">autocreate</a> will create
|
|
||||||
automatically FHT devices, the following description is for
|
|
||||||
doing it manually.<br><br>
|
|
||||||
|
|
||||||
Wait for a while (2-5 mins) till the FHT is sending some signals. In the
|
|
||||||
logfile ("All together" -> Logs:LogFile:text) a line should
|
|
||||||
appear:<br><pre>
|
|
||||||
FHZ1: Unknown FHT device detected, define one to get detailed information</pre>
|
|
||||||
|
|
||||||
Define your FHT device with an arbitrary code in order to load the FHT
|
|
||||||
module, see <a href="commandref.html#FHT">this</a> link for details:<pre>
|
|
||||||
define MyFHT FHT 1111</pre>
|
|
||||||
|
|
||||||
The next message in the log will contain more details:<pre>
|
|
||||||
FHT Unknown device <HOUSECODE>, please define it</pre>
|
|
||||||
|
|
||||||
Delete and create your device again:<pre>
|
|
||||||
delete MyFHT
|
|
||||||
define MyFHT FHT <HOUSECODE></pre>
|
|
||||||
|
|
||||||
If there is no signal for a while, then check <a href="faq.html#faq6">
|
|
||||||
this</a> FAQ entry.
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<a name="at"></a>
|
<a name="at"></a>
|
||||||
<h3>Timed commands / Notification</h3>
|
<h3>Timed commands / Notification</h3>
|
||||||
<ul>
|
<ul>
|
||||||
To execute commands at a given time / periodically, you have to define
|
To execute commands at a given time / periodically, you have to define
|
||||||
devices of the type at. See the definition <a href="commandref.html#at">
|
devices of the type at. See the definition <a href="commandref.html#at">
|
||||||
here</a> and the examples <a href="example.06_at">here</a> The last link
|
here</a> and the examples <a href="example.06_at">here</a>. The last link
|
||||||
only works if you are reading this HOWTO from your fhem Web.<br><br>
|
only works if you are reading this HOWTO from your fhem Web.<br><br>
|
||||||
|
|
||||||
To execute commands if a device sent a message you have to define
|
To execute commands if a device sent a message you have to define
|
||||||
@ -219,7 +189,7 @@
|
|||||||
"Unsorted" room. Devices in the room "hidden" will not be shown.
|
"Unsorted" room. Devices in the room "hidden" will not be shown.
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
Set the title of the webpage by setting the title attribute of the global
|
Set the title of the webpage by setting the <code>title</code> attribute of the global
|
||||||
device ("All together" -> global)<br><br>
|
device ("All together" -> global)<br><br>
|
||||||
|
|
||||||
Edit the colors / fonts by changing the style.css ("Edit files" ->
|
Edit the colors / fonts by changing the style.css ("Edit files" ->
|
||||||
@ -231,12 +201,17 @@
|
|||||||
<a href="commandref.html#plotsize">plotsize</a>.
|
<a href="commandref.html#plotsize">plotsize</a>.
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<a name="log"></a>
|
<a name="log"></a>
|
||||||
<h3>Logging data</h3>
|
<h3>Logging data</h3>
|
||||||
<ul>
|
<ul>
|
||||||
To log messages into files, define devices of the type <a
|
To log messages into files, define devices of the type <a
|
||||||
href="commandref.html#FileLog">FileLog</a>. Autocreate will create
|
href="commandref.html#FileLog">FileLog</a>. Autocreate will create
|
||||||
logfiles for newly detected devices. To log messages into a
|
logfiles for newly detected devices, or you can use <a
|
||||||
|
href="commandref.html#createlog">createlog</a> in order to add a FileLog
|
||||||
|
later.<br>
|
||||||
|
|
||||||
|
To log messages into a
|
||||||
database, see the contrib/dblog directory in the fhem
|
database, see the contrib/dblog directory in the fhem
|
||||||
distribution.<br><br>
|
distribution.<br><br>
|
||||||
|
|
||||||
@ -255,72 +230,79 @@
|
|||||||
<h3>Plotting logs</h3>
|
<h3>Plotting logs</h3>
|
||||||
<ul>
|
<ul>
|
||||||
Autocreate will create weblinks (i.e. plots) for newly detected devices.
|
Autocreate will create weblinks (i.e. plots) for newly detected devices.
|
||||||
The following section describes how to do it manually.<br>
|
The following section describes how to do it manually.<br><br>
|
||||||
|
|
||||||
To convert a log into a plot in FHEMWEB, set the
|
To convert a FileLog into a plot (chart) in FHEMWEB, set the
|
||||||
<a href="commandref.html#logtype">logtype</a> attribute of the
|
<a href="commandref.html#logtype">logtype</a> attribute of the
|
||||||
corresponding FileLog. Take a look at the available gnuplot files in the
|
corresponding FileLog. Take a look at the available gnuplot files in the
|
||||||
"Edit files" section, they contain the corresponding FileLog definition
|
"Edit files" section, they contain the corresponding FileLog definition
|
||||||
example.<br>
|
example.<br>
|
||||||
Note that the .gplot files are also used if you use SVG output and
|
Note that the .gplot files are also used if you use SVG output and
|
||||||
not the gnuplot backend!<br><br>
|
not the gnuplot backend!<br>
|
||||||
|
Examples:<pre>
|
||||||
|
attr em1000log logtype cul_em:Power,text
|
||||||
|
attr fs20_log logtype fs20:Plot,text
|
||||||
|
attr hms100th_log logtype hms:Plot,text
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
When displaying the plot, you can convert it into a "weblink" device,
|
||||||
|
so that we can in turn have a room attribute to group more than one Plot
|
||||||
|
together. If the weblink refers to the current logfile, then it will be
|
||||||
|
stored as a CURRENT weblink, and it will always display the most recent
|
||||||
|
log (you do not have to redefine it if the logfile changes due to
|
||||||
|
year/month/date parameters in its name).
|
||||||
|
|
||||||
When displaying the plot, you can convert it into a "weblink", which can
|
|
||||||
in turn have a room attribute to group more than one Plot together. If
|
|
||||||
the weblink refers to the current logfile, then it will be stored as a
|
|
||||||
CURRENT weblink, and it will always display the most recent log (you do
|
|
||||||
not have to redefine it if the logfile changes due to year/month/date
|
|
||||||
parameters in its name).
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
|
|
||||||
The logs can be converted to a plot either with gnuplot (which must be
|
The logs can be converted to a plot either with gnuplot (which must be
|
||||||
installed and in your PATH), or via the builtin SVG module, in this case
|
installed and in your PATH), or via the builtin SVG module, in this case
|
||||||
your internet browser must support SVG. Firefox, opera and the
|
your browser must support SVG. Firefox, Opera, Chrome, Safari
|
||||||
iPhone/Android borwser support SVG out of the box, Internet Explorer does
|
(on the iPhone/iPad too) support SVG out of the box, Internet Explorer does
|
||||||
it via the Adobe "SVG viewer" plugin. SVG mode is the default, to change
|
it via the Adobe "SVG viewer" plugin, Android does not support it (as of
|
||||||
it set the <a href="commandref.html#plotmode">plotmode</a> attribute to
|
2011/02).
|
||||||
gnuplot or gnuplot-scroll.<br><br>
|
SVG mode is the default, to change it set the <a
|
||||||
|
href="commandref.html#plotmode">plotmode</a> attribute to gnuplot or
|
||||||
|
gnuplot-scroll.<br><br>
|
||||||
|
|
||||||
In order to look at historic data, you can either convert at the
|
In order to look at historic data, you can either convert at the
|
||||||
archive entries to weblink in "plotmode=gnuplot" mode, or use the
|
archive entries to weblink in "plotmode=gnuplot" mode, or use the
|
||||||
"plotmode=gnuplot-scroll" or "plotmode=SVG" modes. In the latter case
|
"plotmode=gnuplot-scroll" or "plotmode=SVG" modes. fnuplot-scroll and SVG
|
||||||
you'll get the possibility to zoom or scroll in the plot.<br><br>
|
offer the possibility to zoom or scroll in the plot, see the arrow and
|
||||||
|
magnifier icons at the top of the page.<br><br>
|
||||||
Use the zoom and scroll icons at the top of the page.<br><br>
|
|
||||||
|
|
||||||
The current time scope (day, week, month..) set at the overview
|
|
||||||
page (containing weblinks) will also be used for graphics you open via
|
|
||||||
links (current log or archive) - there are no zoom and scroll icons
|
|
||||||
there.<br><br>
|
|
||||||
|
|
||||||
Note: the gnuplot files must have #FileLog entries in order to be
|
Note: the gnuplot files must have #FileLog entries in order to be
|
||||||
useable with scrolling, as the filtering happens with the FileLog get
|
useable with scrolling, as the filtering happens with the FileLog get
|
||||||
function, see the supplied gnuplot files for an example.<br><br>
|
function, see the supplied gnuplot files for an example or the
|
||||||
|
column_spec paragraph <a href="commandref.html#FileLogget">here</a> for
|
||||||
|
the syntax.<br><br>
|
||||||
|
|
||||||
The order of the #FileLog lines need to match the corresponding
|
The order of the #FileLog lines must match the corresponding 'awk'
|
||||||
'awk'-(double-)lines!<br><br>
|
entries.<br><br>
|
||||||
|
|
||||||
It make sense to build large logfiles for scrolling in them (year
|
It make sense to build large logfiles for scrolling in them (year
|
||||||
resolution), or smaller ones if you do not want to use the zoom/scroll
|
resolution), or smaller ones if you do not want to use the zoom/scroll
|
||||||
feature. The size of the logfiles will be determined by its wildcard
|
feature. The size of the logfiles will be determined by its wildcard
|
||||||
characters (year/month/week/day), look at the FileLog definition.
|
characters (year/month/week/day), look at the FileLog definition.
|
||||||
Don't forget to enable archiving with the archivedir or archivecmd
|
|
||||||
attributes.<br><br>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="tips"></a>
|
<a name="tips"></a>
|
||||||
<h3>FHEMWEB tips</h3>
|
<h3>FHEMWEB tips</h3>
|
||||||
<ul>
|
<ul>
|
||||||
Click on the State link on the device page to get a documentation of
|
Click on the State link on the detail page to get a documentation of
|
||||||
all its settable values, similarly clicking on Attributes will guide you
|
all its settable values, similarly clicking on "Attribute" will guide you
|
||||||
to the documentation of its attributes.
|
to the documentation of its attributes.
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
Password/HTTPS<br>
|
There are two different ways to enable <b>Password and HTTPS</b><br><br>
|
||||||
These features are implemented by apache, and apache must be configured
|
<ul>
|
||||||
to redirect the page to 01_FHEMWEB.pm. For this purpose add the following
|
<li>Using the builtin features of FHEMWEB for <a
|
||||||
lines to your httpd.conf:<pre>
|
href="commandref.html#basicAuth">basic</a> html authentication and <a
|
||||||
|
href="commandref.html#HTTPS">HTTPS</a>. <br><br>
|
||||||
|
|
||||||
|
<li>Using apache to implement this features, and redirect a certain prefix to
|
||||||
|
each FHEMWEB instance.<br>
|
||||||
|
Add the following lines to your httpd.conf:<pre>
|
||||||
<Proxy *>
|
<Proxy *>
|
||||||
AuthType Basic
|
AuthType Basic
|
||||||
AuthName "Password Required"
|
AuthName "Password Required"
|
||||||
@ -349,6 +331,7 @@
|
|||||||
one of your system files, look at /etc/init.d/httpd).</li>
|
one of your system files, look at /etc/init.d/httpd).</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
</ul>
|
||||||
|
|
||||||
To display "foreign" (non fhem) files as a plot or a just as plain text,
|
To display "foreign" (non fhem) files as a plot or a just as plain text,
|
||||||
configure a fake logfile with the correct filename and an unused regexp,
|
configure a fake logfile with the correct filename and an unused regexp,
|
||||||
|
@ -2445,6 +2445,24 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
set 4Dis text 1 off Kitchen Off<br>
|
set 4Dis text 1 off Kitchen Off<br>
|
||||||
</ul>
|
</ul>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
|
<li>Thermostat (HM-CC-TC)
|
||||||
|
<ul>
|
||||||
|
<li>day-temp <tmp><br>
|
||||||
|
night-temp <tmp><br>
|
||||||
|
Set the day or night temperature. Temp must be between 6 and 30
|
||||||
|
Centigrade, and precision is half a degree.
|
||||||
|
<li>tempListSat HH:MM temp 24:00 temp ...<br>
|
||||||
|
tempListSun HH:MM temp 24:00 temp ...<br>
|
||||||
|
tempListMon HH:MM temp 24:00 temp ...<br>
|
||||||
|
tempListTue HH:MM temp 24:00 temp ...<br>
|
||||||
|
tempListThu HH:MM temp 24:00 temp ...<br>
|
||||||
|
tempListWed HH:MM temp 24:00 temp ...<br>
|
||||||
|
tempListFri HH:MM temp 24:00 temp ...<br>
|
||||||
|
Specify a list of temperature intervals. Up to 24 intervals can be
|
||||||
|
spacified for each week day, the resolution is 10 Minutes. The
|
||||||
|
last time spec must always be 24:00.<br>
|
||||||
|
Example: set th tempListSat 06:00 19 23:00 22.5 24:00 19<br>
|
||||||
|
</ul></li>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user