# elero-cc1101-stick Drop-in replacement for the discontinued **Elero Centero Transmitter Stick** (art. 221250001), built from an **ESP32** and a cheap **CC1101** radio module. The firmware speaks the original stick's USB serial protocol (38400 8N1, Easy Check / Easy Send / Easy Info). Existing integrations such as the Home Assistant Elero integration, the openHAB `elerotransmitterstick` binding or FHEM should work with it **unchanged**: just point them at the new serial port. On the radio side it uses the Elero Proline2 bidirectional protocol (868 MHz band, 76.8 kBaud GFSK), so it receives the blinds' status replies, not only sends commands. > Status: **early, untested on hardware.** The protocol core is unit tested, > including a check against a real captured Elero packet. See > [What still needs verifying](#what-still-needs-verifying). ## Hardware | Part | Notes | |---|---| | ESP32-S3 DevKitC (recommended) | Native USB (`/dev/ttyACM0`), no separate USB-UART chip. Plug into the board's "USB" port, not "UART" | | or classic ESP32 DevKit | USB-UART bridge. Opening the port may reset the board (DTR), see below | | CC1101 module, **868 MHz** | A 433 MHz-tuned module also works, but with much shorter range | ### Wiring (RFinChina "TI-CC1101" 2×5 header) ``` CC1101 header ESP32-S3 ESP32 (classic) VCC VCC -> 3V3 3V3 (3.3 V only! never 5 V) SI SCK -> MOSI 11 / SCK 12 MOSI 23 / SCK 18 SO GDO2 -> MISO 13 / (n.c.) MISO 19 / (n.c.) CSN GDO0 -> CSN 10 / GDO0 9 CSN 5 / GDO0 26 GND GND -> GND GND ``` Pins can be changed in `platformio.ini` (`-DPIN_...`). On a classic ESP32 DevKit, opening the serial port toggles DTR/RTS and resets the board, so the first command after the integration starts can be lost. The native USB port of the ESP32-S3 should not do this, but check it on first use (`$INFO` right after opening the port must still answer). ## Build and flash ``` pip install platformio pio run -e esp32s3 -t upload # or -e esp32 ``` Unit tests (host, no hardware needed): `pio test -e native` ## Setup: clone the old stick The new stick can take over the **identity of your old stick**, so the blinds accept it without re-learning anything. You need the old stick for this once. All setup is done with text commands that start with `$`, in any serial terminal (38400 baud) or with `tools/stick_cli.py console`. 1. **Check the radio:** `$RADIO` should print `CC1101 OK partnum=00 version=14` (or `version=04`). 2. **Check the reception:** `$SNIFF ON`. Now move a blind with the old stick (from Home Assistant, or with `tools/stick_cli.py /dev/ttyUSB0 send 1 up`). You should see `# RX ...` lines: the old stick's command (`typ=6A`) and the blind's answer (`typ=CA`/`C9`). Look at `rssi=`: with the sticks 1-2 m apart, about -40...-60 is good. Around -80 or nothing at all means the module is tuned for another band or the frequency is off (see `$FREQ`). 3. **Learn:** `$LEARN ANY`, then send a command from the old stick on each of its channels (1, 2, 3, ...). Each one prints `# LEARNED channel n`. `$LEARN OFF` when done, `$LIST` to check the table. 4. Unplug the old stick, point your integration to the new port, and restart it. Done. You can also enter channels by hand, e.g. from an esphome-elero config: ``` $ADDR f0d008 the address this stick sends from $CH 4 a831e5 channel 4 -> blind a831e5 $CH 5 a1b2c3,d4e5f6 hop=0a channel 5 -> two blinds (a group) $SEND 4 UP try it ``` ### Console commands | Command | Meaning | |---|---| | `$HELP` | list commands | | `$INFO` | version, address, counter, frequency | | `$RADIO` | CC1101 detected? | | `$LIST` | channel table | | `$ADDR ` | own radio address (normally learned from the old stick) | | `$CH [,...] [RF=n] [SRC=hex6] [PI1=hh] [PI2=hh] [HOP=hh] [P1=hh] [P2=hh]` | set channel *n* (1-15) | | `$DEL ` | delete channel | | `$LEARN \|ANY\|OFF` | learn channels from sniffed commands of a stick or remote | | `$SNIFF ON\|OFF` | print every received / sent packet | | `$FREQ ` | CC1101 FREQ registers (default `21 71 7A`). Some modules need e.g. `21 71 C0` | | `$SEND UP\|DOWN\|STOP\|TILT\|INT\|CHECK` | send a command, prints the blind's status | | `$FACTORY` | erase all settings | Settings are kept in flash. The firmware never prints anything on its own unless `$SNIFF` or `$LEARN` is on, so the integration only ever sees binary frames. ## Serial protocol (what the integrations send) ``` Easy Check AA 02 4A cs -> AA 04 4B hi lo cs learned channel mask Easy Send AA 05 4C hi lo cmd cs -> AA 05 4D hi lo st cs status after the command Easy Info AA 04 4E hi lo cs -> AA 05 4D hi lo st cs current status cs = (0x100 - sum of all previous bytes) & 0xFF mask: bit (n-1) = channel n; commands 10 stop, 20 up, 24 tilt, 40 down, 44 intermediate ``` ## Home Assistant Tested against the protocol code of both [home-assistant-elero](https://github.com/W00D00/home-assistant-elero) and [home-assistant-elero-async](https://github.com/W00D00/home-assistant-elero-async): same frames, checksums, channel bitmap and status codes; both send one channel per request and read a fixed 6/7 byte answer, which is what this firmware sends. The one difference: the integrations auto-discover the original stick by its FTDI USB ID (`0403:6001`, manufacturer "elero"). The ESP32 has a different USB ID, so add it by hand: choose "Elero" in *Add integration* and enter the serial port (e.g. `/dev/serial/by-id/usb-Espressif_..._ACM0` or `/dev/ttyACM0`). ## What still needs verifying These were not checked against an original stick yet. `tools/stick_cli.py` prints every answer with its timing, so running the same commands against the old and the new stick shows any difference: - What the original stick answers when a blind does not reply (now: after 1.5 s, with the last known status or `00`; the original HA integration stops waiting after 2 s). - Whether the original stick sends one packet per channel or one packet to several blinds when more channels are set in the mask (now: one per channel). - That the radio channel byte the old stick sends equals its stick channel number (`$LEARN` assumes so; otherwise use `$CH` with `RF=`). - The exact frequency of your module (`$FREQ`). ## Credits - Payload encryption reverse engineered by [QuadCorei8085/elero_protocol](https://github.com/QuadCorei8085/elero_protocol) (MIT). - CC1101 register settings and packet layout as proven by [andyboeh/esphome-elero](https://github.com/andyboeh/esphome-elero) and [stanleypa/eleropy](https://github.com/stanleypa/eleropy). - Elero "Proline2" radio specification (FCC filing). All code in this repository is an independent implementation. ## License MIT