Difference between revisions of "Sprinkler"
Jump to navigation
Jump to search
Line 49: | Line 49: | ||
Weather -0)- Sprinkler | Weather -0)- Sprinkler | ||
</uml> | </uml> | ||
− | == | + | == Packages and Classes == |
<uml> | <uml> | ||
hide circle | hide circle | ||
package com.bitplan.sprinkler { | package com.bitplan.sprinkler { | ||
+ | class Configuration { | ||
+ | Location location; | ||
+ | double lPerMinute; | ||
+ | double areaSizeSquareMeter; | ||
+ | double earliestSprinkleHour; | ||
+ | double latestSprinkleHour; | ||
+ | int sprinklesPerDay; | ||
+ | double lEvaporationPerDay; | ||
+ | } | ||
+ | } | ||
+ | package org.openweathermap.weather { | ||
class Location { | class Location { | ||
long id | long id | ||
Line 62: | Line 73: | ||
{static} Location byId(long id) | {static} Location byId(long id) | ||
} | } | ||
− | class | + | class Coord { |
double lat | double lat | ||
double lon | double lon | ||
} | } | ||
− | class | + | class WeatherReport { |
− | + | Coord coord; | |
− | + | Weather[] weather; | |
− | + | Main main; | |
− | + | Clouds clouds; | |
− | + | Rain rain; | |
− | + | Wind wind; | |
− | + | Sys sys; | |
+ | String base; | ||
+ | long id; | ||
+ | long dt; | ||
+ | String name; | ||
+ | long cod; | ||
} | } | ||
} | } |
Revision as of 09:57, 3 August 2018
Project
OsProject | |
---|---|
id | |
state | |
owner | |
title | software for sprinkler / water irrigation system based on weather and other parameters |
url | https://github.com/BITPlan/com.bitplan.sprinkler |
version | 0.0.1 |
description | |
date | |
since | |
until |
Requirements
See also
- https://gardening.stackexchange.com/questions/41255/calculating-amount-of-water-needed-per-day-based-on-weather-and-other-parameters
- open issues on github
- implemented issues on github
- The System shall sprinkle if the lawn needs water
- The System shall sprinkle in the morning no earlier than configured
- The System shall sprinkle in the evening no later than configured
- The System shall sprinkle as often per day as configured
- The System shall collect rain data from a weather service
- The System shall be able to read weather data from the openweathermap api
- The System shall operate by simply switching on and off a garden pump at appropriate times
- The System shall determine the amount of irrigation needed based on the weather and the configuration data
- An Administrator shall be able to configure the system by setting
- coordinates of the location where the system is operated lon/lat
- l/minute the sprinkler deploys when switched on
- earliest time in the morning the system may sprinkle
- latest time in the evening the system may sprinkle
- number of times per day the system shall sprinkle if needed
- size of area to being sprinkled
- average l/day beeing evaporated per day by non lawn plants (e.g. trees)
- A user shall be able to arm/disarm the system
- A user shell be able to see the system operation log
- The system operation log shall show the amount of water that has been irrigated as an equivalent mm rain / day and the total liters for the area
- The system shall read a list of weather locations from the openweather api
Use cases
configure system
As an administrator I'd like to configure the system.
arm / disarm system
As a user I'd like to arm/disarm the system. When the system is armed it will automatically sprinkle. If the system is disarmed only manual operation of the sprinkler is possible.
System context
Packages and Classes
Weather API alternatives
- http://www.programmieren-optimieren.de/php/google-wetter-api-eingestellt-die-alternativen/
- https://stackoverflow.com/questions/12461730/find-weather-using-java
Open Weather Api
City list: http://bulk.openweathermap.org/sample/city.list.json.gz
Example city Willich
{
"id": 2808559,
"name": "Willich",
"country": "DE",
"coord": {
"lon": 6.55,
"lat": 51.26667
}
},
Example weather
https://api.openweathermap.org/data/2.5/weather?q=Willich,DE&appid=0123456789abcdef...&units=metric
{
"coord":{"lon":6.54,"lat":51.26},
"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"base":"stations",
"main":{"temp":28.84,"pressure":1020,"humidity":37,"temp_min":27,"temp_max":30},"visibility":10000,
"wind":{"speed":1.5},
"clouds":{"all":0},"dt":1533138900,
"sys":{"type":1,"id":4909,"message":0.0046,"country":"DE","sunrise":1533095958,"sunset":1533151198},
"id":2808559,
"name":"Willich",
"cod":200
}
Java Code
DWD Data
Precipitation data:
- https://www.dwd.de/DE/leistungen/radolan/radolan.html
- Adjusted 1h total precipitation [mm/h] (Radolan), 1km x 1km, Runlength format raa01-rw_10000-[yyMMddhhmm]-dwd---bin
- https://www.dwd.de/EN/ourservices/surface_weather_observations/surface_weather_observations.html
How to read Radolan data
Wetter Online
METAR
https://en.wikipedia.org/wiki/METAR Example: Mönchengladbach
Hardware example
Software controllable power switch
AVM Fritz DECT 200/210