Skip to content

๐Ÿ  Plugin for Homebridge which checks a HTTP response against a RegEx pattern

License

Notifications You must be signed in to change notification settings

WouterJanson/homebridge-http-regex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

18 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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.

About

๐Ÿ  Plugin for Homebridge which checks a HTTP response against a RegEx pattern

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published