Ein patch der Signalstärke der Schalter usw zu Sehen:
diff --git a/46_TRX_LIGHT.pm b/46_TRX_LIGHT.pm
index 304dadd..ac009bd 100644
--- a/46_TRX_LIGHT.pm
+++ b/46_TRX_LIGHT.pm
@@ -1,4 +1,4 @@
-# $Id$
+# $Id: 46_TRX_LIGHT.pm 6225 2014-07-09 18:36:02Z wherzig $
##############################################################################
#
# 46_TRX_LIGHT.pm
@@ -767,6 +767,12 @@ sub TRX_LIGHT_parse_X10 ($$)
readingsBeginUpdate($def);
if ($type == 0x10 || $type == 0x11 || $type == 0x14 || $type == 0x16) {
+ if ($type == 0x10) {
+ readingsBulkUpdate($def, "signal", $bytes->[6]);
+ } else {
+ readingsBulkUpdate($def, "signal", $bytes->[10]);
+ }
+
# try to use it for all types:
$current = $command;
if ($type == 0x11 && $command eq "level") {
Wäre das nicht sinnvoll für alle RFX-Treiber?
Vielleicht wenn es Implementiert ist, aber könnte ich nichts fuer andere Protokoll finden.
ist dieses jetzt im Modul enthalten ????
Im Moment nicht. Ich habe nichts von Willi (Maintainer) schon gehoert.
Würde das gerne versuchen, aber habe null Ahnung wie ich den Patch dazu spiele?
Kann mir wer ne kurze Anleitung geben bitte.
Lg
Habe den Patch eingebracht.
Nur wie bekomme ich nun die RSSI der Schalter?
LG
Hi Matt,
this was already implemented for TRX_SECURITY and TRX_WEATHER.
The reading is rssi and there's an attribute switch rssi to enable it in TRX.
Fixed version attached.
Markus
Nochmal als aktueller Patch:
Index: FHEM/46_TRX_LIGHT.pm
===================================================================
--- FHEM/46_TRX_LIGHT.pm (revision 10673)
+++ FHEM/46_TRX_LIGHT.pm (working copy)
@@ -36,6 +36,7 @@
use warnings;
my $time_old = 0;
+my $trx_rssi;
my $TRX_LIGHT_type_default = "ds10a";
my $TRX_LIGHT_X10_type_default = "x10";
@@ -266,12 +267,12 @@
return "No set implemented for $device_type";
}
- if ( lc($hash->{TRX_LIGHT_devicelog}) eq "window" || lc($hash->{TRX_LIGHT_devicelog}) eq "door" ||
+ if (( lc($hash->{TRX_LIGHT_devicelog}) eq "window" || lc($hash->{TRX_LIGHT_devicelog}) eq "door" ||
lc($hash->{TRX_LIGHT_devicelog}) eq "motion" ||
lc($hash->{TRX_LIGHT_devicelog}) eq "ring" ||
lc($hash->{TRX_LIGHT_devicelog}) eq "lightsensor" || lc($hash->{TRX_LIGHT_devicelog}) eq "photosensor" ||
lc($hash->{TRX_LIGHT_devicelog}) eq "lock"
- ) {
+ ) and ($device_type ne "PT2262") ){
return "No set implemented for $device_type";
}
@@ -741,6 +742,16 @@
Log3 $name, 5, "TRX_LIGHT_parse_X10() $name devn=$device_name first=$firstdevice command=$command, cmd=$hexdata";
+ my $rssi = "";
+ if ($trx_rssi == 1) {
+ if($type == 0x10) {
+ $rssi = sprintf("%d", ($bytes->[6] & 0xf0) >> 4);
+ } else {
+ $rssi = sprintf("%d", ($bytes->[10] & 0xf0) >> 4);
+ }
+ Log3 $name, 5, "TRX_LIGHT_parse_X10() $name devn=$device_name rssi=$rssi";
+ }
+
my $n = 0;
my $tm = TimeNow();
my $val = "";
@@ -790,6 +801,11 @@
return $error;
}
+ if ($rssi ne "") {
+ $sensor = "rssi";
+ readingsBulkUpdate($def, $sensor, $rssi);
+ }
+
if (($firstdevice == 1) && $val) {
#$def->{STATE} = $val;
readingsBulkUpdate($def, "state", $val);
@@ -892,6 +908,13 @@
Log3 $name, 5, "TRX_LIGHT_parse_PT2262() $name devn=$device_name command=$command, cmd=$hexdata";
+ my $rssi = "";
+ if ($trx_rssi == 1) {
+ $rssi = sprintf("%d", ($bytes->[4] & 0xf0) >> 4);
+ Log3 $name, 5, "TRX_LIGHT_parse_PT2262() $name devn=$device_name rssi=$rssi";
+ }
+
+
my $n = 0;
my $val = "";
@@ -921,6 +944,11 @@
if ($sensor ne "none") { readingsBulkUpdate($def, $sensor, $val); }
}
+ if ($rssi ne "") {
+ $sensor = "rssi";
+ readingsBulkUpdate($def, $sensor, $rssi);
+ }
+
readingsBulkUpdate($def, "state", $val);
readingsEndUpdate($def, 1);
@@ -935,6 +963,12 @@
{
my ($iohash, $hexline) = @_;
+ $trx_rssi = 0;
+ if (defined($attr{$iohash->{NAME}}{rssi})) {
+ $trx_rssi = $attr{$iohash->{NAME}}{rssi};
+ Log3 $iohash, 5,"TRX_LIGHT_Parse() attr rssi = $trx_rssi";
+ }
+
my $time = time();
# convert to binary
my $msg = pack('H*', $hexline);
Baue ich gerne ein.
Was macht das
Zitat- if ( lc($hash->{TRX_LIGHT_devicelog}) eq "window" || lc($hash->{TRX_LIGHT_devicelog}) eq "door" ||
+ if (( lc($hash->{TRX_LIGHT_devicelog}) eq "window" || lc($hash->{TRX_LIGHT_devicelog}) eq "door" ||
lc($hash->{TRX_LIGHT_devicelog}) eq "motion" ||
lc($hash->{TRX_LIGHT_devicelog}) eq "ring" ||
lc($hash->{TRX_LIGHT_devicelog}) eq "lightsensor" || lc($hash->{TRX_LIGHT_devicelog}) eq "photosensor" ||
lc($hash->{TRX_LIGHT_devicelog}) eq "lock"
- ) {
+ ) and ($device_type ne "PT2262") ){
Scheint mir überflüssig zu sein oder was habe ich übesehen?
Ich bin heute unterwegs und schaue mir die einzelnen Zeilen voraussichtlich morgen an.
Ahh, das soll bei PT2262 Devices grundsätzlich immer auch Sets zulassen, da ich da ein paar Sonderlösungen habe.
Kannst du weglassen, wird ausser mir mit Sicherheit niemand brauchen :)