2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 00:36:25 +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:
borisneubert 2008-11-02 18:04:33 +00:00
parent b3275db23a
commit 7f24599c6a
8 changed files with 1255 additions and 71 deletions

View File

@ -435,3 +435,7 @@
- feature: The strange stty settings in 00_FHEM.pm are optional
- bugfix: webpgm2 iPhone fix
- 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)

View File

@ -316,4 +316,9 @@ Fri Jul 25 18:14:26 MEST 2008
- Boris Sat Nov 01 CET 2008
- 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

View File

@ -106,7 +106,8 @@ DbLog_ParseEvent($$)
($type eq "EMEM")) {
}
# FS20
elsif($type eq "FS20") {
elsif(($type eq "FS20") ||
($type eq "X10")) {
@parts= split(/ /,$value);
my $reading= $parts[0]; if(!defined($reading)) { $reading= ""; }
if($#parts>=1) {

4
fhem/docs/X10/README Normal file
View 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

File diff suppressed because it is too large Load Diff

View File

@ -1040,6 +1040,69 @@ fs20usr</pre></li>
<br>
</ul>
<a name="CM11"></a>
<h4>Type CM11</h4>
<ul>
<code>define &lt;name&gt; CM11 &lt;serial-device&gt;</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 &lt;name&gt; FHZ &lt;serial-device&gt; 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 &lt;name&gt; X10 &lt;model&gt; &lt;housecode&gt;
&lt;unitcode&gt;</code>
<br><br>
Defines an X10 device via its model, housecode and unitcode.<br><br>
Notes:
<ul>
<li><code>&lt;model&gt;</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>&lt;housecode&gt;</code> ranges from A to P.</li>
<li><code>&lt;unitcode&gt;</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>
<h4>Type FileLog</h4>
<ul>
@ -1792,7 +1855,9 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
time
FHTcode
activefor
raw</pre>
raw
initfull
reopen</pre>
Notes:
<ul>
<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
it, you <b>must</b> reprogram each FHT80b with: PROG (until Sond
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>
@ -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
specified time.</li>
<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 { &lt;perl code&gt; }, 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.
@ -2084,7 +2170,7 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
<br><br>
Sets the state of all digital ports at once, value is 0..255.
<br><br>
<code>set &lt;name&gt; [io0..io7] 0|1</code>
<code>set &lt;name&gt; io0..io7 0|1</code>
<br><br>
Turns digital port 0..7 off or on.
<br><br>
@ -2099,6 +2185,57 @@ Send buffer:<br/> 2007-10-19 00:31:24 desired-temp 22.5
<br><br>
</ul>
<a name="X10set"></a>
<h4>Type X10:</h4>
<ul>
<code>set &lt;name&gt; &lt;value&gt; [&lt;argument&gt]</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 { &lt;perl code&gt; }, 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>
<h4>Type FileLog:</h4>
<ul>

View File

@ -10,7 +10,7 @@
<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
<br/><br/>
Current Version: (as of =DATE=) is <a
@ -22,7 +22,8 @@ href="#webfrontends"/>webfrontends</a> section for screenshots.
<h2>Description</h2>
<ul>
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
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
@ -32,18 +33,26 @@ Currently implemented features:<br>
<ul>
<li>Via the FHZ module (with access to one or more FHZ1000/FHZ1300 device):
<ul>
<li>reading and sending FS20 events (on/off/dimming, timer commands)<br>
<li>support of FS20 address features function group, local and global master
<li>reading and sending FS20 events (on/off/dimming, timer
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>
The FHT8b seems to work too. <b>Note:</b> the FHT8 wont work.<br>
Internal software buffer to prevent lost commands.<br>
</li>
The FHT8b seems to work too. Note: the FHT8 wont work.<br>
Internal software buffer to prevent lost commands.</li>
<li>reading HMS data (HMS100-T,-TF,-WD,-MG,-TFK,-CO,-FIT and RM100-2)</li>
<li>reading KS300 data</li>
</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.
</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>reading WS300 data, and up to 9 attached devices</li>
<li>reading EM1000WZ/EM1000EM/EM1000GZ data via an attached EM1010PC</li>
<li>reading attached SCIVT devices</li>

View File

@ -334,7 +334,7 @@ xml_parser_free($xml_parser);
if ($showroombuttons==1)
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++)
{
@ -599,7 +599,7 @@ xml_parser_free($xml_parser);
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];
echo "<tr><td $bg1 colspan=4><font $fontcolor1>";