Esphome configuration for Somfy Blind
This project still has bugs and is not optimized for use. So, you may have a little trouble using it.
Materials:
- 1 - Wemos D1;
- 1 - 220 ohms resistor;
- 1 - Led, any color;
- 1 - FS1000A 433,42 Mhz (*);
- 1 - Breadboard;
(*) You need to buy a FS1000A 433,92 Mhz and change the crystal for a 433,42 Mhz.
Software:
- Running Home Assistant [https://www.home-assistant.io/]
- ESPhome component [https://esphome.io/]
I found on the internet some instructions on how to make an antenna for 433.42Mhz transmission.
It was better than just a thread. In fact, I think that some problems in programming the controls have improved.
- Copy the files from this repository to the
/config/esphome/
directory.
- RFsomfy.h
- SomfyRts.cpp
- SomfyRts.h
- platformio.ini
-
Create a new ESPHome device and use
esp_somfy.yaml
from this repository. -
Customize
RFsomfy.h
file, as you need.
#define STATUS_LED_PIN D1
#define REMOTE_TX_PIN D0
#define REMOTE_FIRST_ADDR 0x121311 // <- Change remote name and remote code here!
#define REMOTE_COUNT 3 // <- Number of somfy blinds.
- Customize your ESPHome device, changing
esp_somfy.yaml
as you need.
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pass
use_address: 192.168.50.12
manual_ip:
static_ip: 192.168.50.12
gateway: 192.168.50.1
subnet: 255.255.255.0
Change here according to the amount of blinds you have.
cover:
- platform: custom
lambda: |-
std::vector<Cover *> covers;
auto rfSomfy0 = new RFsomfy(0);
rfSomfy0->set_code(1);
App.register_component(rfSomfy0);
auto rfSomfy1 = new RFsomfy(1);
rfSomfy1->set_code(1); // 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
ATTENTION
You do not need to use this line rfSomfy0->set_code(1);
, only if you need to manually set the first code.
- Compile and Upload customized ESPhome to your device.
-
Insert your new entities in your home assistant's dashboard.
They should have names similar to these:
- cover.veneziana_roxo
- cover.blind_roxo
- cover.blind_2
-
For programming, place your ESPHome device as close as possible to the blind to be controlled.
Once programmed, you can place it further away, in a position that is close to all the blinds to be controlled.
-
Choose one of the entities and open it in full mode.
Blind control interface
-
Put your blind in programming mode. If necessary, consult the blind manual or the manufacturer.
-
Slide the bar that controls the tilt position to the value 11.
a) This causes your ESP device to enter programming mode. As if it were an additional remote control.
b) If the programming without problems, your blind will move immediately.
c) In case of problems, check your device's log.
Some commands were created, accessed by tilting the blind to try to facilitate debugging and configuration.
// cmd 11 - program mode
// cmd 16 - program mode for grail devices
// cmd 21 - delete rolling code file
// cmd 41 - List files
// cmd 51 - Test filesystem.
// cmd 61 - Format filesystem and test.
// cmd 71 - Show actual rolling code
// cmd 81 - Get all rolling code
// cmd 85 - Write new rolling codes