Closed he4th3n closed 1 year ago
Please notice sensors are also updated at reboot time + specified delay, as expected (in my case, 13:15 + 00:15 [900s] --> 13:30):
2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation] Initial update triggered - calling calculate hourly adjusted run time now. 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation] Calculate Hourly Adjusted Run Time service called, calculating now. 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation] Updating Smart Irrigation Data 2022-01-06 13:30:31 INFO (SyncWorker_3) [custom_components.smart_irrigation.sensor] _hourly_data_updated, calling update_state for type Hourly Adjusted Run Time 2022-01-06 13:30:31 INFO (SyncWorker_3) [custom_components.smart_irrigation.sensor] update_state for type: Hourly Adjusted Run Time 2022-01-06 13:30:31 INFO (SyncWorker_3) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_temperature, entity: sensor.temperatura_esterna_temperature, sensor_state: <state sensor.temperatura_esterna_temperature=11.3; state_class=measurement, battery=100, humidity=53.4, linkquality=34, pressure=1010.4, temperature=11.3, voltage=3005, unit_of_measurement=°C, device_class=temperature, friendly_name=Temperatura esterna temperature @ 2022-01-06T13:16:27.889955+01:00> 2022-01-06 13:30:31 INFO (SyncWorker_3) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_min_temperature, entity: sensor.temperatura_esterna_temperature_min, sensor_state: <state sensor.temperatura_esterna_temperature_min=8.1; sensor=sensor.temperatura_esterna_temperature, operation=min, interval=30, unit_of_measurement=°C, auto_reset=True, icon=mdi:timetable, friendly_name=Min temperature esterna @ 2022-01-06T13:15:32.343634+01:00> 2022-01-06 13:30:31 INFO (SyncWorker_3) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_max_temperature, entity: sensor.temperatura_esterna_temperature_max, sensor_state: <state sensor.temperatura_esterna_temperature_max=11.7; sensor=sensor.temperatura_esterna_temperature, operation=max, interval=30, unit_of_measurement=°C, auto_reset=True, icon=mdi:timetable, friendly_name=Max temperature esterna @ 2022-01-06T13:15:32.343448+01:00> 2022-01-06 13:30:31 INFO (SyncWorker_3) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_dewpoint, entity: sensor.temperatura_esterna_dewpoint, sensor_state: <state sensor.temperatura_esterna_dewpoint=2.2; unit_of_measurement=°C, icon=mdi:thermometer-lines, friendly_name=Temperatura esterna dewpoint @ 2022-01-06T13:16:27.909022+01:00> 2022-01-06 13:30:31 INFO (SyncWorker_3) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_pressure, entity: sensor.temperatura_esterna_pressure, sensor_state: <state sensor.temperatura_esterna_pressure=1010.4; state_class=measurement, battery=100, humidity=53.4, linkquality=34, pressure=1010.4, temperature=11.3, voltage=3005, unit_of_measurement=hPa, device_class=pressure, friendly_name=Temperatura esterna pressure @ 2022-01-06T13:16:27.890348+01:00> 2022-01-06 13:30:31 INFO (SyncWorker_3) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_humidity, entity: sensor.temperatura_esterna_humidity, sensor_state: <state sensor.temperatura_esterna_humidity=53.4; state_class=measurement, battery=100, humidity=53.4, linkquality=34, pressure=1010.4, temperature=11.3, voltage=3005, unit_of_measurement=%, device_class=humidity, friendly_name=Temperatura esterna humidity @ 2022-01-06T13:16:27.890140+01:00> 2022-01-06 13:30:31 INFO (SyncWorker_3) [custom_components.smart_irrigation.sensor] rain: 1.38, snow: 0 2022-01-06 13:30:31 INFO (SyncWorker_3) [custom_components.smart_irrigation.sensor] calculated evapotranspiration: 2.774343295786568 2022-01-06 13:30:31 INFO (SyncWorker_3) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0.09320476576113423 and adjusted_run_time: 131 for type: Hourly Adjusted Run Time. Bucket value was: -1.3943432957865682, and base schedule index is: 1402.5000000000002, force mode is: False, force mode duration is: 900, lead_time is: 0, maximum_duration: 3600, change percentage: 1.0, type: Hourly Adjusted Run Time 2022-01-06 13:30:31 INFO (SyncWorker_3) [custom_components.smart_irrigation.sensor] update_state: just updated hourly_precipitation_list: [1.38, 1.38, 1.38, 1.38] and hourly_evapotranspiration_list: [3.3176669294557812, 3.3176669294557812, 3.3176669294557812, 2.774343295786568] 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Hourly Adjusted Run Time 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_temperature, entity: sensor.temperatura_esterna_temperature, sensor_state: <state sensor.temperatura_esterna_temperature=11.3; state_class=measurement, battery=100, humidity=53.4, linkquality=34, pressure=1010.4, temperature=11.3, voltage=3005, unit_of_measurement=°C, device_class=temperature, friendly_name=Temperatura esterna temperature @ 2022-01-06T13:16:27.889955+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_min_temperature, entity: sensor.temperatura_esterna_temperature_min, sensor_state: <state sensor.temperatura_esterna_temperature_min=8.1; sensor=sensor.temperatura_esterna_temperature, operation=min, interval=30, unit_of_measurement=°C, auto_reset=True, icon=mdi:timetable, friendly_name=Min temperature esterna @ 2022-01-06T13:15:32.343634+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_max_temperature, entity: sensor.temperatura_esterna_temperature_max, sensor_state: <state sensor.temperatura_esterna_temperature_max=11.7; sensor=sensor.temperatura_esterna_temperature, operation=max, interval=30, unit_of_measurement=°C, auto_reset=True, icon=mdi:timetable, friendly_name=Max temperature esterna @ 2022-01-06T13:15:32.343448+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_dewpoint, entity: sensor.temperatura_esterna_dewpoint, sensor_state: <state sensor.temperatura_esterna_dewpoint=2.2; unit_of_measurement=°C, icon=mdi:thermometer-lines, friendly_name=Temperatura esterna dewpoint @ 2022-01-06T13:16:27.909022+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_pressure, entity: sensor.temperatura_esterna_pressure, sensor_state: <state sensor.temperatura_esterna_pressure=1010.4; state_class=measurement, battery=100, humidity=53.4, linkquality=34, pressure=1010.4, temperature=11.3, voltage=3005, unit_of_measurement=hPa, device_class=pressure, friendly_name=Temperatura esterna pressure @ 2022-01-06T13:16:27.890348+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_humidity, entity: sensor.temperatura_esterna_humidity, sensor_state: <state sensor.temperatura_esterna_humidity=53.4; state_class=measurement, battery=100, humidity=53.4, linkquality=34, pressure=1010.4, temperature=11.3, voltage=3005, unit_of_measurement=%, device_class=humidity, friendly_name=Temperatura esterna humidity @ 2022-01-06T13:16:27.890140+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] rain: 1.38, snow: 0 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculated evapotranspiration: 2.774343295786568 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0.09320476576113423 and adjusted_run_time: 131 for type: Hourly Adjusted Run Time. Bucket value was: -1.3943432957865682, and base schedule index is: 1402.5000000000002, force mode is: False, force mode duration is: 900, lead_time is: 0, maximum_duration: 3600, change percentage: 1.0, type: Hourly Adjusted Run Time 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state: just updated hourly_precipitation_list: [1.38, 1.38, 1.38, 1.38, 1.38] and hourly_evapotranspiration_list: [3.3176669294557812, 3.3176669294557812, 3.3176669294557812, 2.774343295786568, 2.774343295786568] 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Hourly Adjusted Run Time 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_temperature, entity: sensor.temperatura_esterna_temperature, sensor_state: <state sensor.temperatura_esterna_temperature=11.3; state_class=measurement, battery=100, humidity=53.4, linkquality=34, pressure=1010.4, temperature=11.3, voltage=3005, unit_of_measurement=°C, device_class=temperature, friendly_name=Temperatura esterna temperature @ 2022-01-06T13:16:27.889955+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_min_temperature, entity: sensor.temperatura_esterna_temperature_min, sensor_state: <state sensor.temperatura_esterna_temperature_min=8.1; sensor=sensor.temperatura_esterna_temperature, operation=min, interval=30, unit_of_measurement=°C, auto_reset=True, icon=mdi:timetable, friendly_name=Min temperature esterna @ 2022-01-06T13:15:32.343634+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_max_temperature, entity: sensor.temperatura_esterna_temperature_max, sensor_state: <state sensor.temperatura_esterna_temperature_max=11.7; sensor=sensor.temperatura_esterna_temperature, operation=max, interval=30, unit_of_measurement=°C, auto_reset=True, icon=mdi:timetable, friendly_name=Max temperature esterna @ 2022-01-06T13:15:32.343448+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_dewpoint, entity: sensor.temperatura_esterna_dewpoint, sensor_state: <state sensor.temperatura_esterna_dewpoint=2.2; unit_of_measurement=°C, icon=mdi:thermometer-lines, friendly_name=Temperatura esterna dewpoint @ 2022-01-06T13:16:27.909022+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_pressure, entity: sensor.temperatura_esterna_pressure, sensor_state: <state sensor.temperatura_esterna_pressure=1010.4; state_class=measurement, battery=100, humidity=53.4, linkquality=34, pressure=1010.4, temperature=11.3, voltage=3005, unit_of_measurement=hPa, device_class=pressure, friendly_name=Temperatura esterna pressure @ 2022-01-06T13:16:27.890348+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_humidity, entity: sensor.temperatura_esterna_humidity, sensor_state: <state sensor.temperatura_esterna_humidity=53.4; state_class=measurement, battery=100, humidity=53.4, linkquality=34, pressure=1010.4, temperature=11.3, voltage=3005, unit_of_measurement=%, device_class=humidity, friendly_name=Temperatura esterna humidity @ 2022-01-06T13:16:27.890140+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] rain: 1.38, snow: 0 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculated evapotranspiration: 2.774343295786568 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0.09320476576113423 and adjusted_run_time: 131 for type: Hourly Adjusted Run Time. Bucket value was: -1.3943432957865682, and base schedule index is: 1402.5000000000002, force mode is: False, force mode duration is: 900, lead_time is: 0, maximum_duration: 3600, change percentage: 1.0, type: Hourly Adjusted Run Time 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state: just updated hourly_precipitation_list: [1.38, 1.38, 1.38, 1.38, 1.38, 1.38] and hourly_evapotranspiration_list: [3.3176669294557812, 3.3176669294557812, 3.3176669294557812, 2.774343295786568, 2.774343295786568, 2.774343295786568] 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Hourly Adjusted Run Time 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_temperature, entity: sensor.temperatura_esterna_temperature, sensor_state: <state sensor.temperatura_esterna_temperature=11.3; state_class=measurement, battery=100, humidity=53.4, linkquality=34, pressure=1010.4, temperature=11.3, voltage=3005, unit_of_measurement=°C, device_class=temperature, friendly_name=Temperatura esterna temperature @ 2022-01-06T13:16:27.889955+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_min_temperature, entity: sensor.temperatura_esterna_temperature_min, sensor_state: <state sensor.temperatura_esterna_temperature_min=8.1; sensor=sensor.temperatura_esterna_temperature, operation=min, interval=30, unit_of_measurement=°C, auto_reset=True, icon=mdi:timetable, friendly_name=Min temperature esterna @ 2022-01-06T13:15:32.343634+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_max_temperature, entity: sensor.temperatura_esterna_temperature_max, sensor_state: <state sensor.temperatura_esterna_temperature_max=11.7; sensor=sensor.temperatura_esterna_temperature, operation=max, interval=30, unit_of_measurement=°C, auto_reset=True, icon=mdi:timetable, friendly_name=Max temperature esterna @ 2022-01-06T13:15:32.343448+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_dewpoint, entity: sensor.temperatura_esterna_dewpoint, sensor_state: <state sensor.temperatura_esterna_dewpoint=2.2; unit_of_measurement=°C, icon=mdi:thermometer-lines, friendly_name=Temperatura esterna dewpoint @ 2022-01-06T13:16:27.909022+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_pressure, entity: sensor.temperatura_esterna_pressure, sensor_state: <state sensor.temperatura_esterna_pressure=1010.4; state_class=measurement, battery=100, humidity=53.4, linkquality=34, pressure=1010.4, temperature=11.3, voltage=3005, unit_of_measurement=hPa, device_class=pressure, friendly_name=Temperatura esterna pressure @ 2022-01-06T13:16:27.890348+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state USING A SENSOR for instance Irrigazione, type: Hourly Adjusted Run Time, sensor: sensor_humidity, entity: sensor.temperatura_esterna_humidity, sensor_state: <state sensor.temperatura_esterna_humidity=53.4; state_class=measurement, battery=100, humidity=53.4, linkquality=34, pressure=1010.4, temperature=11.3, voltage=3005, unit_of_measurement=%, device_class=humidity, friendly_name=Temperatura esterna humidity @ 2022-01-06T13:16:27.890140+01:00> 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] rain: 1.38, snow: 0 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculated evapotranspiration: 2.774343295786568 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0.09320476576113423 and adjusted_run_time: 131 for type: Hourly Adjusted Run Time. Bucket value was: -1.3943432957865682, and base schedule index is: 1402.5000000000002, force mode is: False, force mode duration is: 900, lead_time is: 0, maximum_duration: 3600, change percentage: 1.0, type: Hourly Adjusted Run Time 2022-01-06 13:30:31 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state: just updated hourly_precipitation_list: [1.38, 1.38, 1.38, 1.38, 1.38, 1.38, 1.38] and hourly_evapotranspiration_list: [3.3176669294557812, 3.3176669294557812, 3.3176669294557812, 2.774343295786568, 2.774343295786568, 2.774343295786568, 2.774343295786568]
interesting, not sure how to solve this one as in the __init.py
file the initial update delay is handled correctly. Not sure why HA still decides to update the sensor.
Hallo, +1 here, I guess this might be my issue I was just describing in other thread here: https://github.com/jeroenterheerdt/HAsmartirrigation/issues/63#issuecomment-1127530788
is there plz some way to solve this?
(Or - is there maybe some work-around?) Thank you. Willy
@berkavil - please collect the debug logs and create a new issue. I am still not seeing this behavior on my end.
closing this issue because of staleness, please re-open an issue if this is still a problem in 2.0 version (now in beta)
Describe the bug During HomeAssistant startup, Smart Irrigation component updates the state of its hourly sensors right away, even if it's configured to wait for a time delay (in my case, 900s), and pushes their value in the list to be averaged at the end of day, thus skewing its values since the sensors readout are not yet ready/correct during HA startup.
To Reproduce Steps to reproduce the behavior:
Expected behavior Smart Irrigation should wait for the delay set in "Delay before first sensor update after reboot" before doing its first hourly values update after a HomeAssistant reboot.
Screenshots Log of Home Assistant core startup (was rebooted at 13:15):
Installed version SmartIrrigation v0.0.75 HomeAssistant core-2021.12.8