diff --git a/fhem/FHEM/00_CUL.pm b/fhem/FHEM/00_CUL.pm
index caacf622e..2c985d9cc 100755
--- a/fhem/FHEM/00_CUL.pm
+++ b/fhem/FHEM/00_CUL.pm
@@ -126,15 +126,22 @@ CUL_Initialize($)
$hash->{GetFn} = "CUL_Get";
$hash->{SetFn} = "CUL_Set";
$hash->{AttrFn} = "CUL_Attr";
- $hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 " .
- "showtime:1,0 model:CUL,CUN sendpool addvaltrigger ".
- "rfmode:SlowRF,HomeMatic,MAX,WMBus_T,WMBus_S,KOPP_FC ".
- "hmId longids ".
- "hmProtocolEvents:0_off,1_dump,2_dumpFull,3_dumpTrigger " .
- $readingFnAttributes;
-
+ no warnings 'qw';
+ my @attrList = qw(
+ addvaltrigger
+ connectCommand
+ do_not_notify:1,0
+ dummy:1,0 " .
+ hmId longids
+ hmProtocolEvents:0_off,1_dump,2_dumpFull,3_dumpTrigger
+ model:CUL,CUN,CUNO,SCC,nanoCUL
+ rfmode:SlowRF,HomeMatic,MAX,WMBus_T,WMBus_S,KOPP_FC
+ sendpool
+ showtime:1,0
+ );
+ use warnings 'qw';
+ $hash->{AttrList} = join(" ", @attrList)." ".$readingFnAttributes;
$hash->{ShutdownFn} = "CUL_Shutdown";
-
}
sub
@@ -495,6 +502,9 @@ CUL_DoInit($)
}
}
+ my $cc = AttrVal($name, "connectCommand", undef);
+ CUL_SimpleWrite($hash, $cc) if($cc);
+
readingsSingleUpdate($hash, "state", "Initialized", 1);
# Reset the counter
@@ -1010,9 +1020,10 @@ sub
CUL_Attr(@)
{
my ($cmd,$name,$aName,$aVal) = @_;
+ my $hash = $defs{$name};
+
if($aName eq "rfmode") {
- my $hash = $defs{$name};
$aVal = "SlowRF" if(!$aVal ||
($aVal ne "HomeMatic"
@@ -1106,6 +1117,10 @@ CUL_Attr(@)
return "wrong syntax: hmId must be 6-digit-hex-code (3 byte)"
if($aVal !~ m/^[A-F0-9]{6}$/i);
}
+
+ } elsif($aName eq "connectCommand"){
+ CUL_SimpleWrite($hash, $aVal) if($cmd eq "set");
+
}
return undef;
@@ -1311,10 +1326,62 @@ CUL_prefix($$$)
Attributes
+ - addvaltrigger
+ Create triggers for additional device values. Right now these are RSSI
+ and RAWMSG for the CUL family and RAWMSG for the FHZ.
+
+
+ - connectCommand
+ raw culfw command sent to the CUL after a (re-)connect of the USB device,
+ and sending the usual initialization needed for the configured rfmode.
+
+
- do_not_notify
- dummy
- - showtime
- - model (CUL,CUN)
+ - hmId
+ Set the HomeMatic ID of this device. If this attribute is absent, the
+ ID will be F1<FHTID>. Note 1: After setting or changing this
+ attribute you have to relearn all your HomeMatic devices. Note 2: The
+ value must be a 6 digit hex number, and 000000 is not valid. FHEM
+ won't complain if it is not correct, but the communication won't work.
+
+
+ - hmProtocolEvents
+ Generate events for HomeMatic protocol messages. These are normally
+ used for debugging, by activating "inform timer" in a telnet session,
+ or looking at the Event Monitor window in the FHEMWEB frontend.
+ Example:
+
+
+ 2012-05-17 09:44:22.515 CUL CULHM RCV L:0B N:81 CMD:A258 SRC:......
+ DST:...... 0000 (TYPE=88,WAKEMEUP,BIDI,RPTEN)
+
+
+
+
+ - longids
+ Comma separated list of device-types for CUL that should be handled
+ using long IDs. This additional ID allows it to differentiate some
+ weather sensors, if they are sending on the same channel.
+ Therefore a random generated id is added. If you choose to use longids,
+ then you'll have to define a different device after battery change.
+ Default is not to use long IDs.
+ Modules which are using this functionality are for e.g. :
+ 14_Hideki, 41_OREGON, 14_CUL_TCM97001, 14_SD_WS07.
+
+ Examples:
+
+ # Do not use any long IDs for any devices (this is default):
+ attr cul longids 0
+ # Use long IDs for all devices:
+ attr cul longids 1
+ # Use longids for SD_WS07 devices.
+ # Will generate devices names like SD_WS07_TH_3 for channel 3.
+ attr cul longids SD_WS07
+
+
+
+ - model (CUL,CUN,etc)
- sendpool
If using more than one CUL for covering a large area, sending
different events by the different CUL's might disturb each other. This
@@ -1326,10 +1393,6 @@ CUL_prefix($$$)
attr CUN2 sendpool CUN1,CUN2,CUN3
attr CUN3 sendpool CUN1,CUN2,CUN3
- - addvaltrigger
- Create triggers for additional device values. Right now these are RSSI
- and RAWMSG for the CUL family and RAWMSG for the FHZ.
-
- rfmode
Configure the RF Transceiver of the CUL (the CC1101). Available
arguments are:
@@ -1354,48 +1417,8 @@ CUL_prefix($$$)
+ showtime
- hmId
- Set the HomeMatic ID of this device. If this attribute is absent, the
- ID will be F1<FHTID>. Note 1: After setting or changing this
- attribute you have to relearn all your HomeMatic devices. Note 2: The
- value must be a 6 digit hex number, and 000000 is not valid. FHEM
- won't complain if it is not correct, but the communication won't work.
-
-
- hmProtocolEvents
- Generate events for HomeMatic protocol messages. These are normally
- used for debugging, by activating "inform timer" in a telnet session,
- or looking at the Event Monitor window in the FHEMWEB frontend.
- Example:
-
-
- 2012-05-17 09:44:22.515 CUL CULHM RCV L:0B N:81 CMD:A258 SRC:...... DST:...... 0000 (TYPE=88,WAKEMEUP,BIDI,RPTEN)
-
-
-
-
- longids
- Comma separated list of device-types for CUL that should be handled
- using long IDs. This additional ID allows it to differentiate some
- weather sensors, if they are sending on the same channel.
- Therefore a random generated id is added. If you choose to use longids,
- then you'll have to define a different device after battery change.
- Default is not to use long IDs.
- Modules which are using this functionality are for e.g. :
- 14_Hideki, 41_OREGON, 14_CUL_TCM97001, 14_SD_WS07.
-
- Examples:
-
- # Do not use any long IDs for any devices (this is default):
- attr cul longids 0
- # Use long IDs for all devices:
- attr cul longids 1
- # Use longids for SD_WS07 devices.
- # Will generate devices names like SD_WS07_TH_3 for channel 3.
- attr cul longids SD_WS07
-
-
readingFnAttributes
@@ -1519,9 +1542,9 @@ CUL_prefix($$$)
- freq bestimmt sowohl die Empfangs- als auch die Sendefrequenz.
Bemerkung: Auch wenn der CC1101 zwischen den Frequenzen 315 und 915
- MHz eingestellt werden kann, ist die Antennenanbindung bzw. die Antenne
- des CUL exakt auf eine Frequenz eingestellt.
- Standard ist 868.3 MHz (bzw. 433 MHz).
+ MHz eingestellt werden kann, ist die Antennenanbindung bzw. die
+ Antenne des CUL exakt auf eine Frequenz eingestellt. Standard ist
+ 868.3 MHz (bzw. 433 MHz).
- bWidth kann zwischen 58 kHz und 812 kHz variiert werden.
Große Werte sind empfindlicher gegen Interferencen, aber
@@ -1613,53 +1636,19 @@ CUL_prefix($$$)
Attribute
- - do_not_notify
- - dummy
- - showtime
- - model (CUL,CUN)
- - sendpool
- Wenn mehr als ein CUL verwendet wird, um einen größeren
- Bereich abzudecken, können diese sich gegenseitig
- beeinflussen. Dieses Phänomen wird auch Palm-Beach-Resort Effekt
- genannt. Wenn man diese zu einen gemeinsamen Sende"pool"
- zusammenschließt, wird das Senden der einzelnen Telegramme
- seriell (d.h. hintereinander) durchgeführt.
- Wenn z.B. drei CUN's zur
- Verfügung stehen, werden folgende Attribute gesetzt:
- attr CUN1 sendpool CUN1,CUN2,CUN3
- attr CUN2 sendpool CUN1,CUN2,CUN3
- attr CUN3 sendpool CUN1,CUN2,CUN3
-
-
- addvaltrigger
Generiert Trigger für zusätzliche Werte. Momentan sind dies
RSSI und RAWMSG für die CUL Familie und RAWMSG für FHZ.
- - rfmode
- Konfiguriert den RF Transceiver des CULs (CC1101). Verfügbare
- Argumente sind:
-
- - SlowRF
- Für die Kommunikation mit FS20/FHT/HMS/EM1010/S300/Hoermann
- Geräten @1 kHz Datenrate (Standardeinstellung).
+ - connectCommand
+ culfw Befehl, was nach dem Verbindungsaufbau mit dem USB-Gerät, nach
+ Senden der zum Initialisieren der konfigurierten rfmode benötigten
+ Befehle gesendet wird.
+
- - HomeMatic
- Für die Kommunikation mit HomeMatic Geräten @10 kHz
- Datenrate.
-
- - MAX
- Für die Kommunikation mit MAX! Geräten @10 kHz
- Datenrate.
- - WMBus_S
- - WMBus_T
- Für die Kommunikation mit Wireless M-Bus Geräten wie
- Wasser-, Gas- oder Elektrozählern. Wireless M-Bus verwendet
- zwei unterschiedliche Kommunikationsarten, S-Mode und T-Mode. In
- diesem Modus ist der Empfang von anderen Protokollen wie SlowRF
- oder HomeMatic nicht möglich.
-
-
+ - do_not_notify
+ - dummy
- hmId
Setzt die HomeMatic ID des Gerätes. Wenn dieses Attribut fehlt,
@@ -1678,7 +1667,8 @@ CUL_prefix($$$)
Beispiel:
- 2012-05-17 09:44:22.515 CUL CULHM RCV L:0B N:81 CMD:A258 SRC:...... DST:...... 0000 (TYPE=88,WAKEMEUP,BIDI,RPTEN)
+ 2012-05-17 09:44:22.515 CUL CULHM RCV L:0B N:81 CMD:A258 SRC:......
+ DST:...... 0000 (TYPE=88,WAKEMEUP,BIDI,RPTEN)
@@ -1705,6 +1695,48 @@ CUL_prefix($$$)
+ - model (CUL,CUN)
+
+ - rfmode
+ Konfiguriert den RF Transceiver des CULs (CC1101). Verfügbare
+ Argumente sind:
+
+ - SlowRF
+ Für die Kommunikation mit FS20/FHT/HMS/EM1010/S300/Hoermann
+ Geräten @1 kHz Datenrate (Standardeinstellung).
+
+ - HomeMatic
+ Für die Kommunikation mit HomeMatic Geräten @10 kHz
+ Datenrate.
+
+ - MAX
+ Für die Kommunikation mit MAX! Geräten @10 kHz
+ Datenrate.
+ - WMBus_S
+ - WMBus_T
+ Für die Kommunikation mit Wireless M-Bus Geräten wie
+ Wasser-, Gas- oder Elektrozählern. Wireless M-Bus verwendet
+ zwei unterschiedliche Kommunikationsarten, S-Mode und T-Mode. In
+ diesem Modus ist der Empfang von anderen Protokollen wie SlowRF
+ oder HomeMatic nicht möglich.
+
+
+
+ - sendpool
+ Wenn mehr als ein CUL verwendet wird, um einen größeren
+ Bereich abzudecken, können diese sich gegenseitig
+ beeinflussen. Dieses Phänomen wird auch Palm-Beach-Resort Effekt
+ genannt. Wenn man diese zu einen gemeinsamen Sende"pool"
+ zusammenschließt, wird das Senden der einzelnen Telegramme
+ seriell (d.h. hintereinander) durchgeführt.
+ Wenn z.B. drei CUN's zur
+ Verfügung stehen, werden folgende Attribute gesetzt:
+ attr CUN1 sendpool CUN1,CUN2,CUN3
+ attr CUN2 sendpool CUN1,CUN2,CUN3
+ attr CUN3 sendpool CUN1,CUN2,CUN3
+
+
+ - showtime
- readingFnAttributes