Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjdhjd committed May 21, 2024
1 parent 2b4c6ff commit 913f840
Show file tree
Hide file tree
Showing 25 changed files with 5,530 additions and 0 deletions.
129 changes: 129 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Ignore compiled code
dist

# Ignore npmrc.
.npmrc

# Ignore macOS attribute files.
.DS_Store

# Ignore generated files.
homebridge-ui/public/lib

# ------------- Defaults ------------- #

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.pnp.*
10 changes: 10 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Ignore everything by default.
*

# Include the following.
!LICENSE.md
!README.md
!config.schema.json
!dist/**
!homebridge-ui/**
!package.json
18 changes: 18 additions & 0 deletions CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Code of Conduct

By interacting with this GitHub repository, you agree that you'll follow this code of conduct.

### In short: Be nice. Be respectful. No harassment, trolling, or spamming.

Always be mindful that in the free / open source community, people are contributing their time away from friends and families to work on these projects. No one is being compensated for their work here. While feedback is useful, coming to this repository to make demands isn’t respectful.

* Harassment includes sexual language and imagery, deliberate intimidation, stalking, name-calling, unwelcome attention, libel, and any malicious hacking or social engineering. This repository should be a harassment-free experience for everyone, regardless of your background, identity, or experience level.

* Trolling includes posting inflammatory comments to provoke an emotional response or disrupt discussions.

* Spamming includes posting off-topic messages to disrupt discussions, promote a product, solicit donations, advertise a job / internship / gig, or flooding discussions with files or text.

#### The maintainers of this GitHub repository will take any action we deem appropriate, up to and including banning the offender from this repository.

##### Attribution
This code of conduct was inspired by and adapted from the [freeCodeCamp](https://www.freecodecamp.org/news/code-of-conduct/) code of conduct.
16 changes: 16 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Internet Systems Consortium license
===================================

Copyright (c) `2017-2024`, `HJD https://github.com/hjdhjd`

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<SPAN ALIGN="CENTER" STYLE="text-align:center">
<DIV ALIGN="CENTER" STYLE="text-align:center">

[![homebridge-hunter-hydrawise: Native HomeKit support for Hunter Hydrawise](https://raw.githubusercontent.com/hjdhjd/homebridge-hunter-hydrawise/main/images/homebridge-hydrawise.svg)](https://github.com/hjdhjd/homebridge-hunter-hydrawise)

# Homebridge Hunter Hydrawise

[![Downloads](https://img.shields.io/npm/dt/homebridge-hunter-hydrawise?color=%230A6E93&logo=icloud&logoColor=%23FFFFFF&style=for-the-badge)](https://www.npmjs.com/package/homebridge-hunter-hydrawise)
[![Version](https://img.shields.io/npm/v/homebridge-hunter-hydrawise?color=%230A6E93&label=Homebridge%20Hunter%20Hydrawise&logoColor=%23FFFFFF&style=for-the-badge&logo=rainmeter)](https://www.npmjs.com/package/homebridge-hunter-hydrawise)
[![Hunter Hydrawise@Homebridge Discord](https://img.shields.io/discord/432663330281226270?color=%230A6E93&label=Discord&logo=discord&logoColor=%23FFFFFF&style=for-the-badge)](https://discord.gg/QXqfHEW)
[![verified-by-homebridge](https://img.shields.io/badge/homebridge-verified-blueviolet?color=%2357277C&style=for-the-badge&logoColor=%23FFFFFF&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5OTIuMDkiIGhlaWdodD0iMTAwMCIgdmlld0JveD0iMCAwIDk5Mi4wOSAxMDAwIj48ZGVmcz48c3R5bGU+LmF7ZmlsbDojZmZmO308L3N0eWxl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ODIuNzlhNzMuNjYsNzMuNjYsMCwwLDEtMTAzLjY3LS4yN2wtMzktMzlhNzMuNjYsNzMuNjYsMCwwLDEsMC0xMDMuODZMNDM1LjE3LDQyNy44OGE3My43OSw3My43OSwwLDAsMSwxMDMuMzctLjlMNzU4LjEsNjM5Ljc1YTE2LjEzLDE2LjEzLDAsMCwwLDIyLjY2LDBsMzguNDMtMzguNDNhMTYuMTMsMTYuMTMsMCwwLDAsMC0yMi42Nkw1MDYuNSwyNjUuOTNhMTYuMTEsMTYuMTEsMCwwLDAtMjIuNjYsMEwxNjQuNjksNTgwLjQ0QTczLjY5LDczLjY5LDAsMCwxLDYxLjEsNTgwTDIxLjU3LDU0MC42OWwtLjExLS4xMmE3My40Niw3My40NiwwLDAsMSwuMTEtMTAzLjg4TDQzNi44NSwyMS40MUE3My44OSw3My44OSwwLDAsMSw1NDAsMjAuNTZMNjYyLjYzLDEzOS4zMnYtMS4xYTczLjYxLDczLjYxLDAsMCwxLDczLjU0LTczLjVINzg4YTczLjYxLDczLjYxLDAsMCwxLDczLjUsNzMuNVYzMjkuODFhMTYsMTYsMCwwLDAsNC43MSwxMS4zMmw4My4wNyw4My4wNWguNzlhNDEuOTQsNDEuOTQsMCwwLDEsLjA4LDgzLjg4WiIvPjwvc3ZnPg==)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)

## Hunter Hydrawise support for [Homebridge](https://homebridge.io).
</DIV>
</SPAN>

`homebridge-hunter-hydrawise` is a [Homebridge](https://homebridge.io) plugin that makes your Hunter Hydrawise irrigation controller available to [Apple's](https://www.apple.com) [HomeKit](https://www.apple.com/ios/home) smart home platform.

## Why use this plugin for Hunter Hydrawise support in HomeKit?
In a nutshell, the aim of this plugin for things to *just work* with minimal required configuration by users. The goal is to provide as close to a streamlined experience as you would expect from a first-party or native HomeKit solution. For the adventurous, those additional granular options are, of course, available to support more esoteric use cases or other unique needs.

What does *just work* mean in practice? It means that this plugin will discover all of the Hydrawise controllers connected to your Hydrawise account without the need for additional configuration beyond entering your account-specific API key. This plugin will expose those controllers and their zones as an irrigation system in HomeKit.

**I rely on this plugin every day and actively maintain and support it.**

I've developed a full-featured Homebridge plugin that enables the following features:

* Control each individual zone on your irrigation controller.
* Display when your irrigation system is off due to a rain sensor preventing watering (the irrigation system will show as *off* in HomeKit).
* Show, at a glance, all the zones that are queued up to run in the next 60 minutes on your controller (each individual zone will appear active in HomeKit when it's queued to run).
* A rich webUI for configuration.
* MQTT support.

## Installation
To get started with `homebridge-hunter-hydrawise`:

* [Generate a Hydrawise API key](https://app.hydrawise.com/config/account-details), should you need one.</li>
* Install `homebridge-hunter-hydrawise` using the Homebridge webUI. Make sure you make `homebridge-hunter-hydrawise` a child bridge for the best experience.
* Configure `homebridge-hunter-hydrawise` and enter your API key.
* That's it. Enjoy!

> [!IMPORTANT]
> Things to keep in mind regarding the Hydrawise API:
> * The Hydrawise API is rate-limited with the following constraints:
> * A limit of 3 API calls to start, stop, or suspend any zone within a 30 second interval.
> * An additional limit across the entire API of no more than 30 calls in any 5 minute period.
> * While the API provides the ability to suspend a zone, it does not provide the ability to resume a schedule.
## Plugin Development Dashboard
This is mostly of interest to the true developer nerds amongst us.

[![License](https://img.shields.io/npm/l/homebridge-hunter-hydrawise?color=%23000000&logo=open%20source%20initiative&logoColor=%23FFFFFF&style=for-the-badge)](https://github.com/hjdhjd/homebridge-hunter-hydrawise/blob/main/LICENSE.md)
[![Build Status](https://img.shields.io/github/actions/workflow/status/hjdhjd/homebridge-hunter-hydrawise/ci.yml?branch=main&color=%23000000&logo=github-actions&logoColor=%23FFFFFF&style=for-the-badge)](https://github.com/hjdhjd/homebridge-hunter-hydrawise/actions?query=workflow%3A%22Continuous+Integration%22)
[![Dependencies](https://img.shields.io/librariesio/release/npm/homebridge-hunter-hydrawise?color=%23000000&logo=dependabot&style=for-the-badge)](https://libraries.io/npm/homebridge-hunter-hydrawise)
[![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/hjdhjd/homebridge-hunter-hydrawise/latest?color=%23000000&logo=github&sort=semver&style=for-the-badge)](https://github.com/hjdhjd/homebridge-hunter-hydrawise/commits/main)

135 changes: 135 additions & 0 deletions config.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"pluginAlias": "Hydrawise",
"pluginType": "platform",
"singular": true,
"customUi": true,
"headerDisplay": "[homebridge-hunter-hydrawise](https://github.com/hjdhjd/homebridge-hunter-hydrawise) provides HomeKit support for Hunter Hydrawise irrigation controllers.",
"footerDisplay": "See the [homebridge-hunter-hydrawise developer page](https://github.com/hjdhjd/homebridge-hunter-hydrawise) for detailed documentation, including [feature options](https://github.com/hjdhjd/homebridge-hunter-hydrawise#feature-options).",
"schema": {
"type": "object",
"properties": {

"apiKey": {
"title": "Hunter Hydrawise Account API Key",
"type": "string",
"placeholder": "e.g. ABCD-EFGH-0123-4567",
"maxLength": 19,
"minLength": 19,
"required": true,
"description": "The API key for your Hunter Hydrawise account. You can generate one by going to the Account Settings section of the Account Details page on your Hydrawise online account. Default: None."
},

"debug": {
"title": "Debug Logging",
"type": "boolean",
"required": false,
"description": "Logging verbosity for debugging. Default: false."
},

"mqttTopic": {
"type": "string",
"title": "MQTT Base Topic",
"required": false,
"placeholder": "e.g. hydrawise",
"description": "The base MQTT topic to publish to. Default: hydrawise."
},

"mqttUrl": {
"type": "string",
"title": "MQTT Broker URL",
"required": false,
"format": "uri",
"placeholder": "e.g. mqtt://1.2.3.4",
"description": "URL for the MQTT broker you'd like to publish event messages to. Default: None."
},

"name": {
"title": "Plugin Name",
"type": "string",
"required": true,
"default": "Hunter Hydrawise",
"description": "Name to use for Homebridge logging purposes. Default: Hunter Hydrawise."
},

"options": {
"title": "Feature Options",
"type": "array",

"items": {
"type": "string",
"title": "Feature Option",
"required": false,
"description": "Enter only one option per entry. Use the feature options webUI tab above unless you know what you're doing.",
"placeholder": "e.g. Disable.Device"
}
}
}
},

"layout": [
{
"type": "section",
"title": "Required Settings",
"items": [
{
"description": "These options are required in order to use this plugin.",
"items": [
"apiKey"
]
}
]
},
{
"type": "section",
"title": "Plugin Feature Options (Optional)",
"expandable": true,
"expanded": false,
"items": [
{
"key": "options",
"type": "array",
"orderable": true,
"title": " ",
"description": "Use the feature options webUI tab above instead of manually configuring feature options here.",
"buttonText": "Add Feature Option",
"items": [
"options[]"
]
}
]
},

{
"type": "section",
"title": "MQTT Settings (Optional)",
"expandable": true,
"expanded": false,
"items": [
{
"description": "MQTT support will only be enabled if an MQTT broker URL is specified below.",
"items": [
"mqttUrl",
"mqttTopic"
]
}
]
},

{
"type": "section",
"title": "Advanced Settings (Optional)",
"expandable": true,
"expanded": false,
"items": [
{
"description": "These settings should be rarely used or needed by most people. Use these with caution.",
"items": [
"name",
"debug"
]
}
]
}

]
}
6 changes: 6 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

All notable changes to this project will be documented in this file. This project uses [semantic versioning](https://semver.org/).

## 1.0.0 (2024-05-20)
* Initial release.
Loading

0 comments on commit 913f840

Please sign in to comment.