Closed gatonero closed 9 months ago
Push
the start
event only fires if daily_adjusted_run_time
is > 0. So: in your automation you don't need the condition, but it doesn't cause any issues. What's the value of your daily_adjusted_run_time
?
Last week the daily_adjusted_run_time
varied between 20s and 172s. with values for each day.
Thanks, that is interesting. Can you enable 'debug' logging for to see if there is anything in the logs?
I activated DEBUG some days ago and searched all logs for smart_irrigation and also for debug. I didn't find any errors nor warnings.
Today I saw some errors I didn't regognize before. We have had a lot of rain the last couple of days (weeks), so the irrigation didn't run and I didn't look for errors:
`2023-08-03 16:05:31.002 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0 and adjusted_run_time: 0 for type: Daily Adjusted Run Time. Bucket value was: 75.77, and base schedule index is: 542.5312499999999, 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 2023-08-03 16:05:31.002 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculating wb and art for daily adjusted run time, result: {'wb': 0, 'art': 0} 2023-08-03 16:05:31.003 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Daily Adjusted Run Time 2023-08-03 16:05:31.003 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0 and adjusted_run_time: 0 for type: Daily Adjusted Run Time. Bucket value was: 75.77, and base schedule index is: 542.5312499999999, 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 2023-08-03 16:05:31.003 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculating wb and art for daily adjusted run time, result: {'wb': 0, 'art': 0} 2023-08-03 16:05:31.011 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform smart_irrigation Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 750, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 808, in _async_write_ha_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 752, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/config/custom_components/smart_irrigation/sensor.py", line 557, in state self._state = self.update_state() ^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smart_irrigation/sensor.py", line 516, in update_state self.evapotranspiration = self.get_evapotranspiration(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smart_irrigation/sensor.py", line 689, in get_evapotranspiration t_day = data["temp"]["day"]
KeyError: 'day'
2023-08-03 16:05:31.078 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform smart_irrigation
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 750, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 808, in _async_write_ha_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 752, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 557, in state
self._state = self.update_state()
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 516, in update_state
self.evapotranspiration = self.get_evapotranspiration(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 689, in get_evapotranspiration
t_day = data["temp"]["day"]
~~~~~~~~~~~~^^^^^^^
KeyError: 'day'
2023-08-03 16:05:31.097 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up smart_irrigation platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 370, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 750, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 808, in _async_write_ha_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 752, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 557, in state
self._state = self.update_state()
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 516, in update_state
self.evapotranspiration = self.get_evapotranspiration(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 689, in get_evapotranspiration
t_day = data["temp"]["day"]
~~~~~~~~~~~~^^^^^^^
KeyError: 'day'
2023-08-03 16:05:31.128 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up smart_irrigation platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 370, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 750, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 808, in _async_write_ha_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 752, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 557, in state
self._state = self.update_state()
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 516, in update_state
self.evapotranspiration = self.get_evapotranspiration(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 689, in get_evapotranspiration
t_day = data["temp"]["day"]
~~~~~~~~~~~~^^^^^^^
KeyError: 'day'`
so it's not getting the 'day' weather info. What is your config? OWM? Sensors? Mix? If OWM, what version of OWM api?
Thank You! I think I got the point! :-) Before I ran in mixed mode with temperature_max/max from OpenWeather v2. I think there I didn't get values for min/max.
Now I set up HADailySensor and use these values in the automations. Now I'm in full sensor mode. :-)
It's raining since weeks and the forecast is also ongoing rain. From one point of view this is OK, but for testing purposes ... I will give You feedback as soon I notice something again.
I still get following errors when booting HA sometimes, but not on every boot.
Logger: homeassistant.components.sensor
Source: custom_components/smart_irrigation/sensor.py:689
Integration: Sensor (documentation, issues)
First occurred: 19:43:04 (6 occurrences)
Last logged: 19:43:05
Error adding entities for domain sensor with platform smart_irrigation
Error while setting up smart_irrigation platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 750, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 808, in _async_write_ha_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 752, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 557, in state
self._state = self.update_state()
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 516, in update_state
self.evapotranspiration = self.get_evapotranspiration(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 689, in get_evapotranspiration
t_day = data["temp"]["day"]
~~~~~~~~~~~~^^^^^^^
KeyError: 'day'
yeah, this is a known issue if your sensors have not updated yet. You can use the initial update delay option to delay the first update.
Thanks! I have had this value set to 300 seconds. Now I will set it to 600.
Now with the update delay to 600 I get an error 70 seconds after a restart.
Logger: homeassistant.components.sensor
Source: custom_components/smart_irrigation/sensor.py:689
Integration: Sensor (documentation, issues)
First occurred: 10:53:47 (6 occurrences)
Last logged: 10:53:47
Error adding entities for domain sensor with platform smart_irrigation
Error while setting up smart_irrigation platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 750, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 808, in _async_write_ha_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 752, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 557, in state
self._state = self.update_state()
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 516, in update_state
self.evapotranspiration = self.get_evapotranspiration(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 689, in get_evapotranspiration
t_day = data["temp"]["day"]
~~~~~~~~~~~~^^^^^^^
KeyError: 'day'
version 2.0 is now in beta, please install it and confirm this issue is resolved there.
Never before I installed a beta version, so I hope I have done it right. I activated "Show beta versions" and choosed "master". Version downloaded shows "9035648"
I still have an error in the logs.
Logger: homeassistant.components.sensor
Source: custom_components/smart_irrigation/sensor.py:689
Integration: Sensor (documentation, issues)
First occurred: 16:45:47 (6 occurrences)
Last logged: 16:45:47
Error adding entities for domain sensor with platform smart_irrigation
Error while setting up smart_irrigation platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 750, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 808, in _async_write_ha_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 752, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 557, in state
self._state = self.update_state()
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 516, in update_state
self.evapotranspiration = self.get_evapotranspiration(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/sensor.py", line 689, in get_evapotranspiration
t_day = data["temp"]["day"]
~~~~~~~~~~~~^^^^^^^
KeyError: 'day'
sorry for not being clear, this is how you install a beta, assuming you have HACS installed on your HA:
I'm now on v2023.8.0-beta11. All my integrations failed to set up.
Logger: homeassistant.config_entries
Source: components/frontend/__init__.py:289
First occurred: 13:31:35 (2 occurrences)
Last logged: 14:07:01
Error setting up entry Smart Irrigation Balkon for smart_irrigation
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/__init__.py", line 96, in async_setup_entry
await async_register_panel(hass)
File "/config/custom_components/smart_irrigation/panel.py", line 29, in async_register_panel
await panel_custom.async_register_panel(
File "/usr/src/homeassistant/homeassistant/components/panel_custom/__init__.py", line 124, in async_register_panel
frontend.async_register_built_in_panel(
File "/usr/src/homeassistant/homeassistant/components/frontend/__init__.py", line 289, in async_register_built_in_panel
raise ValueError(f"Overwriting panel {panel.frontend_url_path}")
ValueError: Overwriting panel smart_irrigation
Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:613
Integration: Sensor (documentation, issues)
First occurred: 13:31:53 (72 occurrences)
Last logged: 14:07:28
Platform smart_irrigation does not generate unique IDs. ID sensor.default_zone_1 is already used by sensor.default_zone_1 - ignoring sensor.default_zone_1
Platform smart_irrigation does not generate unique IDs. ID sensor.default_zone_2 is already used by sensor.default_zone_2 - ignoring sensor.default_zone_2
Platform smart_irrigation does not generate unique IDs. ID sensor.default_zone_1_2 is already used by sensor.default_zone_1_2 - ignoring sensor.default_zone_1_2
Platform smart_irrigation does not generate unique IDs. ID sensor.default_zone_2_2 is already used by sensor.default_zone_2_2 - ignoring sensor.default_zone_2_2
Logger: homeassistant.config_entries
Source: components/http/__init__.py:426
First occurred: 13:31:35 (7 occurrences)
Last logged: 14:11:21
Error setting up entry Smart Irrigation Küche for smart_irrigation
Error setting up entry Smart Irrigation Balkon for smart_irrigation
Error setting up entry Smart Irrigation Terrasse for smart_irrigation
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smart_irrigation/__init__.py", line 96, in async_setup_entry
await async_register_panel(hass)
File "/config/custom_components/smart_irrigation/panel.py", line 27, in async_register_panel
hass.http.register_static_path(PANEL_URL, view_url, cache_headers=False)
File "/usr/src/homeassistant/homeassistant/components/http/__init__.py", line 426, in register_static_path
self.app.router.add_route("GET", url_path, serve_file)
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_urldispatcher.py", line 1101, in add_route
return resource.add_route(method, handler, expect_handler=expect_handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_urldispatcher.py", line 348, in add_route
raise RuntimeError(
RuntimeError: Added route will never be executed, method GET is already registered
Logger: homeassistant.config_entries
Source: helpers/entity_component.py:187
First occurred: 14:07:01 (6 occurrences)
Last logged: 14:11:21
Error setting up entry Smart Irrigation Balkon for sensor
Error setting up entry Smart Irrigation Terrasse for sensor
Error setting up entry Smart Irrigation Küche for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 132, in async_setup_entry
return await component.async_setup_entry(entry)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 187, in async_setup_entry
raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
Thansk for reporting this. You have the integration set up multiple times, where only one is allowed and required in the new version. Please read the wiki link that is in the beta description found in HACS or here https://github.com/jeroenterheerdt/HAsmartirrigation/wiki/v2.0-getting-started-info.
Also note that there is no upgrade so any info you have about size/throughput of your old config you should write down so you can enter that in the new version. So write it down, remove all versions, reboot HA, install new version
Please confirm and close this if it works fine with just one integration set up.
Now I have one device with two sensors (Default zone 1 and Default zone 2) .
The only thing I'm able to configure in the integration is the API Key for Open Weather Map. Even if I enter a valid API key I don't see more options to configure.
Also I found this error:
Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:613
Integration: Sensor (documentation, issues)
First occurred: 00:49:00 (2 occurrences)
Last logged: 00:49:00
Platform smart_irrigation does not generate unique IDs. ID sensor.default_zone_1 is already used by sensor.default_zone_1 - ignoring sensor.default_zone_1
Platform smart_irrigation does not generate unique IDs. ID sensor.default_zone_2 is already used by sensor.default_zone_2 - ignoring sensor.default_zone_2
I have overseen that the Re is an entry in the sidebar which gives all the wanted options. I will give it a try tomorrow.
ok, great - if you actually read the Wiki that I linked you to already (https://github.com/jeroenterheerdt/HAsmartirrigation/wiki/v2.0-getting-started-info) you would have known that that panel existed and that you would only be allowed to have one instance :)
Ok, it doesn't point to that entry in the sidebar. ;-) Now I have my one Instance. To get it working is very intuitive. Thanks for your effort and great work.
The only issue I see now is, that I can't add a zone beside one. All other zones I would like to add overwrite that one zone.
Should I close this issue and open another one?
Somehow I managed to add other zones. I'll close this issue. Thanks a lot!
Thanks, please let me know if you find anything else. Also, the wiki literally says that a panel gets added... 😂 But hey, you found it and that's all that matters!
In installed this Integration. All went fine also setting up the automation like in the example (see below). I expected that the event smart_irrigation_start would have been fired this morning at sunrise. But nothing happened. Did I misunderstood something?
This are my settings for BSI
Number of sprinklers 8 Flow 0.2 l Throughput 1.6 l/min Reference evapotranspiration [1.66, 2.0, 3.76, 4.99, 6.43, 6.37, 6.41, 5.35, 3.72, 2.55, 1.56, 1.15] mm Peak evapotranspiration 6.43 mm Area 4.5 m2 Precipitation rate 21.33 mm/hr Base schedule index minutes 18.08 min Auto refresh true Auto refresh time 23:00 Initial update delay 300 s Coastal false Estimate solrad from temp true