Skip to content

AlexLaur/ESP-RTSomfy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SomfyController

Control Somfy blinds (with RTS Protocol) througt an Arduino Wemos D1.

It is based from the work of Nickduino at Somfy_Remote

Hardware

Soldering

Solder a 433.42 MHz crystals to replace the one on a 433.92MHz transmitter. A RTL-SDR comes in handy to check the frequency and make sure the transmitter is working.

Wiring

Wiring

Software

First step

Once binaries (Core and UI) uploaded. Connect to the Hotspot SomfyController Fallback Hotspot (defined in includes/config.h). Use the password 5cKErSRCyQzy (also defined in includes/config.h). Then, connect to 192.168.4.1 to setup your WiFi connection.

On the UI, you can create, read, update and delete remotes.

UI

UI is build with HTML/CSS/JS. It use library like tailwind and alpine.js. UI

OTA updates

TODO

TODO

  • Support non ASCII chars in names ?
  • Add OTA
  • Improve HTML part
  • Create a HA integration

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

API

REST

POST /api/v1/system/restart (Resuqests a restart)
Parameters

None

Responses
http code content-type response
200 application/json {"message":"Restart requested."}
400 application/json {"message":"error"}
Example cURL
 curl -X POST -H "application/x-www-form-urlencoded" http://192.168.4.1/api/v1/system/restart
GET /api/v1/system/infos (Gets system informations)
Parameters

None

Responses
http code content-type response
200 application/json JSON string
Example cURL
 curl -X GET -H "application/x-www-form-urlencoded" http://192.168.4.1/api/v1/system/infos
GET /api/v1/wifi/networks (Gets scanned networks)
Parameters

None

Responses
http code content-type response
200 application/json JSON string
Example cURL
 curl -X GET -H "application/x-www-form-urlencoded" http://192.168.4.1/api/v1/wifi/networks
GET /api/v1/wifi/config (Gets WiFi configuration)
Parameters

None

Responses
http code content-type response
200 application/json JSON string
Example cURL
 curl -X GET -H "application/x-www-form-urlencoded" http://192.168.4.1/api/v1/wifi/config
POST /api/v1/wifi/config (Updates WiFi configuration)
Parameters
name type data type description
ssid required string The SSID of the network to connect
password optional string The Password of the network to connect
Responses
http code content-type response
200 application/json {"ssid":"foo","password":"bar"}
400 application/json {"message":"error"}
Example cURL
 curl -X POST -H "application/x-www-form-urlencoded" -d "ssid=foo&password=bar" http://192.168.4.1/api/v1/wifi/config
GET /api/v1/mqtt/config (Gets MQTT configuration)
Parameters

None

Responses
http code content-type response
200 application/json JSON string
Example cURL
 curl -X GET -H "application/x-www-form-urlencoded" http://192.168.4.1/api/v1/mqtt/config
POST /api/v1/mqtt/config (Updates MQTT configuration)
Parameters
name type data type description
enabled required bool Enable or not MQTT
broker required string The MQTT server address
port required int The port of MQTT server
username optional string Login to connect to the server
password optional string Password to connect to the server
Responses
http code content-type response
200 application/json {"enabled":true, "broker": "", "port": 42, "username": "", "password":""}
400 application/json {"message":"error"}
Example cURL
 curl -X POST -H "application/x-www-form-urlencoded" -d "enabled=true&broker=bar&port=42&username=&password=" http://192.168.4.1/api/v1/mqtt/config
GET /api/v1/remotes (Gets all registered remotes)
Parameters

None

Responses
http code content-type response
200 application/json JSON string
Example cURL
 curl -X GET -H "application/x-www-form-urlencoded" http://192.168.4.1/api/v1/remotes
POST /api/v1/remotes (Creates a new remote)
Parameters
name type data type description
name required string Name of the remote
Responses
http code content-type response
201 application/json {"name":"foo", "id": 42, "rolling_code": 42}
400 application/json {"message":"error"}
Example cURL
 curl -X POST -H "application/x-www-form-urlencoded" -d "name=foo" http://192.168.4.1/api/v1/remotes
GET /api/v1/remotes/{remote_id} (Gets a specific remote)
Parameters

None

Responses
http code content-type response
200 application/json JSON string
400 application/json {"message":"error"}
Example cURL
 curl -X GET -H "application/x-www-form-urlencoded" http://192.168.4.1/api/v1/remotes/0
PATCH /api/v1/remotes/{remote_id} (Updates a remote)
Parameters
name type data type description
name optional string Name of the remote
rolling_code optional int Rolling code of the remote (Not implemented yet)
Responses
http code content-type response
200 application/json {"name":"foo", "id": 42, "rolling_code": 42}
400 application/json {"message":"error"}
Example cURL
 curl -X PATCH -H "application/x-www-form-urlencoded" -d "name=foo&rolling_code=0" http://192.168.4.1/api/v1/remotes/0
DELETE /api/v1/remotes/{remote_id} (Deletes a remote)
Parameters

None

Responses
http code content-type response
200 application/json {"name":"foo", "id": 42, "rolling_code": 42}
400 application/json {"message":"error"}
Example cURL
 curl -X DELETE -H "application/x-www-form-urlencoded" http://192.168.4.1/api/v1/remotes/0
POST /api/v1/remotes/{remote_id}/action (Send a command with the remote)
Parameters
name type data type description
action required string Action to do. (up, down, stop, pair, reset)
Responses
http code content-type response
200 application/json {"message": "Command sent."}
400 application/json {"message":"error"}
Example cURL
 curl -X POST -H "application/x-www-form-urlencoded" -d "action=up" http://192.168.4.1/api/v1/remotes/0/action

MQTT

Publish

/esprtsomfy/system/infos/version (Gets Firmware version) /esprtsomfy/system/infos/mac (Gets MAC Address) /esprtsomfy/system/infos/ip (Gets IP Address) /esprtsomfy/remotes/+/rolling_code (Gets the Rolling Code of a specific remote) /esprtsomfy/remotes/+/name (Gets the Name of a specific remote) /esprtsomfy/remotes/+/last_action (Gets the last action of a specific remote)

Subscribe

/esprtsomfy/remotes/+/set/name (Updates the Name of a specific remote) /esprtsomfy/remotes/+/set/action (Sends a command (up, stop, down, pair, reset) with the remote)

About

Control Somfy blinds with an ESP-8266

Resources

License

Stars

Watchers

Forks

Packages

No packages published