From c2687ab55297e90b46fd33f7ec7a5e32f9780738 Mon Sep 17 00:00:00 2001 From: Donavan Becker Date: Sat, 19 Aug 2023 14:48:33 -0500 Subject: [PATCH] v1.11.0 (#492) ## [Version 1.11.0](https://github.com/donavanbecker/homebridge-rainbird/releases/tag/v1.11.0) (2023-08-19) ### What's Changed - Added `minValueRemainingDuration` and `maxValueRemainingDuration` for Remaining Duration Characteristic. [#485](https://github.com/donavanbecker/homebridge-rainbird/issues/485) - Added time remaining to Zone Running log messages. [#486](https://github.com/donavanbecker/homebridge-rainbird/issues/486) - Added `includeZones` to allow only specified zones to be created as Valve accessories. [#488](https://github.com/donavanbecker/homebridge-rainbird/issues/488) - Added showing Idle/Waiting state for zones queued by scheduled programs (only for ESP-TM2 & ESP-ME3 at this stage) - Added support warning for other models about limited zone state details - Added Delay Irrigation Switch [#489](https://github.com/donavanbecker/homebridge-rainbird/issues/489) - Housekeeping and updated dependencies. **Full Changelog**: https://github.com/donavanbecker/homebridge-rainbird/compare/v1.10.0...v1.11.0 --- CHANGELOG.md | 13 + README.md | 2 +- config.schema.json | 192 +- homebridge-ui/public/index.html | 12 +- nodemon.json | 8 +- package-lock.json | 2301 +++++++++-------- package.json | 38 +- src/RainBird/RainBirdClient.ts | 67 +- src/RainBird/RainBirdService.ts | 336 ++- .../requests/IrrigationDelayGetRequest.ts | 11 + .../requests/IrrigationDelaySetRequest.ts | 28 + ...eRequest.ts => ProgramZoneStateRequest.ts} | 2 +- src/RainBird/requests/RawRequest.ts | 24 + .../responses/CurrentZoneStateResponse.ts | 83 - .../responses/IrrigationDelayGetResponse.ts | 22 + .../responses/ModelAndVersionResponse.ts | 9 + .../responses/ProgramZoneStateResponse.ts | 22 + src/RainBird/responses/RawResponse.ts | 20 + src/devices/DelayIrrigationSwitch.ts | 57 + src/devices/IrrigationSystem.ts | 62 +- src/devices/StopIrrigationSwitch.ts | 2 +- src/devices/ZoneValve.ts | 8 +- src/platform.ts | 129 +- src/settings.ts | 8 +- 24 files changed, 2119 insertions(+), 1337 deletions(-) create mode 100644 src/RainBird/requests/IrrigationDelayGetRequest.ts create mode 100644 src/RainBird/requests/IrrigationDelaySetRequest.ts rename src/RainBird/requests/{CurrentZoneStateRequest.ts => ProgramZoneStateRequest.ts} (84%) create mode 100644 src/RainBird/requests/RawRequest.ts delete mode 100644 src/RainBird/responses/CurrentZoneStateResponse.ts create mode 100644 src/RainBird/responses/IrrigationDelayGetResponse.ts create mode 100644 src/RainBird/responses/ProgramZoneStateResponse.ts create mode 100644 src/RainBird/responses/RawResponse.ts create mode 100644 src/devices/DelayIrrigationSwitch.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index aadddea..1055974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/) +## [Version 1.11.0](https://github.com/donavanbecker/homebridge-rainbird/releases/tag/v1.11.0) (2023-08-19) + +### What's Changed +- Added `minValueRemainingDuration` and `maxValueRemainingDuration` for Remaining Duration Characteristic. [#485](https://github.com/donavanbecker/homebridge-rainbird/issues/485) +- Added time remaining to Zone Running log messages. [#486](https://github.com/donavanbecker/homebridge-rainbird/issues/486) +- Added `includeZones` to allow only specified zones to be created as Valve accessories. [#488](https://github.com/donavanbecker/homebridge-rainbird/issues/488) +- Added showing Idle/Waiting state for zones queued by scheduled programs (only for ESP-TM2 & ESP-ME3 at this stage) +- Added support warning for other models about limited zone state details +- Added Delay Irrigation Switch [#489](https://github.com/donavanbecker/homebridge-rainbird/issues/489) +- Housekeeping and updated dependencies. + +**Full Changelog**: https://github.com/donavanbecker/homebridge-rainbird/compare/v1.10.0...v1.11.0 + ## [Version 1.10.0](https://github.com/donavanbecker/homebridge-rainbird/releases/tag/v1.10.0) (2023-04-07) ### What's Changed diff --git a/README.md b/README.md index a23dc15..c7d6ff2 100644 --- a/README.md +++ b/README.md @@ -46,4 +46,4 @@ Any controller that supports the [RainBird LNK WiFi Module](https://www.rainbird ## Known Limitations - Using the RainBird app while the plugin is running can cause connectivity issues. - The RainBird LNK WiFi Module may not support "Band Steering" and WiFi Channel 13. Try not using these on your router if you are having connectivity issues. -- iOS 15.4/macOS 12.3 introduced a bug that prevents the valves (zones) from showing within the Irrigation System accessory in the Home app. Try using the "Show Zones as Valve Accessories" option as a workaround. [NOTE: Fixed in iOS 16.0/macOS 13.0] +- Some models do not yet have support for displaying the time remaining. If its not working for your model please log a GitHub issue and we will try to add it with your help. diff --git a/config.schema.json b/config.schema.json index 9c7c80e..e5d6a0c 100644 --- a/config.schema.json +++ b/config.schema.json @@ -34,97 +34,201 @@ "required": true, "x-schema-form": { "type": "password" + }, + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } + }, + "external": { + "title": "External Accessory", + "description": "This will make all device under this acessory be displayed as an external accesory and will not be added to cache or be added with child bridge of this plugin. Each device will have to be added seperately.", + "type": "boolean", + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" } }, "showRainSensor": { "title": "Show Rain Sensor (as Leak Sensor)", "type": "boolean", - "required": false + "required": false, + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } }, "showValveSensor": { "title": "Enable Valve Notifications (as Contact Sensors)", "type": "boolean", "required": false, - "description": "If enabled, whichever zone runs the contact sensors will go off as detected so you know that it is running." + "description": "If enabled, whichever zone runs the contact sensors will go off as detected so you know that it is running.", + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } }, "showProgramASwitch": { "title": "Show Program A Switch", "type": "boolean", - "requried": false + "requried": false, + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } }, "showProgramBSwitch": { "title": "Show Program B Switch", "type": "boolean", - "requried": false + "requried": false, + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } }, "showProgramCSwitch": { "title": "Show Program C Switch", "type": "boolean", - "requried": false + "requried": false, + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } }, "showProgramDSwitch": { "title": "Show Program D Switch (not supported by all models)", "type": "boolean", - "requried": false + "requried": false, + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } }, "showStopIrrigationSwitch": { "title": "Show Stop Irrigation Switch", "type": "boolean", - "requried": false + "requried": false, + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } }, "showZoneValve": { "title": "Show Zones as Valve Accessories", "type": "boolean", "required": false, - "description": "Show zones as seperate valve accessories (useful to workaround the bug introduced in iOS 15.4/macOS 12.3 that prevents the valves from showing within the Irrigation System accessory)." + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } + }, + "includeZones": { + "title": "Zones to Include", + "type": "string", + "requried": false, + "description": "comma seperated list of zone numbers to create valve accessories for (leave blank for all)", + "pattern": "^[0-9]{1,3}(,[0-9]{1,3})*$", + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } + }, + "showDelayIrrigationSwitch": { + "title": "Show Delay Irrigation Switch", + "type": "boolean", + "required": false, + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } + }, + "irrigationDelay": { + "title": "Irrigation Delay (days)", + "type": "number", + "minimum": 1, + "maximum": 14, + "placeholder": 1, + "required": false, + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } + }, + "minValueRemainingDuration": { + "title": "Min Value", + "type": "number", + "placeholder": 0, + "required": false, + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } + }, + "maxValueRemainingDuration": { + "title": "Max Value", + "type": "number", + "placeholder": 3600, + "required": false, + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } }, "syncTime": { "title": "Sync date and time of controller with host", "type": "boolean", "default": false, "required": false, - "description": "Useful for automatically changing the controller's time when Daylight Savings starts/ends or fixing the time if the controller's internal clock runs fast or slow" + "description": "Useful for automatically changing the controller's time when Daylight Savings starts/ends or fixing the time if the controller's internal clock runs fast or slow", + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } }, "showRequestResponse": { "title": "Show RainBird requests and responses in the log", "type": "boolean", - "requried": false + "requried": false, + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } }, "firmware": { "title": "Firmware Override", "type": "string", - "placeholder": "1.2.8" + "placeholder": "1.2.8", + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } }, "refreshRate": { "title": "Device Refresh Rate", "type": "number", "minimum": 120, "placeholder": 900, - "description": "Indicates the number of seconds between refreshes of the Rainbird Client." + "description": "Indicates the number of seconds between refreshes of the Rainbird Client.", + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } + }, + "delete": { + "title": "Delete Device", + "type": "boolean", + "description": "DO NOT USE, UNLESS YOU WANT TO DELETE THIS DEVICE FROM CACHE.", + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } }, "logging": { "title": "Device Logging Override Setting", "type": "string", + "required": true, + "default": "", "oneOf": [ + { + "title": "Default Logging", + "enum": [""] + }, { "title": "Standard Logging", - "enum": [ - "standard" - ] + "enum": ["standard"] }, { "title": "No Logging", - "enum": [ - "none" - ] + "enum": ["none"] }, { "title": "Debug Logging", - "enum": [ - "debug" - ] + "enum": ["debug"] } - ] + ], + "condition": { + "functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);" + } } } } @@ -142,33 +246,28 @@ "logging": { "title": "Logging Setting", "type": "string", + "required": true, + "default": "", "oneOf": [ + { + "title": "Default Logging", + "enum": [""] + }, { "title": "Standard Logging", - "enum": [ - "standard" - ] + "enum": ["standard"] }, { "title": "No Logging", - "enum": [ - "none" - ] + "enum": ["none"] }, { "title": "Debug Logging", - "enum": [ - "debug" - ] + "enum": ["debug"] } ] } } - }, - "disablePlugin": { - "title": "Disable Plugin", - "type": "boolean", - "description": "DO NOT USE, UNLESS YOU WANT TO REMOVE ACCESSORIES FROM CACHE." } } }, @@ -197,8 +296,9 @@ "type": "fieldset", "title": "Device Settings", "expandable": true, - "expanded": false, + "expanded": true, "items": [ + "devices[].external", "devices[].showRainSensor", "devices[].showValveSensor", "devices[].showProgramASwitch", @@ -207,11 +307,22 @@ "devices[].showProgramDSwitch", "devices[].showStopIrrigationSwitch", "devices[].showZoneValve", + "devices[].includeZones", + "devices[].showDelayIrrigationSwitch", + "devices[].irrigationDelay", + { + "type": "fieldset", + "title": "Remaining Duration Override", + "expandable": true, + "expanded": false, + "items": ["devices[].minValueRemainingDuration", "devices[].maxValueRemainingDuration"] + }, "devices[].syncTime", "devices[].showRequestResponse", "devices[].firmware", "devices[].refreshRate", - "devices[].logging" + "devices[].logging", + "devices[].delete" ] } ] @@ -242,9 +353,8 @@ "key": "options.pushRate", "notitle": true }, - "options.logging", - "disablePlugin" + "options.logging" ] } ] -} \ No newline at end of file +} diff --git a/homebridge-ui/public/index.html b/homebridge-ui/public/index.html index 245bdfc..adbb819 100644 --- a/homebridge-ui/public/index.html +++ b/homebridge-ui/public/index.html @@ -55,6 +55,7 @@ +

External Accessories Will Not Display Here.