Add optional Somfy RTS receiver support (CC1101): track physical remote presses - #175
Add optional Somfy RTS receiver support (CC1101): track physical remote presses#175orren5 wants to merge 25 commits into
Conversation
|
I love this idea—, his is a really neat addition, and I think it could make Pi-Somfy much more useful for people who still use their physical remotes. A few things I'd love to see before merging is a bit more detail in the README around the hardware setup. Specifically:
This feature looks so clean that I'm honestly considering upgrading my own setup. 🙂 Having a more beginner-friendly hardware guide would make it much easier for others to adopt as well. Great work on this! |
|
|
This looks great! Thanks again for all the work you have put into this. I will take a closer look through the code later today or tomorrow, and if everything checks out, I will get it merged. I am especially excited to see this come together. It will be great for the sender to use the same hardware once this is successfully merged. Thanks again! |
|
The README was updated, and some wiring diagrams were added. |
|
I noticed one small issue with the graphical display. The expansion animation for the Physical Remote accordion is not completely smooth. The top part of the section seems to expand correctly, but the bottom part appears suddenly and feels tacked on rather than expanding naturally with the rest. Everything else seems fine as far as I was able to test. |
The bottom part is "Recently Heard (Unpaired)"? Can you share recording or screenshots? On my side it looks good. Screenshare.-.2026-08-01.11_41_05.AM.mp4 |
1fb8f2d to
67f5e74
Compare
|
Thanks. You won’t see it in your screenshot because you have so many paired remotes that the unpaired-remotes section extends below the visible viewport. Basically, the paired-remotes section expands properly. However, once it finishes expanding, the unpaired remotes are added instantly below it, without a smooth animation extending the section to include them. See the attached recording. You may have to slow down the video a bit. Recording.2026-08-01.131528.mp4 |
Add optional Somfy RTS receiver support: track physical remote presses
Summary
Pi-Somfy currently only sends RTS commands. This PR adds an optional receiver path: a cheap CC1101 module wired to the Pi decodes real Somfy RTS frames from any existing physical remote, so pressing one — not just issuing a command through Pi-Somfy itself — keeps the app's tracked shutter position, MQTT state, and Home Assistant in sync.
Fully opt-in and backwards compatible: leave
RXGPIOunset inoperateShutters.confand nothing about existing behavior changes.What's included
receiver.py, new) — CC1101 driver, RTS frame decoder, and press-tracker. SPI is bit-banged on ordinary GPIOs (noconfig.txtchanges or reboot needed). A TX-pause gate drops edges while Pi-Somfy is transmitting, and a self-echo filter ignores Pi-Somfy's own frames, so the receiver coexists safely with the existing TX path on the samepigpioddaemon._simulateUp/_simulateDown/_simulateStopstate machine as software-issued commands (newrecordExternalCommand), so position tracking, MQTT, and Home Assistant treat them identically to an app-issued command.opening/closing/stoppedevents now fire for every trigger source, not just app-issued ones. Wired into MQTT (mqtt.py), the web UI's "Manual Operation" panel (live state + a new live-interpolatedgetDisplayPosition()), and the Home Assistant custom component (cover.py'sis_opening/is_closingare now server-authoritative instead of only reflecting HA-issued commands).[PhysicalRemotes]config section), with unassign support — no manual config editing required.rx_gpio_pin/spi_sck/spi_mosi/spi_miso/spi_csnoptions;Dockerfile/run.sh/patch_pigpiod.pyupdates for pigpiod container quirks uncovered along the way (see below).Notable bugs found & fixed along the way
pigpiod's-l -mstartup flags disable thepi.callback()edge-notification mechanism the receiver depends on — root cause of an initial "receiver looks completely dead" investigation./dev/vcioaccess plus a pigpiod DMA/mailbox patch (patch_pigpiod.py) to run inside Supervisor's sandbox.stoppedmovement event, leaving the UI stuck showing "Opening…"/"Closing…" forever.RawConfigParserdoesn't drop removed options on re-read — the newconfig.RemoveValue()needed an explicitremove_option()call, not just a file rewrite.Screenshots
Config changes (all additive, no migration needed)
operateShutters.conf: new optionalRXGPIO/RXSpiSCK/RXSpiMOSI/RXSpiMISO/RXSpiCSN, new[PhysicalRemotes]and[ShutterPositions]sections (auto-created on first write if missing, so upgrading an existing install in place is safe).config.yaml: new optionalrx_gpio_pin/spi_sck/spi_mosi/spi_miso/spi_csn.Testing
test_receiver.py,test_config.py,test_webserver.py), all passing; skip cleanly on a machine withoutpigpio/Flask/etc. installed rather than failing collection.cover.py(Home Assistant custom component) changes are verified viapy_compileonly — needs thehomeassistantpackage to unit test — recommend a manual HA smoke-test before merge.Deferred / explicitly out of scope