homebridge-sonoff-blinds
v1.0.3
Published
Homebridge Sonoff plugin for Blinds.
Downloads
13
Maintainers
Readme
homebridge-sonoff-blinds
Sonoff Basic, Dual or 4CH/4CH Pro over homebridge for blinds.
Features
- Up or Down Blinds or Windows with 220V od 110V Motor (4 wire).
- You can now ask Siri to up / down any blinds in house
Instructions flash
Instruction for SonOff 4CH PRO / SonOff 4CH
Url: https://github.com/radebebek/homebridge-sonoff-4CH
Instruction for SonOff Basic
Url: https://github.com/seikan/homebridge-sonoff-basic-espeasy
Configuration SonOff 4CH or Sonoff 4CH PRO
Sonoff 4ch/4chpro will creates a new Wi-Fi access point called ESP_0.
Connect your PC to the network with password
configesp
.Open web browser and go to
http://192.168.4.1
or some assigned ip addres.Go through the setup to connect Sonoff to your Wi-Fi network.
Now, go to HARDWARE section, select GPIO-13 (D7) for Wifi Status Led to enable the green LED light on Sonoff. Change SDA and SCL to GPIO-16 (D0) GPIO-14 (D3). Submit changes
Go to
DEVICES
section, editTask #1
. Insert the values:
Device: Switch input
Name: Blinds1UP
1st GPIO: Gpio 4
Switch Type: Switch
Switch Button Type: Normal Switch
Go to DEVICES
section, edit Task #2
. Insert the values:
Device: Switch input
Name: Blinds1DOWN
1st GPIO: Gpio 5
Switch Type: Switch
Switch Button Type: Normal Switch
Go to DEVICES
section, edit Task #3
. Insert the values:
Device: Switch input
Name: Blinds2UP
1st GPIO: Gpio 12
Switch Type: Switch
Switch Button Type: Normal Switch
Go to DEVICES
section, edit Task #4
. Insert the values:
Device: Switch input
Name: Blinds2DOWN
1st GPIO: Gpio 15
Switch Type: Switch
Switch Button Type: Normal Switch
Submit changes
We have enabled the hardware GPIO to work, now we need to configure the rules for HTTP request. You enabled section rules in sectio Tool->Advance->Enable Rules Submit changes
Go to
RULES
section, insert the following codes and submit.
On 4PowerOn Do
gpio,4,1
EndOn
On 4PowerOff Do
gpio,4,0
EndOn
On 5PowerOn Do
gpio,5,1
EndOn
On 5PowerOff Do
gpio,5,0
EndOn
On 12PowerOn Do
gpio,12,1
EndOn
On 12PowerOff Do
gpio,12,0
EndOn
On 15PowerOn Do
gpio,15,1
EndOn
On 15PowerOff Do
gpio,15,0
EndOn
- Explanations in config file for one blinds sonoff 4ch:
"accessory": "SonOffBlinds", // It must be for every service
"name": "Blidns Kitchen", // Name of Blinds
"up_url": "http://192.168.2.10/control?cmd=event,4PowerOn", // Url for active Gpio 4 for moving up blinds
"down_url": "http://192.168.2.10/control?cmd=event,5PowerOn",// Url for active Gpio 5 for moving down blinds
"stop_url_up": "http://192.168.2.10/control?cmd=event,4PowerOff",// Url for deactive Gpio 4 for moving up blinds
"stop_url_down": "http://192.168.2.10/control?cmd=event,5PowerOff",// Url for deactive Gpio 5 for moving down blinds
"time_up": 20000, // Total time from complete closing to full opening.
"time_down": 20000, // Total time from complete opening to full closing.
"time_botton_margine_up": 0, // Picture down
"time_botton_margine_down": 0 // Picture down
Picture:
- Finally, the Sonoff basic switch is fully customized. Connect it to a live socket.
Wiring schema
This plugin use for:
* Two Sonoff Basic for one blinds.
* One Sonoff Dual for one blinds.
* One Sonoff 4CH/4CHPRO for two blinds.
Installation
Install required packages.
npm i homebridge-sonoff-blinds
Add following lines to
config.json
.{ "bridge": { "name": "Home of Name", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "123-45-568" }, "accessories": [ { "accessory": "SonOffBlinds", "name": "Config for SonOff Basic (Diferent only becouse use two ipaddres for each sonoffbasic device)", "up_url": "http://192.168.2.10/control?cmd=GPIO,12,1", "down_url": "http://192.168.2.11/control?cmd=GPIO,12,1", "stop_url_up": "http://192.168.2.10/control?cmd=GPIO,12,0", "stop_url_down": "http://192.168.2.11/control?cmd=GPIO,12,0", "time_up": 20000, "time_down": 20000, "time_botton_margine_up": 0, "time_botton_margine_down": 0 }, { "accessory": "SonOffBlinds", "name": "Config for SonOff Dual (Only one ip addres with two gpio)", "up_url": "http://192.168.2.10/control?cmd=GPIO,12,1", "down_url": "http://192.168.2.10/control?cmd=GPIO,4,1", "stop_url_up": "http://192.168.2.10/control?cmd=GPIO,12,0", "stop_url_down": "http://192.168.2.10/control?cmd=GPIO,4,0", "time_up": 20000, "time_down": 40000, "time_botton_margine_up": 0, "time_botton_margine_down": 0 }, { "accessory": "SonOffBlinds", "name": "Config for SonOff 4CH (Only one ip addres and four gpio) 1 Blinds", "up_url": "http://192.168.2.10/control?cmd=event,4PowerOn", "down_url": "http://192.168.2.10/control?cmd=event,5PowerOn", "stop_url_up": "http://192.168.2.10/control?cmd=event,4PowerOff", "stop_url_down": "http://192.168.2.10/control?cmd=event,5PowerOff", "time_up": 20000, "time_down": 40000, "time_botton_margine_up": 0, "time_botton_margine_down": 0 }, { "accessory": "SonOffBlinds", "name": "Config for SonOff 4CH (Only one ip addres and four gpio) 2 Blinds", "up_url": "http://192.168.2.10/control?cmd=event,12PowerOn", "down_url": "http://192.168.2.10/control?cmd=event,15PowerOn", "stop_url_up": "http://192.168.2.10/control?cmd=event,12PowerOff", "stop_url_down": "http://192.168.2.10/control?cmd=event,15PowerOff", "time_up": 20000, "time_down": 40000, "time_botton_margine_up": 0, "time_botton_margine_down": 0 } ] }
Restart Homebridge, and your Sonoff basic a will be added to Home app.