Bugfixes. 80_xxLG7000 now honours SetID attr.
git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@560 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -57,6 +57,7 @@
|
|||||||
# able for any alerting uses (unless a delay of said
|
# able for any alerting uses (unless a delay of said
|
||||||
# amount of time doesn't matter, of course ;)).
|
# amount of time doesn't matter, of course ;)).
|
||||||
#
|
#
|
||||||
|
# $Id: 09_CUL_FHTTK.pm,v 1.6 2010-01-22 09:51:55 painseeker Exp $
|
||||||
##############################################
|
##############################################
|
||||||
package main;
|
package main;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
# with LG's Scarlet Series of LCDs (e. g. LG 47LG7000)
|
# with LG's Scarlet Series of LCDs (e. g. LG 47LG7000)
|
||||||
#
|
#
|
||||||
# Written by Kai 'wusel' Siering <wusel+fhem@uu.org> around 2010-01-20
|
# Written by Kai 'wusel' Siering <wusel+fhem@uu.org> around 2010-01-20
|
||||||
|
# $Id: 80_xxLG7000.pm,v 1.2 2010-01-22 09:51:56 painseeker Exp $
|
||||||
#
|
#
|
||||||
# re-using code of 80_M232.pm by Dr. Boris Neubert
|
# re-using code of 80_M232.pm by Dr. Boris Neubert
|
||||||
##############################################
|
##############################################
|
||||||
@@ -18,24 +19,25 @@ sub Log($$);
|
|||||||
use vars qw {%attr %defs};
|
use vars qw {%attr %defs};
|
||||||
|
|
||||||
my %commands = (
|
my %commands = (
|
||||||
"power state" => "ka %d FF\r",
|
"power state" => "ka %x FF\r",
|
||||||
"power on" => "ka %d 01\r",
|
"power on" => "ka %x 01\r",
|
||||||
"power off" => "ka %d 00\r",
|
"power off" => "ka %x 00\r",
|
||||||
"input AV1" => "xb %d 20\r",
|
"input AV1" => "xb %x 20\r",
|
||||||
"input AV2" => "xb %d 21\r",
|
"input AV2" => "xb %x 21\r",
|
||||||
"input AV3" => "xb %d 22\r",
|
"input AV3" => "xb %x 22\r",
|
||||||
"input AV4" => "xb %d 23\r",
|
"input AV4" => "xb %x 23\r",
|
||||||
"input Component" => "xb %d 40\r",
|
"input Component" => "xb %x 40\r",
|
||||||
"input RGB-PC" => "xb %d 50\r",
|
"input RGB-PC" => "xb %x 50\r",
|
||||||
"input HDMI1" => "xb %d 90\r",
|
"input HDMI1" => "xb %x 90\r",
|
||||||
"input HDMI2" => "xb %d 91\r",
|
"input HDMI2" => "xb %x 91\r",
|
||||||
"input HDMI3" => "xb %d 92\r",
|
"input HDMI3" => "xb %x 92\r",
|
||||||
"input HDMI4" => "xb %d 93\r",
|
"input HDMI4" => "xb %x 93\r",
|
||||||
"input DVBT" => "xb %d 00\r",
|
"input DVB-T" => "xb %x 00\r",
|
||||||
"input PAL" => "xb %d 10\r",
|
"input PAL" => "xb %x 10\r",
|
||||||
"selected input" => "xb %d FF\r",
|
"selected input" => "xb %x FF\r",
|
||||||
"audio mute" => "ke %d 00\r",
|
"audio mute" => "ke %x 00\r",
|
||||||
"audio normal" => "ke %d 01\r",
|
"audio normal" => "ke %x 01\r",
|
||||||
|
"audio state" => "ke %x FF\r",
|
||||||
);
|
);
|
||||||
|
|
||||||
my %responses = (
|
my %responses = (
|
||||||
@@ -49,11 +51,15 @@ my %responses = (
|
|||||||
"b OK91" => "input HDMI2",
|
"b OK91" => "input HDMI2",
|
||||||
"b OK92" => "input HDMI3",
|
"b OK92" => "input HDMI3",
|
||||||
"b OK93" => "input HDMI4",
|
"b OK93" => "input HDMI4",
|
||||||
|
"b OKa0" => "input HDMI1-no_link", # At least 47LG7000 returns 10100001 instead of 10010001 when
|
||||||
|
"b OKa1" => "input HDMI2-no_link", # there is no link/signal connected to the corresponding
|
||||||
|
"b OKa2" => "input HDMI3-no_link", # HDMI input. -wusel, 2010-01-20
|
||||||
|
"b OKa3" => "input HDMI4-no_link",
|
||||||
"b OK40" => "input Components",
|
"b OK40" => "input Components",
|
||||||
"b OK50" => "input RGB-PC",
|
"b OK50" => "input RGB-PC",
|
||||||
"b OK10" => "input PAL",
|
"b OK10" => "input PAL", # Selecting analogue (dubbed PAL here) input does not work for
|
||||||
"b OK00" => "input DVB-T",
|
"b OK00" => "input DVB-T", # me; well, there's nothing to see anymore anyway, at least
|
||||||
"e OK00" => "audio muted",
|
"e OK00" => "audio muted", # in Germany ;) (Ack, I don't have CATV.) -wusel, 2010-01-20
|
||||||
"e OK01" => "audio normal",
|
"e OK01" => "audio normal",
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -74,9 +80,7 @@ xxLG7000_Initialize($)
|
|||||||
# Consumer
|
# Consumer
|
||||||
$hash->{DefFn} = "xxLG7000_Define";
|
$hash->{DefFn} = "xxLG7000_Define";
|
||||||
$hash->{UndefFn} = "xxLG7000_Undef";
|
$hash->{UndefFn} = "xxLG7000_Undef";
|
||||||
# $hash->{GetFn} = "xxLG7000_Get";
|
$hash->{AttrList}= "SetID:1,2,... loglevel:0,1,2,3,4,5";
|
||||||
# $hash->{SetFn} = "xxLG7000_Set";
|
|
||||||
$hash->{AttrList}= "SetID:01,02, loglevel:0,1,2,3,4,5";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -125,6 +129,7 @@ xxLG7000_Define($$)
|
|||||||
$po->close();
|
$po->close();
|
||||||
|
|
||||||
$hash->{DeviceName} = $dev;
|
$hash->{DeviceName} = $dev;
|
||||||
|
$attr{$a[0]}{SetID}=1;
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,128 +168,6 @@ xxLG7000_Ready($$)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#####################################
|
|
||||||
sub
|
|
||||||
xxLG7000_Set($@)
|
|
||||||
{
|
|
||||||
my ($hash, @a) = @_;
|
|
||||||
my $u1 = "Usage: see commandref.html for details\n";
|
|
||||||
|
|
||||||
return $u1 if(int(@a) < 2);
|
|
||||||
my $msg;
|
|
||||||
my $reading= $a[1];
|
|
||||||
my $value;
|
|
||||||
my @legal;
|
|
||||||
|
|
||||||
if($reading eq "auto") {
|
|
||||||
return $u1 if(int(@a) !=3);
|
|
||||||
$value= $a[2];
|
|
||||||
@legal= (0..5,"none");
|
|
||||||
if(!grep($value eq $_, @legal)) {
|
|
||||||
return "Illegal value $value, possible values: @legal";
|
|
||||||
}
|
|
||||||
if($value eq "none") { $value= 0; } else { $value+=1; }
|
|
||||||
$msg= "M" . $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
elsif($reading eq "start") {
|
|
||||||
return $u1 if(int(@a) !=2);
|
|
||||||
$msg= "Z1";
|
|
||||||
}
|
|
||||||
|
|
||||||
elsif($reading eq "stop") {
|
|
||||||
return $u1 if(int(@a) !=2);
|
|
||||||
$msg= "Z0";
|
|
||||||
}
|
|
||||||
|
|
||||||
elsif($reading eq "octet") {
|
|
||||||
return $u1 if(int(@a) !=3);
|
|
||||||
$value= $a[2];
|
|
||||||
@legal= (0..255);
|
|
||||||
if(!grep($value eq $_, @legal)) {
|
|
||||||
return "Illegal value $value, possible values: 0..255";
|
|
||||||
}
|
|
||||||
$msg= sprintf("W%02X", $value);
|
|
||||||
}
|
|
||||||
|
|
||||||
elsif($reading =~ /^io[0-7]$/) {
|
|
||||||
return $u1 if(int(@a) !=3);
|
|
||||||
$value= $a[2];
|
|
||||||
return $u1 unless($value eq "0" || $value eq "1");
|
|
||||||
$msg= "D" . substr($reading,2,1) . $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
else { return $u1; }
|
|
||||||
|
|
||||||
my $d = xxLG7000GetData($hash, $msg);
|
|
||||||
return "Read error" if(!defined($d));
|
|
||||||
return $d;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#####################################
|
|
||||||
sub
|
|
||||||
xxLG7000_Get($@)
|
|
||||||
{
|
|
||||||
|
|
||||||
my ($hash, @a) = @_;
|
|
||||||
my $u1 = "Usage: get <name> [an0..an5]\n" .
|
|
||||||
"get <name> [io0..io7]\n" .
|
|
||||||
"get <name> octet\n" .
|
|
||||||
"get <name> counter";
|
|
||||||
|
|
||||||
return $u1 if(int(@a) != 2);
|
|
||||||
|
|
||||||
my $name= $a[0];
|
|
||||||
my $reading= $a[1];
|
|
||||||
my $msg;
|
|
||||||
my $retval;
|
|
||||||
my ($count,$d,$state,$iscurrent,$voltage);
|
|
||||||
|
|
||||||
|
|
||||||
if($reading eq "counter") {
|
|
||||||
$msg= "z";
|
|
||||||
$d = xxLG7000GetData($hash, $msg);
|
|
||||||
return "Read error" if(!defined($d));
|
|
||||||
$count= hex $d;
|
|
||||||
$retval= $count;
|
|
||||||
}
|
|
||||||
|
|
||||||
elsif($reading =~ /^an[0-5]$/) {
|
|
||||||
$msg= "a" . substr($reading,2,1);
|
|
||||||
$d = xxLG7000GetData($hash, $msg);
|
|
||||||
return "Read error" if(!defined($d));
|
|
||||||
$voltage= (hex substr($d,0,3))*5.00/1024.0;
|
|
||||||
$iscurrent= substr($d,3,1);
|
|
||||||
$retval= $voltage; # . " " . $iscurrent;
|
|
||||||
}
|
|
||||||
|
|
||||||
elsif($reading =~ /^io[0-7]$/) {
|
|
||||||
$msg= "d" . substr($reading,2,1);
|
|
||||||
$d = xxLG7000GetData($hash, $msg);
|
|
||||||
return "Read error" if(!defined($d));
|
|
||||||
$state= hex $d;
|
|
||||||
$retval= $state;
|
|
||||||
}
|
|
||||||
|
|
||||||
elsif($reading eq "octet") {
|
|
||||||
$msg= "w";
|
|
||||||
$d = xxLG7000GetData($hash, $msg);
|
|
||||||
return "Read error" if(!defined($d));
|
|
||||||
$state= hex $d;
|
|
||||||
$retval= $state;
|
|
||||||
}
|
|
||||||
|
|
||||||
else { return $u1; }
|
|
||||||
|
|
||||||
$hash->{READINGS}{$reading}{VAL}= $retval;
|
|
||||||
$hash->{READINGS}{$reading}{TIME}= TimeNow();
|
|
||||||
|
|
||||||
return "$name $reading => $retval";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
sub
|
sub
|
||||||
xxLG7000_Write($$)
|
xxLG7000_Write($$)
|
||||||
@@ -293,31 +176,42 @@ xxLG7000_Write($$)
|
|||||||
my $dev = $hash->{DeviceName};
|
my $dev = $hash->{DeviceName};
|
||||||
my $UnitNo=1;
|
my $UnitNo=1;
|
||||||
my $ret;
|
my $ret;
|
||||||
my $retmsg;
|
my $retmsg="error occured";
|
||||||
|
my $myname=$hash->{NAME};
|
||||||
|
|
||||||
|
|
||||||
|
if(defined($attr{$myname}{SetID})) {
|
||||||
|
$UnitNo=$attr{$myname}{SetID};
|
||||||
|
Log $UnitNo==1?5:4, "xxLG7000_Write: Using SetID $UnitNo for $myname.";
|
||||||
|
}
|
||||||
|
|
||||||
my $sendstring=$commands{$msg};
|
my $sendstring=$commands{$msg};
|
||||||
|
|
||||||
if(!defined($sendstring)) {
|
if(!defined($sendstring)) {
|
||||||
return "Unknown command $msg, choose one of " . join(" ", sort keys %commands);
|
return "error unknown command $msg, choose one of " . join(" ", sort keys %commands);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sendstring=sprintf($sendstring, $UnitNo); # FIXME! This needs to become a settable attribut!
|
$sendstring=sprintf($sendstring, $UnitNo);
|
||||||
|
Log 5, "xxLG7000_Write: sending $sendstring";
|
||||||
$ret=xxLG7000GetData($hash, $sendstring);
|
$ret=xxLG7000GetData($hash, $sendstring);
|
||||||
|
if(!defined($ret) || length($ret)<=6) {
|
||||||
Log 3, "xxLG7000_Write: wrote $msg, received $ret";
|
Log 2, "xxLG7000_Write: error, got too short answer ($ret).";
|
||||||
|
|
||||||
$retmsg=sprintf("%s %s", substr($ret, 0, 1), substr($ret, 5));
|
|
||||||
$retmsg=$responses{$retmsg};
|
|
||||||
if(!defined($retmsg)) {
|
|
||||||
if(substr($ret, 5, 2) eq "NG") {
|
|
||||||
$retmsg="error message";
|
|
||||||
Log 3, "xxLG7000_Write: error message: $ret";
|
|
||||||
} else {
|
|
||||||
$retmsg=sprintf("Unknown response %s, help me!");
|
|
||||||
Log 3, "xxLG7000_Write: $retmsg";
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Log 3, "xxLG7000_Write: returns $retmsg";
|
Log 5, "xxLG7000_Write: wrote $msg, received $ret";
|
||||||
|
|
||||||
|
$retmsg=sprintf("%s %s", substr($ret, 0, 1), substr($ret, 5));
|
||||||
|
$retmsg=$responses{$retmsg};
|
||||||
|
if(!defined($retmsg)) {
|
||||||
|
if(substr($ret, 5, 2) eq "NG") {
|
||||||
|
$retmsg="error message";
|
||||||
|
Log 5, "xxLG7000_Write: error message: $ret";
|
||||||
|
} else {
|
||||||
|
Log 2, "xxLG7000_Write: Unknown response $ret, help me!";
|
||||||
|
$retmsg=sprintf("error message_unknown:%s", $ret =~ s/ /_/);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log 5, "xxLG7000_Write: returns $retmsg";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $retmsg;
|
return $retmsg;
|
||||||
|
|||||||
166
FHEM/82_LGTV.pm
166
FHEM/82_LGTV.pm
@@ -5,6 +5,7 @@
|
|||||||
# 80_xxLG7000.pm for a serial connection.
|
# 80_xxLG7000.pm for a serial connection.
|
||||||
#
|
#
|
||||||
# Written by Kai 'wusel' Siering <wusel+fhem@uu.org> around 2010-01-20
|
# Written by Kai 'wusel' Siering <wusel+fhem@uu.org> around 2010-01-20
|
||||||
|
# $Id: 82_LGTV.pm,v 1.2 2010-01-22 09:51:56 painseeker Exp $
|
||||||
#
|
#
|
||||||
# re-using code of 82_M232Voltage.pm
|
# re-using code of 82_M232Voltage.pm
|
||||||
# written by Dr. Boris Neubert 2007-12-24
|
# written by Dr. Boris Neubert 2007-12-24
|
||||||
@@ -35,11 +36,12 @@ my @commandlist = (
|
|||||||
"input HDMI2",
|
"input HDMI2",
|
||||||
"input HDMI3",
|
"input HDMI3",
|
||||||
"input HDMI4",
|
"input HDMI4",
|
||||||
"input DVBT",
|
"input DVB-T",
|
||||||
"input PAL",
|
"input PAL",
|
||||||
"audio mute",
|
"audio mute",
|
||||||
"audio normal",
|
"audio normal",
|
||||||
"selected input"
|
"selected input",
|
||||||
|
"audio state"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -49,11 +51,11 @@ LGTV_Initialize($)
|
|||||||
{
|
{
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
|
|
||||||
# $hash->{GetFn} = "LGTV_Get";
|
$hash->{GetFn} = "LGTV_Get";
|
||||||
$hash->{SetFn} = "LGTV_Set";
|
$hash->{SetFn} = "LGTV_Set";
|
||||||
$hash->{DefFn} = "LGTV_Define";
|
$hash->{DefFn} = "LGTV_Define";
|
||||||
|
|
||||||
$hash->{AttrList} = "dummy:1,0 model:LGTV loglevel:0,1,2,3,4,5";
|
$hash->{AttrList} = "dummy:1,0 model:LGTV loglevel:0,1,2,3,4,5 TIMER:30";
|
||||||
}
|
}
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
@@ -61,13 +63,26 @@ sub
|
|||||||
LGTV_GetStatus($)
|
LGTV_GetStatus($)
|
||||||
{
|
{
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
|
my $numchanged=0;
|
||||||
if(!$hash->{LOCAL}) {
|
|
||||||
InternalTimer(gettimeofday()+60, "LGTV_GetStatus", $hash, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
my @cmdlist;
|
||||||
|
my $retval;
|
||||||
|
|
||||||
|
@cmdlist=("get", "power", "state");
|
||||||
|
|
||||||
|
$retval=LGTV_Set($hash, @cmdlist);
|
||||||
|
|
||||||
|
my ($value, $state)=split(" ", $retval);
|
||||||
|
if($value eq "power" && $state eq "on") {
|
||||||
|
@cmdlist=("get", "selected", "input");
|
||||||
|
|
||||||
|
$retval=LGTV_Set($hash, @cmdlist);
|
||||||
|
}
|
||||||
|
|
||||||
|
InternalTimer(gettimeofday()+$attr{$name}{TIMER}, "LGTV_GetStatus", $hash, 1);
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
my $d = IOWrite($hash, "power state");
|
my $d = IOWrite($hash, "power state");
|
||||||
if(!defined($d)) {
|
if(!defined($d)) {
|
||||||
my $msg = "LGTV $name read error";
|
my $msg = "LGTV $name read error";
|
||||||
@@ -76,27 +91,35 @@ LGTV_GetStatus($)
|
|||||||
}
|
}
|
||||||
my $tn = TimeNow();
|
my $tn = TimeNow();
|
||||||
|
|
||||||
my ($value, $state)=split(" ", $d);
|
# my ($value, $state)=split(" ", $d);
|
||||||
|
|
||||||
if($value eq "power") {
|
|
||||||
$hash->{READINGS}{$value}{TIME} = $tn;
|
|
||||||
$hash->{READINGS}{$value}{VAL} = $state;
|
|
||||||
$hash->{CHANGED}[0]= "$value: $state";
|
|
||||||
$hash->{STATE} = $state;
|
|
||||||
|
|
||||||
if($state eq "on") {
|
if($value eq "power") {
|
||||||
$d = IOWrite($hash, "selected input");
|
if($hash->{READINGS}{$value}{VAL} ne $state) {
|
||||||
if(!defined($d)) {
|
|
||||||
my $msg = "LGTV $name read error";
|
|
||||||
Log GetLogLevel($name,2), $msg;
|
|
||||||
return $msg;
|
|
||||||
}
|
|
||||||
$tn = TimeNow();
|
|
||||||
($value, $state)=split(" ", $d);
|
|
||||||
|
|
||||||
$hash->{READINGS}{$value}{TIME} = $tn;
|
$hash->{READINGS}{$value}{TIME} = $tn;
|
||||||
$hash->{READINGS}{$value}{VAL} = $state;
|
$hash->{READINGS}{$value}{VAL} = $state;
|
||||||
$hash->{CHANGED}[1]= "$value: $state";
|
$hash->{CHANGED}[$numchanged++]= "$value: $state";
|
||||||
|
$hash->{STATE} = $hash->{READINGS}{$value}{VAL};
|
||||||
|
}
|
||||||
|
$hash->{STATE} = $hash->{READINGS}{$value}{VAL};
|
||||||
|
}
|
||||||
|
|
||||||
|
if($state eq "on") {
|
||||||
|
$d = IOWrite($hash, "selected input");
|
||||||
|
if(!defined($d)) {
|
||||||
|
my $msg = "LGTV $name read error";
|
||||||
|
Log GetLogLevel($name,2), $msg;
|
||||||
|
return $msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($value eq "input") { # ... and not e. g. "error" ;)
|
||||||
|
if($hash->{READINGS}{$value}{VAL} ne $state) {
|
||||||
|
$tn = TimeNow();
|
||||||
|
($value, $state)=split(" ", $d);
|
||||||
|
|
||||||
|
$hash->{READINGS}{$value}{TIME} = $tn;
|
||||||
|
$hash->{READINGS}{$value}{VAL} = $state;
|
||||||
|
$hash->{CHANGED}[$numchanged++]= "$value: $state";
|
||||||
|
}
|
||||||
$hash->{STATE} = $hash->{STATE} . ", " . $state;
|
$hash->{STATE} = $hash->{STATE} . ", " . $state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,20 +135,23 @@ LGTV_GetStatus($)
|
|||||||
sub
|
sub
|
||||||
LGTV_Get($@)
|
LGTV_Get($@)
|
||||||
{
|
{
|
||||||
my ($hash, @a) = @_;
|
my ($hash, @a) = @_;
|
||||||
|
my $msg;
|
||||||
|
|
||||||
return "argument is missing" if(int(@a) != 2);
|
return "argument is missing" if(int(@a) != 2);
|
||||||
|
|
||||||
my $msg;
|
if($a[1] eq "power") {
|
||||||
|
$msg="get power state";
|
||||||
if($a[1] ne "status") {
|
} elsif($a[1] eq "input") {
|
||||||
return "unknown get value, valid is status";
|
$msg="get selected input";
|
||||||
}
|
} elsif($a[1] eq "audio") {
|
||||||
$hash->{LOCAL} = 1;
|
$msg="get audio state";
|
||||||
my $v = LGTV_GetStatus($hash);
|
} else {
|
||||||
delete $hash->{LOCAL};
|
return "unknown get value, valid is power, input, audio";
|
||||||
|
}
|
||||||
return "$a[0] $a[1] => $v";
|
my @msgarray=split(" ", $msg);
|
||||||
|
my $v = LGTV_Set($hash, @msgarray);
|
||||||
|
return "$a[0] $v";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -140,16 +166,18 @@ LGTV_Set($@)
|
|||||||
my $i;
|
my $i;
|
||||||
my $known_cmd=0;
|
my $known_cmd=0;
|
||||||
my $what = "";
|
my $what = "";
|
||||||
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
$what=$a[1];
|
$what=$a[1];
|
||||||
if($na>1) {
|
if($na>1) {
|
||||||
for($i=2; $i<$na; $i++) {
|
for($i=2; $i<$na; $i++) {
|
||||||
$what=$what . " " . $a[$i];
|
$what=$what . " " . lc($a[$i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for($i=0; $i<$ncmds; $i++ && $known_cmd==0) {
|
for($i=0; $i<$ncmds; $i++) {
|
||||||
if($commandlist[$i] eq $what) {
|
if(lc($commandlist[$i]) eq $what) {
|
||||||
|
$what=$commandlist[$i];
|
||||||
$known_cmd+=1;
|
$known_cmd+=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -159,35 +187,57 @@ LGTV_Set($@)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ret=IOWrite($hash, $what, "");
|
$ret=IOWrite($hash, $what, "");
|
||||||
|
if(!defined($ret)) {
|
||||||
|
my $msg = "LGTV $name read error";
|
||||||
|
Log GetLogLevel($name,2), $msg;
|
||||||
|
} else {
|
||||||
|
my $tn = TimeNow();
|
||||||
|
my ($value, $state)=split(" ", $ret);
|
||||||
|
# Logic of the following: if no error:
|
||||||
|
# if unset READINGS or difference:
|
||||||
|
# store READINGS
|
||||||
|
# if power-status: update STATE
|
||||||
|
# if input-status: update STATE
|
||||||
|
if($value ne "error") {
|
||||||
|
if(!defined($hash->{READINGS}{$value}{VAL}) || $state ne $hash->{READINGS}{$value}{VAL}) {
|
||||||
|
$hash->{READINGS}{$value}{TIME} = $tn;
|
||||||
|
$hash->{READINGS}{$value}{VAL} = $state;
|
||||||
|
$hash->{CHANGED}[0]= "$value: $state";
|
||||||
|
}
|
||||||
|
if($value eq "power") {
|
||||||
|
$hash->{STATE}=$state;
|
||||||
|
}
|
||||||
|
if($value eq "input") { # implies power being on, usually ...
|
||||||
|
$hash->{STATE}=$hash->{READINGS}{"power"}{VAL} . ", " . $state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DoTrigger($name, undef);
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
sub
|
sub
|
||||||
LGTV_Define($$)
|
LGTV_Define($$)
|
||||||
{
|
{
|
||||||
my ($hash, $def) = @_;
|
my ($hash, $def) = @_;
|
||||||
my @a = split("[ \t][ \t]*", $def);
|
my @a = split("[ \t][ \t]*", $def);
|
||||||
|
my $name = $hash->{NAME};
|
||||||
# return "syntax: define <name> LGTV an0..an5 [unit [factor]]"
|
|
||||||
# if(int(@a) < 3 && int(@a) > 5);
|
|
||||||
#
|
|
||||||
# my $reading= $a[2];
|
|
||||||
# return "$reading is not an analog input, valid: an0..an5"
|
|
||||||
# if($reading !~ /^an[0-5]$/) ;
|
|
||||||
#
|
|
||||||
# my $unit= ((int(@a) > 3) ? $a[3] : "volts");
|
|
||||||
# my $factor= ((int(@a) > 4) ? $a[4] : 1.0);
|
|
||||||
#
|
|
||||||
# $hash->{INPUT}= substr($reading,2);
|
|
||||||
# $hash->{UNIT}= $unit;
|
|
||||||
# $hash->{FACTOR}= $factor;
|
|
||||||
|
|
||||||
AssignIoPort($hash);
|
AssignIoPort($hash);
|
||||||
|
|
||||||
if(!$hash->{LOCAL}) {
|
$attr{$name}{TIMER}=30;
|
||||||
InternalTimer(gettimeofday()+60, "LGTV_GetStatus", $hash, 0);
|
|
||||||
|
InternalTimer(gettimeofday()+$attr{$name}{TIMER}, "LGTV_GetStatus", $hash, 0);
|
||||||
|
|
||||||
|
# Preset if undefined
|
||||||
|
if(!defined($hash->{READINGS}{"power"}{VAL})) {
|
||||||
|
my $tn = TimeNow();
|
||||||
|
$hash->{READINGS}{"power"}{VAL}="unknown";
|
||||||
|
$hash->{READINGS}{"power"}{TIME}=$tn;
|
||||||
}
|
}
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,29 +19,29 @@
|
|||||||
<b>fhem commands</b>
|
<b>fhem commands</b>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
||||||
<a href="#attr">attr</a>
|
<a href="#attr">attr</a>
|
||||||
<a href="#define">define</a>
|
<a href="#define">define</a>
|
||||||
<a href="#delete">delete</a>
|
<a href="#delete">delete</a>
|
||||||
<a href="#deleteattr">deleteattr</a>
|
<a href="#deleteattr">deleteattr</a>
|
||||||
<a href="#get">get</a>
|
<a href="#get">get</a>
|
||||||
<a href="#getstate">getstate</a>
|
<a href="#getstate">getstate</a>
|
||||||
<a href="#help">?,help</a>
|
<a href="#help">?,help</a>
|
||||||
<a href="#include">include</a>
|
<a href="#include">include</a>
|
||||||
<a href="#inform">inform</a>
|
<a href="#inform">inform</a>
|
||||||
<a href="#list">list</a>
|
<a href="#list">list</a>
|
||||||
<a href="#modify">modify</a>
|
<a href="#modify">modify</a>
|
||||||
<a href="#quit">quit</a>
|
<a href="#quit">quit</a>
|
||||||
<a href="#reload">reload</a>
|
<a href="#reload">reload</a>
|
||||||
<a href="#rename">rename</a>
|
<a href="#rename">rename</a>
|
||||||
<a href="#rereadcfg">rereadcfg</a>
|
<a href="#rereadcfg">rereadcfg</a>
|
||||||
<a href="#save">save</a>
|
<a href="#save">save</a>
|
||||||
<a href="#set">set</a>
|
<a href="#set">set</a>
|
||||||
<a href="#setdefaultattr">setdefaultattr</a>
|
<a href="#setdefaultattr">setdefaultattr</a>
|
||||||
<a href="#setstate">setstate</a>
|
<a href="#setstate">setstate</a>
|
||||||
<a href="#shutdown">shutdown</a>
|
<a href="#shutdown">shutdown</a>
|
||||||
<a href="#sleep">sleep</a>
|
<a href="#sleep">sleep</a>
|
||||||
<a href="#trigger">trigger</a>
|
<a href="#trigger">trigger</a>
|
||||||
<a href="#xmllist">xmllist</a>
|
<a href="#xmllist">xmllist</a>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@@ -50,62 +50,62 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<a href="#global">global</a><br>
|
<a href="#global">global</a><br>
|
||||||
|
|
||||||
<a href="#BS">BS</a>
|
<a href="#BS">BS</a>
|
||||||
<a href="#CM11">CM11</a>
|
<a href="#CM11">CM11</a>
|
||||||
<a href="#CUL">CUL</a>
|
<a href="#CUL">CUL</a>
|
||||||
<a href="#CUL_EM">CUL_EM</a>
|
<a href="#CUL_EM">CUL_EM</a>
|
||||||
<a href="#CUL_FHTTK">CUL_FHTTK</a>
|
<a href="#CUL_FHTTK">CUL_FHTTK</a>
|
||||||
<a href="#CUL_WS">CUL_WS</a>
|
<a href="#CUL_WS">CUL_WS</a>
|
||||||
<a href="#CUL_RFR">CUL_RFR</a>
|
<a href="#CUL_RFR">CUL_RFR</a>
|
||||||
<a href="#DbLog">DbLog</a>
|
<a href="#DbLog">DbLog</a>
|
||||||
<a href="#EM">EM</a>
|
<a href="#EM">EM</a>
|
||||||
<a href="#EMEM">EMEM</a>
|
<a href="#EMEM">EMEM</a>
|
||||||
<a href="#EMGZ">EMGZ</a>
|
<a href="#EMGZ">EMGZ</a>
|
||||||
<a href="#EMWZ">EMWZ</a>
|
<a href="#EMWZ">EMWZ</a>
|
||||||
<a href="#FHT">FHT</a>
|
<a href="#FHT">FHT</a>
|
||||||
<a href="#FHZ">FHZ</a>
|
<a href="#FHZ">FHZ</a>
|
||||||
<a href="#FS20">FS20</a>
|
<a href="#FS20">FS20</a>
|
||||||
<a href="#HMS">HMS</a>
|
<a href="#HMS">HMS</a>
|
||||||
<a href="#FHEMWEB">FHEMWEB</a>
|
<a href="#FHEMWEB">FHEMWEB</a>
|
||||||
<a href="#IPWE">IPWE</a>
|
<a href="#IPWE">IPWE</a>
|
||||||
<a href="#KS300">KS300</a>
|
<a href="#KS300">KS300</a>
|
||||||
<a href="#LIRC">LIRC</a>
|
<a href="#LIRC">LIRC</a>
|
||||||
<a href="#M232">M232</a>
|
<a href="#M232">M232</a>
|
||||||
<a href="#M232Counter">M232Counter</a>
|
<a href="#M232Counter">M232Counter</a>
|
||||||
<a href="#M232Voltage">M232Voltage</a>
|
<a href="#M232Voltage">M232Voltage</a>
|
||||||
<a href="#OWFS">OWFS</a>
|
<a href="#OWFS">OWFS</a>
|
||||||
<a href="#OWTEMP">OWTEMP</a>
|
<a href="#OWTEMP">OWTEMP</a>
|
||||||
<a href="#DS18S20">DS18S20</a>
|
<a href="#DS18S20">DS18S20</a>
|
||||||
<a href="#SCIVT">SCIVT</a>
|
<a href="#SCIVT">SCIVT</a>
|
||||||
<a href="#structure">structure</a>
|
<a href="#structure">structure</a>
|
||||||
<a href="#WS2000">WS2000</a>
|
<a href="#WS2000">WS2000</a>
|
||||||
<a href="#WS3600">WS3600</a>
|
<a href="#WS3600">WS3600</a>
|
||||||
<a href="#SISPM">SISPM</a>
|
<a href="#SISPM">SISPM</a>
|
||||||
<a href="#SIS_PMS">SIS_PMS</a>
|
<a href="#SIS_PMS">SIS_PMS</a>
|
||||||
<a href="#WS300">WS300</a>
|
<a href="#WS300">WS300</a>
|
||||||
<a href="#Weather">Weather</a>
|
<a href="#Weather">Weather</a>
|
||||||
<a href="#USF1000">USF1000</a>
|
<a href="#USF1000">USF1000</a>
|
||||||
<a href="#X10">X10</a>
|
<a href="#X10">X10</a>
|
||||||
<a href="#xxLG7000">xxLG7000</a>
|
<a href="#xxLG7000">xxLG7000</a>
|
||||||
<a href="#LGTV">LGTV</a>
|
<a href="#LGTV">LGTV</a>
|
||||||
<a href="#FHEMRENDERER">FHEMRENDERER</a>
|
<a href="#FHEMRENDERER">FHEMRENDERER</a>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<b>Helper modules</b>
|
<b>Helper modules</b>
|
||||||
<ul>
|
<ul>
|
||||||
<a href="#FileLog">FileLog</a>
|
<a href="#FileLog">FileLog</a>
|
||||||
<a href="#PachLog">PachLog</a>
|
<a href="#PachLog">PachLog</a>
|
||||||
<a href="#SUNRISE_EL">SUNRISE_EL</a>
|
<a href="#SUNRISE_EL">SUNRISE_EL</a>
|
||||||
<a href="#at">at</a>
|
<a href="#at">at</a>
|
||||||
<a href="#autocreate">autocreate</a>
|
<a href="#autocreate">autocreate</a>
|
||||||
<a href="#dummy">dummy</a>
|
<a href="#dummy">dummy</a>
|
||||||
<a href="#dumpdef">dumpdef</a>
|
<a href="#dumpdef">dumpdef</a>
|
||||||
<a href="#holiday">holiday</a>
|
<a href="#holiday">holiday</a>
|
||||||
<a href="#notify">notify</a>
|
<a href="#notify">notify</a>
|
||||||
<a href="#watchdog">watchdog</a>
|
<a href="#watchdog">watchdog</a>
|
||||||
<a href="#weblink">weblink</a>
|
<a href="#weblink">weblink</a>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@@ -309,12 +309,6 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
Filter/group devices. Recognized by web-pgm2 and web-pgm3.
|
Filter/group devices. Recognized by web-pgm2 and web-pgm3.
|
||||||
Devices in the room hidden will not appear in the web output.</li>
|
Devices in the room hidden will not appear in the web output.</li>
|
||||||
|
|
||||||
<a name="alias"></a>
|
|
||||||
<li>alias<br>
|
|
||||||
Second name (alias), whished for by Martin. Cannot be used
|
|
||||||
directly in fhem, as "set <aliasname> on" wont be recognized, only
|
|
||||||
"set alias=<aliasname> on"</li>
|
|
||||||
|
|
||||||
<a name="showtime"></a>
|
<a name="showtime"></a>
|
||||||
<li>showtime<br>
|
<li>showtime<br>
|
||||||
Used in the webfrontend pgm2 to show the time of last activity
|
Used in the webfrontend pgm2 to show the time of last activity
|
||||||
@@ -453,13 +447,15 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
<br><br>
|
<br><br>
|
||||||
Output a short space seperated status for <devspec>. It is useful for
|
Output a short space seperated status for <devspec>. It is useful for
|
||||||
monitoring the device in e.g. Cacti.<br>
|
monitoring the device in e.g. Cacti.<br>
|
||||||
Examples:<pre>
|
Examples:
|
||||||
getstate lamp
|
<ul>
|
||||||
|
<pre><code> getstate lamp
|
||||||
state:1
|
state:1
|
||||||
|
|
||||||
getstate fl
|
getstate fl
|
||||||
ack:0 actuator:2 day-temp:21.5 desired-temp:22.5 [...]
|
ack:0 actuator:2 day-temp:21.5 desired-temp:22.5 [...] measured-temp:22.9 [...]
|
||||||
</pre>
|
</code></pre>
|
||||||
|
</ul>
|
||||||
Note: to use this command copy the file contrib/getstate/99_getstate.pm into
|
Note: to use this command copy the file contrib/getstate/99_getstate.pm into
|
||||||
your FHEM directory.
|
your FHEM directory.
|
||||||
<br>
|
<br>
|
||||||
@@ -762,12 +758,11 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
Example:
|
Example:
|
||||||
<pre> fhem> xmllist
|
<pre> fhem> xmllist
|
||||||
<FHZINFO>
|
<FHZINFO>
|
||||||
<internal_LIST>
|
<internal_LIST>
|
||||||
<internal name="global" state="internal"
|
<internal name="global" state="internal" sets="" attrs="room configfile logfile modpath pidfilename port statefile userattr verbose version">
|
||||||
sets="" attrs="room configfile logfile ...">
|
<INT key="DEF" value="<no definition>"/>
|
||||||
<INT key="DEF" value="<no definition>"/>
|
<INT key="NR" value="0"/>
|
||||||
<INT key="NR" value="0"/>
|
<INT key="STATE" value="internal"/>
|
||||||
<INT key="STATE" value="internal"/>
|
|
||||||
[...]
|
[...]
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
@@ -1341,15 +1336,8 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
<ul>
|
<ul>
|
||||||
<li>warnings can contain following strings:
|
<li>warnings can contain following strings:
|
||||||
none, Battery low,Temperature too low, Window open,
|
none, Battery low,Temperature too low, Window open,
|
||||||
Fault on window sensor.<br>
|
Fault on window sensor
|
||||||
In addition, the current warnings are reported separately:
|
</li>
|
||||||
<ul>
|
|
||||||
<li>battery: ok / low</li>
|
|
||||||
<li>lowtemp: ok / low</li>
|
|
||||||
<li>window: open / closed</li>
|
|
||||||
<li>windowsensor: ok / fault</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li>actuator (without a suffix) stands for all actuators.
|
<li>actuator (without a suffix) stands for all actuators.
|
||||||
<li>actuator or actuator1..8 can take following values:
|
<li>actuator or actuator1..8 can take following values:
|
||||||
<ul>
|
<ul>
|
||||||
@@ -1369,9 +1357,9 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
<li>pair<br>
|
<li>pair<br>
|
||||||
The the FHT80b sent a "you-belong-to-me" to this actuator.
|
The the FHT80b sent a "you-belong-to-me" to this actuator.
|
||||||
</ul>
|
</ul>
|
||||||
|
Note:
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
<br>
|
||||||
<br>
|
|
||||||
|
|
||||||
<li>The FHT is very economical (or lazy), it accepts one message from the
|
<li>The FHT is very economical (or lazy), it accepts one message from the
|
||||||
FHZ1x00 every 115+x seconds, where x depends on the housecode. Don't
|
FHZ1x00 every 115+x seconds, where x depends on the housecode. Don't
|
||||||
@@ -2941,18 +2929,31 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
<code>define <name> xxLG7000 <serial-device></code>
|
<code>define <name> xxLG7000 <serial-device></code>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
Defines a serial link to a TV set of LG's xxLG70yy series; these LCD TVs
|
Defines a serial link to a TV set of LG's xxLG70yy (e. g. 47LG7000) series
|
||||||
(as well as their Plasma cousins, xxPG70yy) feature a serial connector which
|
and similar TV sets from <a href="http://www.lge.com/">LG</a>. As of January 2010, the following TV sets should
|
||||||
can officially be used to control the TV set (see your Onwer's Manual, there's
|
be compatible:<br><br>
|
||||||
an Appendix labelled "External Control Device setup"). And, well, xxLG7000 is
|
<ul>
|
||||||
the FHEM module to actually do this. (BTW, they run Linux internally ;))<br><br>
|
<li><code>xxLG7000</code>, e. g. 47LG7000 (tested)</li>
|
||||||
|
<li><code>xxPG7000</code>, e. g. 50PG7000 (same Manual as 47LG7000 ;))</li>
|
||||||
|
<li><code>PS3000/6000/7000/8000 series</code> (according to <a href="http://www.lge.com/uk/products/documents/LGSV09-LR.pdf">LG brochure</a>; no liabilities assumed)</li>
|
||||||
|
<li><code>PQ3000/6000 series</code> (see PS3000)</li>
|
||||||
|
<li><code>LU4000/5000 series</code> (<i>not LU7000</i>; see PS3000)</li>
|
||||||
|
<li><code>LH2000/3000/4000/5000 series</code> (see PS3000)</li>
|
||||||
|
<li><code>SL9500/9000/8000 series</code> (see PS3000)</li>
|
||||||
|
</ul><br>
|
||||||
|
These TV sets feature a serial connector which can officially be used to control
|
||||||
|
the TV set (see your Onwer's Manual, there's an Appendix labelled "External Control
|
||||||
|
Device setup", referening to cabling and command set). The xxLG7000 module is
|
||||||
|
the FHEM module to actually utilize this. (BTW, those TVs run Linux internally ;))<br><br>
|
||||||
|
To exercise control over your TV set, use the <a href="#LGTV">LGTV</a> module and
|
||||||
|
bind it ("attr <LGTV-name> IODev <xxLG7000-name>") to xxLG7000.<br><br>
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
<ul>
|
<ul>
|
||||||
<code>define myLG7k xxLG7000 /dev/ttyUSB1</code><br>
|
<code>define myLG7k xxLG7000 /dev/ttyUSB1</code><br>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="xxLG7000set"></a>
|
<a name="xxLG7000set"></a>
|
||||||
<b>Set </b>
|
<b>Set </b>
|
||||||
@@ -2965,7 +2966,7 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
<b>Attributes</b>
|
<b>Attributes</b>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#loglevel">loglevel</a></li>
|
<li><a href="#loglevel">loglevel</a></li>
|
||||||
<li>SetID (1, 2, ...; see Owner's Manual. Currently, only SetID 1 is addressed, regardless of this setting. Anyone who onws more than one of these?)</li>
|
<li>SetID (1, 2, ...; see your TV's Owner's Manual how to set it. Defaults to 1 if unset.)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -2989,6 +2990,13 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
Defining a LGTV device will schedule an internal task, which periodically reads
|
Defining a LGTV device will schedule an internal task, which periodically reads
|
||||||
the status of the TV set (power state; if power is on, query the selected input)
|
the status of the TV set (power state; if power is on, query the selected input)
|
||||||
and triggers notify/filelog commands.<br><br>
|
and triggers notify/filelog commands.<br><br>
|
||||||
|
|
||||||
|
Example:
|
||||||
|
<ul>
|
||||||
|
<code>define 47LG7000 LGTV</code><br>
|
||||||
|
<code>attr 47LG7000 IODev <a href="#xxLG7000">myLG7k</a></code>
|
||||||
|
</ul>
|
||||||
|
<br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="LGTVset"></a>
|
<a name="LGTVset"></a>
|
||||||
@@ -3000,8 +3008,7 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
given TV set. An error messages should be recorded if e. g. the input in question
|
given TV set. An error messages should be recorded if e. g. the input in question
|
||||||
is not usable.
|
is not usable.
|
||||||
|
|
||||||
<pre>power state
|
<pre>power on
|
||||||
power on
|
|
||||||
power off
|
power off
|
||||||
input AV1
|
input AV1
|
||||||
input AV2
|
input AV2
|
||||||
@@ -3016,16 +3023,20 @@ input HDMI4
|
|||||||
input DVBT
|
input DVBT
|
||||||
input PAL
|
input PAL
|
||||||
audio mute
|
audio mute
|
||||||
audio normal
|
audio normal</pre>
|
||||||
selected input</pre>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="LGTVget"></a>
|
<a name="LGTVget"></a>
|
||||||
<b>Get</b>
|
<b>Get</b>
|
||||||
<ul>
|
<ul>
|
||||||
<!-- <code>get <name> status</code>
|
<code>get <name> <what></code>
|
||||||
<br><br> -->
|
|
||||||
Not yet implemented; use "set name power state" or "set name selected input" for now.
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
Currently, the following commands are defined; not all may be available on a
|
||||||
|
given TV set. An error messages should be recorded if e. g. the input in question
|
||||||
|
is not usable.
|
||||||
|
<pre>power
|
||||||
|
input
|
||||||
|
audio</pre>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<b>Attributes</b>
|
<b>Attributes</b>
|
||||||
@@ -3888,14 +3899,7 @@ Terminating
|
|||||||
|
|
||||||
<b>Attributes</b>
|
<b>Attributes</b>
|
||||||
<ul>
|
<ul>
|
||||||
<a name="fixedrange"></a>
|
<li><a href="#fixedrange">fixedrange</a></li>
|
||||||
<li>fixedrange<br/>
|
|
||||||
Can be applied to weblink devices.<br/>
|
|
||||||
Contains two time specs in the form YYYY-MM-DD separated by a space.
|
|
||||||
In plotmode gnuplot-scroll or SVG the given time-range will be used,
|
|
||||||
and no scrolling for this weblinks will be possible. Needed e.g. for
|
|
||||||
looking at last-years data without scrolling.
|
|
||||||
</li><br> </li> </ul>
|
|
||||||
<li><a href="#plotsize">plotsize</a></li>
|
<li><a href="#plotsize">plotsize</a></li>
|
||||||
<li><a href="#plotmode">plotmode</a></li>
|
<li><a href="#plotmode">plotmode</a></li>
|
||||||
<a name="label">
|
<a name="label">
|
||||||
@@ -3969,19 +3973,6 @@ Terminating
|
|||||||
i.e the default http address is http://localhost:8083/fhem
|
i.e the default http address is http://localhost:8083/fhem
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
<a name="fwmodpath"></a>
|
|
||||||
<li>fwmodpath<br/>
|
|
||||||
Path to the style, png, gplot and html files. Defaults to <a
|
|
||||||
href="#modpath">modpath</a>/FHEM . Used to configure different fhem
|
|
||||||
servers, e.g. one with small gnuplots for android phones and one with
|
|
||||||
SVG for the desktop browser. </li><br>
|
|
||||||
|
|
||||||
<a name="fwcompress"></a>
|
|
||||||
<li>fwcompress<br/>
|
|
||||||
Compress the output with the gzip method if the browser supports it.
|
|
||||||
Defaults to 1. Set it to 0 if you have a slow CPU with a fast
|
|
||||||
connection.</li><br>
|
|
||||||
|
|
||||||
<a name="refresh"></a>
|
<a name="refresh"></a>
|
||||||
<li>refresh<br/>
|
<li>refresh<br/>
|
||||||
If set, a http-equiv="refresh" entry will be genererated with the given
|
If set, a http-equiv="refresh" entry will be genererated with the given
|
||||||
@@ -4022,6 +4013,14 @@ Terminating
|
|||||||
the weblink.
|
the weblink.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
<a name="fixedrange"></a>
|
||||||
|
<li>fixedrange<br/>
|
||||||
|
Can be applied to weblink devices (FHEMWEB).<br/>
|
||||||
|
Contains two time specs in the form YYYY-MM-DD separated by a space.
|
||||||
|
In plotmode gnuplot-scroll or SVG the given time-range will be used,
|
||||||
|
and no scrolling for this weblinks will be possible. Needed e.g. for
|
||||||
|
looking at last-years data without scrolling.
|
||||||
|
</li><br> </li> </ul>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@@ -4053,39 +4052,41 @@ Terminating
|
|||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
Examples:<PRE>
|
Examples:
|
||||||
# absolute ones:
|
<PRE>
|
||||||
define a1 at 17:00:00 set lamp on # fhem command
|
# absolute ones:
|
||||||
define a2 at 17:00:00 { Log 1, "Teatime" } # Perl command
|
define a1 at 17:00:00 set lamp on # fhem command
|
||||||
define a3 at 17:00:00 "/bin/echo "Teatime" > /dev/console" # shell command
|
define a2 at 17:00:00 { Log 1, "Teatime" } # Perl command
|
||||||
define a4 at *17:00:00 set lamp on # every day
|
define a3 at 17:00:00 "/bin/echo "Teatime" > /dev/console" # shell command
|
||||||
|
define a4 at *17:00:00 set lamp on # every day
|
||||||
|
|
||||||
# relative ones
|
# relative ones
|
||||||
define a5 at +00:00:10 set lamp on # lamp on in 10 sec
|
define a5 at +00:00:10 set lamp on # switch the lamp on in 10 seconds
|
||||||
define a6 at +00:00:02 set lamp on-for-timer 1 # Blink once in 2 sec
|
define a6 at +00:00:02 set lamp on-for-timer 1 # Blink once in 2 seconds
|
||||||
define a7 at +*{3}00:00:02 set lamp on-for-timer 1 # Blink 3 times
|
define a7 at +*{3}00:00:02 set lamp on-for-timer 1 # Blink 3 times
|
||||||
|
|
||||||
# Blink 3 times if the piri sends a command
|
# Blink 3 times if the piri sends a command
|
||||||
define n1 notify piri:on.* define a8 at +*{3}00:00:02 set lamp on-for-timer 1
|
define n1 notify piri:on.* define a8 at +*{3}00:00:02 set lamp on-for-timer 1
|
||||||
|
|
||||||
# Switch the lamp on from sunset to 11 PM
|
# Switch the lamp on from sunset to 11 PM
|
||||||
define a9 at +*{sunset_rel()} set lamp on
|
define a9 at +*{sunset_rel()} set lamp on
|
||||||
define a10 at *23:00:00 set lamp off
|
define a10 at *23:00:00 set lamp off
|
||||||
|
|
||||||
# More elegant version, works for sunset > 23:00 too
|
# More elegant version, works for sunset > 23:00 too
|
||||||
define a11 at +*{sunset_rel()} set lamp on-till 23:00
|
define a11 at +*{sunset_rel()} set lamp on-till 23:00
|
||||||
|
|
||||||
# Only do this on weekend
|
# Only do this on weekend
|
||||||
define a12 at +*{sunset_rel()} { fhem("set lamp on-till 23:00") if($we) }
|
define a12 at +*{sunset_rel()} { fhem("set lamp on-till 23:00") if($we) }
|
||||||
|
|
||||||
# Switch lamp1 and lamp2 on from 7:00 till 10 minutes after sunrise
|
# Switch lamp1 and lamp2 on from 7:00 till 10 minutes after sunrise
|
||||||
define a13 at *07:00 set lamp1,lamp2 on-till {sunrise(+600)}
|
define a13 at *07:00 set lamp1,lamp2 on-till {sunrise(+600)}
|
||||||
|
|
||||||
# Switch the lamp off 2 minutes after sunrise each day
|
# Switch the lamp off 2 minutes after sunrise each day
|
||||||
define a14 at +{sunrise(+120)} set lamp on
|
define a14 at +{sunrise(+120)} set lamp on
|
||||||
|
|
||||||
|
# Switch lamp1 on at sunset, not before 18:00 and not after 21:00
|
||||||
|
define a15 at *{sunset(0,"18:00","21:00")} set lamp1 on
|
||||||
|
|
||||||
# Switch lamp1 on at sunset, not before 18:00 and not after 21:00
|
|
||||||
define a15 at *{sunset(0,"18:00","21:00")} set lamp1 on
|
|
||||||
</PRE>
|
</PRE>
|
||||||
|
|
||||||
Notes:<br>
|
Notes:<br>
|
||||||
|
|||||||
Reference in New Issue
Block a user