[ { "id": "Tägliche Et0-Bilanz & Laufzeit", "automation": "- alias: Tägliche Et0-Bilanz & Laufzeit\n description: ''\n triggers:\n - at: '23:55:00'\n trigger: time\n actions:\n - repeat:\n for_each:\n - bucket: input_number.lawn_back_bucket\n size: input_number.lawn_back_size\n bucket_name: hinten\n runtime: input_number.lawn_back_runtime\n - bucket: input_number.lawn_front_bucket\n size: input_number.lawn_front_size\n bucket_name: vorne\n runtime: input_number.lawn_front_runtime\n sequence:\n - variables:\n new_bucket: '{% set old = states(repeat.item.bucket) | float(maxb) %} {%\n set val = [ old - (et0 * factor) + rain, 0, maxb ] | sort %} {{ val[1]}}\n\n '\n diff: '{% set old = states(repeat.item.bucket) | float(maxb) %} {% set\n val = new_bucket - old %} {{ val }}\n\n '\n - target:\n entity_id: '{{ repeat.item.bucket }}'\n data:\n value: '{{ new_bucket }}'\n action: input_number.set_value\n enabled: true\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ new_bucket < threshold }}'\n sequence:\n - variables:\n deficit: '{{ maxb - new_bucket }}'\n flow: '{{ states(''input_number.lawn_throughput'') | float(45) }}'\n area: '{{ states(repeat.item.size) | float(160) }}'\n minutes: '{{ (deficit / (flow / area)) | round(0) }}'\n - target:\n entity_id: '{{ repeat.item.runtime }}'\n data:\n value: '{{ minutes }}'\n action: input_number.set_value\n enabled: true\n - action: notify.admin_notification_group\n data:\n title: Bucket {{repeat.item.bucket_name}}\n message: 'Bucket: {{new_bucket|round(1)}} mm ({{diff|round(1)}} mm)\n Runtime: {{minutes|round(1)}} min'\n data:\n tag: bucket_{{repeat.item.bucket_name}}\n sticky: false\n channel: watering\n default:\n - action: notify.admin_notification_group\n data:\n title: Bucket {{repeat.item.bucket_name}}\n message: 'Bucket: {{new_bucket|round(1)}} mm ({{diff|round(1)}} mm)'\n data:\n tag: bucket_{{repeat.item.bucket_name}}\n sticky: false\n channel: watering\n variables:\n et0: '{{ states(''sensor.open_meteo_et0_mm'') | float(0) }}'\n factor: '{{ states(''input_number.lawn_et0_factor'') | float(1)\n }}'\n rain: '{{ states(''sensor.rain_today_mm'') | float(0)\n }}'\n maxb: '{{ states(''input_number.lawn_bucket_max'') | float(40)\n }}'\n threshold: '{{ states(''input_number.lawn_bucket_preemtive_threshold'') | float(15)\n }}'", "config": [ { "name": "open meteo et0 mm sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.open_meteo_et0_mm", "device_id": null } }, { "name": "rain today mm sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.rain_today_mm", "device_id": null } }, { "name": "lawn back bucket input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_back_bucket", "device_id": null } }, { "name": "lawn back size input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_back_size", "device_id": null } }, { "name": "lawn back runtime input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_back_runtime", "device_id": null } }, { "name": "lawn front bucket input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_front_bucket", "device_id": null } }, { "name": "lawn front size input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_front_size", "device_id": null } }, { "name": "lawn front runtime input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_front_runtime", "device_id": null } }, { "name": "lawn throughput input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_throughput", "device_id": null } }, { "name": "lawn et0 factor input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_et0_factor", "device_id": null } }, { "name": "lawn bucket max input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_bucket_max", "device_id": null } }, { "name": "lawn bucket preemtive threshold input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_bucket_preemtive_threshold", "device_id": null } }, { "name": "admin notification group", "room": null, "type": "notify", "id": { "entity_id": "notify.admin_notification_group", "device_id": null } } ] }, { "id": "Rasen bewässern (PV & Regen)", "automation": "- alias: Rasen bewässern (PV & Regen)\n description: ''\n triggers:\n - entity_id: sensor.evcc_energy_available_for_climate\n above: input_number.lawn_pump_power\n trigger: numeric_state\n - entity_id: sensor.solis_battery_soc\n above: input_number.lawn_watering_min_soc\n trigger: numeric_state\n - trigger: time\n at: input_datetime.lawn_watering_late\n conditions:\n - condition: or\n conditions:\n - condition: numeric_state\n entity_id: input_number.lawn_front_runtime\n above: 0\n - condition: numeric_state\n entity_id: input_number.lawn_back_runtime\n above: 0\n - condition: or\n conditions:\n - condition: and\n conditions:\n - condition: state\n entity_id: binary_sensor.lawn_preemtive_watering\n state: 'on'\n - condition: time\n after: input_datetime.lawn_watering_early\n before: input_datetime.lawn_watering_late\n - condition: state\n entity_id: binary_sensor.rain_expected\n state: 'off'\n - condition: numeric_state\n entity_id: sensor.solis_battery_soc\n above: input_number.lawn_watering_min_soc\n - condition: numeric_state\n entity_id: sensor.evcc_energy_available_for_climate\n above: input_number.lawn_pump_power\n - condition: state\n entity_id: binary_sensor.lawn_too_long_dry\n state: 'on'\n - condition: state\n entity_id: binary_sensor.lawn_preemtive_watering\n state: 'off'\n actions:\n - repeat:\n for_each:\n - name: vorne\n valve: valve.vorne\n runtime: input_number.lawn_front_runtime\n bucket: input_number.lawn_front_bucket\n notify_tag: watering_vorne\n notify_title: Bewässern vorne\n - name: hinten\n valve: valve.hinten\n runtime: input_number.lawn_back_runtime\n bucket: input_number.lawn_back_bucket\n notify_tag: watering_hinten\n notify_title: Bewässern hinten\n sequence:\n - variables:\n run_minutes: '{{ states(repeat.item.runtime) | int(0) }}'\n - condition: template\n value_template: \"{{ run_minutes > 0\\n or is_state('binary_sensor.lawn_too_long_dry',\\\n \\ 'on') }}\\n\"\n - data:\n title: '{{ repeat.item.notify_title }}'\n message: Starte Bewässerung für {{ run_minutes }} min\n data:\n tag: '{{ repeat.item.notify_tag }}'\n sticky: false\n channel: watering\n action: notify.admin_notification_group\n - target:\n entity_id: '{{ repeat.item.valve }}'\n action: valve.open_valve\n - delay:\n minutes: '{{ run_minutes }}'\n - target:\n entity_id: '{{ repeat.item.valve }}'\n action: valve.close_valve\n - data:\n title: '{{ repeat.item.notify_title }}'\n message: Bewässerung nach {{ run_minutes }} min beendet\n data:\n tag: '{{ repeat.item.notify_tag }}'\n sticky: false\n channel: watering\n action: notify.admin_notification_group\n - target:\n entity_id: '{{ repeat.item.bucket }}'\n data:\n value: '{{ states(''input_number.lawn_bucket_max'') | float(40) }}'\n action: input_number.set_value\n - target:\n entity_id: '{{ repeat.item.runtime }}'\n data:\n value: 0\n action: input_number.set_value\n - target:\n entity_id: input_datetime.lawn_last_irrigation\n data:\n datetime: '{{ now() }}'\n action: input_datetime.set_datetime\n mode: single\n trace:\n stored_traces: 25", "config": [ { "name": "evcc energy available for climate sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.evcc_energy_available_for_climate", "device_id": null } }, { "name": "solis battery soc sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.solis_battery_soc", "device_id": null } }, { "name": "lawn back bucket input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_back_bucket", "device_id": null } }, { "name": "lawn back runtime input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_back_runtime", "device_id": null } }, { "name": "lawn front bucket input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_front_bucket", "device_id": null } }, { "name": "lawn front runtime input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_front_runtime", "device_id": null } }, { "name": "lawn bucket max input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_bucket_max", "device_id": null } }, { "name": "lawn pump power input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_pump_power", "device_id": null } }, { "name": "lawn watering min soc input number", "room": "lawn", "type": "input_number", "id": { "entity_id": "input_number.lawn_watering_min_soc", "device_id": null } }, { "name": "lawn preemtive watering binary sensor", "room": "lawn", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.lawn_preemtive_watering", "device_id": null } }, { "name": "rain expected binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.rain_expected", "device_id": null } }, { "name": "lawn too long dry binary sensor", "room": "lawn", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.lawn_too_long_dry", "device_id": null } }, { "name": "lawn watering early input datetime", "room": "lawn", "type": "input_datetime", "id": { "entity_id": "input_datetime.lawn_watering_early", "device_id": null } }, { "name": "lawn watering late input datetime", "room": "lawn", "type": "input_datetime", "id": { "entity_id": "input_datetime.lawn_watering_late", "device_id": null } }, { "name": "lawn last irrigation input datetime", "room": "lawn", "type": "input_datetime", "id": { "entity_id": "input_datetime.lawn_last_irrigation", "device_id": null } }, { "name": "vorne valve", "room": null, "type": "valve", "id": { "entity_id": "valve.vorne", "device_id": null } }, { "name": "hinten valve", "room": null, "type": "valve", "id": { "entity_id": "valve.hinten", "device_id": null } }, { "name": "admin notification group", "room": null, "type": "notify", "id": { "entity_id": "notify.admin_notification_group", "device_id": null } } ] } ]