HAsmartirrigation icon indicating copy to clipboard operation
HAsmartirrigation copied to clipboard

calculation with own rain sensor not accurate?

Open mikburnz opened this issue 9 months ago • 10 comments

What happened?

yesterday we had 4,3 mm rain during the day. Smart irrigation calculated a bucket of -0,37 or 22s for my area. The day before there was rain of 0,1 mm with a calculated bucket of -0.1 or 6s. Ther weather conditions were similar.

My rain sensor is netatmo (daily rain)

How to reproduce

try another sensor for rain instead of OWM.

Relevant log output

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.2.2",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.1",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Berlin",
    "os_name": "Linux",
    "os_version": "6.1.74-haos",
    "supervisor": "2024.04.4",
    "host_os": "Home Assistant OS 11.5",
    "docker_version": "24.0.7",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "smart_irrigation": {
      "version": "v2024.4.3",
      "requirements": []
    
  },
  "data": {
    "config": {
      "entry_id": "9e2fc88ffd92d1007871657f275915f4",
      "version": 1,
      "minor_version": 1,
      "domain": "smart_irrigation",
      "title": "Smart Irrigation",
      "data": {
        "owm_api_key": "XXXXXXXX",
        "owm_api_version": "3.0",
        "use_owm": true,
        "name": "Smart Irrigation"
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": "Smart Irrigation",
      "disabled_by": null
    },
    "storage": {
      "config": {
        "calctime": "23:00",
        "units": "metric",
        "use_owm": true,
        "autocalcenabled": true,
        "autoupdateenabled": true,
        "autoupdateschedule": "hours",
        "autoupdatedelay": "0",
        "autoupdateinterval": "1",
        "autoclearenabled": true,
        "cleardatatime": "23:59",
        "starteventfiredtoday": true
      },
      "zones": [
        {
          "id": 0,
          "name": "vorn",
          "size": 30.0,
          "throughput": 9.0,
          "state": "automatic",
          "bucket": -24.627610873751383,
          "old_bucket": -24.262084332122786,
          "delta": -0.3655265416285975,
          "duration": 3600,
          "module": 0,
          "multiplier": 1.0,
          "explanation": "Beachte: Diese Beschreibung nutzt '.' als Dezimalzeichen und zeigt gerundete Werte. Das Modul berechnete einen Evapotranspirationsmangel von -0.4. Der alte Vorrat war -24.3.<br/>Der maximale Vorrat ist 50.0.Der neue Vorrat ist [alter_Vorrat]+[Ver\u00e4nderung]=-24.3+-0.4=-24.6.<br/>Wenn der Vorrat < 0 ist, ist eine Bew\u00e4sserung n\u00f6tig..<br/>F\u00fcr eine exakte Berechnung der Dauer, wurden folgende Schritte durchgef\u00fchrt:<br/><li>Der Niederschlag ist [Durchfluss]*60/[Gr\u00f6\u00dfe]=9.0*60/30.0=18.0</li><li>Die Dauer ist abs([Vorrat])/[Niederschlag]*3600=24.6/18.0*3600=4926</li><li>Der Multiplikator wird angewendet. Der Multiplikator ist 1.0, also ist die Dauer 4926</li><li>Die maximale Dauer wird angewendet. Diese ist 3600.0, also ist die Dauer 3600</li><li>Zuletzt wird die Vorlaufzeit angewendet. Die Vorlaufzeit ist 0.0, also ist die Dauer 3600</li></ol>",
          "mapping": 0,
          "lead_time": 0.0,
          "maximum_duration": 3600.0,
          "maximum_bucket": 50,
          "last_calculated": "2024-05-05T23:00:00.880538",
          "last_updated": "2024-05-06T08:55:53.115450",
          "number_of_data_points": 8
        },
        {
          "id": 1,
          "name": "mitterechts",
          "size": 45.0,
          "throughput": 12.0,
          "state": "automatic",
          "bucket": -24.627610873751383,
          "old_bucket": -24.262084332122786,
          "delta": -0.3655265416285975,
          "duration": 3600,
          "module": 0,
          "multiplier": 1.0,
          "explanation": "Beachte: Diese Beschreibung nutzt '.' als Dezimalzeichen und zeigt gerundete Werte. Das Modul berechnete einen Evapotranspirationsmangel von -0.4. Der alte Vorrat war -24.3.<br/>Der maximale Vorrat ist 50.0.Der neue Vorrat ist [alter_Vorrat]+[Ver\u00e4nderung]=-24.3+-0.4=-24.6.<br/>Wenn der Vorrat < 0 ist, ist eine Bew\u00e4sserung n\u00f6tig..<br/>F\u00fcr eine exakte Berechnung der Dauer, wurden folgende Schritte durchgef\u00fchrt:<br/><li>Der Niederschlag ist [Durchfluss]*60/[Gr\u00f6\u00dfe]=12.0*60/45.0=16.0</li><li>Die Dauer ist abs([Vorrat])/[Niederschlag]*3600=24.6/16.0*3600=5541</li><li>Der Multiplikator wird angewendet. Der Multiplikator ist 1.0, also ist die Dauer 5541</li><li>Die maximale Dauer wird angewendet. Diese ist 3600.0, also ist die Dauer 3600</li><li>Zuletzt wird die Vorlaufzeit angewendet. Die Vorlaufzeit ist 0.0, also ist die Dauer 3600</li></ol>",
          "mapping": 0,
          "lead_time": 0.0,
          "maximum_duration": 3600.0,
          "maximum_bucket": 50,
          "last_calculated": "2024-05-05T23:00:01.118368",
          "last_updated": "2024-05-06T08:55:53.115450",
          "number_of_data_points": 8
        },
        {
          "id": 2,
          "name": "mittelinks",
          "size": 49.0,
          "throughput": 14.0,
          "state": "automatic",
          "bucket": -24.627610873751383,
          "old_bucket": -24.262084332122786,
          "delta": -0.3655265416285975,
          "duration": 3600,
          "module": 0,
          "multiplier": 1.0,
          "explanation": "Beachte: Diese Beschreibung nutzt '.' als Dezimalzeichen und zeigt gerundete Werte. Das Modul berechnete einen Evapotranspirationsmangel von -0.4. Der alte Vorrat war -24.3.<br/>Der maximale Vorrat ist 50.0.Der neue Vorrat ist [alter_Vorrat]+[Ver\u00e4nderung]=-24.3+-0.4=-24.6.<br/>Wenn der Vorrat < 0 ist, ist eine Bew\u00e4sserung n\u00f6tig..<br/>F\u00fcr eine exakte Berechnung der Dauer, wurden folgende Schritte durchgef\u00fchrt:<br/><li>Der Niederschlag ist [Durchfluss]*60/[Gr\u00f6\u00dfe]=14.0*60/49.0=17.1</li><li>Die Dauer ist abs([Vorrat])/[Niederschlag]*3600=24.6/17.1*3600=5172</li><li>Der Multiplikator wird angewendet. Der Multiplikator ist 1.0, also ist die Dauer 5172</li><li>Die maximale Dauer wird angewendet. Diese ist 3600.0, also ist die Dauer 3600</li><li>Zuletzt wird die Vorlaufzeit angewendet. Die Vorlaufzeit ist 0.0, also ist die Dauer 3600</li></ol>",
          "mapping": 0,
          "lead_time": 0.0,
          "maximum_duration": 3600.0,
          "maximum_bucket": 50,
          "last_calculated": "2024-05-05T23:00:01.406552",
          "last_updated": "2024-05-06T08:55:53.115450",
          "number_of_data_points": 8
        },
        {
          "id": 3,
          "name": "hinten",
          "size": 42.0,
          "throughput": 9.0,
          "state": "automatic",
          "bucket": -24.627610873751383,
          "old_bucket": -24.262084332122786,
          "delta": -0.3655265416285975,
          "duration": 3600,
          "module": 0,
          "multiplier": 1.0,
          "explanation": "Beachte: Diese Beschreibung nutzt '.' als Dezimalzeichen und zeigt gerundete Werte. Das Modul berechnete einen Evapotranspirationsmangel von -0.4. Der alte Vorrat war -24.3.<br/>Der maximale Vorrat ist 50.0.Der neue Vorrat ist [alter_Vorrat]+[Ver\u00e4nderung]=-24.3+-0.4=-24.6.<br/>Wenn der Vorrat < 0 ist, ist eine Bew\u00e4sserung n\u00f6tig..<br/>F\u00fcr eine exakte Berechnung der Dauer, wurden folgende Schritte durchgef\u00fchrt:<br/><li>Der Niederschlag ist [Durchfluss]*60/[Gr\u00f6\u00dfe]=9.0*60/42.0=12.9</li><li>Die Dauer ist abs([Vorrat])/[Niederschlag]*3600=24.6/12.9*3600=6896</li><li>Der Multiplikator wird angewendet. Der Multiplikator ist 1.0, also ist die Dauer 6896</li><li>Die maximale Dauer wird angewendet. Diese ist 3600.0, also ist die Dauer 3600</li><li>Zuletzt wird die Vorlaufzeit angewendet. Die Vorlaufzeit ist 0.0, also ist die Dauer 3600</li></ol>",
          "mapping": 0,
          "lead_time": 0.0,
          "maximum_duration": 3600.0,
          "maximum_bucket": 50,
          "last_calculated": "2024-05-05T23:00:01.648197",
          "last_updated": "2024-05-06T08:55:53.115450",
          "number_of_data_points": 8
        },
        {
          "id": 4,
          "name": "bucketday",
          "size": 10.0,
          "throughput": 10.0,
          "state": "automatic",
          "bucket": -24.627610873751383,
          "old_bucket": -24.262084332122786,
          "delta": -0.3655265416285975,
          "duration": 1478,
          "module": 0,
          "multiplier": 1.0,
          "explanation": "Beachte: Diese Beschreibung nutzt '.' als Dezimalzeichen und zeigt gerundete Werte. Das Modul berechnete einen Evapotranspirationsmangel von -0.4. Der alte Vorrat war -24.3.<br/>Der maximale Vorrat ist 10000.0.Der neue Vorrat ist [alter_Vorrat]+[Ver\u00e4nderung]=-24.3+-0.4=-24.6.<br/>Wenn der Vorrat < 0 ist, ist eine Bew\u00e4sserung n\u00f6tig..<br/>F\u00fcr eine exakte Berechnung der Dauer, wurden folgende Schritte durchgef\u00fchrt:<br/><li>Der Niederschlag ist [Durchfluss]*60/[Gr\u00f6\u00dfe]=10.0*60/10.0=60.0</li><li>Die Dauer ist abs([Vorrat])/[Niederschlag]*3600=24.6/60.0*3600=1478</li><li>Der Multiplikator wird angewendet. Der Multiplikator ist 1.0, also ist die Dauer 1478</li><li>Die maximale Dauer wird angewendet. Diese ist 3600.0, <li>Zuletzt wird die Vorlaufzeit angewendet. Die Vorlaufzeit ist 0.0, also ist die Dauer 1478</li></ol>",
          "mapping": 0,
          "lead_time": 0.0,
          "maximum_duration": 3600.0,
          "maximum_bucket": 10000,
          "last_calculated": "2024-05-05T23:00:01.869305",
          "last_updated": "2024-05-06T08:55:53.115450",
          "number_of_data_points": 8
        },
        {
          "id": 5,
          "name": "bucketdayreset",
          "size": 10.0,
          "throughput": 10.0,
          "state": "automatic",
          "bucket": 0,
          "old_bucket": 0,
          "delta": -0.3655265416285975,
          "duration": 0,
          "module": 0,
          "multiplier": 1.0,
          "explanation": "Beachte: Diese Beschreibung nutzt '.' als Dezimalzeichen und zeigt gerundete Werte. Das Modul berechnete einen Evapotranspirationsmangel von -0.4. Der alte Vorrat war 0.<br/>Der maximale Vorrat ist 50.0.Der neue Vorrat ist [alter_Vorrat]+[Ver\u00e4nderung]=0+-0.4=-0.4.<br/>Wenn der Vorrat < 0 ist, ist eine Bew\u00e4sserung n\u00f6tig..<br/>F\u00fcr eine exakte Berechnung der Dauer, wurden folgende Schritte durchgef\u00fchrt:<br/><li>Der Niederschlag ist [Durchfluss]*60/[Gr\u00f6\u00dfe]=10.0*60/10.0=60.0</li><li>Die Dauer ist abs([Vorrat])/[Niederschlag]*3600=0.4/60.0*3600=22</li><li>Der Multiplikator wird angewendet. Der Multiplikator ist 1.0, also ist die Dauer 22</li><li>Die maximale Dauer wird angewendet. Diese ist 3600.0, <li>Zuletzt wird die Vorlaufzeit angewendet. Die Vorlaufzeit ist 0.0, also ist die Dauer 22</li></ol>",
          "mapping": 0,
          "lead_time": 0.0,
          "maximum_duration": 3600.0,
          "maximum_bucket": 50,
          "last_calculated": "2024-05-05T23:00:02.099437",
          "last_updated": "2024-05-06T08:55:53.115450",
          "number_of_data_points": 8
        }
      ],
      "modules": [
        {
          "id": 0,
          "name": "PyETO",
          "description": "Die Berechnung der Verunstungsrate basiert auf der FAO56-Formel aus der PyETO-Bibliothek.",
          "config": {
            "forecast_days": "2"
          },
          "schema": [
            {
              "type": "boolean",
              "name": "coastal",
              "optional": true,
              "default": false
            },
            {
              "type": "select",
              "options": [
                [
                  "1",
                  "EstimateFromTemp"
                ],
                [
                  "2",
                  "EstimateFromSunHours"
                ],
                [
                  "3",
                  "DontEstimate"
                ]
              ],
              "name": "solrad_behavior",
              "required": true,
              "default": "1"
            },
            {
              "type": "integer",
              "name": "forecast_days",
              "required": true,
              "default": 0
            }
          ]
        },
        {
          "id": 1,
          "name": "Static",
          "description": "Modul mit einer statisch konfigurierbaren Verdunstungsrate..",
          "config": null,
          "schema": [
            {
              "type": "float",
              "name": "delta",
              "required": true,
              "default": 0.0
            }
          ]
        }
      ],
      "mappings": [
        {
          "id": 0,
          "name": "Standard Sensorgruppe",
          "mappings": {
            "Dewpoint": {
              "source": "owm",
              "sensorentity": "",
              "unit": ""
            },
            "Evapotranspiration": {
              "source": "none",
              "sensorentity": "",
              "unit": ""
            },
            "Humidity": {
              "source": "owm",
              "sensorentity": "",
              "unit": ""
            },
            "Precipitation": {
              "source": "sensor",
              "sensorentity": "sensor.regenmesser_rain_today",
              "unit": ""
            },
            "Pressure": {
              "source": "owm",
              "sensorentity": "",
              "unit": ""
            },
            "Solar Radiation": {
              "source": "none",
              "sensorentity": "",
              "unit": ""
            },
            "Temperature": {
              "source": "owm",
              "sensorentity": "",
              "unit": ""
            },
            "Windspeed": {
              "source": "owm",
              "sensorentity": "",
              "unit": ""
            }
          },
          "data": [
            {
              "Windspeed": 0.6656764568994703,
              "Pressure": 1010.0,
              "Humidity": 82,
              "Temperature": 10.42,
              "Dewpoint": 7.48,
              "Precipitation": 0.0,
              "retrieved": "2024-05-06T00:55:53.119568"
            },
            {
              "Windspeed": 0.38893455908733093,
              "Pressure": 1010.0,
              "Humidity": 84,
              "Temperature": 9.18,
              "Dewpoint": 6.62,
              "Precipitation": 0.0,
              "retrieved": "2024-05-06T01:55:53.318384"
            },
            {
              "Windspeed": 0.628278903141073,
              "Pressure": 1009.0,
              "Humidity": 86,
              "Temperature": 9.15,
              "Dewpoint": 6.93,
              "Precipitation": 0.0,
              "retrieved": "2024-05-06T02:55:53.174191"
            },
            {
              "Windspeed": 0.8526642256914563,
              "Pressure": 1010.0,
              "Humidity": 87,
              "Temperature": 9.36,
              "Dewpoint": 7.31,
              "Precipitation": 0.0,
              "retrieved": "2024-05-06T03:55:53.138562"
            },
            {
              "Windspeed": 0.33657798382557486,
              "Pressure": 1009.0,
              "Humidity": 89,
              "Temperature": 9.8,
              "Dewpoint": 8.08,
              "Precipitation": 0.0,
              "retrieved": "2024-05-06T04:55:53.138539"
            },
            {
              "Windspeed": 0.7329920536645852,
              "Pressure": 1009.0,
              "Humidity": 90,
              "Temperature": 10.55,
              "Dewpoint": 8.98,
              "Precipitation": 0.0,
              "retrieved": "2024-05-06T05:55:53.171145"
            },
            {
              "Windspeed": 0.33657798382557486,
              "Pressure": 1009.0,
              "Humidity": 81,
              "Temperature": 11.39,
              "Dewpoint": 8.25,
              "Precipitation": 0.0,
              "retrieved": "2024-05-06T06:55:53.130265"
            },
            {
              "Windspeed": 0.33657798382557486,
              "Pressure": 1009.0,
              "Humidity": 77,
              "Temperature": 12.29,
              "Dewpoint": 8.38,
              "Precipitation": 0.0,
              "retrieved": "2024-05-06T07:55:53.167005"
            },
            {
              "Windspeed": 0.33657798382557486,
              "Pressure": 1009.0,
              "Humidity": 71,
              "Temperature": 13.71,
              "Dewpoint": 8.55,
              "Precipitation": 0.0,
              "retrieved": "2024-05-06T08:55:53.115430"
            }
          ],
          "data_last_updated": "2024-05-06T08:55:53.115450"
        }
      ]
    }
  }
}

Which version are you running?

2024.2.2

Diagnostics file

  • [X] I have attached a diagnostics file

Additional information

rain

mikburnz avatar May 06 '24 07:05 mikburnz

OWM is notoriously inaccurate depending on where you live. Use your local weather service or use a weather station.

jeroenterheerdt avatar May 06 '24 14:05 jeroenterheerdt

as i told you, i have a problem with the calculatin with my own weather station (not OWM). rain was 4.2 mm. bucket was calcualated . The question is, why?

mikburnz avatar May 07 '24 15:05 mikburnz

hard to say. There are so many factors that go into this: wind speed, temperature, solar radiation, soil drainage, etc etc etc. Rain does not just equal into Bucket changes. If that was the case we didn't need this integration at all. Are the numbers in the json you pasted above correct (keeping in mind they are all in metric)? If so, then there is no bug in the integration (but maybe in the pyeto module that we use but don't control).

jeroenterheerdt avatar May 07 '24 16:05 jeroenterheerdt

same yesterday. 2.7 l rain messured with netatmo. Bucket calculation says - 1,7 .. in total this would mean 4.7 l per m² during rainy condition . Im afraid of overwatering. The own rain sensor should be the most accurate. how can we fix this?

image image

mikburnz avatar May 08 '24 06:05 mikburnz

There is nothing to fix. Have you even read what I wrote above?

jeroenterheerdt avatar May 08 '24 13:05 jeroenterheerdt

Yes I did. It makes no sense that there is a total irrigation of 4.7 mm calculated. I think that with the own sensor instead of OWM the calculation is wrong.

mikburnz avatar May 08 '24 21:05 mikburnz

if the values in the json you pasted above make sense to you then there is no difference in logic between OWM and your own sensor. So if you're happy with what using OWM gives you then the only logical conclusion is that the amount of rain reported by your weather station is off.

jeroenterheerdt avatar May 08 '24 22:05 jeroenterheerdt

I'm not happy with OWM so i want to use the accurate sensor of my rain station. as i told you and you can see the problem in my screenshots. The calculation with the value of my weather station ist not correct.

mikburnz avatar May 13 '24 14:05 mikburnz

Have you checked the values in the json? Do they make sense to you? If not, let me know what does not make sense to at least stand a chance to find bugs. Keep in mind that I don't see any issues on my side nor in 400 other installations...

jeroenterheerdt avatar May 15 '24 03:05 jeroenterheerdt

You also have pyeto set to forecast days = 2 That is going to also have another effect on the calculations above the temp, wind speed etc that will mean it is not a straight forward "add rain" from your sensor to the bucket

Bart39 avatar May 26 '24 07:05 Bart39

Stale issue message

github-actions[bot] avatar Sep 08 '24 19:09 github-actions[bot]