September 2019 Update

New! We're moving to the new forum!

ALL new Blog posts will be on the forum.

Please join us there.

This Blog will no longer be updated...

Friday, June 14, 2019

Watering Time Predictions - Better results?

I'm not absolutely sure why that didn't work better, the theory seems good...

So I grabbed a piece of paper, and started figuring it out on paper, I tend to do that a lot. Model the problem in layman's terms without a computer. Turn it into a word problem, and then it's a lot easier to turn it into a computer function...

So, here's the new plan...

All of this information can come directly from the database...

AutoWaterSensorReadingTarget: 220
CurrentSensorReading: 439
TimeSinceLastWatering: 7437 minutes ago
SensorReadingAfterLastWatering: 708

With that information, we can calculate the rest.


ChangeSinceWatered: how much has the sensor value changed since it was last watered
ChangePerMinute: on average, how much does the value change every minute
UnitsToGo: how many Sensor Reading "units" to go until we reach AutoWater Trigger
MinutesToGo: how many minutes until we reach AutoWater Trigger


ChangeSinceWatered = SensorReadingAfterLastWatering - CurrentSensorReading
ChangeSinceWatered = 708 - 439
ChangeSinceWatered = 269

ChangePerMinute = ChangeSinceWatered / TimeSinceLastWatering
ChangePerMinute = 269 / 7437
ChangePerMinute =  0.0361704988

UnitsToGo =  CurrentSensorReading - AutoWaterSensorReadingTarget
UnitsToGo = 439 - 220
UnitsToGo = 219

MinutesToGo = UnitsToGo / ChangePerMinute
MinutesToGo = 219 / 0.0361704988
MinutesToGo =6054 (Roughly 4 days))

I think this will work better, I'll let it go for a while and watch the logs...

No comments:

Post a Comment

Any comments deemed off topic or offensive will be removed