homebridge-sonoff-4ch
v2.0.3
Published
Sonoff 4CH plugin for Homebridge.
Downloads
11
Maintainers
Readme
homebridge-sonoff-4CH INSTRUCTIONS
Features
- Switch 4 Lights on / off
- Outlet 4 Lights on / off
- Light 4 Lights on / off
You can now ask Siri to turn on / off any lights or somthing else with Outlets and Switch. Functionality is the same, it is just a representation of the application icon in accordance with the service.
Instructions flash for SonOff 4CH PRO
Set Sonoff 4 CH or Sonoff 4 CH Pro in programing mode, and flash ESPEasy firmware
Video instructions link for PRO: https://www.youtube.com/watch?v=hOFvbdYkOII
Firmware Download Link : https://github.com/letscontrolit/ESPEasy/releases Flash Tool Download Link: https://randomnerdtutorials.com/flashing-nodemcu-firmware-on-the-esp8266-using-windows/ Version Firmware: Release v2.0.0-dev12
Configuration Tool:
After flash reboot and go to Configuration SonOff 4CH or Sonoff 4CH PRO
Instructions flash for SonOff 4CH
- Set Sonoff 4CH or Sonoff 4 CH Pro in programing mode, and flash ESPEasy firmware
- For Sonoff 4CH you must press GPIO0 and hold and in same time connect power (usb serial).
- GPIO0 is first white button
Firmware Download Link : https://github.com/letscontrolit/ESPEasy/releases Flash Tool Download Link: https://randomnerdtutorials.com/flashing-nodemcu-firmware-on-the-esp8266-using-windows/ Version Firmware: Release v2.0.0-dev12
Configuration Tool:
After flash reboot and go to Configuration SonOff 4CH or Sonoff 4CH PRO
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: Light1
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: Light2
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: Light3
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: Light4
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
- In config file:
Type 1 is Light.
Type 2 is Switch.
Type 3 is Outlet.
- Finally, the Sonoff basic switch is fully customized. Connect it to a live socket.
Wiring schema
FOR SONOFF 4CH Simple scheme for wiring. Dont work in same time with wall switch.
FOR SONOFF 4CH PRO Complex schema for wiring. You can use Home app and wall switch at the same time. Wall switch must be alternate.
Installation
Install required packages.
npm i homebridge-sonoff-4ch
Add following lines to
config.json
."accessories": [ { "accessory": "sonoff4ch", "name": "NAME_OF_LIGHT_1", "ip": "IP_ADDRESS_OF_THE_SONOFF_4CH", "gpio": "4", "type": "1" }, { "accessory": "sonoff4ch", "name": "NAME_OF_LIGHT_2", "ip": "IP_ADDRESS_OF_THE_SONOFF_4CH", "gpio": "5", "type": "1" }, { "accessory": "sonoff4ch", "name": "NAME_OF_LIGHT_3", "ip": "IP_ADDRESS_OF_THE_SONOFF_4CH", "gpio": "12", "type": "1" }, { "accessory": "sonoff4ch", "name": "NAME_OF_LIGHT_4", "ip": "IP_ADDRESS_OF_THE_SONOFF_4CH", "gpio": "15", "type": "1" } ]
Restart Homebridge, and your Sonoff basic a will be added to Home app.