soesas
(Sascha Schöne)
May 6, 2022, 9:16am
21
Thank you for the help again.
I now created two helpers - one for lawn irrigation and one for drip irrigation
input_number.dauer_tropfbewasserung
and
input_number.dauer_rasenbewasserung
how do I change the automation that it takes the specified time for the duration of the irrigation instead of the fixed 20 minutes of zone as of now it’s fine with me that each zone has an equal length and I could easily change it separately from there.
soesas
(Sascha Schöne)
May 6, 2022, 9:23am
22
The other issue is with displaying the remaining time. I would like to see the remaining time for each irrigation zone. I posted
template:
- sensor:
- name: "Countdown Water Timer Decimal Minutes"
unique_id: "Countdown Water Timer Decimal Minutes"
state: >-
{{ (( states.input_boolean.rasenbewasserung.on | as_timestamp -
utcnow() | as_timestamp +
states('sensor.total_time_watering_seconds') | float(0) ) / 60.0) | round(1) }}
and added the entity
sensor.countdown_water_timer_decimal_minutes
as a result I get -159.5 and it keeps changing even though the irrigation is off. So something is not right still.
AllHailJ
(J Gent)
May 6, 2022, 3:55pm
23
It is running once a minute and is counting down so it will go negative.
Here is a similar sensor that stops at 0.0
template:
- sensor:
- name: "Countdown Water Timer Decimal Minutes"
unique_id: "Countdown Water Timer Decimal Minutes"
state: >-
{% set timestamp = states.input_boolean.rasenbewasserung.on | as_timestamp %}
{% set mynow = utcnow() | as_timestamp %}
{% set watertime = states('sensor.total_time_watering_seconds') | float(0) %}
{% if timestamp - mynow + watertime > 0 %}
{{ ((timestamp - mynow + watertime) / 60.0) | round(1) }}
{% else %}
0.0
{% endif %}
I tested this in the developer tools. I set variables and output the variables for each condition. My zone time is in minutes so that is why it is multiplied by 60. This will updated once a minute.
{% set timestamp = states.input_boolean.run_irrigation.last_changed | as_timestamp %}
{% set mynow = utcnow() | as_timestamp %}
{% set watertime = states('input_number.zone1') | float(0) * 60.0 %}
{% if timestamp - mynow + watertime > 0 %}
{{ timestamp }}
{{ mynow }}
{{ watertime }}
{{ ((timestamp - mynow + watertime) / 60.0) | round(3) }}
{% else %}
0.0
{{ timestamp }}
{{ mynow }}
{{ watertime }}
{% endif %}
and got this
after 5 minutes it becomes this
soesas
(Sascha Schöne)
May 7, 2022, 3:53pm
24
I doesn’t quite work for me - in supervisor I tried
template:
- sensor:
- name: "Countdown Water Timer Decimal Minutes"
unique_id: "Countdown Water Timer Decimal Minutes"
state: >-
{% set timestamp = states.input_boolean.rasenbewasserung.on | as_timestamp %}
{% set mynow = utcnow() | as_timestamp %}
{% set watertime = states('sensor.total_time_watering_seconds') | float(0) %}
{% if timestamp - mynow + watertime > 0 %}
{{ ((timestamp - mynow + watertime) / 60.0) | round(1) }}
{% else %}
0.0
{% endif %}
However, I get this:
UndefinedError: 'homeassistant.helpers.template.TemplateState object' has no attribute 'on'
AllHailJ
(J Gent)
May 7, 2022, 4:07pm
25
states.input_boolean.rasenbewasserung.on | as_timestamp
Should be
states.input_boolean.rasenbewasserung.last_changed | as_timestamp
The last_changed is the time the input boolean last changed.
Thessa
(Thessa)
March 28, 2024, 10:30am
26
Can something like this work?
alias: Automatic Run
description: “”
trigger:
My Time Condition
condition:
My Weather Condition
action:
controller_zone_entity: 1.0 Sprinkler Valve
controller_sequence_entity: 1.1 Run 1
time_entity: “00:10:00”
service: irrigation_unlimited.shim_manual_run
data:
controller_zone_entity: input_select.irrigation_unlimited_entities
controller_sequence_entity: input_select.irrigation_unlimited_sequences
time_entity: input_datetime.irrigation_unlimited_run_time
service: irrigation_unlimited.shim_cancel
data:
controller_zone_entity: input_select.irrigation_unlimited_entities
mode: single