Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 1.85 KB

README.md

File metadata and controls

40 lines (32 loc) · 1.85 KB

homebridge-http-regex

GitHub issues license npm

HTTP RegEx plugin for HomeBridge

Plugin for Homebridge which checks a HTTP response against a RegEx pattern. It creates a contact sensor which opens when RegEx pattern is matched against the HTTP response.

Installation

  1. Install homebridge using: npm install -g homebridge
  2. Install this plugin using: npm install -g homebridge-http-regex
  3. Update your configuration file. See snippet below.

Configuration

You'll need to add a Regex accessory to your homebridge config.json. This example below would check the apple store page every 5 minutes and opens the contact sensor if it's closed.

{
  "accessories": [
    {
      "accessory": "Regex",
      "name": "Apple Store",
      "endpoint": "https://store.apple.com",
      "pattern": "(We'll be back.)",
      "interval": 300000
    }
  ]
}

Value summary

accessory: The name of the accessory, this must be Regex.
name: The name of the contact sensor in HomeKit.
endpoint: The address for the HTTP Get request.
Pattern: The RegEx pattern which needs te be checked against.
interval: The interval between checks in milliseconds. The default is set to 10 seconds if you don't specify an interval.

Note: You'll need to obmit the opening and closing slash from the pattern. Backslashes within the pattern need to be escaped with another backslash, because of how JSON is parsed.