In the meantime, without any changes, notification at finish event worked the last 2-3 times.
Another observation is, that start and finish events are fired in situations that are not scheduled and I cannot find the reason.
This is my current configuration:
irrigation_unlimited:
controllers:
- name: "Rain Bird RC2"
enabled: true
zones:
- name: "Rasen Eingang"
enabled: true
entity_id: "switch.rain_bird_z1_rasen_eingang"
zone_id: "1"
- name: "Rasen Feige"
enabled: true
entity_id: "switch.rain_bird_z2_rasen_feige"
zone_id: "2"
- name: "Rasen Magnolie"
enabled: true
entity_id: "switch.rain_bird_z3_rasen_magnolie"
zone_id: "3"
- name: "Rasen vorne"
enabled: true
entity_id: "switch.rain_bird_z4_rasen_vorne"
zone_id: "4"
- name: "Rasen hinten"
enabled: true
entity_id: "switch.rain_bird_z5_rasen_hinten"
zone_id: "5"
- name: "Hecken Treppe"
enabled: true
entity_id: "switch.rain_bird_z6_hecken_treppe"
zone_id: "6"
- name: "Beet oben"
enabled: true
entity_id: "switch.rain_bird_z7_beet_oben"
zone_id: "7"
- name: "Beet unten"
enabled: true
entity_id: "switch.rain_bird_z8_beet_unten"
zone_id: "8"
sequences:
- name: "Rasen"
enabled: true
schedules:
- time: "06:00"
weekday: [mon, wed, fri]
duration: "01:50"
zones:
- zone_id: 5
enabled: true
duration: "00:25"
- zone_id: 4
enabled: true
duration: "00:25"
- zone_id: 3
enabled: true
duration: "00:20"
- zone_id: 2
enabled: true
duration: "00:20"
- zone_id: 1
enabled: true
duration: "00:20"
- name: "Beete"
enabled: true
schedules:
- time: "05:00"
weekday: [tue, thu, sat]
duration: "02:15"
zones:
- zone_id: 6
enabled: true
duration: "00:45"
- zone_id: 7
enabled: true
duration: "00:45"
- zone_id: 8
enabled: true
duration: "00:45"
This is my adjustment automation:
template:
- trigger:
- platform: time
at: input_datetime.irrigation_adjustment_1
- platform: time
at: input_datetime.irrigation_adjustment_2
- platform: homeassistant
event: start
- platform: state
entity_id:
- input_number.pop
- input_number.prec
- input_boolean.bypass_rainsensor
- input_boolean.bypass_suspension
- input_boolean.bypass_adjustment
sensor:
- name: irrigation_adjustment
state: >
{% set rain_multiplier = states('sensor.rain_multiplier') | float(-1) %}
{% set temperature_multiplier = states('sensor.temperature_multiplier') | float(-1) %}
{% set multiplier = rain_multiplier * temperature_multiplier %}
{{ (multiplier * 100) | round(0) }}
unit_of_measurement: "%"
binary_sensor:
- name: irrigation_suspend
state: >
{% set forecast_pop = states('sensor.wetter_forecast_precipitation_probability') | float(-1) %}
{% set threshold_pop = states('input_number.pop') | float(-1) %}
{% set forecast_prec = states('sensor.wetter_forecast_precipitation') | float(-1) %}
{% set threshold_prec = states('input_number.prec') | float(-1) %}
{% if forecast_pop < threshold_pop or forecast_prec < threshold_prec %}
{{ 'off' }}
{% else %}
{{ 'on' }}
{% endif %}
automation:
- id: 'IU1653340123453'
alias: Irrigation Unlimited Adjustment
trigger:
- platform: homeassistant
event: start
- platform: state
entity_id:
- sensor.irrigation_adjustment
- binary_sensor.irrigation_suspend
- binary_sensor.rainsensor
- input_boolean.bypass_rainsensor
- input_boolean.bypass_suspension
- input_boolean.bypass_adjustment
condition:
condition: and
conditions:
- "{{ has_value('sensor.irrigation_adjustment') }}"
- "{{ has_value('binary_sensor.rainsensor') }}"
- "{{ has_value('binary_sensor.irrigation_suspend') }}"
- "{{ has_value('input_boolean.bypass_rainsensor') }}"
- "{{ has_value('input_boolean.bypass_suspension') }}"
- "{{ has_value('input_boolean.bypass_adjustment') }}"
action:
service: irrigation_unlimited.adjust_time
data:
entity_id: binary_sensor.irrigation_unlimited_c1_m
sequence_id: 0
percentage: >
{% set adjustment = states('sensor.irrigation_adjustment') | int %}
{% set suspension = is_state('binary_sensor.irrigation_suspend', 'off') %}
{% set rain_sensor = is_state('binary_sensor.rainsensor', 'off') %}
{% set rain_sensor_bypass = is_state('input_boolean.bypass_rainsensor', 'on') %}
{% set rain_adjustment_bypass = is_state('input_boolean.bypass_adjustment', 'off') %}
{% set rain_suspension_bypass = is_state('input_boolean.bypass_suspension', 'on') %}
{% if (rain_sensor or rain_sensor_bypass) and rain_adjustment_bypass and (rain_suspension_bypass or suspension) %}
{% set percentage = adjustment %}
{% elif rain_adjustment_bypass is false and (rain_sensor or rain_sensor_bypass) and (rain_suspension_bypass or suspension) %}
{% set percentage = 100 %}
{% else %}
{% set percentage = 0 %}
{% endif %}
{{ percentage }}
with input_datetime.irrigation_adjustment_1
set to 02:00 and input_datetime.irrigation_adjustment_2
set to 16:00
The dashboard looks like this:
This is my notification automation:
alias: Irrigation Unlimited Benachrichtigung
description: ""
trigger:
- platform: event
event_type: irrigation_unlimited_start
id: start
- platform: event
event_type: irrigation_unlimited_finish
id: finish
- platform: event
event_type: mobile_app_notification_action
event_data:
action: irrigation_stop
id: stop
condition: []
action:
- if:
- condition: trigger
id:
- start
- finish
then:
- service: notify.mobile_app_sm_g990b
data:
title: >-
Die Bewässerung wurde {{ 'gestartet' if trigger.id =='start' else
'beendet' }}
message: >
Zeit: {{ as_local(trigger.event.time_fired).strftime('%A, %d.%m.%y
%H:%M') | replace("Monday", "Montag") | replace("Wednesday",
"Mittwoch") | replace("Tuesday", "Dienstag") | replace("Thursday",
"Donnerstag") | replace("Friday", "Freitag") | replace("Saturday",
"Samstag") | replace("Sunday", "Sonntag") }}
Programm: {{ trigger.event.data.sequence.name }}
Auslöser: {% if trigger.event.data.schedule.index is integer %}{{
trigger.event.data.schedule.name }}{% else %}Manuell{% endif %}
Dauer: {{ timedelta(seconds=trigger.event.data.run.duration) }} ({{
states('sensor.irrigation_adjustment') }}%)
data:
clickAction: /dashboard-garten/garten
tag: irrigation
actions:
- action: irrigation_stop
title: Bewässerung abbrechen
- if:
- condition: trigger
id:
- stop
then:
- service: irrigation_unlimited.cancel
data:
entity_id: binary_sensor.irrigation_unlimited_c1_m
mode: single
Today, something weird happened again with a faulty notification, fired at 16:00 according to input_datetime.irrigation_adjustment_2
However, there was no irrigation started finished and nothing scheduled…
2023-08-18 16:00:00.496 INFO (MainThread) [homeassistant.components.automation.irrigation_unlimited_adjustment] Irrigation Unlimited Adjustment: Running automation actions
2023-08-18 16:00:00.497 INFO (MainThread) [homeassistant.components.automation.irrigation_unlimited_adjustment] Irrigation Unlimited Adjustment: Executing step call service
2023-08-18 16:00:00.500 INFO (MainThread) [custom_components.irrigation_unlimited] CALL [2023-08-18 16:00:00] service: adjust_time, controller: 1, zone: 0, data: {"entity_id": ["binary_sensor.irrigation_unlimited_c1_m"], "sequence_id": 0, "percentage": 162.0}
2023-08-18 16:00:00.505 INFO (MainThread) [custom_components.irrigation_unlimited] EVENT [2023-08-18 08:54:18] controller: 1, zone: 0, state: 1
2023-08-18 16:00:00.506 INFO (MainThread) [custom_components.irrigation_unlimited] EVENT [2023-08-18 08:54:18] controller: 1, zone: 1, state: 1, data: 1.1.1.5.1
2023-08-18 16:00:00.568 INFO (MainThread) [homeassistant.components.automation.irrigation_unlimited_benachrichtigung_start] Irrigation Unlimited Benachrichtigung: Running automation actions
2023-08-18 16:00:00.593 INFO (MainThread) [homeassistant.components.automation.irrigation_unlimited_benachrichtigung_start] Irrigation Unlimited Benachrichtigung: If at step 1: Running automation actions
2023-08-18 16:00:00.594 INFO (MainThread) [homeassistant.components.automation.irrigation_unlimited_benachrichtigung_start] Irrigation Unlimited Benachrichtigung: If at step 1: Executing step call service
2023-08-18 16:00:01.505 WARNING (MainThread) [custom_components.irrigation_unlimited] SYNCHRONISATION [2023-08-18 16:00:01] Switch does not match current state: expected: on, switch: switch.rain_bird_z1_rasen_eingang
2023-08-18 16:00:01.521 WARNING (MainThread) [custom_components.irrigation_unlimited] SYNCHRONISATION [2023-08-18 16:00:01] Switch does not match current state: expected: on, switch: switch.rain_bird_z1_rasen_eingang
2023-08-18 16:00:01.527 INFO (MainThread) [custom_components.irrigation_unlimited] EVENT [2023-08-18 16:00:01] controller: 1, zone: 1, state: 0
2023-08-18 16:00:01.528 INFO (MainThread) [custom_components.irrigation_unlimited] EVENT [2023-08-18 16:00:01] controller: 1, zone: 0, state: 0
2023-08-18 16:00:01.552 WARNING (MainThread) [homeassistant.components.automation.irrigation_unlimited_benachrichtigung_start] Irrigation Unlimited Benachrichtigung: Already running
2023-08-18 16:00:06.206 INFO (MainThread) [homeassistant.components.mobile_app.notify] mobile_app push notification rate limits for SM-G990B: 8 sent, 500 allowed, 0 errors, resets in 9:59:53
Any idea why this was triggered or why finish and start events were fired at 16:00 without any schedule? It seems like adjustment automation resultet in a very short activation of the controller and zone 1 for a second (which shouldn’t happen) resulting in the fired start and finish events triggering my notification automation…