Skip to content

Commit

Permalink
Fix Honeywell-CM921 temperature msg (closes #2637)
Browse files Browse the repository at this point in the history
  • Loading branch information
zuckschwerdt committed Sep 25, 2023
1 parent 2cbf3e5 commit 07368e7
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/devices/honeywell_cm921.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,17 @@ static data_t *honeywell_cm921_interpret_message(r_device *decoder, const messag
case 0x0008: {
UNKNOWN_IF(msg->payload_length != 2);
data = data_append(data, "domain_id", "", DATA_INT, msg->payload[0], NULL);
data = data_append(data, "demand", "", DATA_DOUBLE, msg->payload[1] / 200.0 /* 0xC8 */, NULL);
data = data_append(data, "demand", "", DATA_DOUBLE, msg->payload[1] * (1 / 200.0F) /* 0xC8 */, NULL);
break;
}
case 0x3ef0: {
UNKNOWN_IF(msg->payload_length != 3 && msg->payload_length != 6);
switch (msg->payload_length) {
case 3:
data = data_append(data, "status", "", DATA_DOUBLE, msg->payload[1] / 200.0 /* 0xC8 */, NULL);
data = data_append(data, "status", "", DATA_DOUBLE, msg->payload[1] * (1 / 200.0F) /* 0xC8 */, NULL);
break;
case 6:
data = data_append(data, "boiler_modulation_level", "", DATA_DOUBLE, msg->payload[1] / 200.0 /* 0xC8 */, NULL);
data = data_append(data, "boiler_modulation_level", "", DATA_DOUBLE, msg->payload[1] * (1 / 200.0F) /* 0xC8 */, NULL);
data = data_append(data, "flame_status", "", DATA_INT, msg->payload[3], NULL);
break;
}
Expand All @@ -201,17 +201,17 @@ static data_t *honeywell_cm921_interpret_message(r_device *decoder, const messag
UNKNOWN_IF(msg->payload_length != 3);
data = data_append(data, "zone", "", DATA_INT, msg->payload[0], NULL);
// Observation: CM921 reports a very high setpoint during binding (0x7eff); packet: 143255c1230903017efff7
data = data_append(data, "setpoint", "", DATA_DOUBLE, ((msg->payload[1] << 8) | msg->payload[2]) / 100.0, NULL);
data = data_append(data, "setpoint", "", DATA_DOUBLE, ((msg->payload[1] << 8) | msg->payload[2]) * (1 / 100.0F), NULL);
break;
}
case 0x1100: {
UNKNOWN_IF(msg->payload_length != 5 && msg->payload_length != 8);
data = data_append(data, "domain_id", "", DATA_INT, msg->payload[0], NULL);
data = data_append(data, "cycle_rate", "", DATA_DOUBLE, msg->payload[1] / 4.0, NULL);
data = data_append(data, "minimum_on_time", "", DATA_DOUBLE, msg->payload[2] / 4.0, NULL);
data = data_append(data, "minimum_off_time", "", DATA_DOUBLE, msg->payload[3] / 4.0, NULL);
data = data_append(data, "cycle_rate", "", DATA_DOUBLE, msg->payload[1] * (1 / 4.0F), NULL);
data = data_append(data, "minimum_on_time", "", DATA_DOUBLE, msg->payload[2] * (1 / 4.0F), NULL);
data = data_append(data, "minimum_off_time", "", DATA_DOUBLE, msg->payload[3] * (1 / 4.0F), NULL);
if (msg->payload_length == 8)
data = data_append(data, "proportional_band_width", "", DATA_DOUBLE, (msg->payload[5] << 8 | msg->payload[6]) / 100.0, NULL);
data = data_append(data, "proportional_band_width", "", DATA_DOUBLE, (msg->payload[5] << 8 | msg->payload[6]) * (1 / 100.0F), NULL);
break;
}
case 0x0009: {
Expand All @@ -227,18 +227,18 @@ static data_t *honeywell_cm921_interpret_message(r_device *decoder, const messag
case 0x3B00: {
UNKNOWN_IF(msg->payload_length != 2);
data = data_append(data, "domain_id", "", DATA_INT, msg->payload[0], NULL);
data = data_append(data, "state", "", DATA_DOUBLE, msg->payload[1] / 200.0 /* 0xC8 */, NULL);
data = data_append(data, "state", "", DATA_DOUBLE, msg->payload[1] * (1 / 200.0F) /* 0xC8 */, NULL);
break;
}
case 0x30C9: {
size_t num_zones = msg->payload_length/3;
for (size_t i=0; i < num_zones; i++) {
char name[256];
snprintf(name, sizeof(name), "temperature (zone %u)", msg->payload[3*i]);
int16_t temp = msg->payload[3*i+1] << 8 | msg->payload[3*i+1];
data = data_append(data, name, "", DATA_DOUBLE, temp/100.0, NULL);
}
break;
size_t num_zones = msg->payload_length / 3;
for (size_t i = 0; i < num_zones; i++) {
char name[256];
snprintf(name, sizeof(name), "temperature (zone %u)", msg->payload[3 * i]);
int16_t temp = msg->payload[3 * i + 1] << 8 | msg->payload[3 * i + 2];
data = data_append(data, name, "", DATA_DOUBLE, temp * (1 / 100.0F), NULL);
}
break;
}
case 0x1fd4: {
int temp = (msg->payload[1] << 8) | msg->payload[2];
Expand Down

0 comments on commit 07368e7

Please sign in to comment.