jeroenterheerdt / HAsmartirrigation

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

[Bug] Hourly sensors are updated right at HomeAssistant reboot, even if a delay is specified #86

Closed he4th3n closed 1 year ago

he4th3n commented 2 years ago

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:

  1. Set "Delay before first sensor update after reboot" to a non-zero value
  2. Reboot HomeAssistant core

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):

[...] 2022-01-06 13:15:32 INFO (MainThread) [custom_components.hacs] Enable category: integration 2022-01-06 13:15:32 INFO (MainThread) [custom_components.hacs] Enable category: plugin 2022-01-06 13:15:32 INFO (MainThread) [custom_components.hacs] Enable category: theme 2022-01-06 13:15:32 INFO (MainThread) [custom_components.hacs] Executing task: setup_websocket_api 2022-01-06 13:15:32 INFO (MainThread) [homeassistant.setup] Setup of domain input_text took 1.6 seconds 2022-01-06 13:15:32 INFO (MainThread) [homeassistant.setup] Setup of domain input_boolean took 1.6 seconds 2022-01-06 13:15:32 INFO (MainThread) [homeassistant.setup] Setup of domain input_select took 1.5 seconds 2022-01-06 13:15:32 INFO (MainThread) [homeassistant.setup] Setup of domain input_number took 1.5 seconds 2022-01-06 13:15:32 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.3 seconds 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation] registering: type: Base Schedule Index, entity: sensor.irrigazione_base_schedule_index 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_t_hass type: Base Schedule Index state: 1402.5, attributes: {'number_of_sprinklers': 5.0, 'flow': '6.4', 'throughput': '32.0', 'reference_evapotranspiration': '[2.87, 3.71, 5.75, 7.33, 10.52, 12.53, 14.96, 13.27, 8.52, 5.44, 3.3, 2.7]', 'peak_evapotranspiration': '14.96', 'area': '50.0', 'precipitation_rate': '38.4', 'base_schedule_index_minutes': 23.38, 'auto_refresh': True, 'auto_refresh_time': '23:55', 'initial_update_delay': 900, 'coastal': False, 'estimate_solrad_from_temp': True, 'unit_of_measurement': 's', 'icon': 'mdi:sprinkler', 'friendly_name': 'Base Schedule Index'} 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Base Schedule Index 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Base Schedule Index 2022-01-06 13:15:32 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.irrigazione_base_schedule_index (<class 'custom_components.smart_irrigation.sensor.SmartIrrigationSensor'>) implements device_state_attributes. Please report it to the custom component author. 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Base Schedule Index 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation] registering: type: Hourly Adjusted Run Time, entity: sensor.irrigazione_hourly_adjusted_run_time 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_t_hass type: Hourly Adjusted Run Time state: 69, attributes: {'rain': '1.0', 'snow': '0.0', 'precipitation': '1.0', 'evapotranspiration': '1.74', 'netto_precipitation': '-0.74', 'water_budget': 4.95, 'adjusted_run_time_minutes': 1.15, 'unit_of_measurement': 's', 'icon': 'mdi:sprinkler', 'friendly_name': 'Hourly Adjusted Run Time'} 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_t_hass type: Hourly Adjusted Run Time, attribute: evapotranspiration, attribute_value: 1.74, numeric_part: 1.74, show_units: False, a_val was str or contained ' ': False 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_t_hass type: Hourly Adjusted Run Time, attribute: netto_precipitation, attribute_value: -0.74, numeric_part: -0.74, show_units: False, a_val was str or contained ' ': False 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_to_hass restoring state, setting netto precipitation / bucket_delta to: -0.74 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_t_hass type: Hourly Adjusted Run Time, attribute: precipitation, attribute_value: 1.0, numeric_part: 1.0, show_units: False, a_val was str or contained ' ': False 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_t_hass type: Hourly Adjusted Run Time, attribute: rain, attribute_value: 1.0, numeric_part: 1.0, show_units: False, a_val was str or contained ' ': False 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_t_hass type: Hourly Adjusted Run Time, attribute: snow, attribute_value: 0.0, numeric_part: 0.0, show_units: False, a_val was str or contained ' ': False 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_t_hass type: Hourly Adjusted Run Time, attribute: water_budget, attribute_value: 4.95, numeric_part: 4.95, show_units: False, a_val was str or contained ' ': False 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_t_hass type: Hourly Adjusted Run Time, attribute: adjusted_run_time_minutes, attribute_value: 1.15, numeric_part: 1.15, show_units: False, a_val was str or contained ' ': False 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Hourly Adjusted Run Time 2022-01-06 13:15:32 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: None 2022-01-06 13:15:32 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:15:32 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=unknown; unit_of_measurement=°C, icon=mdi:thermometer-lines, friendly_name=Temperatura esterna dewpoint @ 2022-01-06T13:15:32.018435+01:00> 2022-01-06 13:15:32 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: None 2022-01-06 13:15:32 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: None 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] rain: 1.38, snow: 0 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculated evapotranspiration: 3.3176669294557812 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0.12952319047164312 and adjusted_run_time: 182 for type: Hourly Adjusted Run Time. Bucket value was: -1.9376669294557813, 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:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state: just updated hourly_precipitation_list: [1.38] and hourly_evapotranspiration_list: [3.3176669294557812] 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Hourly Adjusted Run Time 2022-01-06 13:15:32 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: None 2022-01-06 13:15:32 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:15:32 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:15:32 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=unknown; unit_of_measurement=°C, icon=mdi:thermometer-lines, friendly_name=Temperatura esterna dewpoint @ 2022-01-06T13:15:32.018435+01:00> 2022-01-06 13:15:32 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: None 2022-01-06 13:15:32 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: None 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] rain: 1.38, snow: 0 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculated evapotranspiration: 3.3176669294557812 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0.12952319047164312 and adjusted_run_time: 182 for type: Hourly Adjusted Run Time. Bucket value was: -1.9376669294557813, 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:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state: just updated hourly_precipitation_list: [1.38, 1.38] and hourly_evapotranspiration_list: [3.3176669294557812, 3.3176669294557812] 2022-01-06 13:15:32 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.irrigazione_hourly_adjusted_run_time (<class 'custom_components.smart_irrigation.sensor.SmartIrrigationSensor'>) implements device_state_attributes. Please report it to the custom component author. 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Hourly Adjusted Run Time 2022-01-06 13:15:32 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: None 2022-01-06 13:15:32 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:15:32 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:15:32 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=unknown; unit_of_measurement=°C, icon=mdi:thermometer-lines, friendly_name=Temperatura esterna dewpoint @ 2022-01-06T13:15:32.018435+01:00> 2022-01-06 13:15:32 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: None 2022-01-06 13:15:32 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: None 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] rain: 1.38, snow: 0 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculated evapotranspiration: 3.3176669294557812 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0.12952319047164312 and adjusted_run_time: 182 for type: Hourly Adjusted Run Time. Bucket value was: -1.9376669294557813, 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:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state: just updated hourly_precipitation_list: [1.38, 1.38, 1.38] and hourly_evapotranspiration_list: [3.3176669294557812, 3.3176669294557812, 3.3176669294557812] 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation] registering: type: Daily Adjusted Run Time, entity: sensor.irrigazione_daily_adjusted_run_time 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_t_hass type: Daily Adjusted Run Time state: 0, attributes: {'water_budget': 0.0, 'bucket': '4.32', 'lead_time': 0, 'maximum_duration': 3600, 'adjusted_run_time_minutes': 0.0, 'force_mode_duration': 900, 'force_mode_enabled': False, 'unit_of_measurement': 's', 'icon': 'mdi:sprinkler', 'friendly_name': 'Daily Adjusted Run Time'} 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_t_hass type: Daily Adjusted Run Time, attribute: water_budget, attribute_value: 0.0, numeric_part: 0.0, show_units: False, a_val was str or contained ' ': False 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_t_hass type: Daily Adjusted Run Time, attribute: bucket, attribute_value: 4.32, numeric_part: 4.32, show_units: False, a_val was str or contained ' ': False 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_to_hass restoring state, settting bucket to: 4.32 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] async_added_t_hass type: Daily Adjusted Run Time, attribute: adjusted_run_time_minutes, attribute_value: 0.0, numeric_part: 0.0, show_units: False, a_val was str or contained ' ': False 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Daily Adjusted Run Time 2022-01-06 13:15:32 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: 4.32, 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: Daily Adjusted Run Time 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculating wb and art for daily adjusted run time, result: {'wb': 0, 'art': 0} 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Daily Adjusted Run Time 2022-01-06 13:15:32 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: 4.32, 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: Daily Adjusted Run Time 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculating wb and art for daily adjusted run time, result: {'wb': 0, 'art': 0} 2022-01-06 13:15:32 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.irrigazione_daily_adjusted_run_time (<class 'custom_components.smart_irrigation.sensor.SmartIrrigationSensor'>) implements device_state_attributes. Please report it to the custom component author. 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Daily Adjusted Run Time 2022-01-06 13:15:32 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: 4.32, 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: Daily Adjusted Run Time 2022-01-06 13:15:32 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculating wb and art for daily adjusted run time, result: {'wb': 0, 'art': 0} 2022-01-06 13:15:32 INFO (MainThread) [homeassistant.setup] Setup of domain automation took 0.1 seconds 2022-01-06 13:15:32 INFO (MainThread) [homeassistant.components.light] Setting up light.mqtt 2022-01-06 13:15:32 INFO (MainThread) [custom_components.hacs] Restore started 2022-01-06 13:15:32 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.mqtt 2022-01-06 13:15:32 WARNING (MainThread) [homeassistant.components.mqtt.light.schema_basic] The 'value_template' option is deprecated, please replace it with 'state_value_template' 2022-01-06 13:15:32 INFO (MainThread) [homeassistant.setup] Setting up tasmota 2022-01-06 13:15:32 INFO (MainThread) [homeassistant.setup] Setup of domain tasmota took 0.0 seconds 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.weather] Setting up weather.met 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.tasmota 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.light] Setting up light.tasmota 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.tasmota 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.switch] Setting up switch.tasmota 2022-01-06 13:15:33 INFO (SyncWorker_3) [homeassistant.loader] Loaded fan from homeassistant.components.fan 2022-01-06 13:15:33 INFO (SyncWorker_6) [homeassistant.loader] Loaded cover from homeassistant.components.cover 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.setup] Setting up fan 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.setup] Setup of domain fan took 0.0 seconds 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.setup] Setting up cover 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.setup] Setup of domain cover took 0.0 seconds 2022-01-06 13:15:33 INFO (MainThread) [custom_components.hacs] Restore done 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.fan] Setting up fan.tasmota 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.cover] Setting up cover.tasmota 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.mqtt 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.setup] Setting up script 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.setup] Setup of domain script took 0.0 seconds 2022-01-06 13:15:33 INFO (MainThread) [custom_components.hacs] Stage changed: HacsStage.STARTUP 2022-01-06 13:15:33 INFO (MainThread) [custom_components.hacs] Executing task: load_hacs_repository 2022-01-06 13:15:33 INFO (MainThread) [custom_components.hacs] Stage changed: HacsStage.WAITING 2022-01-06 13:15:33 INFO (MainThread) [custom_components.hacs] Setup complete, waiting for Home Assistant before startup tasks starts 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.hacs 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.shelly 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.cover] Setting up cover.shelly 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.light] Setting up light.shelly 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.shelly 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.switch] Setting up switch.shelly 2022-01-06 13:15:33 INFO (SyncWorker_2) [homeassistant.loader] Loaded button from homeassistant.components.button 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.setup] Setting up button 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.setup] Setup of domain button took 0.0 seconds 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.button] Setting up button.shelly 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.tuya 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.button] Setting up button.tuya 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.camera] Setting up camera.tuya 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.cover] Setting up cover.tuya 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.fan] Setting up fan.tuya 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.light] Setting up light.tuya 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.scene] Setting up scene.tuya 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.tuya 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.switch] Setting up switch.tuya 2022-01-06 13:15:33 INFO (MainThread) [homeassistant.components.vacuum] Setting up vacuum.tuya 2022-01-06 13:15:33 INFO (SyncWorker_3) [homeassistant.loader] Loaded climate from homeassistant.components.climate 2022-01-06 13:15:33 INFO (SyncWorker_3) [homeassistant.loader] Loaded number from homeassistant.components.number 2022-01-06 13:15:33 INFO (SyncWorker_2) [homeassistant.loader] Loaded select from homeassistant.components.select [...]

Installed version SmartIrrigation v0.0.75 HomeAssistant core-2021.12.8

he4th3n commented 2 years 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]

jeroenterheerdt commented 2 years ago

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.

berkavil commented 2 years ago

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

jeroenterheerdt commented 2 years ago

@berkavil - please collect the debug logs and create a new issue. I am still not seeing this behavior on my end.

jeroenterheerdt commented 1 year ago

closing this issue because of staleness, please re-open an issue if this is still a problem in 2.0 version (now in beta)