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-stateful-blinds

v0.0.5

Published

Sonoff Basic, Dual or 4CH/4CH Pro homebridge stateful plugin for blinds

Downloads

17

Readme

homebridge-sonoff-stateful-blinds

Sonoff Basic, Dual or 4CH/4CH Pro homebridge stateful plugin 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

Explanations in config file for one blinds sonoff 4ch:

		"accessory": "StatefulSonoffBlinds",  // It must be for every service
		"name": "Blidns Kitchen", // Name of Blinds 
		"sonoff_url": "http://sonoff4-blinds.local/", //URL of the selected Sonoff device
            	"sonoff_up_relay": "3", // Relay number for the UP motor
            	"sonoff_down_relay": "4", // Relay number for the DOWN motor
		"time_up": 20000, // Total time from complete closing to full opening.
		"time_down": 20000, // Total time from complete opening to full closing.
		"time_botton_margin_up": 0, // Picture down
		"time_botton_margin_down": 0 // Picture down

Picture: Sonoff 4 CH or Sonoff 4 CH PRO

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-stateful-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": "StatefulSonoffBlinds",
     	"name": "Config for SonOff Basic (Different only because 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_margin_up": 0,
     	"time_botton_margin_down": 0
     	},
     	{
     	"accessory": "StatefulSonoffBlinds",
     	"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_margin_up": 0,
     	"time_botton_margin_down": 0
     	},
     	{
     	"accessory": "StatefulSonoffBlinds",
     	"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_margin_up": 0,
     	"time_botton_margin_down": 0
     	},
     	{
     	"accessory": "StatefulSonoffBlinds",
     	"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_margin_up": 0,
     	"time_botton_margin_down": 0
     	}
     ]
     }
  3. Restart Homebridge, and your Sonoff basic a will be added to Home app.