diff --git a/code/espurna/rfbridge.ino b/code/espurna/rfbridge.ino index 5d9d2fd5..e340bfe3 100644 --- a/code/espurna/rfbridge.ino +++ b/code/espurna/rfbridge.ino @@ -421,11 +421,26 @@ void rfbStatus(unsigned char id, bool status) { String value = rfbRetrieve(id, status); if (value.length() > 0) { bool same = _rfbSameOnOff(id); +#ifdef RF_RAW_SUPPORT + byte message[RF_MAX_MESSAGE_SIZE]; + int len = _rfbToArray(value.c_str(), message, 0); + if (len == RF_MESSAGE_SIZE && // probably a standard msg + (message[0] != RF_CODE_START || // raw would start with 0xAA + message[1] != RF_CODE_RFOUT_BUCKET || // followed by 0xB0, + message[2] + 4 != len || // needs a valid length, + message[len-1] != RF_CODE_STOP)) { // and finish with 0x55 +#else byte message[RF_MESSAGE_SIZE]; _rfbToArray(value.c_str(), message); +#endif unsigned char times = RF_SEND_TIMES; if (same) times = _rfbin ? 0 : 1; _rfbSend(message, times); +#ifdef RF_RAW_SUPPORT + } else { + _rfbSendRawOnce(message, len); // send a raw message + } +#endif } } diff --git a/code/html/index.html b/code/html/index.html index b1cf613b..fcc6ca9a 100644 --- a/code/html/index.html +++ b/code/html/index.html @@ -888,7 +888,7 @@

Sonoff 433 RF Bridge Configuration

To learn a new code click LEARN, the Sonoff RFBridge will beep, then press a button on the remote, the RFBridge will then double beep and the new code should show up. If the device double beeps but the code does not update it has not been properly learnt. Keep trying.

- Modify or create new codes manually (all codes must be 18 characters long) and then click SAVE to store them in the device memory. If your controlled device uses the same code to switch ON and OFF, learn the code with the ON button and copy paste it to the OFF input box, then click SAVE on the last one to store the value.

+ Modify or create new codes manually (18 characters standard, up to 116 raw) and then click SAVE to store them in the device memory. If your controlled device uses the same code to switch ON and OFF, learn the code with the ON button and copy paste it to the OFF input box, then click SAVE on the last one to store the value.

Delete any code clicking the FORGET button.

@@ -922,7 +922,7 @@
- +