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 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-zway-velux

v0.0.6

Published

Homebridge plugin for controlling Velux blinds by triggering Z-Wave switches via HTTP using a Z-Way Server instance

Downloads

12

Readme

homebridge-zway-velux

npm version

Homebridge plugin for controlling Velux blinds by triggering Z-Wave switches via HTTP using a Z-Way Server instance.

This plugin is all about triggering switches by performing HTTP requests to a Z-Way Server. In my case, I used Fibaro FGS-222 Z-Wave switches. One of the switches is connected to the power supply of the Velux shutter blinds and the other one to a Velux KLF 050 controller module, which actually controls the blinds' movement. The switch for the power supply is optional and enables the power supply to be completely disconneced from the electric power when the blinds are not moving (to silence the transformators and to save energy).

Setup

Hardware Stack

The hardware setup is shown as follows. I use a RaZberry module for my Raspberry Pi to communicate with the Z-Wave switches. These are connected to the blinds' power supply and to the Velux KLF 050 controller, which controls the blinds wirelessly.

Hardware Stack

Software Stack

To get the plugin working, an installed Z-Way Server is required. With the Z-Way Server, you can manage all your Z-Wave devices, in this case 2 Fibaro GS-222 switches. The Z-Way Server allows to utilize devices via HTTP requests, which is the main purpose of this plugin.

Software Stack

Installation

First, install Homebridge. See https://www.npmjs.com/package/homebridge for more information.

Then install this plugin:

$ sudo npm install homebridge-zway-velux -g

If you are having permission problems during install, try this:

$ sudo npm install homebridge-zway-velux -g --unsafe-perm

To add this plugin to a Homebridge installation, you have to add a new accessory to the config.json file. The configuration variables are described in the following table:

| Variable | Description | Default | Required | | --------- | ------------- | --------- | --------- | | accessory | System name of the accessory (do not change the default value) | "ZWayVelux" | yes | | name | Name of the shutter blinds to appear in the Home App | "Blinds" | yes | | powerOnUrl | Z-Way API URL to switch on the power supply (absolute) | (none) | yes | | powerOffUrl | Z-Way API URL to switch off the power supply (absolute) | (none) | yes | | openStartUrl | Z-Way API URL to start opening the blinds (absolute) | (none) | yes | | openStopUrl | Z-Way API URL to stop opening the blinds (absolute) | (none) | yes | | closeStartUrl | Z-Way API URL to start closing the blinds (absolute) | (none) | yes | | closeStopUrl | Z-Way API URL to stop closing the blinds (absolute) | (none) | yes | | durationPerPercent | Number of milliseconds the blinds need to open or close 1 percent of the moving distance | (none) | yes | | startDelay | Number of milliseconds the blinds need to start moving after they are given a command to move up or down | (none) | yes | | endPositionDelay | Additional number of milliseconds the blinds need to stop moving after they have opened or closed completely (Velux blinds use to move back a couple of centimeters after they reach an end position to prevent any damage caused by too much stress) | (none) | yes | | httpMethod | HTTP method used to perform the requests to the Z-Way API | "GET" | no | | debugMode | Disables all HTTP requests for debugging purposes | false | no |

Example accessory in config.json:

{
    ...
    
    "accessories": [
        ...

        {
            "accessory": "ZWayVelux",
            "name": "Blinds",
            "powerOnUrl": "http://localhost:8083/ZAutomation/api/v1/devices/ZWayVDev_zway_3-1-37/command/on",
            "powerOffUrl": "http://localhost:8083/ZAutomation/api/v1/devices/ZWayVDev_zway_3-1-37/command/off",
            "openStartUrl": "http://localhost:8083/ZAutomation/api/v1/devices/ZWayVDev_zway_4-2-37/command/on",
            "openStopUrl": "http://localhost:8083/ZAutomation/api/v1/devices/ZWayVDev_zway_4-2-37/command/off",
            "closeStartUrl": "http://localhost:8083/ZAutomation/api/v1/devices/ZWayVDev_zway_4-0-37/command/on",
            "closeStopUrl": "http://localhost:8083/ZAutomation/api/v1/devices/ZWayVDev_zway_4-0-37/command/off",
            "durationPerPercent": 375,
            "startDelay": 1750,
            "endPositionDelay": 6000
        } 
    ]
}

To Do

  • Remove the initial security delay of 1s before starting to move the blinds
  • Cancel the current movement and start over when the target position is changed while the blinds are moving

Updates

  • 2018-08-06: Published first working prototype
  • 2019-08-25: Updated documentation
  • 2019-09-22: Refactored and improved logging
  • 2019-10-03: Added accessory information

Useful Links