Add optional Somfy RTS receiver support (CC1101): track physical remote presses - #175
Open
orren5 wants to merge 24 commits into
Open
Add optional Somfy RTS receiver support (CC1101): track physical remote presses#175orren5 wants to merge 24 commits into
orren5 wants to merge 24 commits into
Conversation
Reciever m2
update readme
Collaborator
|
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 file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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