npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

homebridge-sonoff-blinds

v1.0.3

Published

Homebridge Sonoff plugin for Blinds.

Downloads

13

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

  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
     	}
     ]
     }
  3. Restart Homebridge, and your Sonoff basic a will be added to Home app.