# homebridge-iovalve

> Control a valve over a GPIO pin as a HomeKit valve accessory.

Latest version **2.0.5** (published 2021-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install homebridge-iovalve
pnpm add homebridge-iovalve
yarn add homebridge-iovalve
bun add homebridge-iovalve
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.5 |
| Published | 2021-03-14 |
| First published | 2021-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12.0 |
| Dependencies | 4 |
| Unpacked size | 17.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jacob Gelman |
| Maintainers | ladvoc |
| Keywords | homebridge-plugin |

## Links

- npm: https://www.npmjs.com/package/homebridge-iovalve
- Repository: https://github.com/jacobgelman/homebridge-iovalve
- Homepage: https://github.com/jacobgelman/homebridge-iovalve#readme
- Issues: https://github.com/jacobgelman/homebridge-iovalve/issues
- npm.io page: https://npm.io/package/homebridge-iovalve

## Dependencies (4)

- [onoff](https://npm.io/package/onoff.md) ^6.0.1
- [moment](https://npm.io/package/moment.md) ^2.29.1
- [to-case](https://npm.io/package/to-case.md) ^2.0.0
- [moment-duration-format](https://npm.io/package/moment-duration-format.md) ^2.3.2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.5 (latest) — 2021-03-14
- 2.0.4 — 2021-03-14

## README

# Homebridge GPIO Valve
Control a valve over a GPIO pin as a HomeKit valve accessory.

## Features
- Quick & easy configuration
- Add as many valves as you need: just duplicate the configuration object
- Supports timed valves with duration customizable within the Home app
- Identify support: by default, pressing "Identify" in the Home app will open the valve for ten seconds
- Logs each event (valve open, valve closed, identify) in the Homebridge log

## Installation
```
sudo npm install homebridge-gpio-valve -g --unsafe-perm
```
<small>Depending on how you have Node installed, you may or may not need `sudo` and the `--unsafe-perm` flag.</small>

## Configuration
| Name | Description | Valid Values | Default |
|---|---|---|---|
| `pin` | The pin to use for opening and closing the valve | The GPIO pin number of any valid pin. The selected pin should not be written to by any external applications | None |
| `openOnHigh` | Whether or not the valve opens when the pin is high | `true` or `false` | `true`|
| `defaultDuration` | The duration to open the value for when triggered. The user can change this value in the Home app | A duration in seconds no greater than 3600 (one hour) | `600` seconds (ten minutes) |
| `type` | The type of attached valve. Affects the icon displayed for the accessory in the Home app. | As of iOS 11.3: `"GENERIC_VALVE"`, `"IRRIGATION"`, `"SHOWER_HEAD"`, or `"WATER_FAUCET"` | `"GENERIC_VALVE"` |
| `isTimed` | Whether or not the valve is on a timer | `true` or `false` | `false` |
| `supportsIdentify` | Whether or not the valve opens in responce to an identify request. The user can trigger an identify request when adding the accessory to their home | `true` or `false` | `true` |
| `identifyDuration` | The duration to open the valve for in responce to an identify request | Any duration in seconds. Keep this valve as short as possible; just allow the valve to open and be identified | `10` seconds |
| `storageDirectory` | The directory for storing the user set duration. The directory is created if it does not exist | The path to any directory which is readable and writeable to Node | A subdirectory called `gpio_valve` within the Homebridge storage directory. Using the default Homebridge storage directory: `~/.homebridge/gpio_valve` |
| `manufacturer` | The value of the manufacturer characteristic of the information service | Any string | The author of this package |
| `model` | The value of the model characteristic of the information service | Any string | `"GPIO Valve"` |
| `serialNumber` | The value of the serial number characteristic of the information service | Any string | `"None"` |
| `firmwareRevision` | The value of the firmware revision characteristic of the information service | Any string | The current version of this package |

### Sample
```json
 {
    "accessory": "GPIOValve",
    "name": "Grass",
    "pin": 11,
    "openOnHigh": false,
    "isTimed": true,
    "defaultDuration": 1200,
    "type": "IRRIGATION"
}
```
## Known Issues
- As of iOS 11.3, the Home app only displays a special icon for irrigation valves. All other valve types receive the same generic icon.

---
_Source: https://npm.io/package/homebridge-iovalve · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
