0.1.1 • Published 1 year ago

@vectronic/homebridge-script-switch v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

homebridge-script-switch

A switch plugin for Homebridge which integrates with shell scripts

Installation

  1. Install this plugin using the Homebridge Config UI X or via commandline npm install -g @vectronic/homebridge-script-switch
  2. Setup the plugin's configuration

Configuration

PropertyDescription
nameThe name for the accessory instance.
set_state_on_scriptScript to set state ON, optional. If not provided, setting switch On from Home App is not possible.
set_state_on_scriptScript to set state OFF, optional. If not provided, setting switch Off from Home App is not possible.
get_state_scriptScript to get the current switch state. Should output on stdout text signifying "On" which matches on_state_value and anything else ot signify "Off".
on_state_valueReturn value from get_state_script which corresponds to ON state.

Example config.json entry:

"accessories": [
    {
        "accessory": "ScriptSwitch",
        "name": "mySwitch",
        "set_state_on_script": "/usr/local/bin/setMySwitchOn.sh",
        "set_state_off_script": "/usr/local/bin/setMySwitchOff.sh",
        "get_state_script": "/usr/local/bin/getMySwitchState.sh",
        "on_state_value": "ON"
    }
]

Help

If you have a query or problem, raise an issue in GitHub, or better yet submit a PR!

0.1.1

1 year ago

0.1.0

1 year ago