36_EleroDrive.pm, 36_EMT7110.pm, 36_LaCrosse.pm, 36_Level.pm, 98_CustomReadings.pm: fixed unbalanced tags in commandref part

git-svn-id: https://svn.fhem.de/fhem/trunk@10303 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
hcs-svn 2015-12-29 22:07:01 +00:00
parent 779b68525b
commit 49f36854b0
5 changed files with 84 additions and 50 deletions

View File

@ -229,8 +229,6 @@ EMT7110_Attr(@)
<a name="EMT7110"></a> <a name="EMT7110"></a>
<h3>EMT7110</h3> <h3>EMT7110</h3>
<ul> <ul>
<tr><td>
The EMT7110 is a plug with integrated power meter functionality.<br> The EMT7110 is a plug with integrated power meter functionality.<br>
It can be integrated into FHEM via a <a href="#JeeLink">JeeLink</a> as the IODevice.<br><br> It can be integrated into FHEM via a <a href="#JeeLink">JeeLink</a> as the IODevice.<br><br>
The EMT7110 sends with 9.579 kbit/s. Therefore it is necessary to set the JeeLink to a mode where it recieves this data rate.<br> The EMT7110 sends with 9.579 kbit/s. Therefore it is necessary to set the JeeLink to a mode where it recieves this data rate.<br>

View File

@ -2,7 +2,6 @@
# ToDo-List # ToDo-List
# --------- # ---------
# [ ] Numeric position reading -> percentOpen (0 ... 100)
# [ ] Move to any position, not only top, bottom, intermediate, ... # [ ] Move to any position, not only top, bottom, intermediate, ...
@ -77,16 +76,12 @@ sub EleroDrive_Get($@) {
return undef; return undef;
} }
#======================================================================================= #=======================================================================================
sub EleroDrive_Set($@) { sub EleroDrive_ToFixPosition($$) {
my ( $hash, $name, $cmd, @params ) = @_; my ( $hash, $position) = @_;
my $channel = $hash->{channel};
my $iodev = $hash->{IODev}->{NAME};
my $commands=("stop:noArg moveDown:noArg moveUp:noArg moveIntermediate:noArg moveTilt:noArg refresh:noArg"); my $channel = $hash->{channel};
return $commands if( $cmd eq '?' || $cmd eq ''); ###my $iodev = $hash->{IODev}->{NAME};
my $head = 'aa'; my $head = 'aa';
my $msgLength = '05'; my $msgLength = '05';
@ -97,33 +92,21 @@ sub EleroDrive_Set($@) {
my $secondChannels = ''; my $secondChannels = '';
my $checksum = ''; my $checksum = '';
my $payload = ''; my $payload = '';
my $doRefresh = '0';
if($cmd eq 'refresh'){ if($position eq 'bottom'){
$payload = '0';
IOWrite($hash, "refresh", $channel);
}
elsif($cmd eq 'moveDown'){
$payload = '40'; $payload = '40';
$doRefresh = '1';
} }
elsif($cmd eq 'moveUp'){ elsif($position eq 'top'){
$payload = '20'; $payload = '20';
$doRefresh = '1';
} }
elsif($cmd eq 'stop'){ elsif($position eq 'stop'){
$payload = '10'; $payload = '10';
} }
elsif($cmd eq 'moveIntermediate'){ elsif($position eq 'intermediate'){
$payload = '44'; $payload = '44';
$doRefresh = '1';
} }
elsif($cmd eq 'moveTilt'){ elsif($position eq 'tilt'){
$payload = '24'; $payload = '24';
$doRefresh = '1';
}
else {
return "Unknown argument $cmd, choose one of $commands";
} }
if($payload) { if($payload) {
@ -152,12 +135,67 @@ sub EleroDrive_Set($@) {
###debugLog($name, "EleroDrive_Set->IOWrite: byteMsg=$byteMsg"); ###debugLog($name, "EleroDrive_Set->IOWrite: byteMsg=$byteMsg");
IOWrite($hash, "send", $byteMsg); IOWrite($hash, "send", $byteMsg);
# Start a one time timer that refreshes the position for this drive }
my $refreshDelay = AttrVal($name, "TopToBottomTime", 0);
if($doRefresh && $refreshDelay) { }
InternalTimer(gettimeofday() + $refreshDelay + 2, "EleroDrive_OnRefreshTimer", $hash, 0);
}
#=======================================================================================
sub EleroDrive_ToAnyPosition($$) {
my ( $hash, $position) = @_;
my $name = $hash->{NAME};
###debugLog($name, "ToAnyPosition: $position");
}
#=======================================================================================
sub EleroDrive_Set($@) {
my ( $hash, $name, $cmd, @params ) = @_;
my $channel = $hash->{channel};
my $iodev = $hash->{IODev}->{NAME};
my $commands=("stop:noArg moveDown:noArg moveUp:noArg moveIntermediate:noArg moveTilt:noArg refresh:noArg moveTo");
return $commands if( $cmd eq '?' || $cmd eq '');
my $doRefresh = '0';
if($cmd eq 'refresh'){
IOWrite($hash, "refresh", $channel);
}
elsif($cmd eq 'moveDown'){
EleroDrive_ToFixPosition($hash, "bottom");
$doRefresh = '1';
}
elsif($cmd eq 'moveUp'){
EleroDrive_ToFixPosition($hash, "top");
$doRefresh = '1';
}
elsif($cmd eq 'stop'){
EleroDrive_ToFixPosition($hash, "stop");
}
elsif($cmd eq 'moveIntermediate'){
EleroDrive_ToFixPosition($hash, "intermediate");
$doRefresh = '1';
}
elsif($cmd eq 'moveTilt'){
EleroDrive_ToFixPosition($hash, "tilt");
$doRefresh = '1';
}
elsif($cmd eq 'moveTo' && scalar @params eq 1){
EleroDrive_ToAnyPosition($hash, $params[0]);
$doRefresh = '1';
}
else {
return "Unknown argument $cmd, choose one of $commands";
}
# Start a one time timer that refreshes the position for this drive
my $refreshDelay = AttrVal($name, "TopToBottomTime", 0);
if($doRefresh && $refreshDelay) {
RemoveInternalTimer($hash);
InternalTimer(gettimeofday() + $refreshDelay + 2, "EleroDrive_OnRefreshTimer", $hash, 0);
} }
return undef; return undef;
@ -214,8 +252,8 @@ sub EleroDrive_Parse($$) {
); );
my %percentDefinitions = ('00' => 50, my %percentDefinitions = ('00' => 50,
'01' => 100, '01' => 0,
'02' => 0, '02' => 100,
'03' => 50, '03' => 50,
'04' => 50, '04' => 50,
'05' => -1, '05' => -1,
@ -226,14 +264,14 @@ sub EleroDrive_Parse($$) {
'0a' => -1, '0a' => -1,
'0b' => -1, '0b' => -1,
'0d' => 50, '0d' => 50,
'0e' => 100, '0e' => 0,
'0f' => 0, '0f' => 100,
'10' => -1, '10' => -1,
'11' => -1 '11' => -1
); );
my $newstate = $deviceStati{$statusByte}; my $newstate = $deviceStati{$statusByte};
my $percentOpen = $percentDefinitions{$statusByte}; my $percentClosed = $percentDefinitions{$statusByte};
my $rhash = $modules{EleroDrive}{defptr}{$channel}; my $rhash = $modules{EleroDrive}{defptr}{$channel};
my $rname = $rhash->{NAME}; my $rname = $rhash->{NAME};
@ -244,11 +282,11 @@ sub EleroDrive_Parse($$) {
readingsBeginUpdate($rhash); readingsBeginUpdate($rhash);
readingsBulkUpdate($rhash, "state", $newstate); readingsBulkUpdate($rhash, "state", $newstate);
readingsBulkUpdate($rhash, "position", $newstate); readingsBulkUpdate($rhash, "position", $newstate);
if($percentOpen ne -1) { if($percentClosed ne -1) {
readingsBulkUpdate($rhash, "percentOpen", $percentOpen); readingsBulkUpdate($rhash, "percentClosed", $percentClosed);
} }
readingsEndUpdate($rhash,1); readingsEndUpdate($rhash,1);
my @list; my @list;
push(@list, $rname); push(@list, $rname);
return @list; return @list;
@ -288,7 +326,6 @@ sub EleroDrive_OnRefreshTimer($$) {
<h3>EleroDrive</h3> <h3>EleroDrive</h3>
<ul> <ul>
<tr><td>
This mudule implements an Elero drive. It uses EleroStick as IO-Device. This mudule implements an Elero drive. It uses EleroStick as IO-Device.
<br><br> <br><br>
@ -341,9 +378,9 @@ sub EleroDrive_OnRefreshTimer($$) {
<li>position<br> <li>position<br>
Current position of the drive (top_position, bottom_position, ...)</li> Current position of the drive (top_position, bottom_position, ...)</li>
<li>percentOpen<br> <li>percentClosed<br>
0 ... 100<br> 0 ... 100<br>
0 is completely closed, 100 is completely open</li> 100 is completely closed, 0 is completely open</li>
</ul><br> </ul><br>
</ul> </ul>

View File

@ -544,6 +544,7 @@ sub LaCrosse_Parse($$) {
<a name="LaCrosse"></a> <a name="LaCrosse"></a>
<h3>LaCrosse</h3> <h3>LaCrosse</h3>
<ul> <ul>
FHEM module for LaCrosse Temperature and Humidity sensors and weather stations like WS 1600 (TX22 sensor).<br><br> FHEM module for LaCrosse Temperature and Humidity sensors and weather stations like WS 1600 (TX22 sensor).<br><br>
It can be integrated in to FHEM via a <a href="#JeeLink">JeeLink</a> as the IODevice.<br><br> It can be integrated in to FHEM via a <a href="#JeeLink">JeeLink</a> as the IODevice.<br><br>

View File

@ -206,7 +206,6 @@ Level_Attr(@)
<h3>Level</h3> <h3>Level</h3>
<ul> <ul>
<tr><td>
FHEM module for Level.<br><br> FHEM module for Level.<br><br>
It can be integrated in to FHEM via a <a href="#JeeLink">JeeLink</a> as the IODevice.<br><br> It can be integrated in to FHEM via a <a href="#JeeLink">JeeLink</a> as the IODevice.<br><br>

View File

@ -141,7 +141,7 @@ sub CustomReadings_GetHTML ($)
my @sortedReadings = sort keys %{$hash->{READINGS}}; my @sortedReadings = sort keys %{$hash->{READINGS}};
foreach my $reading (@sortedReadings) { foreach my $reading (@sortedReadings) {
$result .= "<tr>"; $result .= "<tr>";
$result .= "<td>$reading:&nbsp;</td><td>" . ReadingsVal($name, $reading, "???") . "</td>"; $result .= "<td>$reading:&nbsp;</td><td>" . ReadingsVal($name, $reading, "???") . "</td>";
$result .= "</tr>"; $result .= "</tr>";
} }
$result .= "</table>"; $result .= "</table>";
@ -161,7 +161,6 @@ sub CustomReadings_GetHTML ($)
<h3>CustomReadings</h3> <h3>CustomReadings</h3>
<ul> <ul>
<tr><td>
FHEM module to define own readings. FHEM module to define own readings.
<br><br> <br><br>
This module allows to define own readings. The readings can be defined in an attribute so that they can get changed without changing the code of the module.<br> This module allows to define own readings. The readings can be defined in an attribute so that they can get changed without changing the code of the module.<br>
@ -189,7 +188,7 @@ fhem_backup_folder_size:qx(du -ch /opt/fhem/backup | grep total | cut -d 't' -f1
define myReadingsDisplay weblink htmlCode {CustomReadings_GetHTML('myReadings')}<br> define myReadingsDisplay weblink htmlCode {CustomReadings_GetHTML('myReadings')}<br>
attr myReadingsDisplay group Readings<br> attr myReadingsDisplay group Readings<br>
attr myReadingsDisplay room 0-Test<br> attr myReadingsDisplay room 0-Test<br>
</code>
<br> <br>
<u>Resulting readings:</u><br> <u>Resulting readings:</u><br>
@ -198,7 +197,7 @@ attr myReadingsDisplay room 0-Test<br>
<tr> <tr>
<td>ac_powersupply_current</td> <td>ac_powersupply_current</td>
<td>0.236</td> <td>0.236</td>
<td>2014-08-09 15:40:21<td> <td>2014-08-09 15:40:21</td>
</tr> </tr>
<tr> <tr>
<td>ac_powersupply_voltage</td> <td>ac_powersupply_voltage</td>
@ -241,7 +240,7 @@ attr myReadingsDisplay room 0-Test<br>
<td>2014-08-09 15:40:21</td> <td>2014-08-09 15:40:21</td>
</tr> </tr>
</table> </table>
</code>
<br> <br>
<a name="CustomReadings_Define"></a> <a name="CustomReadings_Define"></a>