Skip to content

Arduino program to control equipments via the protocol SOMFY RTS or Chacon DiO

Notifications You must be signed in to change notification settings

stephane/box-somfy-dio

Repository files navigation

Box Somfy DIO

Introduction

Arduino program to control equipments via the protocol SOMFY RTS or Chacon DiO.

This code has been tested on ESP8266 with the very simple electronic components:

History

The code is based on the reverse engineering described in https://pushstack.wordpress.com/somfy-rts-protocol/.

The original code is https://github.com/Nickduino/Somfy_Remote.

There are many forks of this code on internet:

This version is based on TOST Corp. code (2018 to 2020).

Modified by Stéphane Raimbault, 11/2020:

  • MQTT Discovery for easy integration with Home Assistant
  • a cover can be associated to many groups
  • groups are exposed as remotes in Home Assistant
  • simpler configuration (no rolling code, EEPROM addresses, etc)
  • no dynamic allocation in loop() to avoid memory fragmentation
  • faster code (remove many delays, fast path, pointers, pure string management, early return in functions)
  • removed useless Ticker
  • comments in english
  • remove code to publish setup on weird server
  • remove publishing of every handled commands on MQTT box topic
  • DRY on many parts of the code
  • common hostname/MQTT ID/MQTT topic for the box generated from MAC address

License

License CC BY NC SA.

Compilation and upload in ESP8266

Copy the file config-default.h to config.h and edit it for your settings.

In the Arduino IDE, add support for the board:

  1. File > Preferences
  2. in field Additional Boards Manager URLs: http://arduino.esp8266.com/stable/package_esp8266com_index.json
  3. in the menu Tools > Board > Boards manager, install the board ESP8266 [version 2.4.1 to have the board WeMos D1 R2 & mini]. Don't use the last version 2.7.4!
  4. select the board WeMos D1 R2 & mini ou LOLIN (WEMOS) D1 R2 & mini.
  5. select the Port and speed 115200 bauds of the serial monitor.

How to pair a SOMFY cover

After downloading the code in your box:

  1. Press the PROG button on the remote control of one of the your equipment, the shutter will make a back and forth movement up/down
  2. Send a "p" message to the MQTT server with the corresponding topic to the equipment
  3. Send a "u", "d" or "s" message to raise, lower or stop the shutter.

The rolling code value is stored in the EEPROM, so that you don't loose count of your rolling code after a power off or reset.

About

Arduino program to control equipments via the protocol SOMFY RTS or Chacon DiO

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published