Somfy RTS, covers, shutter, ESPhome, github.com/dmslabsbr/esphome-somfy

Hello all,
Would be very thankfull if you could help in getting the Somfy remote ESP HA updated/working.
Thank you in advanced!

I am strugling with integrating Somfy RTS through ESPhome.
Trying to get 4 Somfy RTS shutters with Somfy remotes integrated in HA with a Wemos D1 Mini and a RF 433.42mhz Transmitter.

Hardware Wemos D1 mini
433mhz receiver transmitter (replaced the crystal with a 433.42 crystal)
RF
Transmitter connected to D6
Receiver connected to D5 (to later read existing remotes)

Have also tried:

Issues with SPIFF and Ticker

and:

Issues with SPIFF and Ticker

Tried to integrate one on one using: GitHub - dmslabsbr/esphome-somfy: Esphome configuration for Somfy Blind
Followed all the steps copied the needed files in the ESPhome directory.

Explanations of all three are straight forward and look very easy.
All three are from 2020 - 2021, maybe outdated due to software updates?

With Dmslabsbr GitHub - dmslabsbr/esphome-somfy: Esphome configuration for Somfy Blind i get the following:
First error i get in ESPhome befor installing/compiling:

arduino_version: [email protected] gives:
component not found arduimo version.

Compiling the code in ESPhome giving:
Error on Ticker:

  • src/RFsomfy.h:4:10: fatal error: Ticker.h: No such file or directory

Warning regarding SPIFF:

  • src/SomfyRts.cpp:190:3: warning: ‘SPIFFS’ is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
    190 | SPIFFS.begin();
    (See full log below…)

My Yaml:

esphome:
  name: somfy

  includes:
    - RFsomfy.h
    - SomfyRts.h
    - SomfyRts.cpp

esp8266:
  board: d1_mini
  
#arduino_version: [email protected] 
#Gives an error in ESPhome: component not found arduimo version.

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "xxxxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Somfy Fallback Hotspot"
    password: "xxxxxxx"

captive_portal:

cover:
- platform: custom
  lambda: |-
    std::vector<Cover *> covers;
    auto rfSomfy0 = new RFsomfy(0);
    rfSomfy0->set_code(50);
    App.register_component(rfSomfy0);
    auto rfSomfy1 = new RFsomfy(1);
    rfSomfy1->set_code(100);  // Set initial rolling code. After it works, remove this line.
    App.register_component(rfSomfy1);
    auto rfSomfy2 = new RFsomfy(2);
    App.register_component(rfSomfy2);
    covers.push_back(rfSomfy0);
    covers.push_back(rfSomfy1);
    covers.push_back(rfSomfy2);
    return {covers};

  covers:
    - name: "Blind 2"
      device_class: shade
      id: somfy0
    - name: "Veneziana casal"
      device_class: shutter
      id: somfy1
    - name: "Veneziana roxo"
      device_class: shutter
      id: somfy2

text_sensor:
  - platform: version
    name: "RFsomfy version"
  - platform: custom
    lambda: |-
      auto rfSomfyInfo = new RFsomfyInfo();
      App.register_component(rfSomfyInfo);
      return {rfSomfyInfo};
    text_sensors:
      name: "RFsomfy info"
    
binary_sensor:
  - platform: status
    name: "RFsomfy status"

The esphome logger returns:

INFO Reading configuration /config/esphome/somfy.yaml…
INFO Generating C++ source…
INFO Core config or version changed, cleaning build files…
INFO Deleting /data/somfy/.pioenvs
INFO Deleting /data/somfy/.piolibdeps
INFO Compiling app…
Processing somfy (board: d1_mini; framework: arduino; platform: platformio/espressif8266 @ 3.2.0)

HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
Dependency Graph
|-- 1.2.3
|-- 2.1.0
| |-- 1.2.3
| |-- 1.0
| |-- 1.0
|-- 1.1.1
|-- 1.0
|-- 1.2
Compiling /data/somfy/.pioenvs/somfy/src/SomfyRts.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/api_connection.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/api_frame_helper.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/api_pb2.cpp.o
src/SomfyRts.cpp: In member function ‘uint16_t SomfyRts::_readRemoteRollingCode()’:
src/SomfyRts.cpp:190:3: warning: ‘SPIFFS’ is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
190 | SPIFFS.begin();
| ^~~~~~
In file included from src/SomfyRts.cpp:2:
/data/cache/platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:275:15: note: declared here
275 | extern fs::FS SPIFFS attribute((deprecated(“SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.”)));
| ^~~~~~
src/SomfyRts.cpp:191:7: warning: ‘SPIFFS’ is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
191 | if (SPIFFS.exists(_getConfigFilename())) {
| ^~~~~~
In file included from src/SomfyRts.cpp:2:
/data/cache/platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:275:15: note: declared here
275 | extern fs::FS SPIFFS attribute((deprecated(“SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.”)));
| ^~~~~~
src/SomfyRts.cpp:193:14: warning: ‘SPIFFS’ is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
193 | File f = SPIFFS.open(_getConfigFilename(), “r”);
| ^~~~~~
In file included from src/SomfyRts.cpp:2:
/data/cache/platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:275:15: note: declared here
275 | extern fs::FS SPIFFS attribute((deprecated(“SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.”)));
| ^~~~~~
src/SomfyRts.cpp:205:3: warning: ‘SPIFFS’ is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
205 | SPIFFS.end();
| ^~~~~~
In file included from src/SomfyRts.cpp:2:
/data/cache/platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:275:15: note: declared here
275 | extern fs::FS SPIFFS attribute((deprecated(“SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.”)));
| ^~~~~~
src/SomfyRts.cpp: In member function ‘void SomfyRts::_writeRemoteRollingCode(uint16_t)’:
src/SomfyRts.cpp:211:3: warning: ‘SPIFFS’ is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
211 | SPIFFS.begin();
| ^~~~~~
In file included from src/SomfyRts.cpp:2:
/data/cache/platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:275:15: note: declared here
275 | extern fs::FS SPIFFS attribute((deprecated(“SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.”)));
| ^~~~~~
src/SomfyRts.cpp:213:12: warning: ‘SPIFFS’ is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
213 | File f = SPIFFS.open(_getConfigFilename(), “w”);
| ^~~~~~
In file included from src/SomfyRts.cpp:2:
/data/cache/platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:275:15: note: declared here
275 | extern fs::FS SPIFFS attribute((deprecated(“SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.”)));
| ^~~~~~
src/SomfyRts.cpp:223:3: warning: ‘SPIFFS’ is deprecated: SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
223 | SPIFFS.end();
| ^~~~~~
In file included from src/SomfyRts.cpp:2:
/data/cache/platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:275:15: note: declared here
275 | extern fs::FS SPIFFS attribute((deprecated(“SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.”)));
| ^~~~~~
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/api_pb2_service.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/api_server.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/list_entities.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/proto.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/subscribe_state.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/user_services.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/binary_sensor/automation.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/binary_sensor/binary_sensor.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/binary_sensor/filter.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/captive_portal/captive_portal.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/cover/cover.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/custom/text_sensor/custom_text_sensor.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/esp8266/core.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/esp8266/gpio.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/esp8266/preferences.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/logger/logger.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/md5/md5.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/mdns/mdns_component.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/mdns/mdns_esp32_arduino.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/mdns/mdns_esp8266.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/mdns/mdns_esp_idf.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/network/util.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/ota/ota_backend_arduino_esp32.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/ota/ota_backend_arduino_esp8266.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/ota/ota_backend_esp_idf.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/ota/ota_component.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/socket/bsd_sockets_impl.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/socket/lwip_raw_tcp_impl.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/socket/socket.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/status/status_binary_sensor.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/text_sensor/filter.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/text_sensor/text_sensor.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/version/version_text_sensor.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/web_server_base/web_server_base.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/wifi/wifi_component.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/wifi/wifi_component_esp32_arduino.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/wifi/wifi_component_esp8266.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/wifi/wifi_component_esp_idf.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/core/application.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/core/color.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/core/component.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/core/component_iterator.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/core/controller.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/core/entity_base.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/core/helpers.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/core/log.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/core/scheduler.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/core/util.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/main.cpp.o
In file included from src/main.cpp:33:
src/RFsomfy.h:4:10: fatal error: Ticker.h: No such file or directory


  • Looking for Ticker.h dependency? Check our library registry!
  • CLI > platformio lib search “header:Ticker.h”
  • Web > PlatformIO Registry

4 | #include "Ticker.h"
  |          ^~~~~~~~~~

compilation terminated.
*** [/data/somfy/.pioenvs/somfy/src/main.cpp.o] Error 1
========================= [FAILED] Took 111.40 seconds =========================

Please post your code properly.

Thank you for pointing out!

Hope this helps.

Anybody facing the same issues, or have a “working” solution for Somfy RTS?

Thank you

I got mine working with cc1101 transceiver and wroom 32s.
It was a while ago - I can’t remember exactly what I did to get it going.
I got a few errors with libraries. I googled errors and updated.

esphome:
  name: ${device_name}
  platform: ESP32
  board: nodemcu-32s
  libraries:
    - SPI
    - EEPROM
    - [email protected]
    - [email protected]

  includes:
    - somfy_secrets.h
    - somfy_cover.h

Hope this helps.

Thank you for helping out!

Tried exactly as you suggested in your post including the lib’s and includes.
Get the errors on SPIFFS was not declared.
Any idea what i can do?

Thank you

HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
Dependency Graph
|-- 1.2.2
|-- 1.0
|-- 1.0.3
|-- 2.5.7
|-- <Somfy_Remote_Lib> 0.4.1
|-- 1.0
|-- 1.0
|-- 1.0
|-- 2.1.0
| |-- 1.2.2
|-- 1.1.0
|-- 1.0
Compiling /data/somfy-nodemcu/.pioenvs/somfy-nodemcu/src/SomfyRts.cpp.o
Compiling /data/somfy-nodemcu/.pioenvs/somfy-nodemcu/src/esphome/components/api/api_connection.cpp.o
Compiling /data/somfy-nodemcu/.pioenvs/somfy-nodemcu/src/esphome/components/api/api_frame_helper.cpp.o
Compiling /data/somfy-nodemcu/.pioenvs/somfy-nodemcu/src/esphome/components/api/api_pb2.cpp.o
src/SomfyRts.cpp: In member function ‘uint16_t SomfyRts::_readRemoteRollingCode()’:
src/SomfyRts.cpp:191:3: error: ‘SPIFFS’ was not declared in this scope
SPIFFS.begin();
^
src/SomfyRts.cpp: In member function ‘void SomfyRts::_writeRemoteRollingCode(uint16_t)’:
src/SomfyRts.cpp:212:3: error: ‘SPIFFS’ was not declared in this scope
SPIFFS.begin();
^
*** [/data/somfy-nodemcu/.pioenvs/somfy-nodemcu/src/SomfyRts.cpp.o] Error 1
========================= [FAILED] Took 25.64 seconds =========================

When I compile mine i get:

INFO Reading configuration /config/esphome/somfy.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing somfy (board: nodemcu-32s; framework: arduino; platform: platformio/espressif32 @ 3.5.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- <SPI> 1.0
|-- <EEPROM> 1.0.3
|-- <SmartRC-CC1101-Driver-Lib> 2.5.7
|-- <Somfy_Remote_Lib> 0.4.1
|-- <WiFi> 1.0
|-- <ESPmDNS> 1.0
|-- <Update> 1.0
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/api_connection.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/api_frame_helper.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/api_pb2.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/api_pb2_service.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/api_server.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/list_entities.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/proto.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/subscribe_state.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/api/user_services.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/cover/cover.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/esp32/gpio_arduino.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/esp32/gpio_idf.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/esphome/components/esp32/preferences.cpp.o
Compiling /data/somfy/.pioenvs/somfy/src/main.cpp.o
Linking /data/somfy/.pioenvs/somfy/firmware.elf
RAM:   [=         ]  12.5% (used 40872 bytes from 327680 bytes)
Flash: [=====     ]  46.2% (used 846942 bytes from 1835008 bytes)
Building /data/somfy/.pioenvs/somfy/firmware.bin
esp32_create_combined_bin(["/data/somfy/.pioenvs/somfy/firmware.bin"], ["/data/somfy/.pioenvs/somfy/firmware.elf"])
Wrote 0xdecd0 bytes to file /data/somfy/.pioenvs/somfy/firmware-factory.bin, ready to flash to offset 0x0
========================= [SUCCESS] Took 12.66 seconds =========================

A quick google search for error: ‘SPIFFS’ was not declared in this scope.

Just added SPIFFS.h after the first line
#include <FS.h> //this needs to be first, or it all crashes and burns…
#include “SPIFFS.h”
https://github.com/zhouhan0126/WIFIMANAGER-ESP32/issues/15

Try and find file “src/SomfyRts.cpp” and see what’s in it. It might be in a hidden directory.

I used this guide to build mine:
https://www.die-welt.net/2021/06/controlling-somfy-roller-shutters-using-an-esp32-and-esphome/

https://github.com/LSatan/SmartRC-CC1101-Driver-Lib
https://github.com/Legion2/Somfy_Remote_Lib
https://www.arduino.cc/reference/en/libraries/somfy_remote_lib/