mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
- feature: new modules 00_CM11.pm and 20_X10.pm for integration of X10 devices in fhem
- feature: X10 support for pgm3 git-svn-id: https://svn.fhem.de/fhem/trunk@261 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
b3275db23a
commit
7f24599c6a
@ -435,3 +435,7 @@
|
|||||||
- feature: The strange stty settings in 00_FHEM.pm are optional
|
- feature: The strange stty settings in 00_FHEM.pm are optional
|
||||||
- bugfix: webpgm2 iPhone fix
|
- bugfix: webpgm2 iPhone fix
|
||||||
- feature: fullinit and reopen commands for FHZ added (Boris 2008-11-01)
|
- feature: fullinit and reopen commands for FHZ added (Boris 2008-11-01)
|
||||||
|
- bugfix: avoid access to undefined NotifyFn in hash in fhem.pl (Boris 2008-11-01)
|
||||||
|
- feature: new modules 00_CM11.pm and 20_X10.pm for integration of X10
|
||||||
|
devices in fhem (Boris 2008-11-02)
|
||||||
|
- feature: X10 support for pgm3 (Boris 2008-11-02)
|
||||||
|
@ -316,4 +316,9 @@ Fri Jul 25 18:14:26 MEST 2008
|
|||||||
|
|
||||||
- Boris Sat Nov 01 CET 2008
|
- Boris Sat Nov 01 CET 2008
|
||||||
- feature: new commands fullinit and reopen for FHZ, commandref.html update
|
- feature: new commands fullinit and reopen for FHZ, commandref.html update
|
||||||
|
- bugfix: avoid access to undefined NotifyFn in hash in fhem.pl
|
||||||
|
|
||||||
|
- Boris Sun Nov 02 CET 2008
|
||||||
|
- feature: new modules 00_CM11.pm and 20_X10.pm for integration of X10
|
||||||
|
devices in fhem
|
||||||
|
- feature: X10 support for pgm3
|
@ -34,7 +34,7 @@ DbLog_Define($@)
|
|||||||
my ($hash, $def) = @_;
|
my ($hash, $def) = @_;
|
||||||
my @a = split("[ \t][ \t]*", $def);
|
my @a = split("[ \t][ \t]*", $def);
|
||||||
|
|
||||||
return "wrong syntax: define <name> DbLog configuration regexp"
|
return "wrong syntax: define <name> DbLog configuration regexp"
|
||||||
if(int(@a) != 4);
|
if(int(@a) != 4);
|
||||||
|
|
||||||
my $regexp = $a[3];
|
my $regexp = $a[3];
|
||||||
@ -58,7 +58,7 @@ DbLog_Undef($$)
|
|||||||
{
|
{
|
||||||
my ($hash, $name) = @_;
|
my ($hash, $name) = @_;
|
||||||
my $dbh= $hash->{DBH};
|
my $dbh= $hash->{DBH};
|
||||||
$dbh->disconnect() if(defined($dbh));
|
$dbh->disconnect() if(defined($dbh));
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,17 +101,18 @@ DbLog_ParseEvent($$)
|
|||||||
|
|
||||||
|
|
||||||
# EMEM, M232Counter, M232Voltage return plain numbers
|
# EMEM, M232Counter, M232Voltage return plain numbers
|
||||||
if(($type eq "M232Voltage") ||
|
if(($type eq "M232Voltage") ||
|
||||||
($type eq "M232Counter") ||
|
($type eq "M232Counter") ||
|
||||||
($type eq "EMEM")) {
|
($type eq "EMEM")) {
|
||||||
}
|
}
|
||||||
# FS20
|
# FS20
|
||||||
elsif($type eq "FS20") {
|
elsif(($type eq "FS20") ||
|
||||||
|
($type eq "X10")) {
|
||||||
@parts= split(/ /,$value);
|
@parts= split(/ /,$value);
|
||||||
my $reading= $parts[0]; if(!defined($reading)) { $reading= ""; }
|
my $reading= $parts[0]; if(!defined($reading)) { $reading= ""; }
|
||||||
if($#parts>=1) {
|
if($#parts>=1) {
|
||||||
$value= join(" ", shift @parts);
|
$value= join(" ", shift @parts);
|
||||||
if($reading =~ m(^dim*%$)) {
|
if($reading =~ m(^dim*%$)) {
|
||||||
$value= substr($reading,3,length($reading)-4);
|
$value= substr($reading,3,length($reading)-4);
|
||||||
$reading= "dim";
|
$reading= "dim";
|
||||||
$unit= "%";
|
$unit= "%";
|
||||||
@ -121,7 +122,7 @@ DbLog_ParseEvent($$)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# FHT
|
# FHT
|
||||||
elsif($type eq "FHT") {
|
elsif($type eq "FHT") {
|
||||||
if($reading =~ m(-from[12]\ ) || $reading =~ m(-to[12]\ )) {
|
if($reading =~ m(-from[12]\ ) || $reading =~ m(-to[12]\ )) {
|
||||||
@parts= split(/ /,$event);
|
@parts= split(/ /,$event);
|
||||||
@ -131,7 +132,7 @@ DbLog_ParseEvent($$)
|
|||||||
}
|
}
|
||||||
if($reading =~ m(-temp)) { $value=~ s/ \(Celsius\)//; $unit= "°C"; }
|
if($reading =~ m(-temp)) { $value=~ s/ \(Celsius\)//; $unit= "°C"; }
|
||||||
if($reading =~ m(temp-offset)) { $value=~ s/ \(Celsius\)//; $unit= "°C"; }
|
if($reading =~ m(temp-offset)) { $value=~ s/ \(Celsius\)//; $unit= "°C"; }
|
||||||
if($reading =~ m(^actuator[0-9]*)) {
|
if($reading =~ m(^actuator[0-9]*)) {
|
||||||
if($value eq "lime-protection") {
|
if($value eq "lime-protection") {
|
||||||
$reading= "actuator-lime-protection";
|
$reading= "actuator-lime-protection";
|
||||||
undef $value;
|
undef $value;
|
||||||
@ -165,7 +166,7 @@ DbLog_ParseEvent($$)
|
|||||||
undef $value;
|
undef $value;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$value=~ s/%//; $value= $value*1.; $unit= "%";
|
$value=~ s/%//; $value= $value*1.; $unit= "%";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -179,8 +180,8 @@ DbLog_ParseEvent($$)
|
|||||||
if($reading eq "rain") { $value=~ s/ \(l\/m2\)//; $unit= "l/m2"; }
|
if($reading eq "rain") { $value=~ s/ \(l\/m2\)//; $unit= "l/m2"; }
|
||||||
if($reading eq "rain_raw") { $value=~ s/ \(counter\)//; $unit= ""; }
|
if($reading eq "rain_raw") { $value=~ s/ \(counter\)//; $unit= ""; }
|
||||||
if($reading eq "humidity") { $value=~ s/ \(\%\)//; $unit= "%"; }
|
if($reading eq "humidity") { $value=~ s/ \(\%\)//; $unit= "%"; }
|
||||||
if($reading eq "israining") {
|
if($reading eq "israining") {
|
||||||
$value=~ s/ \(yes\/no\)//;
|
$value=~ s/ \(yes\/no\)//;
|
||||||
$value=~ s/no/0/;
|
$value=~ s/no/0/;
|
||||||
$value=~ s/yes/1/;
|
$value=~ s/yes/1/;
|
||||||
}
|
}
|
||||||
@ -190,13 +191,13 @@ DbLog_ParseEvent($$)
|
|||||||
if($event =~ m(T:.*)) { $reading= "data"; $value= $event; }
|
if($event =~ m(T:.*)) { $reading= "data"; $value= $event; }
|
||||||
if($reading eq "temperature") { $value=~ s/ \(Celsius\)//; $unit= "°C"; }
|
if($reading eq "temperature") { $value=~ s/ \(Celsius\)//; $unit= "°C"; }
|
||||||
if($reading eq "humidity") { $value=~ s/ \(\%\)//; $unit= "%"; }
|
if($reading eq "humidity") { $value=~ s/ \(\%\)//; $unit= "%"; }
|
||||||
if($reading eq "battery") {
|
if($reading eq "battery") {
|
||||||
$value=~ s/ok/1/;
|
$value=~ s/ok/1/;
|
||||||
$value=~ s/replaced/1/;
|
$value=~ s/replaced/1/;
|
||||||
$value=~ s/empty/0/;
|
$value=~ s/empty/0/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@result= ($reading,$value,$unit);
|
@result= ($reading,$value,$unit);
|
||||||
return @result;
|
return @result;
|
||||||
@ -209,7 +210,7 @@ DbLog_Log($$)
|
|||||||
{
|
{
|
||||||
# Log is my entry, Dev is the entry of the changed device
|
# Log is my entry, Dev is the entry of the changed device
|
||||||
my ($log, $dev) = @_;
|
my ($log, $dev) = @_;
|
||||||
|
|
||||||
# name and type required for parsing
|
# name and type required for parsing
|
||||||
my $n= $dev->{NAME};
|
my $n= $dev->{NAME};
|
||||||
my $t= $dev->{TYPE};
|
my $t= $dev->{TYPE};
|
||||||
@ -232,10 +233,10 @@ DbLog_Log($$)
|
|||||||
my $reading= $r[0];
|
my $reading= $r[0];
|
||||||
my $value= $r[1];
|
my $value= $r[1];
|
||||||
my $unit= $r[2];
|
my $unit= $r[2];
|
||||||
if(!defined $reading) { $reading= ""; }
|
if(!defined $reading) { $reading= ""; }
|
||||||
if(!defined $value) { $value= ""; }
|
if(!defined $value) { $value= ""; }
|
||||||
if(!defined $unit) { $unit= ""; }
|
if(!defined $unit) { $unit= ""; }
|
||||||
|
|
||||||
|
|
||||||
my $is= "(TIMESTAMP, DEVICE, TYPE, EVENT, READING, VALUE, UNIT) VALUES " .
|
my $is= "(TIMESTAMP, DEVICE, TYPE, EVENT, READING, VALUE, UNIT) VALUES " .
|
||||||
"('$ts', '$n', '$t', '$s', '$reading', '$value', '$unit')";
|
"('$ts', '$n', '$t', '$s', '$reading', '$value', '$unit')";
|
||||||
@ -287,7 +288,7 @@ sub
|
|||||||
DbLog_ExecSQL1($$)
|
DbLog_ExecSQL1($$)
|
||||||
{
|
{
|
||||||
my ($dbh,$sql)= @_;
|
my ($dbh,$sql)= @_;
|
||||||
|
|
||||||
my $sth = $dbh->do($sql);
|
my $sth = $dbh->do($sql);
|
||||||
if(!$sth) {
|
if(!$sth) {
|
||||||
Log 2, "DBLog error: " . $DBI::errstr;
|
Log 2, "DBLog error: " . $DBI::errstr;
|
||||||
@ -300,7 +301,7 @@ sub
|
|||||||
DbLog_ExecSQL($$)
|
DbLog_ExecSQL($$)
|
||||||
{
|
{
|
||||||
my ($hash,$sql)= @_;
|
my ($hash,$sql)= @_;
|
||||||
|
|
||||||
Log 5, "Executing $sql";
|
Log 5, "Executing $sql";
|
||||||
my $dbh= $hash->{DBH};
|
my $dbh= $hash->{DBH};
|
||||||
if(!DbLog_ExecSQL1($dbh,$sql)) {
|
if(!DbLog_ExecSQL1($dbh,$sql)) {
|
||||||
|
4
fhem/docs/X10/README
Normal file
4
fhem/docs/X10/README
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
protocol.txt is taken from the source tar ball of the programm heyu from
|
||||||
|
Daniel B. Suthers.
|
||||||
|
|
||||||
|
|
1024
fhem/docs/X10/protocol.txt
Normal file
1024
fhem/docs/X10/protocol.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -49,11 +49,11 @@ You can use all of the following commands in in two ways:
|
|||||||
A minimal configuration file would look like:
|
A minimal configuration file would look like:
|
||||||
<pre>
|
<pre>
|
||||||
attr global <a href="#logfile">logfile</a> /tmp/fhem.log
|
attr global <a href="#logfile">logfile</a> /tmp/fhem.log
|
||||||
attr global <a href="#statefile">statefile</a> /tmp/fhem.save
|
attr global <a href="#statefile">statefile</a> /tmp/fhem.save
|
||||||
attr global <a href="#verbose">verbose</a> 3
|
attr global <a href="#verbose">verbose</a> 3
|
||||||
attr global <a href="#port">port</a> 7072
|
attr global <a href="#port">port</a> 7072
|
||||||
attr global <a href="#modpath">modpath</a> /usr/local/lib
|
attr global <a href="#modpath">modpath</a> /usr/local/lib
|
||||||
<a href="#define">define</a> FHZ FHZ /dev/tts/USB0
|
<a href="#define">define</a> FHZ FHZ /dev/tts/USB0
|
||||||
|
|
||||||
<a href="#define">define</a> lamp FS20 8765 01</pre>
|
<a href="#define">define</a> lamp FS20 8765 01</pre>
|
||||||
For other configuration files see the examples subdirectory.<br>
|
For other configuration files see the examples subdirectory.<br>
|
||||||
@ -1004,7 +1004,7 @@ fs20usr</pre></li>
|
|||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="IPWE"></a>
|
<a name="IPWE"></a>
|
||||||
<h4>Type IPWE</h4>
|
<h4>Type IPWE</h4>
|
||||||
<ul>
|
<ul>
|
||||||
@ -1013,21 +1013,21 @@ fs20usr</pre></li>
|
|||||||
|
|
||||||
Define a IPWE network attached weather data receiver device sold by ELV. Details see <a
|
Define a IPWE network attached weather data receiver device sold by ELV. Details see <a
|
||||||
href="http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=21508">here</a>.
|
href="http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=21508">here</a>.
|
||||||
It's intended to receive the same sensors as WS300 (8 T/H-Sensors and one kombi sensor),
|
It's intended to receive the same sensors as WS300 (8 T/H-Sensors and one kombi sensor),
|
||||||
but can be accessed via http and telnet.
|
but can be accessed via http and telnet.
|
||||||
<br>
|
<br>
|
||||||
For unknown reason, my try to use the telnet interface was not working neither with raw sockets
|
For unknown reason, my try to use the telnet interface was not working neither with raw sockets
|
||||||
nor with Net::Telnet module. Therefore i choosed here the "easy" way
|
nor with Net::Telnet module. Therefore i choosed here the "easy" way
|
||||||
to simple readout the http page and extract all data from the offered table. For this reason this module doesnt
|
to simple readout the http page and extract all data from the offered table. For this reason this module doesnt
|
||||||
contain any option to configure this device.
|
contain any option to configure this device.
|
||||||
<br><br><b>Note:</b> You should give your sensors a name within the web interface, once they a received the first time.
|
<br><br><b>Note:</b> You should give your sensors a name within the web interface, once they a received the first time.
|
||||||
<br>To extract a single sensor simply match for this name or sensor id<br>
|
<br>To extract a single sensor simply match for this name or sensor id<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>delay</code>: seconds between read accesses(default 300s)</li>
|
<li><code>delay</code>: seconds between read accesses(default 300s)</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
Example:
|
Example:
|
||||||
@ -1039,7 +1039,70 @@ fs20usr</pre></li>
|
|||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<a name="CM11"></a>
|
||||||
|
<h4>Type CM11</h4>
|
||||||
|
<ul>
|
||||||
|
<code>define <name> CM11 <serial-device></code>
|
||||||
|
<br><br>
|
||||||
|
CM11 is the X10 module to interface X10 devices with the PC.<br><br>
|
||||||
|
|
||||||
|
The current implementation can evaluate incoming data on the powerline of
|
||||||
|
any kind. It can send on, off, dimdown and dimup commands.
|
||||||
|
<br><br>
|
||||||
|
This statement specifies the serial port to communicate with the CM11.
|
||||||
|
The name of the serial-device depends on your distribution. If serial-device
|
||||||
|
is none, then no device will be opened, so youcan experiment without
|
||||||
|
hardware attached.<br>
|
||||||
|
|
||||||
|
If you experience problems (for verbose 4 you get a lot of "Bad CRC message"
|
||||||
|
in the log), then try to define your device as <br>
|
||||||
|
<code>define <name> FHZ <serial-device> strangetty</code><br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
Example:
|
||||||
|
<ul>
|
||||||
|
<code>define x10if CM11 /dev/ttyUSB3</code><br>
|
||||||
|
</ul>
|
||||||
|
<br>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<a name="X10"></a>
|
||||||
|
<h4>Type X10</h4>
|
||||||
|
<ul>
|
||||||
|
<code>define <name> X10 <model> <housecode>
|
||||||
|
<unitcode></code>
|
||||||
|
<br><br>
|
||||||
|
|
||||||
|
Defines an X10 device via its model, housecode and unitcode.<br><br>
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
<ul>
|
||||||
|
<li><code><model></code> is one of
|
||||||
|
<ul>
|
||||||
|
<li><code>lm12</code>: lamp module, dimmable</li>
|
||||||
|
<li><code>lm15</code>: lamp module, not dimmable</li>
|
||||||
|
<li><code>am12</code>: appliance module, not dimmable</li>
|
||||||
|
<li><code>tm12</code>: tranceiver module, not dimmable. Its
|
||||||
|
unitcode is 1.</li>
|
||||||
|
</ul>
|
||||||
|
Model determines whether a dim command is reasonable to be sent
|
||||||
|
or not.</li>
|
||||||
|
<li><code><housecode></code> ranges from A to P.</li>
|
||||||
|
<li><code><unitcode></code> ranges from 1 to 16.</li>
|
||||||
|
</ul>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
<ul>
|
||||||
|
<code>define lamp1 X10 lm12 N 10</code><br>
|
||||||
|
<code>define pump X10 am12 B 7</code><br>
|
||||||
|
<code>define lamp2 X10 lm15 N 11</code><br>
|
||||||
|
</ul>
|
||||||
|
</ul>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
<a name="FileLog"></a>
|
<a name="FileLog"></a>
|
||||||
<h4>Type FileLog</h4>
|
<h4>Type FileLog</h4>
|
||||||
<ul>
|
<ul>
|
||||||
@ -1078,23 +1141,23 @@ fs20usr</pre></li>
|
|||||||
<ul>
|
<ul>
|
||||||
<code>define <name> DbLog <configfilename> <regexp></code>
|
<code>define <name> DbLog <configfilename> <regexp></code>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
Log events to a database. The database connection is defined in
|
Log events to a database. The database connection is defined in
|
||||||
<code><configfilename></code> (see sample configuration file
|
<code><configfilename></code> (see sample configuration file
|
||||||
<code>db.conf</code>). The configuration is stored in a separate file
|
<code>db.conf</code>). The configuration is stored in a separate file
|
||||||
to avoid storing the password in the main configuration file and to have it
|
to avoid storing the password in the main configuration file and to have it
|
||||||
visible in the output of the <a href="#list">list</a> command.
|
visible in the output of the <a href="#list">list</a> command.
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
You must have <code>93_DbLog.pm</code> in the <code>FHEM</code> subdirectory
|
You must have <code>93_DbLog.pm</code> in the <code>FHEM</code> subdirectory
|
||||||
to make this work. Additionally, the modules <code>DBI</code> and
|
to make this work. Additionally, the modules <code>DBI</code> and
|
||||||
<code>DBD::<dbtype></code> need to be installed (use
|
<code>DBD::<dbtype></code> need to be installed (use
|
||||||
<code>cpan -i <module></code> if your distribution does not have it).
|
<code>cpan -i <module></code> if your distribution does not have it).
|
||||||
<br><br>
|
<br><br>
|
||||||
<code><regexp></code> is the same as in <a href="#FileLog">FileLog</a>.
|
<code><regexp></code> is the same as in <a href="#FileLog">FileLog</a>.
|
||||||
<br><br>
|
<br><br>
|
||||||
Sample code to create a MySQL database is in <code>fhemdb_create.sql</code>.
|
Sample code to create a MySQL database is in <code>fhemdb_create.sql</code>.
|
||||||
The database contains two tables: <code>current</code> and
|
The database contains two tables: <code>current</code> and
|
||||||
<code>history</code>. The latter contains all events whereas the former only
|
<code>history</code>. The latter contains all events whereas the former only
|
||||||
contains the last event for any given reading and device.
|
contains the last event for any given reading and device.
|
||||||
The columns have the following meaning:
|
The columns have the following meaning:
|
||||||
@ -1102,9 +1165,9 @@ fs20usr</pre></li>
|
|||||||
<li>TIMESTAMP: timestamp of event, e.g. <code>2007-12-30 21:45:22</code></li>
|
<li>TIMESTAMP: timestamp of event, e.g. <code>2007-12-30 21:45:22</code></li>
|
||||||
<li>DEVICE: device name, e.g. <code>Wetterstation</code></li>
|
<li>DEVICE: device name, e.g. <code>Wetterstation</code></li>
|
||||||
<li>TYPE: device type, e.g. <code>KS300</code></li>
|
<li>TYPE: device type, e.g. <code>KS300</code></li>
|
||||||
<li>EVENT: event specification as full string,
|
<li>EVENT: event specification as full string,
|
||||||
e.g. <code>humidity: 71 (%)</code></li>
|
e.g. <code>humidity: 71 (%)</code></li>
|
||||||
<li>READING: name of reading extracted from event,
|
<li>READING: name of reading extracted from event,
|
||||||
e.g. <code>humidity</code></li>
|
e.g. <code>humidity</code></li>
|
||||||
<li>VALUE: actual reading extracted from event,
|
<li>VALUE: actual reading extracted from event,
|
||||||
e.g. <code>71</code></li>
|
e.g. <code>71</code></li>
|
||||||
@ -1114,8 +1177,8 @@ fs20usr</pre></li>
|
|||||||
<code>yes</code> is translated to <code>1</code>.
|
<code>yes</code> is translated to <code>1</code>.
|
||||||
<br><br>
|
<br><br>
|
||||||
The current values can be retrieved by means of the perl script
|
The current values can be retrieved by means of the perl script
|
||||||
<code>fhemdb_get.pl</code>. Its output is adapted to what a
|
<code>fhemdb_get.pl</code>. Its output is adapted to what a
|
||||||
<a href="www.cacti.net">Cacti</a> data input method expects.
|
<a href="www.cacti.net">Cacti</a> data input method expects.
|
||||||
Call <code>fhemdb_get.pl</code> without parameters to see the usage
|
Call <code>fhemdb_get.pl</code> without parameters to see the usage
|
||||||
information.
|
information.
|
||||||
<br><br>
|
<br><br>
|
||||||
@ -1162,7 +1225,7 @@ fs20usr</pre></li>
|
|||||||
# 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
|
||||||
# Copy 99_SUNRISE_EL.pm in the FHEM directory to have sunset_rel()
|
# Copy 99_SUNRISE_EL.pm in the FHEM directory to have sunset_rel()
|
||||||
{ sunrise_coord("8.686", "50.112", "") }
|
{ sunrise_coord("8.686", "50.112", "") }
|
||||||
define a9 at +*{sunset_rel()} set lamp on
|
define a9 at +*{sunset_rel()} set lamp on
|
||||||
@ -1288,7 +1351,7 @@ fs20usr</pre></li>
|
|||||||
<code>%EVENT</code> (same as <code>%</code>), <code>%NAME</code>
|
<code>%EVENT</code> (same as <code>%</code>), <code>%NAME</code>
|
||||||
(same as <code>@</code>) and <code>%TYPE</code> (contains the device
|
(same as <code>@</code>) and <code>%TYPE</code> (contains the device
|
||||||
type, e.g. <code>FHT</code>) can be used. A single <code>%</code>
|
type, e.g. <code>FHT</code>) can be used. A single <code>%</code>
|
||||||
looses its special meaning if any of these parameters appears in the
|
looses its special meaning if any of these parameters appears in the
|
||||||
definition.</li>
|
definition.</li>
|
||||||
|
|
||||||
<li><code><pattern></code> may also be a compound of
|
<li><code><pattern></code> may also be a compound of
|
||||||
@ -1344,7 +1407,7 @@ fs20usr</pre></li>
|
|||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
Define a dummy. A dummy can take via <a href="#set">set</a> any values.
|
Define a dummy. A dummy can take via <a href="#set">set</a> any values.
|
||||||
Used for programming.
|
Used for programming.
|
||||||
Example:
|
Example:
|
||||||
<ul>
|
<ul>
|
||||||
<code>define myvar dummy</code><br>
|
<code>define myvar dummy</code><br>
|
||||||
@ -1480,7 +1543,7 @@ fs20usr</pre></li>
|
|||||||
<code>list</code> statement for the device).
|
<code>list</code> statement for the device).
|
||||||
<br><br>
|
<br><br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="WS2000get"></a>
|
<a name="WS2000get"></a>
|
||||||
<h4>Type WS2000:</h4>
|
<h4>Type WS2000:</h4>
|
||||||
<ul>
|
<ul>
|
||||||
@ -1495,8 +1558,8 @@ fs20usr</pre></li>
|
|||||||
<code>RAW</code>: original Data from interface
|
<code>RAW</code>: original Data from interface
|
||||||
<br><br>
|
<br><br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<a name="IPWEget"></a>
|
<a name="IPWEget"></a>
|
||||||
<h4>Type IPWE</h4>
|
<h4>Type IPWE</h4>
|
||||||
<ul>
|
<ul>
|
||||||
@ -1693,7 +1756,7 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
|
|||||||
<ul>
|
<ul>
|
||||||
<code>modify <name> <type-dependent-options></code>
|
<code>modify <name> <type-dependent-options></code>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
Used to modify some definitions. Useful for changing some <a
|
Used to modify some definitions. Useful for changing some <a
|
||||||
href="#at">at</a> or <a href="#notify">notify</a> definitions. If specifying
|
href="#at">at</a> or <a href="#notify">notify</a> definitions. If specifying
|
||||||
one argument to an at type deinition, only the time part will be changed. In
|
one argument to an at type deinition, only the time part will be changed. In
|
||||||
@ -1757,7 +1820,7 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
|
|||||||
<ul>
|
<ul>
|
||||||
<code>save [<configfile>]</code>
|
<code>save [<configfile>]</code>
|
||||||
<br><br>
|
<br><br>
|
||||||
Save first the <a href="#statefile">statefile</a>, then the
|
Save first the <a href="#statefile">statefile</a>, then the
|
||||||
<a href="#configfile">configfile</a> information. If a parameter is specified,
|
<a href="#configfile">configfile</a> information. If a parameter is specified,
|
||||||
it will be used instead the global configfile attribute.<br><br>
|
it will be used instead the global configfile attribute.<br><br>
|
||||||
Notes:
|
Notes:
|
||||||
@ -1792,7 +1855,9 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
|
|||||||
time
|
time
|
||||||
FHTcode
|
FHTcode
|
||||||
activefor
|
activefor
|
||||||
raw</pre>
|
raw
|
||||||
|
initfull
|
||||||
|
reopen</pre>
|
||||||
Notes:
|
Notes:
|
||||||
<ul>
|
<ul>
|
||||||
<li>use activefor if you have multiple FHZ devices, and you want to
|
<li>use activefor if you have multiple FHZ devices, and you want to
|
||||||
@ -1810,6 +1875,26 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
|
|||||||
central FHT code, which is used by the FHT devices. After changing
|
central FHT code, which is used by the FHT devices. After changing
|
||||||
it, you <b>must</b> reprogram each FHT80b with: PROG (until Sond
|
it, you <b>must</b> reprogram each FHT80b with: PROG (until Sond
|
||||||
appears), then select CEnt, Prog, Select nA.</li>
|
appears), then select CEnt, Prog, Select nA.</li>
|
||||||
|
<li>If the FHT ceases to work for FHT devices whereas other devices
|
||||||
|
(e.g. HMS, KS300) continue to work, a<ul>
|
||||||
|
<code>set FHZ initfull</code></ul> command could help. Try<ul>
|
||||||
|
<code>set FHZ reopen</code></ul> if the FHZ
|
||||||
|
ceases to work completely. If all else fails, shutdown fhem, unplug
|
||||||
|
and replug the FHZ device. Problems with FHZ may also be related to
|
||||||
|
long USB cables or insufficient power on the USB - use a powered hub
|
||||||
|
to avoid such issues.</li>
|
||||||
|
<li><code>initfull</code> issues the initialization sequence for the FHZ
|
||||||
|
device:<br>
|
||||||
|
<pre>
|
||||||
|
get FHZ init2
|
||||||
|
get FHZ serial
|
||||||
|
set FHZ initHMS
|
||||||
|
set FHZ initFS20
|
||||||
|
set FHZ time
|
||||||
|
set FHZ raw 04 01010100010000</pre></li>
|
||||||
|
<li><code>reopen</code> closes and reopens the serial device port. This
|
||||||
|
implicitely initializes the FHZ and issues the
|
||||||
|
<code>initfull</code> command sequence.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -1830,7 +1915,7 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
|
|||||||
off-for-timer
|
off-for-timer
|
||||||
on # dimmer: set to value before switching it off
|
on # dimmer: set to value before switching it off
|
||||||
on-for-timer # see the note
|
on-for-timer # see the note
|
||||||
on-old-for-timer # set to previous (before switching it on)
|
on-old-for-timer # set to previous (before switching it on)
|
||||||
ramp-on-time # time to reach the desired dim value on dimmers
|
ramp-on-time # time to reach the desired dim value on dimmers
|
||||||
ramp-off-time # time to reach the off state on dimmers
|
ramp-off-time # time to reach the off state on dimmers
|
||||||
reset
|
reset
|
||||||
@ -1873,7 +1958,8 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
|
|||||||
the program automatically schedules a "setstate off" for the
|
the program automatically schedules a "setstate off" for the
|
||||||
specified time.</li>
|
specified time.</li>
|
||||||
<li>on-till requires an absolute time in the "at" format (HH:MM:SS, HH:MM
|
<li>on-till requires an absolute time in the "at" format (HH:MM:SS, HH:MM
|
||||||
or {<perl-code>}, where the perl-code returns a time specification).
|
or { <perl code> }, where the perl-code returns a time
|
||||||
|
specification).
|
||||||
If the current time is greater then the specified time, then the
|
If the current time is greater then the specified time, then the
|
||||||
command is ignored, else an "on" command is generated, and for the
|
command is ignored, else an "on" command is generated, and for the
|
||||||
given "till-time" an off command is scheduleld via the at command.
|
given "till-time" an off command is scheduleld via the at command.
|
||||||
@ -1892,7 +1978,7 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
|
|||||||
desired-temp
|
desired-temp
|
||||||
day-temp night-temp
|
day-temp night-temp
|
||||||
report1 report2
|
report1 report2
|
||||||
mode
|
mode
|
||||||
holiday1 holiday2 # Not verified
|
holiday1 holiday2 # Not verified
|
||||||
manu-temp # No clue what it does.
|
manu-temp # No clue what it does.
|
||||||
year month day hour minute
|
year month day hour minute
|
||||||
@ -1941,7 +2027,7 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
|
|||||||
<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:
|
Note:
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@ -2004,7 +2090,7 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
|
|||||||
|
|
||||||
<li><code>report2</code> with parameter 255 requests the following
|
<li><code>report2</code> with parameter 255 requests the following
|
||||||
settings to be reported: day-temp night-temp windowopen-temp
|
settings to be reported: day-temp night-temp windowopen-temp
|
||||||
lowtemp-offset desired-temp measured-temp mode warnings.
|
lowtemp-offset desired-temp measured-temp mode warnings.
|
||||||
The argument is (more or less) a bitfield, to request unique values
|
The argument is (more or less) a bitfield, to request unique values
|
||||||
add up the following:
|
add up the following:
|
||||||
<ul>
|
<ul>
|
||||||
@ -2084,7 +2170,7 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
|
|||||||
<br><br>
|
<br><br>
|
||||||
Sets the state of all digital ports at once, value is 0..255.
|
Sets the state of all digital ports at once, value is 0..255.
|
||||||
<br><br>
|
<br><br>
|
||||||
<code>set <name> [io0..io7] 0|1</code>
|
<code>set <name> io0..io7 0|1</code>
|
||||||
<br><br>
|
<br><br>
|
||||||
Turns digital port 0..7 off or on.
|
Turns digital port 0..7 off or on.
|
||||||
<br><br>
|
<br><br>
|
||||||
@ -2099,6 +2185,57 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
|
|||||||
<br><br>
|
<br><br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<a name="X10set"></a>
|
||||||
|
<h4>Type X10:</h4>
|
||||||
|
<ul>
|
||||||
|
<code>set <name> <value> [<argument>]</code>
|
||||||
|
<br><br>
|
||||||
|
where <code>value</code> is one of:<br>
|
||||||
|
<pre>
|
||||||
|
dimdown # requires argument, see the note
|
||||||
|
dimup # requires argument, see the note
|
||||||
|
off
|
||||||
|
on
|
||||||
|
on-till # Special, see the note
|
||||||
|
</pre>
|
||||||
|
Examples:
|
||||||
|
<ul>
|
||||||
|
<code>set lamp1 dimup 10</code><br>
|
||||||
|
<code>set lamp1,lamp2 off</code><br>
|
||||||
|
<code>set pump off</code><br>
|
||||||
|
<code>set lamp2 on-till 19:59</code><br>
|
||||||
|
</ul>
|
||||||
|
<br>
|
||||||
|
Notes:
|
||||||
|
<ul>
|
||||||
|
<li>Only switching and dimming are supported by now.</li>
|
||||||
|
<li>Dimming is valid only for a dimmable device as specified by
|
||||||
|
the <code>model</code> argument in its <code>define</code>
|
||||||
|
statement.
|
||||||
|
<li>An X10 device has 210 discrete brightness levels. If you use a
|
||||||
|
X10 sender, e.g. a remote control or a wall switch to dim, a
|
||||||
|
brightness step is 100%/210.</li>
|
||||||
|
<li><code>dimdown</code> and <code>dimup</code> take a number in the
|
||||||
|
range from 0 to 22 as argument. It is assumed that argument 1 is
|
||||||
|
a 1% brightness change (microdim) and arguments 2 to 22 are
|
||||||
|
10%..100% brightness changes. The meaning of argument 0 is
|
||||||
|
unclear.</li>
|
||||||
|
<li>This currently leads to some confusion in the logs as the
|
||||||
|
<code>dimdown</code> and <code>dimup</code> codes are logged with
|
||||||
|
different meaning of the arguments depending on whether the commands
|
||||||
|
were sent from the PC or from a remote control or a wall switch.</li>
|
||||||
|
<li><code>dimdown</code> and <code>dimup</code> from on and off states may
|
||||||
|
have unexpected results. This seems to be a feature of the X10
|
||||||
|
devices.</li>
|
||||||
|
<li><code>on-till</code> requires an absolute time in the "at" format
|
||||||
|
(HH:MM:SS, HH:MM) or { <perl code> }, where the perl code
|
||||||
|
returns a time specification).
|
||||||
|
If the current time is greater then the specified time, then the
|
||||||
|
command is ignored, else an "on" command is generated, and for the
|
||||||
|
given "till-time" an off command is scheduleld via the at command.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</ul>
|
||||||
<a name="FileLogset"></a>
|
<a name="FileLogset"></a>
|
||||||
<h4>Type FileLog:</h4>
|
<h4>Type FileLog:</h4>
|
||||||
<ul>
|
<ul>
|
||||||
@ -2214,12 +2351,12 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
|
|||||||
<h3>Device specification</h3>
|
<h3>Device specification</h3>
|
||||||
<ul>
|
<ul>
|
||||||
The commands
|
The commands
|
||||||
<a href="#attr">attr</a>,
|
<a href="#attr">attr</a>,
|
||||||
<a href="#deleteattr">deleteattr</a>,
|
<a href="#deleteattr">deleteattr</a>,
|
||||||
<a href="#delete">delete</a>,
|
<a href="#delete">delete</a>,
|
||||||
<a href="#get">get</a>,
|
<a href="#get">get</a>,
|
||||||
<a href="#list">list</a>,
|
<a href="#list">list</a>,
|
||||||
<a href="#set">set</a>,
|
<a href="#set">set</a>,
|
||||||
<a href="#setstate">setstate</a>,
|
<a href="#setstate">setstate</a>,
|
||||||
<a href="#trigger">trigger</a>
|
<a href="#trigger">trigger</a>
|
||||||
can take a more complex device specification as argument,
|
can take a more complex device specification as argument,
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<h1>FHEM</h1>
|
<h1>FHEM</h1>
|
||||||
GPL'd server to access devices like FHZ1000/FHZ1300,EM1010PC,WS300,SCIVT.
|
GPL'd server to access devices like FHZ1000/FHZ1300,EM1010PC,WS300,SCIVT,X10.
|
||||||
Formerly known as fhz1000.pl
|
Formerly known as fhz1000.pl
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
Current Version: (as of =DATE=) is <a
|
Current Version: (as of =DATE=) is <a
|
||||||
@ -22,7 +22,8 @@ href="#webfrontends"/>webfrontends</a> section for screenshots.
|
|||||||
<h2>Description</h2>
|
<h2>Description</h2>
|
||||||
<ul>
|
<ul>
|
||||||
This program makes the FHZ1000/FHZ1300/WS300 and other USB devices sold by ELV,
|
This program makes the FHZ1000/FHZ1300/WS300 and other USB devices sold by ELV,
|
||||||
Conrad and others useable with Linux. In fact, there is nothing Linux special
|
Conrad and others as well as X10 devices sold by Marmitek, Powerhouse and
|
||||||
|
others useable with Linux. In fact, there is nothing Linux special
|
||||||
in it, there are reports from OS X and Windows. You should be able to use it on
|
in it, there are reports from OS X and Windows. You should be able to use it on
|
||||||
other platforms as long as you can access the hardware as a serial device.<br>
|
other platforms as long as you can access the hardware as a serial device.<br>
|
||||||
The program runs as a server, you can control it via telnet, command line
|
The program runs as a server, you can control it via telnet, command line
|
||||||
@ -32,17 +33,25 @@ Currently implemented features:<br>
|
|||||||
<ul>
|
<ul>
|
||||||
<li>Via the FHZ module (with access to one or more FHZ1000/FHZ1300 device):
|
<li>Via the FHZ module (with access to one or more FHZ1000/FHZ1300 device):
|
||||||
<ul>
|
<ul>
|
||||||
<li>reading and sending FS20 events (on/off/dimming, timer commands)<br>
|
<li>reading and sending FS20 events (on/off/dimming, timer
|
||||||
<li>support of FS20 address features function group, local and global master
|
commands)</li>
|
||||||
|
<li>support of FS20 address features function group, local and global
|
||||||
|
master</li>
|
||||||
<li>reading and changing FHT80b parameters (temp, actuator, etc).<br>
|
<li>reading and changing FHT80b parameters (temp, actuator, etc).<br>
|
||||||
The FHT8b seems to work too. <b>Note:</b> the FHT8 wont work.<br>
|
The FHT8b seems to work too. Note: the FHT8 wont work.<br>
|
||||||
Internal software buffer to prevent lost commands.<br>
|
Internal software buffer to prevent lost commands.</li>
|
||||||
</li>
|
|
||||||
<li>reading HMS data (HMS100-T,-TF,-WD,-MG,-TFK,-CO,-FIT and RM100-2)</li>
|
<li>reading HMS data (HMS100-T,-TF,-WD,-MG,-TFK,-CO,-FIT and RM100-2)</li>
|
||||||
<li>reading KS300 data</li>
|
<li>reading KS300 data</li>
|
||||||
</ul>
|
</ul>
|
||||||
<b>Note:</b>The FHZ1350 WLAN is probably not working due to a prorietary
|
Note: The FHZ1350 WLAN is probably not working due to a prorietary
|
||||||
encryption.
|
encryption.
|
||||||
|
</li>
|
||||||
|
<li>Via the CM11 module (with access to a X10 computer interface):
|
||||||
|
<ul>
|
||||||
|
<li>reading all X10 events</li>
|
||||||
|
<li>sending X10 events (on/off/dimming)</li>
|
||||||
|
<li>on/off switching suppport</li>
|
||||||
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>reading WS300 data, and up to 9 attached devices</li>
|
<li>reading WS300 data, and up to 9 attached devices</li>
|
||||||
<li>reading EM1000WZ/EM1000EM/EM1000GZ data via an attached EM1010PC</li>
|
<li>reading EM1000WZ/EM1000EM/EM1000GZ data via an attached EM1010PC</li>
|
||||||
@ -130,7 +139,7 @@ and <a href="faq.html">faq.html</a> for more documentation.
|
|||||||
<h3>Server installation on Unix</h3>
|
<h3>Server installation on Unix</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Check the Makefile for the installation path, then type make install.</li>
|
<li>Check the Makefile for the installation path, then type make install.</li>
|
||||||
<li>Create a configuration file (see the examples directory or
|
<li>Create a configuration file (see the examples directory or
|
||||||
docs/commandref.html).</li>
|
docs/commandref.html).</li>
|
||||||
<li>Start the server with <code>fhem.pl <configfile></code></li>
|
<li>Start the server with <code>fhem.pl <configfile></code></li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -141,7 +150,7 @@ If you are using cygwin for your perl installation you can follow the guidelines
|
|||||||
<li>Be sure you have perl.exe in your path (%PATH%)</li>
|
<li>Be sure you have perl.exe in your path (%PATH%)</li>
|
||||||
<li>Make sure that you can access the serial USB device via virtual COM-Port
|
<li>Make sure that you can access the serial USB device via virtual COM-Port
|
||||||
or via socket(e.g. <code>COMX or xport:10001</code>).</li>
|
or via socket(e.g. <code>COMX or xport:10001</code>).</li>
|
||||||
<li>Create a configuration file (see the examples directory and
|
<li>Create a configuration file (see the examples directory and
|
||||||
docs/commandref.html)</li>
|
docs/commandref.html)</li>
|
||||||
<li>Start the server with <code>fhem.pl <configfile></code></li>
|
<li>Start the server with <code>fhem.pl <configfile></code></li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -179,7 +188,7 @@ If you are using cygwin for your perl installation you can follow the guidelines
|
|||||||
<h3>Web frontend 3 (webfrontend/pgm3)</h3>
|
<h3>Web frontend 3 (webfrontend/pgm3)</h3>
|
||||||
<ul>
|
<ul>
|
||||||
This frontend is PHP based and was contributed by Martin Haas.
|
This frontend is PHP based and was contributed by Martin Haas.
|
||||||
Look at the webfrontends/pgm3/docs for more documentation or at
|
Look at the webfrontends/pgm3/docs for more documentation or at
|
||||||
<a href="pgm3-0.5.1.png">this screenshot</a>. A lot more details can be
|
<a href="pgm3-0.5.1.png">this screenshot</a>. A lot more details can be
|
||||||
found on Martins page: <a href="http://www.martin-haas.de/fhz">
|
found on Martins page: <a href="http://www.martin-haas.de/fhz">
|
||||||
http://www.martin-haas.de/fhz</a>
|
http://www.martin-haas.de/fhz</a>
|
||||||
|
@ -334,7 +334,7 @@ xml_parser_free($xml_parser);
|
|||||||
if ($showroombuttons==1)
|
if ($showroombuttons==1)
|
||||||
for($i=0; $i < count($stack[0][children]); $i++)
|
for($i=0; $i < count($stack[0][children]); $i++)
|
||||||
{
|
{
|
||||||
if (substr($stack[0][children][$i][name],0,5)=='FS20_')
|
if ( (substr($stack[0][children][$i][name],0,5)=='FS20_') || (substr($stack[0][children][$i][name],0,4)=='X10_'))
|
||||||
{
|
{
|
||||||
for($j=0; $j < count($stack[0][children][$i][children]); $j++)
|
for($j=0; $j < count($stack[0][children][$i][children]); $j++)
|
||||||
{
|
{
|
||||||
@ -599,7 +599,7 @@ xml_parser_free($xml_parser);
|
|||||||
for($i=0; $i < count($stack[0][children]); $i++)
|
for($i=0; $i < count($stack[0][children]); $i++)
|
||||||
{
|
{
|
||||||
############################
|
############################
|
||||||
if (substr($stack[0][children][$i][name],0,5)=='FS20_')
|
if ((substr($stack[0][children][$i][name],0,5)=='FS20_')||(substr($stack[0][children][$i][name],0,4)=='X10_'))
|
||||||
{
|
{
|
||||||
$type=$stack[0][children][$i][name];
|
$type=$stack[0][children][$i][name];
|
||||||
echo "<tr><td $bg1 colspan=4><font $fontcolor1>";
|
echo "<tr><td $bg1 colspan=4><font $fontcolor1>";
|
||||||
|
Loading…
Reference in New Issue
Block a user