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 TR-502MSV remote controller for RC-710 smart sockets #2921

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

filipkosecek
Copy link

I have written a decoder for TR-502MSV smart socket controller, see merbanan/rtl_433_tests#467.

@zuckschwerdt
Copy link
Collaborator

zuckschwerdt commented May 7, 2024

Thanks, this looks good. It is written in an unusal way for our decoders though. We usually don't have single-use functions but a straight decode function. Also reformatting the bits before pulling out values seems unneeded, simply grabbing the needed bits with a mask and shifts over b[] would be a more general approach. E.g.

int device_id = ((b[0] & 0x7f) << 5) | (b[1] >> 3);

And command could be a lookup, something like:

char const *commands[] = { "OFF", "BRIGHT", "DIM", ON" };
int command = (b[2] >> 6);
char const *command_str = commands[command];

Are you ok to apply those simplifications?

Also can you table some codes, maybe reset the device a few times to get new IDs, so we can examine the UU checksum?

@filipkosecek
Copy link
Author

Sure, I will try to incorporate your suggestions. The get_sock_id function is OK or should I inline that one as well?

As for the checksum, ID doesn't seem to affect UU bits. Anyway, I will try to table some more samples with multiple IDs and upload it to the test repository in the following days.

@zuckschwerdt
Copy link
Collaborator

Yes, get_sock_id could look like the command example above.

You can just post a list of codes right here, easier to discuss.

@filipkosecek
Copy link
Author

filipkosecek commented May 8, 2024

I am adding some more samples with a different Device ID.

Preamble Device id Socket id Command Reserved Unknown
1 111010001000 000 00 0 00
1 111010001000 000 10 0 01
1 111010001000 100 00 0 10
1 111010001000 100 10 0 11
1 111010001000 010 00 0 01
1 111010001000 010 10 0 00
1 111010001000 110 00 0 11
1 111010001000 110 10 0 10
1 111010001000 111 01 0 11
1 111010001000 111 11 0 10
1 111010001000 111 00 0 01
1 111010001000 111 10 0 00
1 101110001000 000 00 0 00
1 101110001000 000 10 0 01
1 101110001000 100 00 0 10
1 101110001000 100 10 0 11
1 101110001000 010 00 0 01
1 101110001000 010 10 0 00
1 101110001000 110 00 0 11
1 101110001000 110 10 0 10
1 101110001000 111 01 0 11
1 101110001000 111 11 0 10
1 101110001000 111 00 0 01
1 101110001000 111 10 0 00
1 000011001000 000 00 0 00
1 000011001000 100 00 0 10
1 000011001000 110 00 0 11
1 000001001000 100 10 0 11
1 000001001000 110 10 0 10
1 000001001000 111 00 0 01
1 011101001000 000 11 0 11
1 011101001000 100 00 0 10
1 011101001000 111 10 0 00

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.

None yet

2 participants