This homebridge plugin exposes a web-based sprinkler system to Apple's HomeKit. Using HTTP requests, the plugin allows you to turn on/off individual sprinkler zones. With the use of the OpenWeatherMap API, the plugin can also provide water scheduling.
Find script samples for the sprinkler controller in the examples folder.
Number of cycles per zone (watering is spread between cycles)
2
restrictedDays
Days of the week when watering should not take place (Sunday is 0, Monday is 1, and so on)
N/A
restrictedMonths
Months of the year when watering should not take place (January is 0, February is 1, and so on)
N/A
zonePercentages
Percentage of calculated zone watering time that a specific zone will receive (do not exceed 100%)
100
disableAdaptiveWatering
Whether to disable adaptive watering and use defaultDuration instead
false
maxDuration
The highest number of minutes that adaptiveWatering can set
30
lowThreshold
Forecasted low temperature (°C) below which watering will not take place
10
highThreshold
Forecasted high temperature (°C) below which watering will not take place
20
rainThreshold
Forecasted rainfall (mm) above which watering will not take place
2.3
Additional options
Key
Description
Default
pollInterval
Time (in seconds) between device polls
300
listener
Whether to start a listener to get real-time changes from the device
false
timeout
Time (in milliseconds) until the accessory will be marked as Not Responding if it is unreachable
3000
port
Port for your HTTP listener (if enabled)
2000
username
Username if HTTP authentication is enabled
N/A
password
Password if HTTP authentication is enabled
N/A
http_method
HTTP method used to communicate with the device
GET
model
Appears under the Model field for the accessory
plugin
serial
Appears under the Serial field for the accessory
apiroute
manufacturer
Appears under the Manufacturer field for the accessory
author
firmware
Appears under the Firmware field for the accessory
version
Scheduling
When scheduling is enabled, the plugin will see if watering can be completed today by however many minutes before sunrise specified in sunriseOffset, if not, it will schedule the relevant time for the next day.
The day selected must match the following criteria for watering to place:
Not a restricted day/month
Forecasted rain for today and tomorrow not higher than threshold
Forecasted low and high temperature higher than their respective thresholds
If adaptive watering is disabled, but scheduling remains enabled, each zone will be watered for a percentage (specified in zonePercentages) of the number of minutes specified in defaultDuration
The plugin schedules asynchronous zone watering times (no more than one zone on at a given time), as most systems are incapable of supplying sufficient pressure to water multiple zones simultaneously.
Start times will vary daily as a result of changing sunrise times.
Adaptive watering
When adaptive watering is enabled, a zone's total watering duration will be calculated as a percentage (specified in zonePercentages) of the calculation below:
Update state following a manual zone override by messaging the listen server:
/state?zone=ZONE_INT_VALUE&value=INT_VALUE
Notes
If you are using scheduling, the sprinkler controller should have an onboard auto-shutoff feature where the valve will automatically close after a period of time (e.g. 30 minutes) has passed so that valves are not left open if there was an error receiving the 'off message' from the plugin
I am open to suggestions about new ways to calculate watering times for adaptive watering in place of the simple calculation currently implemented
The watering times displayed to you within the homebridge log are rounded to make reading them easier due to JavaScript's floating point calculations. The real watering times are not rounded
Your API key grants you access to 1000 API calls per day. The plugin will only make an API call once per day (as well as whenever homebridge starts up) so you shouldn't need to worry about running out of API calls
To-do
Ensure the main service is set to In Use when a valve is active
Set Program Mode to manual when user manually overrides valve
Update Remaining Duration accordingly - for main service or for each valve?
请发表评论