Skip to content
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

Add support for ThermoPro TP829b and Improve rtl_433_mqtt_hass.py #2964

Merged
merged 3 commits into from
Jun 23, 2024

Conversation

ProfBoc75
Copy link
Collaborator

Related to #2961

This decoder is decoding 4 temp probes, the reason why rtl_433_mqtt_hass.py is also updated accordingly (2 temp probes in previous version)

bitbuffer_extract_bytes(bitbuffer, 0, offset, b, 9 * 8);

// checksum is a Galois bit reflect and byte reflect
// need first to reverse byte order then the galois bit reflect.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that galois is a type of LFSR and bit/byte reflect is just input ordering.

Copy link
Collaborator Author

@ProfBoc75 ProfBoc75 Jun 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I did the finding with revdgst but I'm not able to find the corresponding function at rtl_433, I explored bit_util.c.

  • I found lfsr_digest8() where the bit are reflect (bit from 8 to 1), but in normal byte order in the array.
  • I found lfsr_digest8_reflect() where the bytes are reflect from last to first byte but bit are from bit 1 to bit 8.
  • So missing a function to have both byte reflect and bit reflect, the reason why I need to reverse the order of byte first, then lfsr_digest8() as a workaround.

decoder_log_bitrow(decoder, 2, __func__, b, 72, "MSG");

uint16_t id = b[0] << 8 | b[1];
float p1_temp = ((b[2] << 4 | (b[3] & 0xF0) >> 4) - 500) * 0.1f;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be better to have
int p1_raw = ...;
float p1_temp = (p1_raw - 500) * 0.1f;
and then DATA_COND on the int (avoid != on float)

@ProfBoc75 ProfBoc75 merged commit c187c30 into master Jun 23, 2024
16 checks passed
@ProfBoc75 ProfBoc75 deleted the feat-thermopro_tp829b branch July 23, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants