question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Need to filter to sane evapotranspiration values

See original GitHub issue

Describe the bug

After running fine for a few days, I must have pulled some bad data from OWM during an hourly update, because it calculated an ET value of -1206584. After averaging with my typical hourly values of “8”, I now have a bucket with 161 surplus feet of rain, so I’ll have to reset the bucket or else it won’t run the sprinkler for the rest of the year 😃

I don’t know exactly what data OWM returned that caused this, but perhaps the calculation needs some way to reject obviously garbage calculations, so as not to break the whole system? If I wasn’t watching closely this would just effectively turn off my system indefinitely.

This is what I could capture from the logs:

2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation] Updating Smart Irrigation Data
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Base Schedule Index
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Base Schedule Index
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Hourly Adjusted Run Time
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] rain: 0, snow: 0
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculated evapotranspiration: -1206584.844726095
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0 and adjusted_run_time: 0 for type: Hourly Adjusted Run Time. Bucket value was: 1206584.844726095, and base schedule index is: 630.789725952923, force mode is: False, force mode duration is: 0, lead_time is: 0, maximum_duration: -1, change percentage: 1.0, type: Hourly Adjusted Run Time
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state: just updated hourly_precipitation_list: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] and hourly_evapotranspiration_list: [7.823673285287475, 7.059739252304136, 9.260163536064347, 8.245326909966955, 9.168558559199955, 8.149997875880238, 9.11628063758286, 8.095594677032249, 9.086738067575752, 8.064851099995098, 9.069129199527149, 8.04652637092586, -1206584.844726095]
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Hourly Adjusted Run Time
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] rain: 0, snow: 0
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculated evapotranspiration: -1254357.979054323
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0 and adjusted_run_time: 0 for type: Hourly Adjusted Run Time. Bucket value was: 1254357.979054323, and base schedule index is: 630.789725952923, force mode is: False, force mode duration is: 0, lead_time is: 0, maximum_duration: -1, change percentage: 1.0, type: Hourly Adjusted Run Time
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state: just updated hourly_precipitation_list: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] and hourly_evapotranspiration_list: [7.823673285287475, 7.059739252304136, 9.260163536064347, 8.245326909966955, 9.168558559199955, 8.149997875880238, 9.11628063758286, 8.095594677032249, 9.086738067575752, 8.064851099995098, 9.069129199527149, 8.04652637092586, -1206584.844726095, -1254357.979054323]
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Daily Adjusted Run Time
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 15.869023667201393 and adjusted_run_time: 10010 for type: Daily Adjusted Run Time. Bucket value was: -72.5531738847432, and base schedule index is: 630.789725952923, force mode is: False, force mode duration is: 0, lead_time is: 0, maximum_duration: -1, change percentage: 1.0, type: Daily Adjusted Run Time
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculating wb and art for daily adjusted run time, result: {'wb': 15.869023667201393, 'art': 10010}
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Daily Adjusted Run Time
2021-07-29 05:28:49 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 15.869023667201393 and adjusted_run_time: 10010 for type: Daily Adjusted Run Time. Bucket value was: -72.5531738847432, and base schedule index is: 630.789725952923, force mode is: False, force mode duration is: 0, lead_time is: 0, maximum_duration: -1, change percentage: 1.0, type: Daily Adjusted Run Time

And the daily calculation:

2021-07-30 23:00:01 INFO (MainThread) [custom_components.smart_irrigation] bucket_delta set to -8.497678168865999, which is the difference between precipitation and evapotranspiration
2021-07-30 23:00:01 INFO (MainThread) [custom_components.smart_irrigation] Updating bucket: 49138.10116975998 with bucket_delta: -8.497678168865999
2021-07-30 23:00:01 INFO (MainThread) [custom_components.smart_irrigation] hourly_precipitation_list and hourly_evapotranspiration_list are now empty, bucket is 49129.603491591115
2021-07-30 23:00:01 INFO (MainThread) [custom_components.smart_irrigation] Bucket for today is: 49129.603491591115 mm
2021-07-30 23:00:01 INFO (SyncWorker_5) [custom_components.smart_irrigation.sensor] _bucket_updated, received bucket value 49129.603491591115 from event_dict: {'event_type': 'Smart_Irrigation_Zone_4_bucketUpd', 'data': {'bucket': 49129.603491591115}, 'origin': 'LOCAL', 'time_fired': '2021-07-31T06:00:01.109546+00:00', 'context': {'id': 'fafd2411dd3fc8d8056d4cae2a0c2c86', 'parent_id': None, 'user_id': None}}
2021-07-30 23:00:01 INFO (SyncWorker_5) [custom_components.smart_irrigation.sensor] updated_adjusted_run_time_from_event called.
2021-07-30 23:00:01 INFO (SyncWorker_5) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0 and adjusted_run_time: 0 for type: Daily Adjusted Run Time. Bucket value was: 49129.603491591115, and base schedule index is: 630.789725952923, force mode is: False, force mode duration is: 0, lead_time is: 0, maximum_duration: -1, change percentage: 1.0, type: Daily Adjusted Run Time
2021-07-30 23:00:01 INFO (SyncWorker_5) [custom_components.smart_irrigation.sensor] updated_adjusted_run_time_from_event: got result: {'wb': 0, 'art': 0}. Setting attributes of daily adjusted run time (including result['wb']) and state == result['art']

I only have one instance setup, so I’m not sure why it looks like it’s running the hourly calculation twice. I think I saw this in another bug report.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
karwostscommented, Aug 5, 2021

No I have not seen any anomalous values.

1reaction
karwostscommented, Aug 5, 2021

I’ve not yet noticed any negative implications from having this version installed. Seems to be operating normally as before.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Impact of Insect-Proof Screen on Microclimate, Reference ...
Low evaporation demand under shading can increase the stomatal conductance of plants in a way that may reduce irrigation demand, resulting in ...
Read more >
CRAN Package 'Evapotranspiration'
Estimating actual, potential, reference crop and pan evaporation using standard meteorological data: a pragmatic synthesis. Hydrology and Earth ...
Read more >
Evapotranspiration information reporting: II. Recommended ...
Recommended documentation includes description of field procedures, instrumentation, data filtering, model parameterization, and site review.
Read more >
Chapter 1 - Introduction to evapotranspiration
Different kinds of plants may have different transpiration rates. ... Although the values for crop evapotranspiration and crop water requirement are ...
Read more >
Understanding Evapotranspiration And How It Saves Water
What Is Evapotranspiration And How Does It Help Us Save Water? Categories: Maintenance · Water Conservation · Construction · Drought Solutions ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found