diff --git a/fhem/CHANGED b/fhem/CHANGED
index 9ff6efb66..ec2c1e437 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -580,3 +580,5 @@
- =DATE= (5.0)
- feature: KM271: Read only
- bugfix: 99_SUNRISE_EL endless loop bug
+ - feature: CUL: optional baudrate spec in definition
+
diff --git a/fhem/FHEM/00_CUL.pm b/fhem/FHEM/00_CUL.pm
index 748f53af3..711bb7c95 100755
--- a/fhem/FHEM/00_CUL.pm
+++ b/fhem/FHEM/00_CUL.pm
@@ -929,6 +929,10 @@ CUL_OpenDev($$)
$selectlist{"$name.$dev"} = $hash;
} else { # USB Device
+
+ my $baudrate;
+ ($dev, $baudrate) = split("@", $dev);
+
if ($^O=~/Win/) {
require Win32::SerialPort;
$po = new Win32::SerialPort ($dev);
@@ -952,6 +956,17 @@ CUL_OpenDev($$)
delete($readyfnlist{"$name.$dev"});
$selectlist{"$name.$dev"} = $hash;
}
+
+ if($baudrate) {
+ $po->reset_error();
+ Log 3, "$name: Setting baudrate to $baudrate";
+ $po->baudrate($baudrate);
+ $po->databits(8);
+ $po->parity('none');
+ $po->stopbits(1);
+ $po->handshake('none');
+ }
+
}
if($reopen) {
diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html
index f78f2fb41..a68c95184 100644
--- a/fhem/docs/commandref.html
+++ b/fhem/docs/commandref.html
@@ -1700,13 +1700,16 @@ A line ending with \ will be concatenated with the next one, so long lines
define <name> CUL <device> <housecode>
USB-connected devices (CUL/CUR/CUN):
- <device> specifies the serial port to communicate with the CUL or CUR.
- The name of the serial-device depends on your distribution,
- under linux the cdc_acm kernel module is responsible, and usually a
- /dev/ttyACM0 device will be created. If your distribution does not have a
- cdc_acm module, you can force usbserial to handle the CUL by the following
- command:modprobe usbserial vendor=0x03eb product=0x204b
In this
- case the device is most probably /dev/ttyUSB0.
+ <device> specifies the serial port to communicate with the CUL or
+ CUR. The name of the serial-device depends on your distribution, under
+ linux the cdc_acm kernel module is responsible, and usually a
+ /dev/ttyACM0 device will be created. If your distribution does not have a
+ cdc_acm module, you can force usbserial to handle the CUL by the
+ following command:modprobe usbserial vendor=0x03eb
+ product=0x204b
In this case the device is most probably
+ /dev/ttyUSB0.
+ You can also specify a baudrate if the device name contains the @
+ character, e.g.: /dev/ttyACM0@38400
Network-connected devices (CUN):
<device> specifies the host:port of the device. E.g. 192.168.0.244:2323
@@ -4059,7 +4062,7 @@ Terminating
- fixedrange
- plotsize
- plotmode
-
+
- label
Colon separated list of values. The values will be used to replace
<L#> type of strings in the .gplot file, with # beginning at 1
@@ -4067,7 +4070,7 @@ Terminating
expression, so you have access e.g. to the $value hash.
If the plotmode is gnuplot-scroll or SVG, you can also use the min, max,
- avg, cnt, lastv (last value) and lastd (last date) values of the
+ avg, cnt, sum, lastv (last value) and lastd (last date) values of the
individual curves, by accessing the corresponding values from the data
hash, see the example below:
@@ -4089,7 +4092,7 @@ Terminating
-
+
title
A special form of label (see above), which replaces the string <TL>
in the .gplot file. It defaults to the filename of the logfile.