jeroenterheerdt / HAsmartirrigation

Smart Irrigation custom component for Home Assistant
https://jeroenterheerdt.github.io/HAsmartirrigation/
MIT License
355 stars 48 forks source link

Beta 16 owmClient bug #263

Closed apocaliss92 closed 1 year ago

apocaliss92 commented 1 year ago

What happened?

Hi again! I updated from b9 to b16 and since two days no more calculations; I could catch this in the logs:

Logger: homeassistant Source: custom_components/smart_irrigation/init.py:330 Integration: Smart Irrigation (documentation, issues) First occurred: 00:07:55 (1 occurrences) Last logged: 00:07:55

Error doing job: Exception in callback async_call_later..run_action(>>) at /usr/src/homeassistant/homeassistant/helpers/event.py:1490 Traceback (most recent call last): File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run self._context.run(self._callback, self._args) File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1493, in run_action hass.async_run_hass_job(job, time_tracker_utcnow()) File "/usr/src/homeassistant/homeassistant/core.py", line 625, in async_run_hass_job hassjob.target(args) File "/config/custom_components/smart_irrigation/init.py", line 330, in track_update_time if self._OWMClient: ^^^^^^^^^^^^^^^ AttributeError: 'SmartIrrigationCoordinator' object has no attribute '_OWMClient'

How to reproduce

Installed b16 and restarted ha

Relevant log output

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.9.0",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.11.5",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Berlin",
    "os_name": "Linux",
    "os_version": "6.1.21-v8",
    "supervisor": "2023.08.3",
    "host_os": "Home Assistant OS 10.5",
    "docker_version": "23.0.6",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "landroid_cloud": {
      "version": "3.0.6",
      "requirements": [
        "pyworxcloud==3.1.15"
      ]
    },
    "sonoff": {
      "version": "3.5.2",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },
    "browser_mod": {
      "version": "2.3.0",
      "requirements": []
    },
    "hisense_tv": {
      "version": "22.05.09",
      "requirements": [
        "wakeonlan==2.0.1"
      ]
    },
    "hacs": {
      "version": "1.32.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "ui_lovelace_minimalist": {
      "version": "v1.3.6",
      "requirements": [
        "aiofiles==0.8.0",
        "aiogithubapi>=22.2.4"
      ]
    },
    "reolink_dev": {
      "version": "0.64",
      "requirements": [
        "reolink==0.0.64",
        "aiosmtpd>=1.4.2"
      ]
    },
    "alexa_media": {
      "version": "4.6.5",
      "requirements": [
        "alexapy==1.26.8",
        "packaging>=20.3",
        "wrapt>=1.12.1"
      ]
    },
    "smart_irrigation": {
      "version": "v2023.9.0-beta16",
      "requirements": []
    },
    "gardena_smart_system": {
      "version": "1.0.0",
      "requirements": [
        "py-smart-gardena==1.3.7"
      ]
    },
    "smartir": {
      "version": "1.17.6",
      "requirements": [
        "aiofiles==0.6.0"
      ]
    },
    "kia_uvo": {
      "version": "2.14.0",
      "requirements": [
        "hyundai_kia_connect_api==3.8.6"
      ]
    },
    "darkness_manager": {
      "version": "v0.0.0",
      "requirements": []
    },
    "gree": {
      "version": "2.3.1",
      "requirements": [
        "pycryptodome"
      ]
    },
    "daily": {
      "version": "0.4.0",
      "requirements": []
    },
    "scheduler": {
      "version": "v0.0.0",
      "requirements": []
    },
    "irrigation_unlimited": {
      "version": "2023.8.0",
      "requirements": [
        "crontab"
      ]
    },
    "homematicip_local": {
      "version": "1.41.0",
      "requirements": [
        "hahomematic==2023.9.0"
      ]
    },
    "localtuya": {
      "version": "5.2.1",
      "requirements": []
    },
    "samsungtv_tizen": {
      "version": "1.6.1",
      "requirements": [
        "websocket-client>=0.56.0",
        "wakeonlan>=2.0.0",
        "numpy>=1.19.2"
      ]
    },
    "frigate": {
      "version": "4.0.0",
      "requirements": [
        "pytz==2022.7"
      ]
    },
    "dwains_dashboard": {
      "version": "3.4.3",
      "requirements": []
    }
  },
  "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.0-beta16",
    "is_built_in": false
  },
  "data": {
    "config": {
      "entry_id": "5d78337ce4515ccc5839f7448af827d4",
      "version": 1,
      "domain": "smart_irrigation",
      "title": "Smart Irrigation",
      "data": {
        "name": "Smart Irrigation",
        "use_owm": false
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": "Smart Irrigation",
      "disabled_by": null
    },
    "storage": {
      "config": {
        "calctime": "20:00",
        "units": "metric",
        "use_owm": false,
        "autocalcenabled": true,
        "autoupdateenabled": true,
        "autoupdateschedule": "minutes",
        "autoupdatedelay": "100",
        "autoupdateinterval": "10",
        "autoclearenabled": true,
        "cleardatatime": "23:59"
      },
      "zones": [
        {
          "id": 0,
          "name": "Giardino lungo",
          "size": 19.0,
          "throughput": 5.0,
          "state": "automatic",
          "bucket": 0,
          "old_bucket": 0,
          "delta": 0,
          "duration": 0,
          "module": 0,
          "multiplier": 1.0,
          "explanation": null,
          "mapping": 0,
          "lead_time": 0.0,
          "maximum_duration": 3600.0,
          "maximum_bucket": 50,
          "last_calculated": "2023-09-12T00:01:35.463991"
        },
        {
          "id": 1,
          "name": "Giardini piccoli",
          "size": 48.0,
          "throughput": 14.0,
          "state": "automatic",
          "bucket": 0,
          "old_bucket": 0,
          "delta": 0,
          "duration": 0,
          "module": 0,
          "multiplier": 1.0,
          "explanation": null,

          "lead_time": 0.0,
          "maximum_duration": 3600.0,
          "maximum_bucket": 50,
          "last_calculated": "2023-09-12T00:01:35.472494"
        }
      ],
      "modules": [
        {
          "id": 0,
          "name": "PyETO",
          "description": "Calculate duration based on the FAO56 calculation from the PyETO library.",
          "config": {
            "solrad_behavior": "3"
          },
          "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": "Ekowitt",
          "mappings": {
            "Dewpoint": {
              "source": "sensor",
              "sensorentity": "sensor.gw1100a_v2_2_3_dewpoint_1",
              "unit": ""
            },
            "Evapotranspiration": {
              "source": "none",
              "sensorentity": "",
              "unit": ""
            },
            "Humidity": {
              "source": "sensor",
              "sensorentity": "sensor.gw1100a_v2_2_3_umidita_giardino",
              "unit": ""
            },
            "Precipitation": {
              "source": "sensor",
              "sensorentity": "sensor.gw1100a_v2_2_3_event_rain_rate",
              "unit": ""
            },
            "Pressure": {
              "source": "sensor",
              "sensorentity": "sensor.gw1100a_v2_2_3_absolute_pressure",
              "unit": ""
            },
            "Solar Radiation": {
              "source": "sensor",
              "sensorentity": "sensor.gw1100a_v2_2_3_solar_radiation",
              "unit": "W/m2"
            },
            "Temperature": {
              "source": "sensor",
              "sensorentity": "sensor.gw1100a_v2_2_3_temperatura_giardino",
              "unit": ""
            },
            "Windspeed": {
              "source": "sensor",
              "sensorentity": "sensor.gw1100a_v2_2_3_wind_speed",
              "unit": "km/h"
            }
          },
          "data": [
            {
              "Dewpoint": 16.2,
              "Humidity": 77.0,
              "Precipitation": 0.0,
              "Pressure": 1000.2,
              "Solar Radiation": 0.0,
              "Temperature": 21.4,
              "Windspeed": 5.0,
              "retrieved": "2023-09-12T00:01:47.034484"
            },
            {
              "Dewpoint": 16.2,
              "Humidity": 77.0,
              "Precipitation": 0.0,
              "Pressure": 1000.2,
              "Solar Radiation": 0.0,
              "Temperature": 21.4,
              "Windspeed": 5.0,
              "retrieved": "2023-09-12T00:01:50.065857"
            },
            {
              "Dewpoint": 16.3,
              "Humidity": 78.0,
              "Precipitation": 0.0,
              "Pressure": 1000.0,
              "Solar Radiation": 0.0,
              "Temperature": 21.4,
              "Windspeed": 2.2,
              "retrieved": "2023-09-12T00:03:01.924249"
            },
            {
              "Dewpoint": 16.2,
              "Humidity": 77.0,
              "Precipitation": 0.0,
              "Pressure": 1000.3,
              "Solar Radiation": 0.0,
              "Temperature": 21.3,
              "Windspeed": 4.0,
              "retrieved": "2023-09-12T00:07:55.125800"
            }
          ],
          "data_last_updated": "2023-09-12T00:07:55.125821"
        }
      ]
    }
  }
}

Which version are you running?

B16

Diagnostics file

Additional information

No response

jeroenterheerdt commented 1 year ago

thanks, I see why this is happening. Will fix in next beta (beta 17). You are one of the few so far that doesn't not have OWM set up (the rest of us in the beta, or at least most of us in the beta are testing OWM and sensors side-by-side). Thanks for catching this!

jeroenterheerdt commented 1 year ago

beta17 was just released.

apocaliss92 commented 1 year ago

Works now! Thank you very much, glad to help with not own topics 😄