### Clone and set up the repository with make setup Source: https://github.com/altmenorg/hasmartirrigation/blob/master/README.md Clones the HAsmartirrigation repository and creates the virtual environment plus dev dependencies via `make setup`. Run these commands in order from a fresh checkout. ```bash git clone https://github.com/altmenorg/HAsmartirrigation.git cd HAsmartirrigation make setup # create the venv and install dev dependencies ``` -------------------------------- ### Install test requirements and run pytest suite Source: https://github.com/altmenorg/hasmartirrigation/blob/master/README.md Install the test requirements, then run the suite. The project has two test directories: tests/ for integration and component behavior tests, and custom_components/smart_irrigation/tests/ for component unit tests. Tests use pytest-asyncio, so async test functions must be marked accordingly. ```bash pip install -r requirements.test.txt pytest # everything pytest tests/ # integration / behavior tests pytest custom_components/smart_irrigation/tests/ # component unit tests pytest tests/test_services.py # a single file ``` -------------------------------- ### YAML card configuration Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-card.md Example YAML configuration for the Smart Irrigation card. Shows the card type and optional settings like title, zones, and compact mode. ```yaml type: custom:smart-irrigation-card title: Garden zones: [0, 2] compact: true ``` -------------------------------- ### Example diagnostics file for Smart Irrigation V1 Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/installation-migration.md Shows the structure of a diagnostics file downloaded from Home Assistant for a Smart Irrigation V1 instance. It includes configuration data such as number of sprinklers, flow, area, API key, and version. Use this file as a reference when setting up V2 zones. ```json { "home_assistant": { "installation_type": "...", ... }, "custom_components": { ... "smart_irrigation": { "version": "0.0.8X", "requirements": [] }, ... }, "integration_manifest": { "domain": "smart_irrigation", "name": "Smart Irrigation", "codeowners": [ "@jeroenterheerdt" ], "config_flow": true, "dependencies": [], "documentation": "https://github.com/jeroenterheerdt/HASmartIrrigation", "homekit": {}, "integration_type": "service", "iot_class": "cloud_polling", "issue_tracker": "https://github.com/jeroenterheerdt/HASmartIrrigation/issues", "requirements": [], "ssdp": [], "version": "0.0.8X", "zeroconf": [], "is_built_in": false }, "data": { "config": { "entry_id": "0f60ec5036558de65a1659a17522ac36", "version": 1, "domain": "smart_irrigation", "title": "Smart Irrigation", "data": { "number_of_sprinklers": 4.0, "flow": 5.0, "area": 100.0, "api_key": "[Your API key]", "api_version": "[You API version: 2.5 or 3.0]", "reference_evapotranspiration": [ ... ], "name": "Smart Irrigation", "sources": { ... }, "sensors": { ... } }, "options": {}, "pref_disable_new_entities": false, "pref_disable_polling": false, "source": "user", "unique_id": "Smart Irrigation", "disabled_by": null } } } ``` -------------------------------- ### Create Seasonal Adjustment - smart_irrigation.create_seasonal_adjustment Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-enhanced-scheduling-integration.md YAML service call to create a seasonal adjustment. The example creates a 'Summer Boost' adjustment for June through August with a multiplier of 1.5 and a threshold adjustment of -5.0 for all zones. ```yaml service: smart_irrigation.create_seasonal_adjustment data: name: "Summer Boost" month_start: 6 # June month_end: 8 # August multiplier_adjustment: 1.5 threshold_adjustment: -5.0 zones: "all" enabled: true ``` -------------------------------- ### Trigger filter on trigger_name for start event Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-events.md Listens for the smart_irrigation_start_irrigation_all_zones event and filters on the trigger_name 'Morning' to react only to that specific trigger. Use this to differentiate actions per trigger. ```yaml trigger: - platform: event event_type: smart_irrigation_start_irrigation_all_zones event_data: trigger_name: "Morning" ``` -------------------------------- ### Install specific version via update.install service Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/installation-updating.md YAML service call to install a specific version (e.g., v2026.10.2) of the Smart Irrigation update entity. Used when HACS version dropdown is not available. ```yaml action: update.install target: entity_id: update.smart_irrigation_update data: version: v2026.10.2 ``` -------------------------------- ### Alternative weekday condition for Example 3 Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-automations.md Alternative condition for the workday binary sensor in Example 3. Use this YAML condition to restrict the automation to specific weekdays (Monday and Thursday) instead of relying on the workday sensor. ```yaml condition: condition: time weekday: - mon - thu ``` -------------------------------- ### Create Recurring Schedule - smart_irrigation.create_recurring_schedule Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-enhanced-scheduling-integration.md YAML service call to create a recurring schedule. The example creates a daily schedule named 'Morning Calculation' that triggers the 'calculate' action for all zones at 06:00. ```yaml service: smart_irrigation.create_recurring_schedule data: name: "Morning Calculation" type: "daily" time: "06:00" action: "calculate" zones: "all" enabled: true ``` -------------------------------- ### Service call with dry_run: true Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md YAML example of a service call to smart_irrigation.calculate_zone with dry_run: true. The response is stored in the result variable, and the result.zones contains the calculated values without modifying any data. ```yaml action: smart_irrigation.calculate_zone target: entity_id: sensor.smart_irrigation_my_zone data: dry_run: true response_variable: result ``` -------------------------------- ### Smart Irrigation: create_recurring_schedule / update_recurring_schedule / delete_recurring_schedule Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Schedules of your own that calculate, update or start irrigation. See enhanced scheduling. ```APIDOC ## Smart Irrigation: create_recurring_schedule / update_recurring_schedule / delete_recurring_schedule ### Description Schedules of your own that calculate, update or start irrigation. See [enhanced scheduling](usage-enhanced-scheduling-integration.md). ### Services - `smart_irrigation.create_recurring_schedule` - `smart_irrigation.update_recurring_schedule` - `smart_irrigation.delete_recurring_schedule` ``` -------------------------------- ### Clone and set up the development environment Source: https://github.com/altmenorg/hasmartirrigation/blob/master/CONTRIBUTING.md Sets up a developer environment for the Smart Irrigation integration. Run these commands in sequence from a shell after cloning the repository. On Windows without `make`, use the alternative commands shown in the prose. ```bash git clone https://github.com/altmenorg/HAsmartirrigation cd HAsmartirrigation make setup # a virtual environment with the test requirements source .venv/bin/activate ``` -------------------------------- ### List available make commands Source: https://github.com/altmenorg/hasmartirrigation/blob/master/README.md Shows the project's make targets. `make help` lists all commands; `make test`, `make format`, `make lint`, and `make check` run the corresponding quality steps. ```bash make help # list all commands make test # run all tests make format # format code (black) make lint # run linting (ruff) make check # run all CI quality checks ``` -------------------------------- ### Build and test the frontend panel with npm and vitest Source: https://github.com/altmenorg/hasmartirrigation/blob/master/CONTRIBUTING.md Builds and tests the TypeScript/Lit frontend panel (requires Node 20). Run from the frontend directory; the `npm run build` output is committed with the change. A rebuild is only needed for changes to `frontend/src/`, not for translations. ```bash cd custom_components/smart_irrigation/frontend npm ci npm run build # the bundle in dist/ is committed with the change npx vitest run # the panel's tests ``` -------------------------------- ### Smart Irrigation: resume_irrigation Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Lifts a postponement now. ```APIDOC ## Smart Irrigation: resume_irrigation ### Description Lifts a postponement now. ### Service `smart_irrigation.resume_irrigation` ``` -------------------------------- ### Enable debug logging for smart_irrigation scheduler Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-enhanced-scheduling-integration.md Add this YAML configuration to your Home Assistant configuration.yaml to enable debug logging for the smart_irrigation scheduler component. Useful for troubleshooting scheduling issues. ```yaml logger: logs: custom_components.smart_irrigation.scheduler: debug ``` -------------------------------- ### Automation reacting to smart_irrigation_start_irrigation_all_zones event Source: https://github.com/altmenorg/hasmartirrigation/blob/master/README.md YAML automation that listens for the smart_irrigation_start_irrigation_all_zones event and filters on the trigger_name ```yaml trigger: - platform: event event_type: smart_irrigation_start_irrigation_all_zones event_data: trigger_name: "Morning" action: - # open your valves for the durations Smart Irrigation calculated ``` -------------------------------- ### Run project checks (pytest, black, ruff) Source: https://github.com/altmenorg/hasmartirrigation/blob/master/CONTRIBUTING.md Runs the mandatory checks that must pass for every pull request: the test suite, Black formatting check, and Ruff linting. Execute them from the repository root. ```bash pytest tests/ # the test suite black --check custom_components/smart_irrigation/ # formatting ruff check custom_components/smart_irrigation/ # lint ``` -------------------------------- ### YAML resource for manual dashboards Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-card.md Add this resource to your Lovelace YAML configuration to load the card JavaScript. The integration does not manage resources for YAML dashboards, so this must be added manually under 'lovelace: resources:'. ```yaml resources: - url: /api/smart_irrigation/card.js type: module ``` -------------------------------- ### jq command to compare calculation log entries Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/configuration-general.md Use this jq command to filter and extract key fields from the calculation log file (calc_log.jsonl) for a specific zone, such as 'Lawn', to compare days. It outputs timestamp, ETo, solar radiation, whether solar radiation was estimated, bucket after, and duration. ```bash jq -c 'select(.zone.name == "Lawn") | {t: .timestamp, eto: .module.days[0].eto, sol_rad: .module.days[0].sol_rad, estimated: .module.days[0].sol_rad_estimated, bucket: .outputs.bucket_after, duration: .outputs.duration}' calc_log.jsonl ``` -------------------------------- ### Create Recurring Schedule (YAML) Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-enhanced-scheduling-integration.md Defines a daily recurring schedule that triggers a calculation at 06:00 for all zones. Use this to set up a basic daily automation. ```yaml # Daily morning calculation service: smart_irrigation.create_recurring_schedule data: name: "Daily Morning Check" type: "daily" time: "06:00" action: "calculate" zones: "all" ``` -------------------------------- ### Automation: Push duration to Irrigation Unlimited with adjust_time Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-enhanced-scheduling-integration.md Use this automation to pass the calculated duration from Smart Irrigation to Irrigation Unlimited's adjust_time service. It triggers at 23:00 and only runs if the Smart Irrigation sensor value is greater than 0. The entity_id must be a binary_sensor from Irrigation Unlimited. ```yaml automation: - alias: "Smart Irrigation → IU: push duration for zone 1" trigger: - platform: time at: "23:00:00" condition: - condition: template value_template: "{{ states('sensor.smart_irrigation_zone_1') | int(0) > 0 }}" action: - service: irrigation_unlimited.adjust_time data: entity_id: binary_sensor.irrigation_unlimited_c1_z1 actual: "{{ timedelta(seconds=states('sensor.smart_irrigation_zone_1') | int(0)) }}" ``` -------------------------------- ### Credit watering action in open loop Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-output-contract.md Use this YAML action to credit the watering duration for a zone in open loop mode. Include the 'seconds' data to specify the actual run duration; omitting it credits the zone's own duration. Avoid using this in closed loop mode to prevent double-counting. ```yaml action: smart_irrigation.credit_watering target: entity_id: sensor.smart_irrigation_lawn data: seconds: 900 ``` -------------------------------- ### Smart Irrigation: reset_bucket Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Resets one specific bucket to 0. It says the soil is back at field capacity, whatever the run delivered. credit_watering is the better end to an irrigation automation. ```APIDOC ## Smart Irrigation: reset_bucket ### Description Resets one specific bucket to 0. It says the soil is back at field capacity, whatever the run delivered: `credit_watering` is the better end to an irrigation automation. ### Service `smart_irrigation.reset_bucket` ### Parameters - `zone` (string) - Required - The zone whose bucket to reset. ``` -------------------------------- ### Create Seasonal Adjustment (YAML) Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-enhanced-scheduling-integration.md Defines a seasonal adjustment for summer months (June-August) with a 1.3 multiplier for all zones. Use this to boost irrigation during hot periods. ```yaml # Summer irrigation boost service: smart_irrigation.create_seasonal_adjustment data: name: "Summer Heat Adjustment" month_start: 6 month_end: 8 multiplier_adjustment: 1.3 zones: "all" ``` -------------------------------- ### Smart Irrigation: create_seasonal_adjustment / update_seasonal_adjustment / delete_seasonal_adjustment Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Scale the crop factor, and shift the irrigation threshold, over a range of months. ```APIDOC ## Smart Irrigation: create_seasonal_adjustment / update_seasonal_adjustment / delete_seasonal_adjustment ### Description Scale the crop factor, and shift the irrigation threshold, over a range of months. ### Services - `smart_irrigation.create_seasonal_adjustment` - `smart_irrigation.update_seasonal_adjustment` - `smart_irrigation.delete_seasonal_adjustment` ``` -------------------------------- ### Smart Irrigation: set_all_buckets Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Sets all buckets to a specific new_bucket_value (required; the form suggests 0). ```APIDOC ## Smart Irrigation: set_all_buckets ### Description Sets all buckets to a specific `new_bucket_value` (required; the form suggests 0). ### Service `smart_irrigation.set_all_buckets` ### Parameters - `new_bucket_value` (number) - Required - The value to set all buckets to. ``` -------------------------------- ### Smart Irrigation: calculate_all_zones Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Triggers the calculation of all automatic zones. Use only if automatic refresh is disabled. Weather data is deleted by default unless delete_weather_data is false. dry_run previews the calculation. ```APIDOC ## Smart Irrigation: calculate_all_zones ### Description Triggers the calculation of all automatic zones. Use only if you disabled automatic refresh in the options. Note that after calculation weather data is deleted by default unless you specify `delete_weather_data: false`. Specify `dry_run: true` to see what the calculation would do without changing anything. ### Service `smart_irrigation.calculate_all_zones` ### Parameters - `delete_weather_data` (boolean) - Optional - Whether to delete weather data after calculation. Defaults to true. - `dry_run` (boolean) - Optional - If true, only preview the calculation without making changes. ``` -------------------------------- ### calculate_all_zones with dry_run Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Performs a dry run calculation for all zones, returning the result without modifying any irrigation data. ```APIDOC ## calculate_all_zones (dry run) ### Description Performs a dry run calculation for all zones, returning the result without modifying any irrigation data. The bucket, zones, weather data, and internal 'last calculated' marker are left unchanged. ### Service `smart_irrigation.calculate_all_zones` ### Parameters #### Service Data - **data** (object) - Required - The data payload. - **dry_run** (boolean) - Required - Set to `true` to perform a dry run. - **response_variable** (string) - Required - The variable name to store the response, e.g., `result`. ### Request Example ```yaml action: smart_irrigation.calculate_all_zones data: dry_run: true response_variable: result ``` ### Response #### Success Response - **zones** (array) - List of zone results. Each zone contains: - **delta** (number|null) - The delta value. - **bucket** (number|null) - The bucket value. - **duration** (number|null) - The duration value. - **current_drainage** (number|null) - The current drainage value. - **et_deficiency** (number|null) - The evapotranspiration deficiency value. All five keys are always present, and are null when the zone's module does not produce that value. Zones that produced no result are omitted from the list. #### Response Example ```json { "zones": [ { "delta": 0.5, "bucket": 10, "duration": 120, "current_drainage": 2.0, "et_deficiency": 1.5 } ] } ``` ``` -------------------------------- ### Smart Irrigation: reset_all_buckets Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Resets all buckets to 0. ```APIDOC ## Smart Irrigation: reset_all_buckets ### Description Resets all buckets to 0. ### Service `smart_irrigation.reset_all_buckets` ``` -------------------------------- ### Smart Irrigation: credit_watering Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Credits a zone with the water a run of your own delivered: its precipitation rate times seconds (the zone's duration when left out), less its lead time. Use it at the end of an irrigation automation rather than reset_bucket. ```APIDOC ## Smart Irrigation: credit_watering ### Description Credits a zone with the water a run of your own delivered: its precipitation rate times `seconds` (the zone's duration when left out), less its lead time. Use it at the end of an irrigation automation rather than `reset_bucket`: a run cut short by the zone's maximum duration keeps the deficit it did not water. ### Service `smart_irrigation.credit_watering` ### Parameters - `zone` (string) - Required - The zone to credit. - `seconds` (number) - Required - The duration of the run in seconds. ``` -------------------------------- ### Smart Irrigation: set_zone Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Allows configuration for bucket, multiplier, duration, state, and throughput settings for a zone. ```APIDOC ## Smart Irrigation: set_zone ### Description Allows configuration for bucket (with `new_bucket_value` (default 0)), multiplier (with `new_multiplier_value` (default 1.0)), duration (with `new_duration_value` (default 0)), state (with `new_state_value` (default 'automatic')) and throughput (with `new_throughput_value` (default 50)) settings for a zone. ### Service `smart_irrigation.set_zone` ### Parameters - `zone` (string) - Required - The zone to configure. - `new_bucket_value` (number) - Optional - The new bucket value. Defaults to 0. - `new_multiplier_value` (number) - Optional - The new multiplier value. Defaults to 1.0. - `new_duration_value` (number) - Optional - The new duration value. Defaults to 0. - `new_state_value` (string) - Optional - The new state value. Defaults to 'automatic'. - `new_throughput_value` (number) - Optional - The new throughput value. Defaults to 50. ``` -------------------------------- ### Smart Irrigation: set_bucket Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Sets a specific bucket to a specific new_bucket_value (required; the form suggests 0). ```APIDOC ## Smart Irrigation: set_bucket ### Description Sets a specific bucket to a specific `new_bucket_value` (required; the form suggests 0). ### Service `smart_irrigation.set_bucket` ### Parameters - `zone` (string) - Required - The zone whose bucket to set. - `new_bucket_value` (number) - Required - The value to set the bucket to. ``` -------------------------------- ### Smart Irrigation: update_all_zones Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Updates all automatic zones with weather data. ```APIDOC ## Smart Irrigation: update_all_zones ### Description Updates all automatic zones with weather data. ### Service `smart_irrigation.update_all_zones` ``` -------------------------------- ### Smart Irrigation: postpone_irrigation Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Holds watering back for hours (default 24), for rain the forecast missed or an afternoon on the lawn. It is a moment, not a countdown: it survives a restart and ends by itself. It resets nothing, so a zone that is short of water still is when it ends. hours: 0 lifts it. ```APIDOC ## Smart Irrigation: postpone_irrigation ### Description Holds watering back for `hours` (default 24), for rain the forecast missed or an afternoon on the lawn. It is a moment, not a countdown: it survives a restart and ends by itself. It resets nothing, so a zone that is short of water still is when it ends. `hours: 0` lifts it. ### Service `smart_irrigation.postpone_irrigation` ### Parameters - `hours` (number) - Optional - Number of hours to postpone irrigation. Defaults to 24. Set to 0 to lift the postponement. ``` -------------------------------- ### Watering report automation for smart_irrigation_irrigation_finished Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/configuration-closed-loop.md Trigger a Home Assistant notification when the smart irrigation run finishes. Uses the smart_irrigation_irrigation_finished event to gather zones and problems, then sends a single message summarizing each zone's duration and volume, including warnings for any problem zones. Requires the notify.mobile_app_your_phone entity and the direct valve control feature. ```yaml alias: Watering report triggers: - trigger: event event_type: smart_irrigation_irrigation_finished actions: - variables: zones: "{{ trigger.event.data.zones }}" problems: "{{ trigger.event.data.problems }}" - action: notify.mobile_app_your_phone data: title: "{{ '🚨' if problems | count > 0 else '🌱' }} Watering finished" message: >- {% set l = namespace(t=[]) %} {% for z in zones %} {% set l.t = l.t + [z.zone ~ ": " ~ (z.seconds / 60) | round(1) ~ " min, " ~ z.volume_l ~ " L"] %} {% endfor %} {% for p in problems %} {% set l.t = l.t + ["WARNING " ~ p.zone ~ ": " ~ p.reason] %} {% endfor %} {{ l.t | join("\n") }} mode: single ``` -------------------------------- ### Smart Irrigation: set_all_multipliers Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Sets all multipliers to a specific new_multiplier_value (required; the form suggests 1.0). ```APIDOC ## Smart Irrigation: set_all_multipliers ### Description Sets all multipliers to a specific `new_multiplier_value` (required; the form suggests 1.0). ### Service `smart_irrigation.set_all_multipliers` ### Parameters - `new_multiplier_value` (number) - Required - The value to set all multipliers to. ``` -------------------------------- ### Smart Irrigation: generate_watering_calendar Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Generates a 12-month watering calendar for a zone based on representative climate data. ```APIDOC ## Smart Irrigation: generate_watering_calendar ### Description Generate a 12-month watering calendar for a zone based on representative climate data. ### Service `smart_irrigation.generate_watering_calendar` ### Parameters - `zone` (string) - Required - The zone for which to generate the calendar. ``` -------------------------------- ### Automation to notify when irrigation was skipped Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-events.md Listens for the smart_irrigation_irrigation_skipped event and sends a persistent notification with the reason from the event data. Use this to alert when a scheduled irrigation is skipped due to skip conditions. ```yaml automation: - alias: "Tell me when irrigation was skipped" trigger: - platform: event event_type: smart_irrigation_irrigation_skipped action: - service: notify.persistent_notification data: message: "No irrigation today: {{ trigger.event.data.reason }}" ``` -------------------------------- ### Template sensor for wind speed at 2m Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/configuration-sensor-groups.md Use this template sensor to convert your wind speed reading to the equivalent at 2 meters height, as an alternative to the Anemometer height field. Replace the placeholders with your sensor's name and the measurement height in meters. ```yaml sensor: - platform: template sensors: wind_at_2m: friendly_name: Wind Speed at 2m value_template: {% raw %}"{{states('[name of your wind speed sensor (WSmeasured)]')|float()*(4.87/log((67.8*[height the wind speed was measured on in meters (H)])-5.42))}}"{% endraw %} ``` -------------------------------- ### Smart Irrigation: update_zone Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Updates one specific zone with weather data. ```APIDOC ## Smart Irrigation: update_zone ### Description Updates one specific zone with weather data. ### Service `smart_irrigation.update_zone` ### Parameters - `zone` (string) - Required - The zone to update. ``` -------------------------------- ### calculate_zone with dry_run Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Performs a dry run calculation for a single zone, returning the result without modifying any irrigation data. ```APIDOC ## calculate_zone (dry run) ### Description Performs a dry run calculation for a single zone, returning the result without modifying any irrigation data. The bucket, zone, weather data, and internal 'last calculated' marker are left unchanged. ### Service `smart_irrigation.calculate_zone` ### Parameters #### Service Data - **target** (object) - Required - The target entity for the zone. - **entity_id** (string) - Required - The entity ID of the zone, e.g., `sensor.smart_irrigation_my_zone`. - **data** (object) - Required - The data payload. - **dry_run** (boolean) - Required - Set to `true` to perform a dry run. - **response_variable** (string) - Required - The variable name to store the response, e.g., `result`. ### Request Example ```yaml action: smart_irrigation.calculate_zone target: entity_id: sensor.smart_irrigation_my_zone data: dry_run: true response_variable: result ``` ### Response #### Success Response - **zones** (array) - List of zone results. Each zone contains: - **delta** (number|null) - The delta value. - **bucket** (number|null) - The bucket value. - **duration** (number|null) - The duration value. - **current_drainage** (number|null) - The current drainage value. - **et_deficiency** (number|null) - The evapotranspiration deficiency value. All five keys are always present, and are null when the zone's module does not produce that value. Zones that produced no result are omitted from the list. #### Response Example ```json { "zones": [ { "delta": 0.5, "bucket": 10, "duration": 120, "current_drainage": 2.0, "et_deficiency": 1.5 } ] } ``` ``` -------------------------------- ### Smart Irrigation: set_multiplier Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Sets a specific multiplier to a specific new_multiplier_value (required; the form suggests 1.0). ```APIDOC ## Smart Irrigation: set_multiplier ### Description Sets a specific multiplier to a specific `new_multiplier_value` (required; the form suggests 1.0). ### Service `smart_irrigation.set_multiplier` ### Parameters - `zone` (string) - Required - The zone whose multiplier to set. - `new_multiplier_value` (number) - Required - The value to set the multiplier to. ``` -------------------------------- ### Smart Irrigation: calculate_zone Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Triggers the calculation of one specific zone. By default, weather data is deleted after calculation unless delete_weather_data is set to false. Use dry_run to preview the calculation without making changes. ```APIDOC ## Smart Irrigation: calculate_zone ### Description Triggers the calculation of one specific zone. Note that used weather data is deleted afterwards by default unless you specify `delete_weather_data: false`. Specify `dry_run: true` to see what the calculation would do without changing anything. ### Service `smart_irrigation.calculate_zone` ### Parameters - `zone` (string) - Required - The zone to calculate. - `delete_weather_data` (boolean) - Optional - Whether to delete weather data after calculation. Defaults to true. - `dry_run` (boolean) - Optional - If true, only preview the calculation without making changes. ``` -------------------------------- ### Smart Irrigation: clear_all_weather_data Source: https://github.com/altmenorg/hasmartirrigation/blob/master/docs/usage-services.md Deletes all weather data. If zones are specified, only the weather data of their sensor groups is deleted, affecting other zones in those groups. ```APIDOC ## Smart Irrigation: clear_all_weather_data ### Description Deletes all weather data. Pick zones and only the weather data of their sensor groups is deleted (the other zones of those groups lose it too, since a group's data is shared). ### Service `smart_irrigation.clear_all_weather_data` ### Parameters - `zones` (list) - Optional - List of zones to clear weather data for. If not provided, all weather data is cleared. ```