-
Notifications
You must be signed in to change notification settings - Fork 639
RFBRIDGE
RFBRIGE module (rfbridge.ino) was originally created for the Sonoff RF Bridge. Since 1.13.6 it was combined with RF module and now allows to use standalone ESP8266 board with external RF receiver / transmitter.
rfin
and rfout
topics are used to receive and send messages.
State topic | Example payload | Notes |
---|---|---|
{root topic}/rfin |
26C0013603CA511451 |
received code |
Command topic | Example payload | Notes |
---|---|---|
{root topic}/rflearn/0/set |
1 |
see note1 below |
{root topic}/rfout/set |
26C0013603CA511451 |
send code |
{root topic}/rfout/set |
26C0013603CA511451,3 |
send code N times |
{root topic}/rfraw/set |
see note 2 below |
Command | description |
---|---|
learn <id> | Learn RF code for relay ID |
forget <id> | Forget previously learned RF code |
Key | Description | Possible values | Default value |
---|---|---|---|
rfbOFF# | Code to turn OFF the n-th device | A string | |
rfbON# | Code to turn ON the n-th device | A string | |
rfbRX | (DIRECT) RX GPIO | 0-15 | - |
rfbTX | (DIRECT) TX GPIO | 0-15 | - |
The RF codes produced by the firmware for the "direct" modified board are different from the ones produced by the "vanilla" bridge for same remote. This was a design choice, due to the different kind of information passed by the EFM8 hardware and the software library.
For example, running mosquitto_sub -v -t +/rfin
:
rfbridge-vanilla/rfin 2F260186046ACE9778
rfbridge-direct/rfin C00101841800CE9778
Thanks to @pelson, here is an example of how to port basic Arduino sketch code that uses RCSwitch to send messages using MQTT 3:
mySwitch.setProtocol(4);
mySwitch.send(2175276, 24);
Equivalent message for the rfout
would be:
mosquitto_pub -t "rfbridge-direct/rfout/set" -m "C0040000180021312C"
- C0: The initial byte (always the same)
- 04: Protocol 4.
- 0000: 2 timing bytes (16 bit int?) - I wanted the timing to be defined by the protocol, not overridden.
- 18: Bit length (24 in decimal)
- 0021312C: The code to send (2175276 in decimal). This code is limited to 4 bytes.
(1) Triggers a learn action. The index after the "learn" magnitude indicates the relay the code will be linked to. The payload of the message indicates the action (0
for off, 1
for on).
(2) Raw codes requires a special firmware in the EFM8BB1. See Portisch/RF-Bridge-EFM8BB1 and issue #386 for more information.
(3) https://gitter.im/tinkerman-cat/espurna?at=5d39a15be16c666d8967d6c9
If you're looking for support:
- Issues: this is the most dynamic channel at the moment, you might find an answer to your question by searching open or closed issues.
- Wiki pages: might not be as up-to-date as we all would like (hey, you can also contribute in the documentation!).
- Gitter channel: you have better chances to get fast answers from project contributors or other ESPurna users. (also available with any Matrix client!)
- Issue a question: as a last resort, you can open new question issue on GitHub. Just remember: the more info you provide the more chances you'll have to get an accurate answer.
- Backup the stock firmware
- Flash a pre-built binary image
- Flash a virgin Itead Sonoff device without opening
- Flash TUYA-based device without opening
- Flash Shelly device without opening
- Using PlatformIO
- from Visual Studio Code
- Using Arduino IDE
- Build the Web Interface
- Over-the-air updates
- Two-step updates
- ESPurna OTA Manager
- NoFUSS
- Troubleshooting
- MQTT
- REST API
- Domoticz
- Home Assistant
- InfluxDB
- Prometheus metrics
- Thingspeak
- Alexa
- Google Home
- Architecture
- 3rd Party Plugins
- Coding style
- Pull Requests