ESP Somfy RTS Integration

This solution is only for RTS protocol motors. I do not know what the path is for connecting RS485 motors with Zigbee.

This has been working brilliantly for me but every now and again the device seems to completely crash to the point that only removing the power and plugging back in fixes it. I first notice it’s gone unavailable and then back online a few seconds later. It does this several times before going offline permanently. I know it’s not a HA/integration issue because the device doesn’t even respond to pings. Signal strength averages -62.

Any suggestions? The HA logs contain the following:

This error originated from a custom integration.

Logger: websocket
Source: custom_components/espsomfy_rts/
integration: ESPSomfy RTS (documentation)
First occurred: 27 March 2024 at 18:45:49 (10186 occurrences)
Last logged: 08:59:21

[Errno 104] Connection reset by peer - goodbye
[Errno 111] Connection refused - goodbye
Connection to remote host was lost. - goodbye
[Errno 113] Host is unreachable - goodbye
ping/pong timed out - goodbye

I’m wondering if I have a dodgy module. Hoping I don’t have to rebuild it as I’m pretty slow with the soldering iron!

EDIT: There was no unavailable statuses in HA for the whole night, then when my automation to open a blind ran at 07.15, the blind opened as it should then at 07.15 and 22 secs the whole thing went haywire. Over the next two minutes it went off and back on 22 times before staying off altogether. It doesn’t always happen but it seems to be getting more frequent. I have it powered by an 8-way usb charger off Amazon, that only has one other device connected to it but I think to rule it out I should probably try another power supply.

Your logs from HA are indicating that the module is going offline and cannot reconnect. The next version of the plugin will only report this once for the disconnect and on not for each attempt at reconnecting.

Certainly a low power condition can make an ESP32 do really weird things. Has the device been updated to the current released version v2.4.1 not any of the pre-releases?

Open an issue on github and give me a little bit of info regarding your setup.

  1. Which board do you have?
  2. Is MQTT and/or Discovery enabled?
  3. Is UPnP broadcast enabled?
  4. How many shades/groups are set up?

If you provide a backup I can stand up a device and watch it. There is currently another user with wifi dropouts but he is having wild swings on the link quality which indicates the module may be defective.

Could the kind folks here help out a complete noob venturing into home automation?
I have 4 somfy rts devices that I would like to control through HA.

I bought a rfxusb-rfx433 and followed instructions from below link and added HACS integration.
The next step is where I am lost. I can see the ESPSomfy-RTS-HA under devices however, how do I configure my somfy device? I have put it in program mode and still nothing picked up by HA.

Any help is appreciated.

GitHub - rstrouse/ESPSomfy-RTS-HA: Control your somfy shades in Home Assistant

Control your somfy shades in Home Assistant. Contribute to rstrouse/ESPSomfy-RTS-HA development by creating an account on GitHub.

The referenced rfxusb-rfx433 device is not needed or desired for the integration. Please see the following github for the hardware related to the above plugin.

Thanks for the reply. I have no knowledge or know how on the HW guide listed on github. I bought this HW based on the post below. Will it work?

The RFXtrx is a completely different animal and will not work with the integration listed above. There have been a lot of users that saved themselves $100 and simply set up an ESP32 just like the guide shows. No special skills are required and the functionality is far greater without creating a bunch of yaml code.

Anyone knows if there is a ready made harware boartd with ESP32 and CC1101 ?
I’m now running the ESPhome verions with dupont cables and would like to migrate to this solution.

Hello all,

I’m trying to setup my ESP32 with the transceiver, but I can’t get past the “radio not initialized” phase.

I have a Olimex ESP21-POE-ISO board. In the web interface I have setup this:
Capture d’écran 2024-04-07 à 23.32.42

This is because I want to use the pins on the UEXT, and according to the manual they are setup like this:


As far as I understand I should have the following pinout:
01 +3.3V
02 GND
06 CSN
07 TX
08 RX

Now I connect these to their matching pins on the transceiver - this is an E07-M11010D v2.0. The doc I can find indicates this pinout:

I understand GDO2 is RX and GDO0 is TX.

These are all connected and yet I have “radio not initialized”.

Am I doing something wrong? How can I test the transceiver to know it’s working?

Thank you!

Did you check the enable radio checkbox?

Yes, the checkbox is enabled.

Hey Gang,
I’m looking for some debug suggestions.
I have 3 RTS shades, two are powered off of 120v and one is a Sonesse Lion battery powered shade. All 3 work perfectly from the esp32 web interface. The two 120v shades work perfectly from HomeAssistant. The Sonesse Lion powered shade works from the controllers web interface, but not from Home Assistant.
Any ideas how I debug this?

From the devices and services page click reload integration. Then try it again. It sounds like it is working fine from the ESPSomfy RTS web interface but it does not work from a card. Is this correct?

Your pinout definition for the E07-M1101D is correct. Do you by chance have an SD card installed on the board. If you do GPIO15 and GPIO2 are not usable. GPIO2 is also a bootstrap pin meaning that it can be finicky.

The board not initialized will only occur if ESPSomfy RTS writes a value to the transceiver circuit over SPI and cannot read it back. So the top row of pins on the configuration are either not correct or there is some limitation to the pins you have selected. I would be suspect of your choice for MISO as GPIO36 is sometimes an input only pin.

Try setting it up where the wires are connected as follows:
SCLK (Pin5) = GPIO-16
CSN (Pin4) = GPIO-13
MOSI (Pin6) = GPIO-14
MISO (Pin7) = GPIO-15
TX (Pin3) = GPIO-04
RX (Pin8) = GPIO-36

Thanks a lot for the help. I’m not using an SD card, only the internal flash.

In your pinout, I assume you meant:
“CSN (Pin6) = GPIO-13” instead of “CSN (Pin4) = GPIO-13”
“MOSI (Pin9) = GPIO-14” instead of “MOSI (Pin6) = GPIO-14”

I assume this because I can’t correct the pinout “the other way around”, for instance for CSN I can’t pick GPIO-36 (the list stops at 33 for this entry).

In any case, I tried the configuration with my corrections above. No change, I still have the same message “radio not initialized”.

I have also ordered two extra transceivers, I’m still not convinced the one I’m using is ok…

The pin numbers I was referring to are the pin numbers on the E07-M1101D. The header pins on the Olimex are referred to by the GPIO number. If you look at the E07-M1101D the pins will be numbered. Then on the header of the UEXT connector there will be a GPIO reference. So pin 4 (CSN) on the E07-M1101D will connect to the GPIO13 on the Olimex UEXT connector.

GPIO-36 on the ESP32 is an input only pin and the CSN function is an output from the ESP32. From the pics in the documentation I cannot discern whether GND is pin 1 on the UEXT connector but it looks like it here. The key slot appears to be on the left.

1 Like

The devices work from ESPSomfy, and 2 of the 3 devices work from HA… one does not. I’ll reload the integration and do more testing.

@rstrouse indeed, I had wrongly understood that the pin numbers were the ones on the ESP32. It all makes sense now (and on the UEXT, GND is pin 2).

And at last I am past the error message. When I start a scan, the message is gone, so I assume the radio works. I need to assume for now because my RTS curtains are not in place yet :slight_smile: I will resume the project when they arrive.

In any case, a big thank you! for the code and for the support here. This is awesome and I wish I could buy you a beer!

OK - I have reloaded the integration, but the issue remains.
I have confirmed that the shades all work from ESPSomfy, and two out of three work from HA. Puzzling!

Post an issue and include a backup on Issues · rstrouse/ESPSomfy-RTS · GitHub

It is very strange that a single entity in HA would not respond.