homebridge-programmable-http-switch
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Programmable HTTP Switch

verified-by-homebridge Downloads Version
Issues Pull requests

This Homebridge plugin allows users to create Stateless Programmable Switches which can be controlled using a HTTP API.

Installation

First, install Homebridge
npm install --global homebridge

Then, install the Programmable HTTP Switch plugin
npm install --global homebridge-programmable-http-switch

Configuration

Platform configuration

An example configuration can be found in the config.example.json file.

Property Type Details
platform string Required
Must always be ProgrammableHTTPSwitch.
accessories Accessory[] Required
List of accessory configurations.
port number Optional, default: 3000
The port that the HTTP server should listen on.

Accessory configuration

Property Type Details
name string Required
The name of the accessory.
identifier string Required
The identifier used in the API.
buttons Button[] Required
List of button configurations.

Button configuration

Property Type Details
name string Required
The name of the button.
Note: Not shown in Apple's Home app.
identifier string Required
The identifier used in the API.
supportedActions string[] Optional, default: all
List of actions that this button supports.
Supported values: singlePress (0), doublePress (1) and longPress (2)

API endpoints

GET /accessories

Description
Returns all the currently configured accessoires.

GET /accessories/:accessoryIdentifier

Description
Returns an accessory with a specific identifier.

GET /accessories/:accessoryIdentifier/buttons

Description
Returns all buttons for an accessory with a specific identifier.

GET /accessories/:accessoryIdentifier/buttons/:buttonIdentifier

Description
Returns a button with a specific identifier for an accessory with a specific identifier.

PUT /accessories/:accessoryIdentifier/buttons/:buttonIdentifier

Description
Sets the state of a specific button on a specific accessory.

Body

{
    "action": "singlePress"
}

Note: Action must be one of the supported actions configured for the specific button.

Package Sidebar

Install

npm i homebridge-programmable-http-switch

Weekly Downloads

6

Version

1.0.3

License

MIT

Unpacked Size

27.4 kB

Total Files

19

Last publish

Collaborators

  • stefannienhuis