https://github.com/vectronic/homebridge-script-switch
A switch plugin for Homebridge which integrates with shell scripts
https://github.com/vectronic/homebridge-script-switch
Last synced: 10 months ago
JSON representation
A switch plugin for Homebridge which integrates with shell scripts
- Host: GitHub
- URL: https://github.com/vectronic/homebridge-script-switch
- Owner: vectronic
- License: mit
- Created: 2023-05-09T13:36:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-09T14:37:51.000Z (over 2 years ago)
- Last Synced: 2025-02-25T10:52:11.370Z (11 months ago)
- Language: TypeScript
- Size: 59.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# homebridge-script-switch
> A switch plugin for [Homebridge](https://homebridge.io) 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`
1. Setup the plugin's configuration
## Configuration
| Property | Description |
|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| name | The name for the accessory instance. |
| set_state_on_script | Script to set state ON, optional. If not provided, setting switch On from Home App is not possible. |
| set_state_on_script | Script to set state OFF, optional. If not provided, setting switch Off from Home App is not possible. |
| get_state_script | Script 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_value | Return value from get_state_script which corresponds to ON state. |
Example `config.json` entry:
```json
"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!