jeroenterheerdt / HAsmartirrigation

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

OWM connection fails with OWM 3.0, new key not saved #393

Closed ScratMan closed 5 months ago

ScratMan commented 5 months ago

What happened?

Hello, I updated my Home Assistant to 2024.6.0, and subscribed to the new OWM plan with 1000 calls per day, and generated a new token. I updated the OWM integration in HA to use API 3.0 and it's working fine. I also tried to call the API 3.0 directly with my web browser and the generated token, and it's working fine.

But after upgrading the integration Smart irrigation integration to 2024.6.1 and update it's token to the 3.0, it says it can't talk to the API.

When I return to the SI configuration wizard, the old API key is back in the field, it looks like the new API key is not saved !

How to reproduce

Go to integration settings, click configure, enter new API key, optionally reboot HA, go to settings again and see the old key is back.

Relevant log output

Cette erreur provient d'une intégration personnalisée

Enregistreur: homeassistant
Source: custom_components/smart_irrigation/OWMClient.py:232
intégration: Smart Irrigation (documentation, problèmes)
S'est produit pour la première fois: 19:57:39 (1 occurrences)
Dernier enregistrement: 19:57:39

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/config/custom_components/smart_irrigation/__init__.py", line 439, in _async_update_all
    weatherdata = await self.hass.async_add_executor_job(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smart_irrigation/OWMClient.py", line 313, in get_data
    raise ex
  File "/config/custom_components/smart_irrigation/OWMClient.py", line 232, in get_data
    raise IOError("Cannot talk to OWM API, check API key.")
OSError: Cannot talk to OWM API, check API key.


### Which version are you running?

2024.6.1

### Diagnostics file

- [X] I have attached a diagnostics file

### Additional information

I can't attach the diagnostic file, the download command does nothing.
jeroenterheerdt commented 5 months ago

thanks, this should be fixed in the next beta.

ScratMan commented 5 months ago

Thanks, but I updated to 2024.6.4 beta, and the error message still appears in the logs while the new API key is correctly stored.

jeroenterheerdt commented 5 months ago

did you reconfigure and were the values stored?

ScratMan commented 5 months ago

Yes, I reconfigured the integration with the new key.

jeroenterheerdt commented 5 months ago

so when you clicked 'configure' what do you see? can you show the current config from storage / diag file and then screenshots of the UI? I am not seeing the issue I think you're seeing.

ScratMan commented 5 months ago

Sure, here are the screenshots. The diagnostic file download doesn't work.

Screenshot_20240610-214210 Screenshot_20240610-214218~2 Screenshot_20240610-214224

jeroenterheerdt commented 5 months ago

ok, so the UI looks correct. What is in the storage (.storage\smart_irrigation.storage) file?

ScratMan commented 5 months ago
{
  "version": 3,
  "minor_version": 1,
  "key": "smart_irrigation.storage",
  "data": {
    "config": {
      "calctime": "19:50",
      "units": "metric",
      "use_owm": true,
      "autocalcenabled": true,
      "autoupdateenabled": true,
      "autoupdateschedule": "hours",
      "autoupdatedelay": "0",
      "autoupdateinterval": "1",
      "autoclearenabled": true,
      "cleardatatime": "20:00",
      "starteventfiredtoday": false
    },
    "zones": [
      {
        "id": 0,
        "name": "Carré Potager",
        "size": 3.8,
        "throughput": 1.008,
        "state": "automatic",
        "bucket": 45.09459843179576,
        "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": "2024-06-05T19:50:01.713424",
        "last_updated": "2024-06-06T09:43:04.885085",
        "number_of_data_points": 14
      }
    ],
    "modules": [
      {
        "id": 0,
        "name": "PyETO",
        "description": "Le calcul de durée est basée sur le calcul FAO56 de la bibliothèque PyETO.",
        "config": {
          "forecast_days": "1"
        },
        "schema": [
          {
            "type": "boolean",
            "name": "coastal",
            "optional": true,
            "default": false
          },
          {
            "type": "select",
            "options": [
              [
                "1",
                "EstimateFromTemp"
              ],
              [
                "2",
                "EstimateFromSunHours"
              ],
              [
                "3",
                "DontEstimate"
              ],
              [
                "4",
                "EstimateFromSunHoursAndTemperature"
              ]
            ],
            "name": "solrad_behavior",
            "required": true,
            "default": "1"
          },
          {
            "type": "integer",
            "name": "forecast_days",
            "required": true,
            "default": 0
          }
        ]
      }
    ],
    "mappings": [
      {
        "id": 0,
        "name": "Groupe de capteurs par défaut",
        "mappings": {
          "Dewpoint": {
            "source": "owm",
            "sensorentity": "",
            "unit": ""
          },
          "Evapotranspiration": {
            "source": "none",
            "sensorentity": "",
            "unit": ""
          },
          "Humidity": {
            "source": "owm",
            "sensorentity": "",
            "unit": ""
          },
          "Precipitation": {
            "source": "sensor",
            "sensorentity": "sensor.popp_rain_sensor_cumul_mm",
            "unit": ""
          },
          "Pressure": {
            "source": "owm",
            "sensorentity": "",
            "unit": ""
          },
          "Solar Radiation": {
            "source": "none",
            "sensorentity": "",
            "unit": ""
          },
          "Temperature": {
            "source": "sensor",
            "sensorentity": "sensor.fgbs222_smart_module_1_garage_temperature_2",
            "unit": ""
          },
          "Windspeed": {
            "source": "owm",
            "sensorentity": "",
            "unit": ""
          }
        },
        "data": [
          {
            "Temperature": "25.2",
            "retrieved": "2024-06-10T20:05:35.202204"
          },
          {
            "Temperature": "25.0",
            "retrieved": "2024-06-10T20:07:27.904400"
          },
          {
            "Temperature": "25.2",
            "retrieved": "2024-06-10T20:09:55.436485"
          },
          {
            "Temperature": "25.4",
            "retrieved": "2024-06-10T20:12:14.799180"
          },
          {
            "Temperature": "25.2",
            "retrieved": "2024-06-10T20:13:53.151285"
          },
          {
            "Temperature": "25.4",
            "retrieved": "2024-06-10T20:16:35.041415"
          },
          {
            "Temperature": "25.2",
            "retrieved": "2024-06-10T20:17:05.043922"
          },
          {
            "Temperature": "25.4",
            "retrieved": "2024-06-10T20:17:44.709680"
          },
          {
            "Temperature": "25.2",
            "retrieved": "2024-06-10T20:20:36.850210"
          },
          {
            "Temperature": "25.0",
            "retrieved": "2024-06-10T20:23:49.465880"
          },
          {
            "Temperature": "24.8",
            "retrieved": "2024-06-10T20:27:16.448207"
          },
          {
            "Temperature": "24.6",
            "retrieved": "2024-06-10T20:28:42.532055"
          },
          {
            "Temperature": "24.4",
            "retrieved": "2024-06-10T20:36:33.915205"
          },
          {
            "Temperature": "24.2",
            "retrieved": "2024-06-10T20:38:01.972116"
          },
          {
            "Temperature": "24.0",
            "retrieved": "2024-06-10T20:40:47.966911"
          },
          {
            "Temperature": "23.8",
            "retrieved": "2024-06-10T20:48:18.834034"
          },
          {
            "Temperature": "23.6",
            "retrieved": "2024-06-10T20:51:25.269846"
          },
          {
            "Temperature": "23.4",
            "retrieved": "2024-06-10T20:52:47.222137"
          },
          {
            "Temperature": "23.2",
            "retrieved": "2024-06-10T20:54:05.086867"
          },
          {
            "Temperature": "23.0",
            "retrieved": "2024-06-10T21:07:11.996984"
          },
          {
            "Temperature": "22.8",
            "retrieved": "2024-06-10T21:10:30.783936"
          },
          {
            "Temperature": "22.6",
            "retrieved": "2024-06-10T21:13:45.445235"
          },
          {
            "Temperature": "22.4",
            "retrieved": "2024-06-10T21:18:03.668121"
          },
          {
            "Temperature": "22.2",
            "retrieved": "2024-06-10T21:30:27.562649"
          },
          {
            "Temperature": "22.0",
            "retrieved": "2024-06-10T21:35:39.008226"
          },
          {
            "Temperature": "21.8",
            "retrieved": "2024-06-10T21:44:31.814348"
          },
          {
            "Temperature": "21.6",
            "retrieved": "2024-06-10T21:56:51.582425"
          }
        ],
        "data_last_updated": null
      }
    ]
  }
}
jeroenterheerdt commented 5 months ago

thanks. the only weird thing I see here is the data_last_updated set to null. Why that's causing the issue here, I don't know. I will look into that. However, with your config om my system I was perfectly able to get the diagfile downloaded. I tried using Edge, Chrome and Firefox. It worked in all three. Here's the config_entry-smart_irrigation-7c28207e2ddcf407edd38a35c67ef629.json file for reference:

jeroenterheerdt commented 5 months ago

I am also not seeing the error you referred to originally. Can you test your API key outside of the integration, for example using Postman? You'd call this URL: https://api.openweathermap.org/data/3.0/onecall?units=metric&lat=[insert_your_latitude]&lon=[insert your longitude]&appid=[insert your api key]

ScratMan commented 5 months ago

Calling the API directly works fine.

{"lat":45.xxxx,"lon":5.xxxx,"timezone":"Europe/Paris","timezone_offset":7200,"current":{"dt":1718081036,"sunrise":1718077774,"sunset":1718133939,"temp":13.21,"feels_like":12.88,"pressure":1014,"humidity":88,"dew_point":11.27,"uvi":0.08,"clouds":75,"visibility":10000,"wind_speed":1.54,"wind_deg":0,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}]},"minutely":[{"dt":1718081040,"precipitation":0},{"dt":1718081100,"precipitation":0},{"dt":1718081160,"precipitation":0},{"dt":1718081220,"precipitation":0},{"dt":1718081280,"precipitation":0},{"dt":1718081340,"precipitation":0},{"dt":1718081400,"precipitation":0},{"dt":1718081460,"precipitation":0},{"dt":1718081520,"precipitation":0},{"dt":1718081580,"precipitation":0},{"dt":1718081640,"precipitation":0},{"dt":1718081700,"precipitation":0},{"dt":1718081760,"precipitation":0},{"dt":1718081820,"precipitation":0},{"dt":1718081880,"precipitation":0},{"dt":1718081940,"precipitation":0},{"dt":1718082000,"precipitation":0},{"dt":1718082060,"precipitation":0},{"dt":1718082120,"precipitation":0},{"dt":1718082180,"precipitation":0},{"dt":1718082240,"precipitation":0},{"dt":1718082300,"precipitation":0},{"dt":1718082360,"precipitation":0},{"dt":1718082420,"precipitation":0},{"dt":1718082480,"precipitation":0},{"dt":1718082540,"precipitation":0},{"dt":1718082600,"precipitation":0},{"dt":1718082660,"precipitation":0},{"dt":1718082720,"precipitation":0},{"dt":1718082780,"precipitation":0},{"dt":1718082840,"precipitation":0},{"dt":1718082900,"precipitation":0},{"dt":1718082960,"precipitation":0},{"dt":1718083020,"precipitation":0},{"dt":1718083080,"precipitation":0},{"dt":1718083140,"precipitation":0},{"dt":1718083200,"precipitation":0},{"dt":1718083260,"precipitation":0},{"dt":1718083320,"precipitation":0},{"dt":1718083380,"precipitation":0},{"dt":1718083440,"precipitation":0},{"dt":1718083500,"precipitation":0},{"dt":1718083560,"precipitation":0},{"dt":1718083620,"precipitation":0},{"dt":1718083680,"precipitation":0},{"dt":1718083740,"precipitation":0},{"dt":1718083800,"precipitation":0},{"dt":1718083860,"precipitation":0},{"dt":1718083920,"precipitation":0},{"dt":1718083980,"precipitation":0},{"dt":1718084040,"precipitation":0},{"dt":1718084100,"precipitation":0},{"dt":1718084160,"precipitation":0},{"dt":1718084220,"precipitation":0},{"dt":1718084280,"precipitation":0},{"dt":1718084340,"precipitation":0},{"dt":1718084400,"precipitation":0},{"dt":1718084460,"precipitation":0},{"dt":1718084520,"precipitation":0},{"dt":1718084580,"precipitation":0}],"hourly":[{"dt":1718078400,"temp":12.74,"feels_like":12.42,"pressure":1014,"humidity":90,"dew_point":11.14,"uvi":0,"clouds":68,"visibility":9410,"wind_speed":1.16,"wind_deg":325,"wind_gust":1.26,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"pop":0},{"dt":1718082000,"temp":13.21,"feels_like":12.88,"pressure":1014,"humidity":88,"dew_point":11.27,"uvi":0.08,"clouds":75,"visibility":10000,"wind_speed":1.4,"wind_deg":331,"wind_gust":2.88,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"pop":0},{"dt":1718085600,"temp":12.94,"feels_like":12.64,"pressure":1014,"humidity":90,"dew_point":11.34,"uvi":0.34,"clouds":72,"wind_speed":1.15,"wind_deg":330,"wind_gust":2.82,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"pop":0},{"dt":1718089200,"temp":12.81,"feels_like":12.52,"pressure":1014,"humidity":91,"dew_point":11.38,"uvi":0.86,"clouds":85,"visibility":2925,"wind_speed":1.42,"wind_deg":335,"wind_gust":2.79,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718092800,"temp":12.86,"feels_like":12.58,"pressure":1015,"humidity":91,"dew_point":11.43,"uvi":1.54,"clouds":89,"visibility":10000,"wind_speed":1.46,"wind_deg":341,"wind_gust":3.42,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718096400,"temp":13.47,"feels_like":13.09,"pressure":1015,"humidity":85,"dew_point":11,"uvi":1.97,"clouds":94,"visibility":10000,"wind_speed":1.64,"wind_deg":337,"wind_gust":2.64,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718100000,"temp":14.04,"feels_like":13.67,"pressure":1015,"humidity":83,"dew_point":9.63,"uvi":3.07,"clouds":99,"visibility":10000,"wind_speed":1.57,"wind_deg":336,"wind_gust":2.68,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718103600,"temp":15.27,"feels_like":14.94,"pressure":1015,"humidity":80,"dew_point":10.27,"uvi":3.65,"clouds":99,"visibility":10000,"wind_speed":1.16,"wind_deg":344,"wind_gust":2.48,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718107200,"temp":17.04,"feels_like":16.71,"pressure":1015,"humidity":73,"dew_point":10.57,"uvi":3.19,"clouds":98,"visibility":10000,"wind_speed":2.14,"wind_deg":348,"wind_gust":3.74,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718110800,"temp":17.53,"feels_like":17.19,"pressure":1014,"humidity":71,"dew_point":10.75,"uvi":4.72,"clouds":99,"visibility":10000,"wind_speed":3.2,"wind_deg":336,"wind_gust":4.62,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0.05},{"dt":1718114400,"temp":18.29,"feels_like":17.85,"pressure":1014,"humidity":64,"dew_point":9.98,"uvi":4.62,"clouds":99,"visibility":10000,"wind_speed":3.13,"wind_deg":344,"wind_gust":4.79,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718118000,"temp":18.63,"feels_like":18.17,"pressure":1013,"humidity":62,"dew_point":9.87,"uvi":2.33,"clouds":99,"visibility":10000,"wind_speed":3.2,"wind_deg":339,"wind_gust":4.8,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718121600,"temp":17.65,"feels_like":17.25,"pressure":1014,"humidity":68,"dew_point":10.29,"uvi":1.31,"clouds":99,"visibility":10000,"wind_speed":2.67,"wind_deg":326,"wind_gust":4.76,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718125200,"temp":16.92,"feels_like":16.47,"pressure":1014,"humidity":69,"dew_point":9.86,"uvi":0.58,"clouds":99,"visibility":10000,"wind_speed":2.69,"wind_deg":329,"wind_gust":4.92,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718128800,"temp":16.32,"feels_like":15.81,"pressure":1014,"humidity":69,"dew_point":9.16,"uvi":0.23,"clouds":98,"visibility":10000,"wind_speed":2.59,"wind_deg":333,"wind_gust":5.87,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718132400,"temp":13.54,"feels_like":13.01,"pressure":1015,"humidity":79,"dew_point":8.47,"uvi":0,"clouds":33,"visibility":10000,"wind_speed":1.16,"wind_deg":332,"wind_gust":1.7,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"pop":0},{"dt":1718136000,"temp":12.05,"feels_like":11.43,"pressure":1016,"humidity":81,"dew_point":7.44,"uvi":0,"clouds":31,"visibility":10000,"wind_speed":0.13,"wind_deg":212,"wind_gust":0.07,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"pop":0},{"dt":1718139600,"temp":11.2,"feels_like":10.6,"pressure":1016,"humidity":85,"dew_point":7.19,"uvi":0,"clouds":25,"visibility":10000,"wind_speed":0.28,"wind_deg":129,"wind_gust":0.29,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"pop":0},{"dt":1718143200,"temp":10.49,"feels_like":9.89,"pressure":1017,"humidity":88,"dew_point":7.09,"uvi":0,"clouds":23,"visibility":10000,"wind_speed":0.26,"wind_deg":148,"wind_gust":0.43,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"pop":0},{"dt":1718146800,"temp":9.76,"feels_like":9.76,"pressure":1017,"humidity":91,"dew_point":6.84,"uvi":0,"clouds":21,"visibility":10000,"wind_speed":0.26,"wind_deg":233,"wind_gust":0.17,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"pop":0},{"dt":1718150400,"temp":9.2,"feels_like":9.2,"pressure":1017,"humidity":92,"dew_point":6.44,"uvi":0,"clouds":20,"visibility":10000,"wind_speed":0.19,"wind_deg":171,"wind_gust":0.23,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"pop":0},{"dt":1718154000,"temp":8.78,"feels_like":8.78,"pressure":1017,"humidity":93,"dew_point":6.24,"uvi":0,"clouds":7,"visibility":10000,"wind_speed":0.25,"wind_deg":135,"wind_gust":0.4,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1718157600,"temp":8.43,"feels_like":8.43,"pressure":1017,"humidity":94,"dew_point":6.01,"uvi":0,"clouds":7,"visibility":10000,"wind_speed":0.22,"wind_deg":352,"wind_gust":0.56,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1718161200,"temp":8.03,"feels_like":8.03,"pressure":1017,"humidity":95,"dew_point":5.77,"uvi":0,"clouds":4,"visibility":10000,"wind_speed":0.56,"wind_deg":346,"wind_gust":0.72,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1718164800,"temp":7.54,"feels_like":7.54,"pressure":1018,"humidity":96,"dew_point":5.46,"uvi":0,"clouds":2,"visibility":10000,"wind_speed":0.83,"wind_deg":354,"wind_gust":0.62,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1718168400,"temp":8.76,"feels_like":8.76,"pressure":1018,"humidity":95,"dew_point":6.42,"uvi":0.22,"clouds":1,"visibility":10000,"wind_speed":0.73,"wind_deg":337,"wind_gust":0.8,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1718172000,"temp":10.85,"feels_like":10.26,"pressure":1018,"humidity":87,"dew_point":7.23,"uvi":0.75,"clouds":1,"visibility":10000,"wind_speed":1.2,"wind_deg":324,"wind_gust":1.21,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1718175600,"temp":12.77,"feels_like":12.11,"pressure":1018,"humidity":77,"dew_point":7.31,"uvi":1.77,"clouds":20,"visibility":10000,"wind_speed":1.78,"wind_deg":326,"wind_gust":2.4,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"pop":0},{"dt":1718179200,"temp":14.21,"feels_like":13.54,"pressure":1018,"humidity":71,"dew_point":7.61,"uvi":3.26,"clouds":14,"visibility":10000,"wind_speed":2.52,"wind_deg":334,"wind_gust":3.26,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"pop":0},{"dt":1718182800,"temp":15.45,"feels_like":14.83,"pressure":1018,"humidity":68,"dew_point":8.13,"uvi":5,"clouds":11,"visibility":10000,"wind_speed":2.84,"wind_deg":338,"wind_gust":3.65,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"pop":0},{"dt":1718186400,"temp":16.71,"feels_like":16.11,"pressure":1017,"humidity":64,"dew_point":8.53,"uvi":6.52,"clouds":15,"visibility":10000,"wind_speed":3.01,"wind_deg":340,"wind_gust":4.1,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"pop":0},{"dt":1718190000,"temp":17.68,"feels_like":17.07,"pressure":1017,"humidity":60,"dew_point":8.47,"uvi":7.45,"clouds":24,"visibility":10000,"wind_speed":3.11,"wind_deg":339,"wind_gust":4.27,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"pop":0},{"dt":1718193600,"temp":18.41,"feels_like":17.77,"pressure":1017,"humidity":56,"dew_point":8.3,"uvi":7.5,"clouds":34,"visibility":10000,"wind_speed":3.3,"wind_deg":334,"wind_gust":4.44,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"pop":0},{"dt":1718197200,"temp":18.61,"feels_like":18.01,"pressure":1016,"humidity":57,"dew_point":8.51,"uvi":5.79,"clouds":91,"visibility":10000,"wind_speed":3.74,"wind_deg":330,"wind_gust":4.54,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718200800,"temp":18.24,"feels_like":17.69,"pressure":1017,"humidity":60,"dew_point":9.02,"uvi":4.22,"clouds":95,"visibility":10000,"wind_speed":3.61,"wind_deg":334,"wind_gust":5.05,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718204400,"temp":18.26,"feels_like":17.73,"pressure":1017,"humidity":61,"dew_point":9.14,"uvi":2.68,"clouds":96,"visibility":10000,"wind_speed":3.67,"wind_deg":345,"wind_gust":5.72,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718208000,"temp":17.35,"feels_like":16.84,"pressure":1017,"humidity":65,"dew_point":9.4,"uvi":1.61,"clouds":95,"visibility":10000,"wind_speed":3.17,"wind_deg":359,"wind_gust":6.28,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718211600,"temp":16.74,"feels_like":16.25,"pressure":1017,"humidity":68,"dew_point":9.47,"uvi":0.85,"clouds":95,"visibility":10000,"wind_speed":3.17,"wind_deg":9,"wind_gust":6.5,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718215200,"temp":16.07,"feels_like":15.53,"pressure":1017,"humidity":69,"dew_point":8.87,"uvi":0.28,"clouds":93,"visibility":10000,"wind_speed":2.76,"wind_deg":2,"wind_gust":6.03,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"pop":0},{"dt":1718218800,"temp":13.69,"feels_like":13.15,"pressure":1018,"humidity":78,"dew_point":8.45,"uvi":0,"clouds":59,"visibility":10000,"wind_speed":1.21,"wind_deg":338,"wind_gust":0.8,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"pop":0},{"dt":1718222400,"temp":12.32,"feels_like":11.75,"pressure":1019,"humidity":82,"dew_point":7.83,"uvi":0,"clouds":50,"visibility":10000,"wind_speed":0.62,"wind_deg":354,"wind_gust":0.44,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"pop":0},{"dt":1718226000,"temp":13.21,"feels_like":12.6,"pressure":1019,"humidity":77,"dew_point":7.81,"uvi":0,"clouds":68,"visibility":10000,"wind_speed":0.99,"wind_deg":11,"wind_gust":0.98,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"pop":0},{"dt":1718229600,"temp":12.79,"feels_like":12.16,"pressure":1019,"humidity":78,"dew_point":7.55,"uvi":0,"clouds":78,"visibility":10000,"wind_speed":0.49,"wind_deg":278,"wind_gust":0.47,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"pop":0},{"dt":1718233200,"temp":10.34,"feels_like":9.78,"pressure":1019,"humidity":90,"dew_point":7.23,"uvi":0,"clouds":71,"visibility":10000,"wind_speed":0.67,"wind_deg":272,"wind_gust":0.59,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"pop":0},{"dt":1718236800,"temp":9.21,"feels_like":9.21,"pressure":1020,"humidity":93,"dew_point":6.64,"uvi":0,"clouds":60,"visibility":10000,"wind_speed":0.69,"wind_deg":229,"wind_gust":0.52,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"pop":0},{"dt":1718240400,"temp":8.56,"feels_like":8.56,"pressure":1020,"humidity":95,"dew_point":6.27,"uvi":0,"clouds":19,"visibility":10000,"wind_speed":0.55,"wind_deg":253,"wind_gust":0.42,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"pop":0},{"dt":1718244000,"temp":7.94,"feels_like":7.94,"pressure":1021,"humidity":97,"dew_point":5.96,"uvi":0,"clouds":14,"visibility":10000,"wind_speed":0.37,"wind_deg":239,"wind_gust":0.18,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"pop":0},{"dt":1718247600,"temp":7.63,"feels_like":7.63,"pressure":1021,"humidity":97,"dew_point":5.67,"uvi":0,"clouds":10,"visibility":10000,"wind_speed":0.34,"wind_deg":238,"wind_gust":0.07,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0}],"daily":[{"dt":1718103600,"sunrise":1718077774,"sunset":1718133939,"moonrise":1718094540,"moonset":1718060400,"moon_phase":0.16,"summary":"There will be clear sky until morning, then partly cloudy","temp":{"day":15.27,"min":11.2,"max":18.63,"night":11.2,"eve":16.92,"morn":13.21},"feels_like":{"day":14.94,"night":10.6,"eve":16.47,"morn":12.88},"pressure":1015,"humidity":80,"dew_point":10.27,"wind_speed":3.2,"wind_deg":336,"wind_gust":5.87,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":99,"pop":0.05,"uvi":4.72},{"dt":1718190000,"sunrise":1718164165,"sunset":1718220371,"moonrise":1718185020,"moonset":1718148180,"moon_phase":0.2,"summary":"Expect a day of partly cloudy with clear spells","temp":{"day":17.68,"min":7.54,"max":18.61,"night":13.21,"eve":16.74,"morn":8.76},"feels_like":{"day":17.07,"night":12.6,"eve":16.25,"morn":8.76},"pressure":1017,"humidity":60,"dew_point":8.47,"wind_speed":3.74,"wind_deg":330,"wind_gust":6.5,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"clouds":24,"pop":0,"uvi":7.5},{"dt":1718276400,"sunrise":1718250559,"sunset":1718306801,"moonrise":1718275320,"moonset":1718235660,"moon_phase":0.23,"summary":"Expect a day of partly cloudy with clear spells","temp":{"day":18.63,"min":7.39,"max":21.01,"night":13.33,"eve":20.32,"morn":8.85},"feels_like":{"day":18.06,"night":12.83,"eve":19.87,"morn":8.85},"pressure":1019,"humidity":58,"dew_point":8.99,"wind_speed":2.97,"wind_deg":340,"wind_gust":3.06,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":10,"pop":0,"uvi":7.44},{"dt":1718362800,"sunrise":1718336955,"sunset":1718393229,"moonrise":1718365560,"moonset":1718323020,"moon_phase":0.25,"summary":"There will be partly cloudy today","temp":{"day":17.56,"min":12.36,"max":18.72,"night":15.84,"eve":18.72,"morn":13.58},"feels_like":{"day":17.28,"night":15.46,"eve":18.66,"morn":12.74},"pressure":1018,"humidity":73,"dew_point":11.15,"wind_speed":2.24,"wind_deg":147,"wind_gust":2.13,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":100,"pop":0,"uvi":5.69},{"dt":1718449200,"sunrise":1718423353,"sunset":1718479655,"moonrise":1718455740,"moonset":1718410320,"moon_phase":0.29,"summary":"The day will start with partly cloudy through the late morning hours, transitioning to rain","temp":{"day":16.22,"min":14.33,"max":17.54,"night":14.33,"eve":17.54,"morn":15.5},"feels_like":{"day":16.48,"night":14.35,"eve":17.8,"morn":15.64},"pressure":1014,"humidity":99,"dew_point":14.59,"wind_speed":2.08,"wind_deg":171,"wind_gust":1.85,"weather":[{"id":501,"main":"Rain","description":"moderate rain","icon":"10d"}],"clouds":100,"pop":1,"rain":11.04,"uvi":1.82},{"dt":1718535600,"sunrise":1718509753,"sunset":1718566079,"moonrise":1718546040,"moonset":1718497680,"moon_phase":0.32,"summary":"Expect a day of partly cloudy with rain","temp":{"day":25.54,"min":13.28,"max":25.54,"night":17.28,"eve":23.08,"morn":15.64},"feels_like":{"day":25.56,"night":17.52,"eve":23.56,"morn":15.61},"pressure":1013,"humidity":54,"dew_point":14.12,"wind_speed":2.52,"wind_deg":288,"wind_gust":3.54,"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":47,"pop":0.85,"rain":1.11,"uvi":2},{"dt":1718622000,"sunrise":1718596155,"sunset":1718652501,"moonrise":1718636400,"moonset":1718585040,"moon_phase":0.35,"summary":"Expect a day of partly cloudy with rain","temp":{"day":26.1,"min":14.71,"max":27.68,"night":17.41,"eve":23.1,"morn":18.53},"feels_like":{"day":26.1,"night":17.53,"eve":23.35,"morn":18.61},"pressure":1014,"humidity":61,"dew_point":16.55,"wind_speed":2.87,"wind_deg":281,"wind_gust":5.3,"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":51,"pop":0.58,"rain":1.23,"uvi":2},{"dt":1718708400,"sunrise":1718682560,"sunset":1718738920,"moonrise":1718726940,"moonset":1718672640,"moon_phase":0.38,"summary":"Expect a day of partly cloudy with clear spells","temp":{"day":28.46,"min":15.62,"max":28.46,"night":19.33,"eve":25.45,"morn":19.14},"feels_like":{"day":29.42,"night":19.69,"eve":26.06,"morn":19.25},"pressure":1014,"humidity":54,"dew
jeroenterheerdt commented 5 months ago

Nto sure what is going on here. I changed the logic for the diag file rendering in hopes of finding something in there for your install. It all seems fine by me, except for that null for last updated. So maybe get rid of that part of the config (delete the zone, recreate it) and maybe it magically starts working again?

ScratMan commented 5 months ago

After updating to 2024.6.9, I tried to delete the zone and recreate it, same issue. So I decided to remove the zone, the pyETO module and the sensors group, then I rebooted HA. I then noticed this errors in log:

Cette erreur provient d'une intégration personnalisée

Enregistreur: py.warnings
Source: custom_components/smart_irrigation/store.py:342
intégration: Smart Irrigation (documentation, problèmes)
S'est produit pour la première fois: 07:11:02 (1 occurrences)
Dernier enregistrement: 07:11:02

/config/custom_components/smart_irrigation/store.py:342: RuntimeWarning: coroutine 'localize' was never awaited MODULE_DESCRIPTION: localize(

Enregistreur: homeassistant.config_entries
Source: config_entries.py:594
S'est produit pour la première fois: 07:11:02 (1 occurrences)
Dernier enregistrement: 07:11:02

Error setting up entry Smart Irrigation for smart_irrigation
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smart_irrigation/__init__.py", line 154, in async_setup_entry
    await store.set_up_factory_defaults()
  File "/config/custom_components/smart_irrigation/store.py", line 308, in set_up_factory_defaults
    await self.async_factory_default_modules()
  File "/config/custom_components/smart_irrigation/store.py", line 342, in async_factory_default_modules
    MODULE_DESCRIPTION: localize(
                        ^^^^^^^^^
TypeError: unsupported operand type(s) for +: 'coroutine' and 'str'

I'll remove the integration, clean it from storage and start from scratch.

ScratMan commented 5 months ago

I tried to reinstall 2024.6.1 and after adding the integration to HA, I get the following error in log:

Enregistreur: homeassistant.config_entries
Source: config_entries.py:594
S'est produit pour la première fois: 08:46:10 (1 occurrences)
Dernier enregistrement: 08:46:10

Error setting up entry Smart Irrigation for smart_irrigation
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smart_irrigation/__init__.py", line 139, in async_setup_entry
    await store.set_up_factory_defaults()
  File "/config/custom_components/smart_irrigation/store.py", line 308, in set_up_factory_defaults
    await self.async_factory_default_modules()
  File "/config/custom_components/smart_irrigation/store.py", line 332, in async_factory_default_modules
    inst = m(self.hass, {})
           ^^^^^^^^^^^^^^^^
TypeError: Static.__init__() missing 1 required positional argument: 'config'
ScratMan commented 5 months ago

I finally managed to fix the issue.

  1. Remove totally the integration and restart HA.
  2. Install 2024.4.3 in HACS, restart HA.
  3. Add integration in HA, configure the integration with the OWM 3.0 key. Create the zone, keep default sensors group (everything based on OWM). Restart HA.
  4. Update to 2024.6.9 and restart HA.
  5. Configure sensors group with my physical precipitation and temperature sensors. Restart HA.

Now I have no more errors from integration in logs, and I can update the zone and compute duration for irrigation. So I had to setup 2024.4.3 with OWM 3.0 first to be able to update. It seems there is an issue in the config flow on releases >2024.6.1 that fails when starting from scratch.

ScratMan commented 5 months ago

Regarding diagnostic file, it looks like the following error is generated when trying to download the file from HA Android companion app.

Enregistreur: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/connection.py:307
intégration: Home Assistant WebSocket API (documentation, problèmes)
S'est produit pour la première fois: 23:45:41 (2 occurrences)
Dernier enregistrement: 23:47:06

[547366698816] Error handling message: expected str for dictionary value @ data['path']. Got None (invalid_format) Adrien Bonnat from 192.168.1.103 (Mozilla/5.0 (Linux; Android 14; Pixel 6 Pro Build/AP1A.240505.004; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.165 Mobile Safari/537.36 Home Assistant/2024.6.1-12936 (Android 14; Pixel 6 Pro))
jeroenterheerdt commented 5 months ago

closing as likely fixed in https://github.com/jeroenterheerdt/HAsmartirrigation/releases/tag/v2024.6.11. Feel free re-open create a new issue if not fixed.