ESP Somfy RTS Integration


I was looking at my database (for something unrelated to ESP Somfy) and noticed a large number of states table rows for two entities that seem to be part of ESP Somfy: sensor.free_memory and sensor.wifi_strength.

Is that expected? It’s by far the largest entity tracked.

sqlite> select m.entity_id, count(*) from states s join states_meta m on s.metadata_id = m.metadata_id GROUP BY m.entity_id ORDER BY 2 DESC LIMIT 10;
entity_id                                        count(*)
-----------------------------------------------  --------
sensor.free_memory                               179142
sensor.system_monitor_processor_temperature      42176
sensor.powerwall_load_power                      28379
sensor.powerwall_site_power                      27578
sensor.wifi_strength                             26925
sensor.my_home_tg123139001jjr_battery_voltage    26006
sensor.my_home_tg123139000svf_battery_voltage    25986
binary_sensor.irrigation_unlimited_c1_m          23694
sensor.powerwall_battery_power                   22383
sensor.my_home_tg123139000svf_battery_remaining  19732

And seems to be updating frequently:

sqlite> select m.entity_id, DATETIME(last_updated_ts, 'unixepoch', 'localtime') as last_updated, DATETIME(last_reported_ts, 'unixepoch', 'localtime') as last_reported from states s join states_meta m on s.metadata_id = m.metadata_id where m.entity_id = 'sensor.free_memory' order by 2 desc limit 10;
entity_id           last_updated         last_reported
------------------  -------------------  -------------------
sensor.free_memory  2024-06-11 07:28:53
sensor.free_memory  2024-06-11 07:28:50  2024-06-11 07:28:50
sensor.free_memory  2024-06-11 07:28:39  2024-06-11 07:28:39
sensor.free_memory  2024-06-11 07:28:38  2024-06-11 07:28:38
sensor.free_memory  2024-06-11 07:28:38  2024-06-11 07:28:38
sensor.free_memory  2024-06-11 07:28:36  2024-06-11 07:28:36
sensor.free_memory  2024-06-11 07:28:36  2024-06-11 07:28:36
sensor.free_memory  2024-06-11 07:28:35  2024-06-11 07:28:35
sensor.free_memory  2024-06-11 07:28:34  2024-06-11 07:28:34
sensor.free_memory  2024-06-11 07:28:34  2024-06-11 07:28:34

Well that’s unfortunate that recorder writes every value to the database and there appears to be no way to display the current value without recording it. I’ll look at some ways to reduce the display and still keep some modicum of what the current value is. This value is only emitted when it changes but it really is too bad that there isn’t more control over the value packing.

For now you can exclude the entity in the recorder config so it is an all or nothing.

@rstrouse I just finished setting up my shades in Home Assistant and I wanted to thank you for the excellent work and support you provide to the community. You definitely deserve a beer or twelve.

Oh, I somehow I thought the recorder was only for writing to the statistics tables. Oops.

Does setting the commit_interval change the number of rows written? Or is that just more of how often the data is written? That is, it doesn’t change the number of rows written, rather just how frequently they are written?

Does seem like one might want realtime-ish display but not write every change to the states table – or maybe define what is considered a state change that triggers a new row in the states table.


commit_interval is how frequently the rows are written. To be fair this is not a huge amount of data in terms of storage or management. This data is purged depending on the purge interval set but there is really no reason to persist it anyway. But there is no way by default to not include the sensor entity in the recorder.

@ChrisMac715 did you get your radio sorted out?

I finnaly had spare time to try pairing ESPRTS with the gate Somfy RTS.
So here is how I pair a new remote control (there is no pairing buton)

So I have try to do it at the same time with ESP RTS.
Unfortunaly I did not suceed doing it.
Is there some one else trying to do that ?
and if so did you succeed ?

If someone can help me ?

This is great. Excited to give try to use it.

Has anyone tried to use this with m5stack device? I have some of them already and it would be a bit easier for me to use one. I see a reference to it in this github issue but nothing else.

The ESP32 part of it is supported but it does not support the LoRa module for 433mHz because it uses an SX1278 chip. The firmware only supports CC1101 chips.

Got it, that makes sense. I thought I saw it had a different chip. I’m a super noob with the hardware side of it, so I might have to do some digging on how to do this with available hardware that’s not effectively prepackaged like the m5stack stuff.
Thank you


first of all a big “THANK YOU” @rstrouse for the work you have put in that project.
I´ve built my own box now and it works like a charm from the WebGUI.
The published topics also arrive in my MQTT broker instance (iobroker) without problems.

I´ve manually created the following two additional states (read/write) from the subscribed topics in my MQTT broker:

  • [root topic]/shades/[shadeId]/direction/set
  • [root topic]/shades/[shadeId]/target/set

Reference: [Integrations · rstrouse/ESPSomfy-RTS Wiki · GitHub]
I have replaced [root topic] with “somfy” and [shadeId] with the respective object/number of course.

Here comes an example of the state definition (JSON format):
{ "common": { "name": "somfy/shades/7/target/set", "desc": "Manuell erzeugt", "role": "state", "type": "number", "read": true, "write": true, "def": 0 }, "native": { "topic": "somfy/shades/7/target/set" }, "type": "state", "_id": "mqtt.0.somfy.shades.7.targetSet", "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "" }, "from": "system.adapter.admin.0", "user": "system.user.admin", "ts": 1718545777490 }

However setting the applicable values on those states (-1/0/+1 or 0-100) does not trigger movement of the shades.

Any advice how to fix this / what I´m doing wrong would be very much appreciated.

Sorry, but I did not find the link to this HA forum in the Wiki earlier, so I opened a bug report on GitHub: MQTT subscribed topics not working · Issue #400 · rstrouse/ESPSomfy-RTS · GitHub

If it is just a “newbie” problem in MQTT configuration, the bug report can be closed.

Regards /// Marc

I answered you in the Github repo. The set topics are not stateful. They are only publish topics. I put the code that you should be using to set them in that issue response.

1 Like

Sorry for replying to an old post. But I have the same problem as RaA11.
But can’t find .zip file.

Is this still available?

Thanks for rapid response. sendTo procedure is doing the trick. Now I only need to sort out how/if the percentage values of the shutters can be aligned/calibrated.

@Jovink yes this is still available. If you are looking for the onboard files go to the GitHub repo and click on the current release. There is an extensive wiki with instructions on install and configuration.

1 Like

Go into each shade definition and set the timing for the up and down travel in milliseconds.

I had to replace my hardware. I put in the backup from the old one but now in HA it shows me 2 devices (with the double of entities) and an discovered device.
(Bevore I had 1 device with 22 entties)

What I have to do, that all gets replaced with the new HW?

If someone else is in the same case …
here what to do:

I first create a new room then a new shade.
I have to change on the shade tab the bit from 56 bits to 80 bits (and save).
I put the ESPSomfy RTS device (antenna) on the somfy gateway motor device (I don’t have any button on it.)
Then I took the virtual remote tab and I did as I was on the real keytis remote.
That’s mean the TOGGLE button. I push long the1st time then the gateway device jump to the pairing mode (LED RADIO turn on), I then push TOGGLE again the LED RADIO is still ON and the LED “Sequential auto closing” is ON and finaly, I push TOGGLE again “RAZ” LED is blinking then all LED is turning OFF.
That’s it.

The old device is tagged to the chip id on the ESP32 you will need to delete the old one. It will be the one with the inactive devices.

But if I delete it, I have to do all work on the visualization and automations again?