[Bug] Need to filter to sane evapotranspiration values
See original GitHub issueDescribe 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:
- Created 2 years ago
- Comments:11 (6 by maintainers)
Top GitHub Comments
No I have not seen any anomalous values.
I’ve not yet noticed any negative implications from having this version installed. Seems to be operating normally as before.