jeroenterheerdt / HAsmartirrigation

Smart Irrigation custom component for Home Assistant
MIT License
301 stars 47 forks source link

Cannot set evapotranspiration reference per month #305

Closed pove closed 7 months ago

pove commented 7 months ago

What happened?

On v1 I was able to set evapotranspiration reference for every month:

"reference_evapotranspiration": [
          18.0,
          21.0,
          37.0,
          52.0,
          85.0,
          115.0,
          146.0,
          138.0,
          101.0,
          60.0,
          32.0,
          19.0
        ]

Now I am asked for a unique sensor or a unique static value:

image

How to reproduce

Update to v2 and try to configure evapotranspiration per month.

Relevant log output

v1 diagnostics:

"integration_manifest": {
    "domain": "smart_irrigation",
    "name": "Smart Irrigation",
    "codeowners": [
      "@jeroenterheerdt"
    ],
    "config_flow": true,
    "dependencies": [],
    "documentation": "https://github.com/jeroenterheerdt/HASmartIrrigation",
    "homekit": {},
    "integration_type": "service",
    "iot_class": "cloud_polling",
    "issue_tracker": "https://github.com/jeroenterheerdt/HASmartIrrigation/issues",
    "requirements": [],
    "ssdp": [],
    "version": "0.0.82",
    "zeroconf": [],
    "is_built_in": false
  },
  "data": {
    "config": {
      "entry_id": "926ed16ca4fd712ee63343f98142b332",
      "version": 1,
      "domain": "smart_irrigation",
      "title": "Smart Irrigation",
      "data": {
        "number_of_sprinklers": 1.0,
        "flow": 0.13,
        "area": 3.0,
        "api_key": null,
        "reference_evapotranspiration": [
          18.0,
          21.0,
          37.0,
          52.0,
          85.0,
          115.0,
          146.0,
          138.0,
          101.0,
          60.0,
          32.0,
          19.0
        ],
        "name": "Smart Irrigation",
        "sources": {
          "use_owm_precipitation": false,
          "use_owm_temperature": false,
          "use_owm_min_temperature": false,
          "use_owm_max_temperature": false,
          "use_owm_dewpoint": false,
          "use_owm_pressure": false,
          "use_owm_humidity": false,
          "use_owm_windspeed": false,
          "calculate_solar_radiation": true,
          "calculate_ET_value": true
        },
        "sensors": {
          "sensor_precipitation": "sensor.netatmo_elda_rain_today",
          "sensor_temperature": "sensor.sonofftemp1_temperature",
          "sensor_min_temperature": "sensor.outside_temperature_min",
          "sensor_max_temperature": "sensor.outside_temperature_max",
          "sensor_dewpoint": "sensor.outside_dewpoint",
          "sensor_pressure": "sensor.netatmo_elda_pressure",
          "sensor_humidity": "sensor.sonofftemp1_humidity",
          "sensor_windspeed": "sensor.netatmo_elda_wind_strength"
        }
      },
      "options": {
        "lead_time": 0,
        "maximum_duration": -1,
        "force_mode_duration": 0,
        "show_units": false,
        "auto_refresh": false,
        "auto_refresh_time": "23:00",
        "initial_update_delay": 300,
        "coastal": false,
        "estimate_solrad_from_temp": true
      },
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": "Smart Irrigation",
      "disabled_by": null
    }
  }

v2 diagnostics:

 "integration_manifest": {
    "domain": "smart_irrigation",
    "name": "Smart Irrigation",
    "codeowners": [
      "@jeroenterheerdt"
    ],
    "config_flow": true,
    "dependencies": [
      "http",
      "panel_custom"
    ],
    "documentation": "https://github.com/jeroenterheerdt/HASmartIrrigation",
    "iot_class": "local_push",
    "issue_tracker": "https://github.com/jeroenterheerdt/HASmartIrrigation/issues",
    "requirements": [],
    "version": "v2023.9.2",
    "is_built_in": false
  },
  "data": {
    "config": {
      "entry_id": "beba7e673d7ac0f7ed6cbdbe36a0a419",
      "version": 1,
      "domain": "smart_irrigation",
      "title": "Smart Irrigation",
      "data": {
        "name": "Smart Irrigation",
        "use_owm": false
      },
      "options": {
        "use_owm": false,
        "owm_api_key": "XXXXXXXXXXX",
        "owm_api_version": null
      },
      "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": false,
        "autocalcenabled": true,
        "autoupdateenabled": true,
        "autoupdateschedule": "hours",
        "autoupdatedelay": "0",
        "autoupdateinterval": "1",
        "autoclearenabled": true,
        "cleardatatime": "23:59",
        "starteventfiredtoday": false
      },
      "zones": [
        {
          "id": 0,
          "name": "Irrigation bucket 1",
          "size": 3.0,
          "throughput": 0.13,
          "state": "automatic",
          "bucket": 0,
          "old_bucket": 0,
          "delta": 0,
          "duration": 0,
          "module": 0,
          "multiplier": 1.0,
          "explanation": "None",
          "mapping": 0,
          "lead_time": 0.0,
          "maximum_duration": 3600.0,
          "maximum_bucket": 50,
          "last_calculated": null
        }
      ],
      "modules": [
        {
          "id": 0,
          "name": "PyETO",
          "description": "Calculate duration based on the FAO56 calculation from the PyETO library.",
          "config": {
            "forecast_days": "1"
          },
          "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": "'Dummy' module with a static configurable delta.",
          "config": null,
          "schema": [
            {
              "type": "float",
              "name": "delta",
              "required": true,
              "default": 0
            }
          ]
        }
      ],
      "mappings": [
        {
          "id": 0,
          "name": "Default sensor group",
          "mappings": {
            "Dewpoint": {
              "source": "sensor",
              "sensorentity": "sensor.outside_dewpoint",
              "unit": ""
            },
            "Evapotranspiration": {
              "source": "static",
              "sensorentity": "",
              "unit": "",
              "aggregate": "average"
            },
            "Humidity": {
              "source": "sensor",
              "sensorentity": "sensor.sonofftemp1_humidity",
              "unit": ""
            },
            "Maximum Temperature": {
              "source": "sensor",
              "sensorentity": "sensor.outside_temperature_max",
              "unit": ""
            },
            "Minimum Temperature": {
              "source": "sensor",
              "sensorentity": "sensor.outside_temperature_min",
              "unit": ""
            },
            "Precipitation": {
              "source": "sensor",
              "sensorentity": "sensor.netatmo_elda_rain_today",
              "unit": ""
            },
            "Pressure": {
              "source": "sensor",
              "sensorentity": "sensor.netatmo_elda_pressure",
              "unit": ""
            },
            "Solar Radiation": {
              "source": "sensor",
              "sensorentity": "sensor.power_production_now",
              "unit": "W/m2"
            },
            "Temperature": {
              "source": "sensor",
              "sensorentity": "sensor.sonofftemp1_temperature",
              "unit": ""
            },
            "Windspeed": {
              "source": "sensor",
              "sensorentity": "sensor.netatmo_elda_wind_strength",
              "unit": ""
            }
          },
          "data": [
            "[",
            "]",
            {
              "Dewpoint": 18.9667666417301,
              "Humidity": 78.44,
              "Maximum Temperature": 27.15,
              "Minimum Temperature": 18.92,
              "Precipitation": 0,
              "Pressure": 1025.4,
              "Solar Radiation": 293,
              "Temperature": 22.9,
              "Windspeed": 4,
              "retrieved": "2023-10-08T12:56:21.808976"
            },
            {
              "Dewpoint": 18.9667666417301,
              "Humidity": 78.44,
              "Maximum Temperature": 27.15,
              "Minimum Temperature": 18.92,
              "Precipitation": 0,
              "Pressure": 1025.4,
              "Solar Radiation": 293,
              "Temperature": 22.9,
              "Windspeed": 4,
              "retrieved": "2023-10-08T12:56:41.309393"
            },
            {
              "Dewpoint": 18.9667666417301,
              "Humidity": 78.44,
              "Maximum Temperature": 27.15,
              "Minimum Temperature": 18.92,
              "Precipitation": 0,
              "Pressure": 1025.4,
              "Solar Radiation": 293,
              "Temperature": 22.9,
              "Windspeed": 4,
              "retrieved": "2023-10-08T12:56:57.373056"
            },
            {
              "Dewpoint": 18.9667666417301,
              "Humidity": 78.44,
              "Maximum Temperature": 27.15,
              "Minimum Temperature": 18.92,
              "Precipitation": 0,
              "Pressure": 1025.4,
              "Solar Radiation": 293,
              "Temperature": 22.9,
              "Windspeed": 4,
              "retrieved": "2023-10-08T12:58:19.734424"
            },
            {
              "Dewpoint": 19.1802673440864,
              "Humidity": 78.44,
              "Maximum Temperature": 27.15,
              "Minimum Temperature": 18.92,
              "Precipitation": 0,
              "Pressure": 1025.4,
              "Solar Radiation": 293,
              "Temperature": 23.12,
              "Windspeed": 4,
              "retrieved": "2023-10-08T13:01:10.299079"
            }
          ],
          "data_last_updated": "2023-10-08T13:01:10.299108"
        }
      ]
    }
  }

Which version are you running?

v2023.9.2

Diagnostics file

Additional information

No response

jeroenterheerdt commented 7 months ago

Read the readme. Reference ET values are no longer necessary. The et value you can set is used to bypass calculation and works in conjunction with Passthrough module.