michaeljolley / aviary

Aviary is a soil moisture management system that runs within a Particle mesh network consisting of an Argon and n Xenons.
MIT License
4 stars 0 forks source link

Only request watering between the hours of X & Y #15

Closed michaeljolley closed 5 years ago

michaeljolley commented 5 years ago

Current Situation

When the baby bird sends moisture level and mother bird determines whether to water, the decision is make irrespective of the time of day. To prevent mold & fungi, we only want to water during daylight hours.

Goal

michaeljolley commented 5 years ago

https://docs.particle.io/reference/device-os/firmware/argon/#eeprom

michaeljolley commented 5 years ago

I'm doing it myself

michaeljolley commented 5 years ago

Mother Bird now defaults to watering only between 6AM & 6PM CDT but you can override those settings by sending a JSON payload of:

{ 
  "startHour": 5, 
  "endHour": 12
}

where those numbers represent the UTC hour.

The device will keep those as variables to use in determining whether to water and also save them to EEPROM so on start up it will reinitialize for the correct timespan.