Browse Source

Enhance Honeywell 2Gig support

Christian W. Zuckschwerdt 1 month ago
parent
commit
9c23ceba9f
4 changed files with 20 additions and 8 deletions
  1. 2 1
      README.md
  2. 4 1
      man/man1/rtl_433.1
  3. 1 1
      src/devices/fineoffset.c
  4. 13 5
      src/devices/honeywell.c

+ 2 - 1
README.md

@@ -145,7 +145,7 @@ Read the Test Data section at the bottom.
     [67]  Radiohead ASK
     [68]  Kerui PIR / Contact Sensor
     [69]  Fine Offset WH1050 Weather Station
-    [70]  Honeywell Door/Window Sensor
+    [70]  Honeywell Door/Window Sensor, 2Gig DW10/DW11, RE208 repeater
     [71]  Maverick ET-732/733 BBQ Sensor
     [72]* RF-tech
     [73]  LaCrosse TX141-Bv2, TX141TH-Bv2, TX141-Bv3, TX141W sensor
@@ -329,6 +329,7 @@ E.g. -X "n=doorbell,m=OOK_PWM,s=400,l=800,r=7000,g=1000,match={24}0xa9878c,repea
 	Use "time:iso" to show the time with ISO-8601 format (YYYY-MM-DD"T"hh:mm:ss).
 	Use "time:off" to remove time meta data.
 	Use "time:usec" to add microseconds to date time meta data.
+	Use "time:tz" to output time with timezone offset.
 	Use "time:utc" to output time in UTC.
 		(this may also be accomplished by invocation with TZ environment variable set).
 		"usec" and "utc" can be combined with other options, eg. "time:unix:utc:usec".

+ 4 - 1
man/man1/rtl_433.1

@@ -336,7 +336,7 @@ Kerui PIR / Contact Sensor
 Fine Offset WH1050 Weather Station
 .TP
 [ \fB70\fI\fP ]
-Honeywell Door/Window Sensor
+Honeywell Door/Window Sensor, 2Gig DW10/DW11, RE208 repeater
 .TP
 [ \fB71\fI\fP ]
 Maverick ET\-732/733 BBQ Sensor
@@ -793,6 +793,9 @@ Use "time:off" to remove time meta data.
 Use "time:usec" to add microseconds to date time meta data.
 .RE
 .RS
+Use "time:tz" to output time with timezone offset.
+.RE
+.RS
 Use "time:utc" to output time in UTC.
 .RE
 .RS

+ 1 - 1
src/devices/fineoffset.c

@@ -590,7 +590,7 @@ static int fineoffset_WH51_callback(r_device *decoder, bitbuffer_t *bitbuffer)
 
     // Decode data
     char id[7];
-    sprintf(id, "%2x%2x%2x", b[1], b[2], b[3]);
+    sprintf(id, "%02x%02x%02x", b[1], b[2], b[3]);
     int boost           = (b[4] & 0xe0) >> 5;
     int battery_mv      = (b[4] & 0x1f) * 100;
     float battery_level = (battery_mv - 700) / 900; // assume 1.6V (100%) to 0.7V (0%) range

+ 13 - 5
src/devices/honeywell.c

@@ -16,6 +16,7 @@ Tested with the Honeywell 5811 Wireless Door/Window transmitters.
 
 Also: 2Gig DW10 door sensors,
 and Resolution Products RE208 (wire to air repeater).
+And DW11 with 96 bit packets.
 
 Maybe: 5890PI?
 
@@ -45,7 +46,8 @@ static int honeywell_decode(r_device *decoder, bitbuffer_t *bitbuffer)
     data_t *data;
     int row;
     int pos;
-    uint8_t b[6] = {0};
+    int len;
+    uint8_t b[10] = {0};
     int channel;
     int device_id;
     int event;
@@ -64,9 +66,10 @@ static int honeywell_decode(r_device *decoder, bitbuffer_t *bitbuffer)
     bitbuffer_invert(bitbuffer);
 
     pos = bitbuffer_search(bitbuffer, row, 0, preamble_pattern, 12) + 12;
-    if (pos >= bitbuffer->bits_per_row[row])
+    len = bitbuffer->bits_per_row[row] - pos;
+    if (len < 48)
         return DECODE_ABORT_LENGTH;
-    bitbuffer_extract_bytes(bitbuffer, row, pos, b, 48);
+    bitbuffer_extract_bytes(bitbuffer, row, pos, b, 80);
 
     channel   = b[0] >> 4;
     device_id = ((b[0] & 0xf) << 16) | (b[1] << 8) | b[2];
@@ -75,7 +78,12 @@ static int honeywell_decode(r_device *decoder, bitbuffer_t *bitbuffer)
     if (device_id == 0 && crc == 0)
         return DECODE_ABORT_EARLY; // Reduce collisions
 
-    if (channel == 0x2 || channel == 0xA) {
+    if (len > 50) { // DW11
+        if (decoder->verbose)
+            bitrow_printf(b, len, "%s: ", __func__);
+    }
+
+    if (channel == 0x2 || channel == 0x4 || channel == 0xA) {
         // 2GIG brand
         crc_calculated = crc16(b, 4, 0x8050, 0);
     } else { // channel == 0x8
@@ -125,7 +133,7 @@ static char *output_fields[] = {
 };
 
 r_device honeywell = {
-        .name        = "Honeywell Door/Window Sensor",
+        .name        = "Honeywell Door/Window Sensor, 2Gig DW10/DW11, RE208 repeater",
         .modulation  = OOK_PULSE_MANCHESTER_ZEROBIT,
         .short_width = 156,
         .long_width  = 0,