1.0.3 • Published 6 years ago

homebridge-sonoff-blinds v1.0.3

Weekly downloads
14
License
Rade Bebek
Repository
github
Last release
6 years ago

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

  1. Sonoff 4ch/4chpro will creates a new Wi-Fi access point called ESP_0.

  2. Connect your PC to the network with password configesp.

  3. Open web browser and go to http://192.168.4.1 or some assigned ip addres.

  4. Go through the setup to connect Sonoff to your Wi-Fi network.

  5. 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). Sonoff 4 CH or Sonoff 4 CH PRO Submit changes

  6. Go to DEVICES section, edit Task #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

Sonoff 4 CH or Sonoff 4 CH PRO Submit changes

  1. 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

  2. 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
  1. 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: Sonoff 4 CH or Sonoff 4 CH PRO

  1. 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.

Sonoff Basic

* One Sonoff Dual for one blinds.

Sonoff Dual

* One Sonoff 4CH/4CHPRO for two blinds.

Sonoff SONOFFPRO

Installation

  1. Install required packages.

    npm i homebridge-sonoff-blinds
  2. 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
		}
	]
	}
  1. Restart Homebridge, and your Sonoff basic a will be added to Home app.