Skip to content

Add device for GE Choice Alert wireless alarm sensors #1768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ See [CONTRIBUTING.md](./docs/CONTRIBUTING.md).
[201] Unbranded SolarTPMS for trucks
[202] Funkbus / Instafunk (Berker, Jira, Jung)
[203] Porsche Boxster/Cayman TPMS
[204] Jasco/GE Choice Alert Security Devices

* Disabled by default, use -R n or -G

Expand Down
1 change: 1 addition & 0 deletions conf/rtl_433.example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ stop_after_successful_events false
protocol 201 # Unbranded SolarTPMS for trucks
protocol 202 # Funkbus / Instafunk (Berker, Jira, Jung)
protocol 203 # Porsche Boxster/Cayman TPMS
protocol 204 # Jasco/GE Choice Alert Security Devices

## Flex devices (command line option "-X")

Expand Down
1 change: 1 addition & 0 deletions include/rtl_433_devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
DECL(tpms_truck) \
DECL(funkbus_remote) \
DECL(tpms_porsche) \
DECL(jasco) \

/* Add new decoders here. */

Expand Down
2 changes: 1 addition & 1 deletion man/man1/rtl_433.1
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ RTL\-SDR device driver is available.
To set gain for RTL\-SDR use \-g <gain> to set an overall gain in dB.
.RE
.RS
SoapySDR device driver is available.
SoapySDR device driver is not available.
.RE
.TP
[ \fB\-d\fI ""\fP ]
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ add_library(r_433 STATIC
devices/insteon.c
devices/interlogix.c
devices/intertechno.c
devices/jasco.c
devices/kedsum.c
devices/kerui.c
devices/klimalogg.c
Expand Down
103 changes: 103 additions & 0 deletions src/devices/jasco.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/** @file
Jasco/GE Choice Alert Wireless Device Decoder.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
*/
/**
Jasco/GE Choice Alert Wireless Device Decoder.

- Frequency: 318.01 MHz

v0.1 based on the contact and water sensors Model 45131 / FCC ID QOB45131-3

v0.2 corrected decoder

v0.3 internal naming consistancies

*/

#include "decoder.h"

#define JASCO_MSG_BIT_LEN 86

static int jasco_decode(r_device *decoder, bitbuffer_t *bitbuffer)
{

if (bitbuffer->bits_per_row[0] != JASCO_MSG_BIT_LEN && bitbuffer->bits_per_row[0] != JASCO_MSG_BIT_LEN+1) {
if (decoder->verbose > 1 && bitbuffer->bits_per_row[0] > 0) {
fprintf(stderr, "%s: invalid bit count %d\n", __func__,
bitbuffer->bits_per_row[0]);
}
return DECODE_ABORT_LENGTH;
}

uint8_t b[4];
uint8_t chk;
uint32_t sensor_id = 0;
int s_closed=0;
// int battery=0;
bitbuffer_t packet_bits;
data_t *data;
uint8_t const preamble[] = {0xfc, 0x0c};
unsigned bitpos = 0;

if (decoder->verbose > 1) {
bitbuffer_debug(bitbuffer);
}
bitpos = bitbuffer_search(bitbuffer, 0, 0, preamble, sizeof(preamble) * 8) + sizeof(preamble) * 8;

bitpos = bitbuffer_manchester_decode(bitbuffer, 0, bitpos, &packet_bits, 87);

bitbuffer_extract_bytes(&packet_bits, 0, 0,b, 32);

if (decoder->verbose > 1) {
bitbuffer_debug(&packet_bits);
}

bitbuffer_clear(&packet_bits);

chk = b[0] ^ b[1] ^ b[2];
if (chk != b[3]) {
return DECODE_FAIL_MIC;
}


sensor_id = (b[0] << 8)+ b[1];

s_closed = ((b[2] & 0xef) == 0xef);


/* clang-format off */
data = data_make(
"model", "", DATA_STRING, "Jasco/GE Choice Alert Security Devices",
"id", "Id", DATA_INT, sensor_id,
"status", "Closed", DATA_INT, s_closed,
"mic", "Integrity", DATA_STRING, "CRC",
NULL);
/* clang-format on */

decoder_output_data(decoder, data);
return 1;
}

static char *output_fields[] = {
"model",
"id",
"status",
"mic",
NULL,
};

r_device jasco = {
.name = "Jasco/GE Choice Alert Security Devices",
.modulation = OOK_PULSE_PCM_RZ,
.short_width = 250,
.long_width = 250,
.reset_limit = 1800, // Maximum gap size before End Of Message
.decode_fn = &jasco_decode,
.fields = output_fields,

};
1 change: 1 addition & 0 deletions vs15/rtl_433.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ COPY ..\..\libusb\MS64\dll\libusb*.dll $(TargetDir)</Command>
<ClCompile Include="..\src\devices\insteon.c" />
<ClCompile Include="..\src\devices\interlogix.c" />
<ClCompile Include="..\src\devices\intertechno.c" />
<ClCompile Include="..\src\devices\jasco.c" />
<ClCompile Include="..\src\devices\kedsum.c" />
<ClCompile Include="..\src\devices\kerui.c" />
<ClCompile Include="..\src\devices\klimalogg.c" />
Expand Down
3 changes: 3 additions & 0 deletions vs15/rtl_433.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,9 @@
<ClCompile Include="..\src\devices\intertechno.c">
<Filter>Source Files\devices</Filter>
</ClCompile>
<ClCompile Include="..\src\devices\jasco.c">
<Filter>Source Files\devices</Filter>
</ClCompile>
<ClCompile Include="..\src\devices\kedsum.c">
<Filter>Source Files\devices</Filter>
</ClCompile>
Expand Down