-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for nexus protocol to rc-switch library (#21886)
* add support for nexus protocol to RCSwitch library Nexus protocol is used by temperature and humidity sensor that operate at 433 MHz. It is used by various brands. * calc separation limit for RCSwitch library automatically
- Loading branch information
Showing
3 changed files
with
57 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
caa501b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For long codes (over 0xFFFFFFFF) the 'xdrv_17_rcswitch.ino' driver does not display them correctly.
Mainly I modified:
on line 54:
unsigned long long data = mySwitch.getReceivedValue(); // it should be 'long long' in accordance with rc_switch
on lines 65 - 70:
char stemp[24];
if (Settings->flag.rf_receive_decimal) { // SetOption28 - RF receive data format (0 = hexadecimal, 1 = decimal)
snprintf_P(stemp, sizeof(stemp), PSTR("%lu"), data);
} else {
if (data <= 0xFFFFFFFF) { // otherwise it still doesn't display the entire reception in hexa format
snprintf_P(stemp, sizeof(stemp), PSTR(""0x%lX""), (uint32_t) (data));
} else {
snprintf_P(stemp, sizeof(stemp), PSTR(""0x%lX%08lX""), (uint32_t) (data>>32),(uint32_t) (data)); // this is the solution I found for the correct display
}
}
caa501b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx.
As we have "%_X" for printing 64-bit values I'll test a final solution now.
caa501b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in latest dev just now.
caa501b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arendst
I'm sorry but it seems like something is wrong.
I just uploaded the version 14.4.1.4 ( from http://ota.tasmota.com/tasmota/tasmota-sensors.bin.gz).
The reception is display:
tele/433_bridge/RESULT {"Time":"2025-02-11T18:55:23","RfReceived":{"Data":"0x00000009D8088F24","Bits":36,"Protocol":38,"Pulse":593}}
but it should look like this:
tele/433_bridge/RESULT {"Time":"2025-02-11T19:53:20","RfReceived":{"Data":"0x9D8083F24","Bits":36,"Protocol":38,"Pulse":596}}
and this reception:
tele/433_bridge/RESULT {"Time":"2025-02-11T19:55:08","RfReceived":{"Data":"0x38F9EF0000AE","Bits":52,"Protocol":38,"Pulse":555}}
is not display.