Homebridge plugin that exposes file values as a contact sensor.
This plugin will be exposed in HomeKit as a contact sensor of your choice. At the moment, you may expose it as Window, Garage, Contact Sensor, Door or as a Blind. The state of the accessory is determined by the response of the file that is called (which is defined in config.json)
- Install homebridge using:
npm install -g homebridge
- Install this plugin using:
npm install -g https://github.com/GatoPharaoh/homebridge-file-contactsensor
- Update your configuration file. See
config.json
in this repository for a sample.
Configuration sample:
"accessories": [
{
"accessory": "FileCoSensor",
"name": "Window",
"state": "./check_state.sh"
}
]
Field | Description |
---|---|
accessory | Must be "FileCoSensor". |
name | Name of the Contact Sensor |
state | state command. Example: ./check_state.sh |
The state command should return the following terms: CONTACT_NOT_DETECTED
(sensor is opened), CONTACT_DETECTED
(sensor is closed)
This plugin is based on @apexad's plugin homebridge-garagedoor-command