1 /* blyss DC5-UK-WH as sold by B&Q
 
   3  * DC5-UK-WH pair with receivers, the codes used may be specific to a receiver - use with caution
 
   5  * Copyright (C) 2016 John Jore
 
   6  * This program is free software; you can redistribute it and/or modify
 
   7  * it under the terms of the GNU General Public License as published by
 
   8  * the Free Software Foundation; either version 2 of the License, or
 
   9  * (at your option) any later version.
 
  15 static int blyss_dc5_uk_wh(bitbuffer_t *bitbuffer)
 
  17         bitrow_t *bb = bitbuffer->bb;
 
  19         for (int i = 0; i < bitbuffer->num_rows; i++)
 
  21                 //This needs additional validation, but works on mine. Suspect each DC5-UK-WH uses different codes as the transmitter
 
  22                 //is paired to the receivers to avoid being triggerd by the neighbours transmitter ?!?
 
  23                 if (((bb[i][0] == 0xce) && (bb[i][1] == 0x8e) && (bb[i][2] == 0x2a) && (bb[i][3] == 0x6c) && (bb[i][4] == 0x80)) || 
 
  24                         ((bb[i][0] == 0xe7) && (bb[i][1] == 0x37) && (bb[i][2] == 0x7a) && (bb[i][3] == 0x2c) && (bb[i][4] == 0x80)))
 
  27                                 fprintf(stdout, "blyss DC5-UK-WH ringing\n");
 
  28                                 bitbuffer_print(bitbuffer);
 
  32                         char time_str[LOCAL_TIME_BUFLEN];
 
  33                         local_time_str(0, time_str);
 
  35                         data = data_make("time", "", DATA_STRING, time_str,
 
  36                                 "type", "", DATA_STRING, "doorbell",
 
  37                                 "make", "", DATA_STRING, "blyss",
 
  38                                 "model", "", DATA_STRING, "dc5-uk-wh",
 
  39                                 "mode", "", DATA_STRING, "ringing",
 
  41                         data_acquired_handler(data);
 
  47         //This was not a blyss device after all
 
  51 static char *output_fields[] = {
 
  60 static int blyss_callback(bitbuffer_t *bitbuffer) {
 
  61         // Validate its a 'blyss' we understand
 
  62         int rows = bitbuffer->num_rows;
 
  64         for (int i = 0; i < rows; i++) {
 
  65                 unsigned bits = bitbuffer->bits_per_row[i];
 
  68                 if (bits == 33) { //33 bits in a "proper" message. Last row is 32
 
  70                         int result = blyss_dc5_uk_wh(bitbuffer);
 
  72                         return result; // done
 
  76         //If we got this far, its not a blyss device we know of
 
  82         .name           = "blyss DC5-UK-WH (433.92 MHz)",
 
  83         .modulation     = OOK_PULSE_PWM_RAW,
 
  87         .json_callback  = &blyss_callback,