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 🙏

© 2026 – Pkg Stats / Ryan Hefner

homebridge-plugin-window-blinds-pattern

v2.0.0

Published

Plugin for Homebridge to control window blinds with a regex pattern.

Readme

Homebridge Window Blinds Pattern Plugin

npm npm

A Homebridge plugin that allows you to control window blinds or shades where status information is obtained through regex pattern matching from an HTTP endpoint.

This plugin is particularly useful for DIY smart blinds projects using ESP8266/ESP32 or similar microcontrollers that expose HTTP APIs.

Features

  • Control window blinds/shades position with HomeKit
  • Compatible with any device that provides HTTP API endpoints for control
  • Extracts position information from API responses using configurable regex patterns
  • Adjustable timing parameters and position ranges

Installation

Option 1: Install through Homebridge UI

  1. Open your Homebridge UI
  2. Go to the "Plugins" tab
  3. Search for "window blinds pattern"
  4. Click "Install"

Option 2: Install manually

npm install -g homebridge-plugin-window-blinds-pattern

Configuration

Configure the plugin through the Homebridge UI or by editing your config.json file directly.

Configuration Parameters

| Parameter | Type | Description | Default | |-----------|------|-------------|---------| | platform | string | REQUIRED Platform identifier | "WindowBlindsPattern" | | name | string | Plugin name displayed in logs | "Window Blinds Pattern" | | accessories | array | Array of blind accessories | [] |

Accessory Configuration

Each blind accessory in the accessories array supports these parameters:

| Parameter | Type | Description | Default | |-----------|------|-------------|---------| | displayName | string | Name of the blind shown in HomeKit | "Window Blinds" | | urlSetTargetPosition | string | REQUIRED URL to set blind position. Use %VALUE% placeholder for position value | N/A | | urlGetCurrentPosition | string | URL to get current blind position | N/A | | statusPattern | string | Regex pattern to extract position value from HTTP response | "(\d+)" | | matchingGroup | number | The regex match group to extract as the value | 1 | | outputValueMultiplier | number | Multiplier applied to HomeKit value when sending to blind | 1 | | minOpen | number | Minimum position value | 0 | | maxOpen | number | Maximum position value | 100 | | timeout | number | HTTP request timeout in milliseconds | 5000 | | debug | boolean | Enable detailed logging | false | | model | string | Model name shown in HomeKit | "nodeMCU based DIY motorised blinds" | | manufacturer | string | Manufacturer shown in HomeKit | "@carlosfrutos" | | serial | string | Serial number shown in HomeKit | "HWB02" |

Example Configuration

{
  "platforms": [
    {
      "platform": "WindowBlindsPattern",
      "name": "Window Blinds Pattern",
      "accessories": [
        {
          "displayName": "Living Room Blind",
          "urlGetCurrentPosition": "http://192.168.1.100/status",
          "urlSetTargetPosition": "http://192.168.1.100/setPosition?pos=%VALUE%",
          "statusPattern": "position: (\\d+)",
          "matchingGroup": 1,
          "outputValueMultiplier": 1,
          "debug": true
        },
        {
          "displayName": "Bedroom Blind",
          "urlGetCurrentPosition": "http://192.168.1.101/status",
          "urlSetTargetPosition": "http://192.168.1.101/setPosition?pos=%VALUE%",
          "timeout": 3000
        }
      ]
    }
  ]
}

How It Works

  1. The plugin sends HTTP requests to your device to set and get blind positions
  2. When setting a position:
    • The %VALUE% in urlSetTargetPosition is replaced with the position value (0-100)
    • The value is multiplied by outputValueMultiplier before sending
  3. When getting a position:
    • The plugin makes a GET request to urlGetCurrentPosition
    • It extracts the position using the provided regex pattern and match group

Status Pattern Examples

  • Simple number: "(\\d+)" (extracts any number)
  • JSON response: "position\":\\s*(\\d+)" (extracts number after "position": )
  • XML response: "<position>(\\d+)</position>" (extracts number between XML tags)

Troubleshooting

  • Enable debug: true to see detailed logs
  • Test your regex pattern with a tool like regex101.com
  • Verify your devices' HTTP endpoints work with tools like curl or Postman

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the Apache-2.0 License - see the LICENSE file for details.

powershell -Command "Compress-Archive -Path .\dist*, .\config.schema.json, .\package.json, .\LICENSE, .\README.md -DestinationPath .\homebridge-plugin-window-blinds-pattern.zip -Force"