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

Change support of ThermoPro TX-2C sensor to enable reading humidity data #2514

Merged
merged 1 commit into from
May 29, 2023

Conversation

mwerlen
Copy link
Contributor

@mwerlen mwerlen commented May 28, 2023

Hi,

I've added some more information on ThermoPro TX-2C when a humidity sensor is available.
Decoding pattern is similar to other ThermoPro devices.
There is working tests in rtl_433_tests in another pull request (merbanan/rtl_433_tests#453)

Copy link
Collaborator

@zuckschwerdt zuckschwerdt left a comment

Choose a reason for hiding this comment

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

Looks good, thanks. We need to think about subtype as that would be a breaking change.
Is it really a fixed model code or maybe a variable preamble?

src/devices/thermopro_tx2c.c Outdated Show resolved Hide resolved
src/devices/thermopro_tx2c.c Outdated Show resolved Hide resolved
src/devices/thermopro_tx2c.c Outdated Show resolved Hide resolved
src/devices/thermopro_tx2c.c Outdated Show resolved Hide resolved
src/devices/thermopro_tx2c.c Outdated Show resolved Hide resolved
src/devices/thermopro_tx2c.c Outdated Show resolved Hide resolved
@mwerlen
Copy link
Contributor Author

mwerlen commented May 28, 2023

I took subtype from another ThermoPro device :

type = b[0] >> 4;
id = ((b[0] & 0x0F) << 4) | ((b[1] & 0xF0) >> 4);
battery = b[1] & 0x08;
button = (b[1] & 0x04) >> 2;
channel = (b[1] & 0x03) + 1;
temp_raw = (int16_t)((b[2] << 8) | (b[3] & 0xF0)); // uses sign-extend
temp_raw = temp_raw >> 4;
humidity = ((b[3] & 0x0F) << 4) | (b[4] >> 4);
/* clang-format off */
data = data_make(
"model", "", DATA_STRING, "Thermopro-TX2",
"subtype", "", DATA_INT, type,
"id", "", DATA_INT, id,
"channel", "Channel", DATA_INT, channel,
"battery_ok", "Battery", DATA_INT, !battery,
"temperature_C", "Temperature", DATA_FORMAT, "%.02f C", DATA_DOUBLE, temp_raw * 0.1,
"humidity", "Humidity", DATA_COND, humidity != 0xcc, DATA_FORMAT, "%u %%", DATA_INT, humidity,
"button", "Button", DATA_INT, button,
NULL);
/* clang-format on */

It's not useful to me. If you think it's better not to output it, I can change that.

All other requested changes have been resolved

@zuckschwerdt
Copy link
Collaborator

Just comment out (//) both subtype lines (80 and 95) for now, we'll merge this and solve that issue later.

@mwerlen
Copy link
Contributor Author

mwerlen commented May 29, 2023

PR updated to comment subtype output.
PR on rtl_433_tests will be updated accordingly

@zuckschwerdt zuckschwerdt merged commit 0564754 into merbanan:master May 29, 2023
andrewjw pushed a commit to andrewjw/rtl_433 that referenced this pull request Sep 29, 2023
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