feat: Add support for Somfy RTS commands#8
Conversation
|
In theory, this should also support garage gates, for example, Somfy GDK 700 (https://www.instrukcjaobslugipdf.pl/somfy/gdk-700/instrukcja?p=4), as it uses the same protocol. |
Based on the manual, you could also use a remote with up, down and stop buttons, which looks like the exact same remote that is working for the roller blinds. I would guess that this would then also directly work with that garage door. Based on the reversed protocol, the keys are just a single hex digit that are send by the remote, so probably the single button remote would also be using one of those values. The only question is which one is set to that single button.
https://pushstack.wordpress.com/somfy-rts-protocol/
|
|
I think I need to order CC1101 and give this a try. If I could have a dedicated up/down/stop button, then I could finally control the direction from HA. When it comes to pairing the remote with the opener, you need to put the opener in the programming mode, and then you press a button on the remote. This way, you could use a single remote with two openers (assuming you have two buttons on a remote). Basically, what you do is you assign a specific button on a remote with the gate opener. |
|
If you want to try that out, you must not wait until this is merged. Here you can find my fully working implementation in ESPHome that I'm using for years in different variations. I recently changed it to use the newly added CC1101 support in ESPHome. The original blog post made a lot of effort to sniff the signals with an SDR. As I didn't had one, I was struggling a lot with the initial implementation as I had no way to verify if I send the correct timings. Since there cannot be that many button presses, you could simply insert them here and have a look if your garage door would react the way you want. But based on page 21 of that manual, you should be able to just pair the remote with the prog button like for a cover and could then enjoy full up/down/stop control. Another advantage of the ESPHome implementation is, that they support time based covers, which estimate the exact position of a cover based on the runtime for a full open/close cycle. You just measure the open and close time of your cover and HA will then show how much the cover is currently opened. As every remote in Somfy RTS has a unique ID, you must set a random 6-digit hex value like 0x1234FF for your remote to be able to pair it here. |
|
For now, I use Shelly Uni with two magnetic door sensors, so I know when the gate is fully opened or closed. I also ordered parts for a potentiometer circuit to use an analog input of Uni and calculate the position from that, but I would prefer to have open, stop and close as dedicated functions. I'm going to order CC1101 and test the code you provided. |
|
While waiting for the module I contacted somfy, asking for a compatible remote with up and down functionality. |
| from .commands import ModulationType, OOKCommand, RadioFrequencyCommand | ||
| from .loader import CodeCollection, get_codes | ||
| from .parser import parse_sub_content | ||
| from .somfy_rts import SomfyRTSButton, SomfyRTSCommand |
There was a problem hiding this comment.
let's not put this in the main import. We should probably move commands out too. Those are gong to cause all files to be loaded while an integration might just use 1 code with 1 command.
There was a problem hiding this comment.
I've just refactored the package to better fit this. See #12
| the output strictly alternates between positive (mark) and negative | ||
| (space) microseconds. | ||
| """ | ||
| button_codes = { |
There was a problem hiding this comment.
CAn't we make the value of SomfyRTSButton.MY already be 0x1 ?
balloob
left a comment
There was a problem hiding this comment.
Please rebase and address comments.
30fde94 to
64cfcaa
Compare
Mirrors the codes-folder pattern from infrared-protocols: button enums live alongside other device codes and expose `to_command()` to build the protocol command. SomfyRTSCommand now takes `button: int`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

This PR adds support for Somfy RTS roller blinds. The protocol was reversed by those awesome guys over there: https://pushstack.wordpress.com/somfy-rts-protocol/
For transparency: Claude Code was used transfer an existing c++ implementation for ESPHome of the protocol that I created with the help of the reversed protocol a while back.
The Somfy RTS system is using a rolling code and thus cannot be loaded from a
.subfile. This implementation is thus instantiating theSomfyRTSCommandon every send action.I have an integration ready for Home Assistant core that is able to use this library to successfully control my roller blinds via the new ESPHome
radio_frequencycomponent. I'll open a PR there soon.