44_TEK603: ser2net support

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@19936 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
eisler 2019-08-02 15:29:41 +00:00
parent be24006048
commit 52be75b0c2
2 changed files with 31 additions and 15 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- feature: 44_TEK603: ser2net support
- feature: 73_AutoShuttersControl: add new Dev TYPE in %posSetCmds,
remove old commandref text
- bugfix: 73_AutoShuttersControl: fix bug in getShuttersPosCmdValueNegate

View File

@ -65,7 +65,7 @@ sub TEK603_define($$) {
my $msg = '';
if( @a != 3) {
$msg = 'wrong syntax: define <name> TEK603 {none | devicename}';
$msg = 'wrong syntax: define <name> TEK603 {none | devicename | hostname:port}';
Log3 $name, 3, $msg;
return $msg;
}
@ -92,21 +92,25 @@ sub TEK603_doInit($) {
my $dev = $hash->{DeviceName};
my $name = $hash->{NAME};
# Parameter 115200, 8, 1, even, none
$po->reset_error();
$po->baudrate(115200);
$po->databits(8);
$po->stopbits(1);
$po->parity('none');
$po->handshake('none');
$po->dtr_active(1);
$po->rts_active(1);
# Wenn / enthalten ist ist es kein ser2net-Device, daher initialisieren
if ($dev =~ m/\//)
{
# Parameter 115200, 8, 1, even, none
$po->reset_error();
$po->baudrate(115200);
$po->databits(8);
$po->stopbits(1);
$po->parity('none');
$po->handshake('none');
$po->dtr_active(1);
$po->rts_active(1);
if (!$po->write_settings) {
undef $po;
$hash->{STATE} = $name . 'Error on write serial line settings on device ' . $dev;
Log3 $name, 3, $hash->{STATE};
return $hash->{STATE} . "\n";
if (!$po->write_settings) {
undef $po;
$hash->{STATE} = $name . 'Error on write serial line settings on device ' . $dev;
Log3 $name, 3, $hash->{STATE};
return $hash->{STATE} . "\n";
}
}
Log3 $name, 3, "connected to device $dev";
@ -243,6 +247,17 @@ sub TEK603_reconnect($) {
<ul>
<code>define OelTank TEK603 /dev/ttyUSB0</code><br />
</ul>
<br />
<br />
<code>define &lt;name&gt; TEK603 hostnameorip:port</code><br />
<br />
Defines an TEK603 Eco Monitor device via ethernet on a remote host running ser2net.<br /><br />
Examples:
<ul>
<code>define OelTank TEK603 somehost:23000</code><br />
</ul>
</ul><br />
<a name="TEK603_Readings"></a>