kloggy / HA-Irrigation-Version2

225 stars 55 forks source link

Rainfall multiplier not properly including historical rainfall #11

Closed ToastedTortilla closed 4 years ago

ToastedTortilla commented 4 years ago

The rainfall multiplier is not adding up the historical rainfall properly if using more than 1 day of history.

In the "Irrigation Rainfall Calculate Multiplier" automation, the if statements for days_used should be >= instead of ==. As written, it will only use the rainfall data for the specific day of history, instead of using the data for all days up to that history. Setting number of days history to 4, it will only use the rainfall data from today + the rainfall data from 4 days ago and ignore days 1-3.

kloggy commented 4 years ago

Yes. Thank you!

I'll update the file.

ToastedTortilla commented 4 years ago

I think I found another issue in this automation. The entity_id list should include input_number.irrigation_rainfall_2 to _4. If it rained and then stopped for a few days, once today and yesterday are set to zero the rainfall multiplier won't update even though you might want to include rainfall from 2-4 days ago.

kloggy commented 4 years ago

Yes, I think you're right (again). Thanks. Again :-))