4 static int mebus433_callback(bitbuffer_t *bitbuffer) {
5 bitrow_t *bb = bitbuffer->bb;
6 char time_str[LOCAL_TIME_BUFLEN];
16 if (bb[0][0] == 0 && bb[1][4] !=0 && (bb[1][0] & 0b01100000) && bb[1][3]==bb[5][3] && bb[1][4] == bb[12][4]){
17 local_time_str(0, time_str);
19 address = bb[1][0] & 0b00011111;
21 channel = ((bb[1][1] & 0b00110000) >> 4) + 1;
23 unknown1 = (bb[1][1] & 0b01000000) >> 6;
24 battery = bb[1][1] & 0b10000000;
26 // Upper 4 bits are stored in nibble 1, lower 8 bits are stored in nibble 2
27 // upper 4 bits of nibble 1 are reserved for other usages.
28 temp = (int16_t)((uint16_t)(bb[1][1] << 12) | bb[1][2] << 4);
30 // lower 4 bits of nibble 3 and upper 4 bits of nibble 4 contains
31 // humidity as decimal value
32 hum = (bb[1][3] << 4 | bb[1][4] >> 4);
35 unknown2 = (bb[1][3] & 0b11110000) >> 4;
37 data = data_make("time", "", DATA_STRING, time_str,
38 "model", "", DATA_STRING, "Mebus/433",
39 "id", "Address", DATA_INT, address,
40 "battery", "Battery", DATA_STRING, battery ? "OK" : "LOW",
41 "channel", "Channel", DATA_INT, channel,
42 "unknown1", "Unknown 1", DATA_INT, unknown1,
43 "unknown2", "Unknown 2", DATA_INT, unknown2,
44 "temperature_C", "Temperature", DATA_FORMAT, "%.02f C", DATA_DOUBLE, temp / 10.0,
45 "humidity", "Humidity", DATA_FORMAT, "%u %%", DATA_INT, hum,
47 data_acquired_handler(data);
57 .modulation = OOK_PULSE_PPM_RAW,
61 .json_callback = &mebus433_callback,