Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore seconds on trigger time #33

Merged
merged 1 commit into from
Feb 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions package/garden_irrigation_triggered.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ automation:
- alias: Irrigation Triggered

variables:
trigger_time: "{{ trigger.now.strftime('%H:%M:00') }}"
trigger_time: "{{ trigger.now.strftime('%H:%M') }}"

#================================================
#=== TRIGGERS
Expand Down Expand Up @@ -56,10 +56,10 @@ automation:
#=== Check this cycle is enabled. NOTE: don't check this for cycle 3
- condition: template
value_template: >
{% if trigger_time == states('input_datetime.irrigation_cycle1_start_time') and
{% if trigger_time == states('input_datetime.irrigation_cycle1_start_time')[0:5] and
is_state('input_boolean.irrigation_cycle1_schedule_enabled', 'on') %}
True
{% elif trigger_time == states('input_datetime.irrigation_cycle2_start_time') and
{% elif trigger_time == states('input_datetime.irrigation_cycle2_start_time')[0:5] and
is_state('input_boolean.irrigation_cycle2_schedule_enabled', 'on') %}
True
{% elif trigger.entity_id == 'input_boolean.irrigation_cycle3_running' %}
Expand Down Expand Up @@ -93,9 +93,9 @@ automation:
- service: homeassistant.turn_on
data_template:
entity_id: >
{% if trigger_time == states('input_datetime.irrigation_cycle1_start_time') %}
{% if trigger_time == states('input_datetime.irrigation_cycle1_start_time')[0:5] %}
input_boolean.irrigation_cycle1_running
{% elif trigger_time == states('input_datetime.irrigation_cycle2_start_time') %}
{% elif trigger_time == states('input_datetime.irrigation_cycle2_start_time')[0:5] %}
input_boolean.irrigation_cycle2_running
{% else%}
input_boolean.irrigation_cycle3_running
Expand Down