Crap:( All this hassle for nothing afterall:(
I somehow automatically assumed it can control a main valve (open it after the irrigation valves & close it before - to avoid water hammer) & also to run multiple zones at the same time - I guess the later would be doable with template switches, but that’s not very elegant…
Thanks anyway.
I can now verify it evaluates correctly and gives a True/False answer. This seems to have also fixed the schedule cycle and it starts as it should. Any idea why that line would make the template invalid? The “input_boolean.irrigation_cycle3_running” entity is valid and returns a state of “off”.
Hello, i`m having some problems with the instalation,i have have installed the last version and have Home Assistant 2021.7.4, i used 1 sonoff 4ch pro for 4 zones with tasmota, in manual mode they work perfectely , when used schedule dont work.
Have installed the telegram and work i can send messeges from service, then when i tried to configurat with the irrigation, i follow some publication from where i dont now wich part i have to put on scripts, and on automation, please can someone help me.
I follow this post
#===================
#=== Input Booleans
#===================
input_boolean:
irrigation_notify_user1:
name: Notify Edoardo of events
icon: mdi:message-text-outline
irrigation_notify_user2:
name: Notify Sabrina of events
icon: mdi:message-text-outline
#================
#=== Automations
#================
automation:
#===================================================
#=== Notify about irrigation events
#===================================================
- alias: Irrigation Notify About Irrigation Events User1
trigger:
- platform: state
entity_id:
- input_boolean.irrigation_cycle1_running
- input_boolean.irrigation_cycle2_running
condition:
- condition: state
entity_id: input_boolean.irrigation_notify_user1
state: 'on'
action:
- service: telegram_bot.send_message
data_template:
target: !secret chat_id_edoardo
title: '*IRRIGATION SYSTEM*'
message: >
{% if trigger.entity_id == 'input_boolean.irrigation_cycle1_running' %}
{% set cycle = 'cycle1' %}
{% else %}
{% set cycle = 'cycle2' %}
{% endif %}
{% set cycle_name = states('input_text.irrigation_' ~ cycle ~ '_name') %}
{% if trigger.to_state.state == 'on' %}
{% set ns = namespace(total_time = 0) %}
{% for zone in states.input_number if zone.entity_id.startswith('input_number.irrigation_' ~ cycle ~ '_zone') and
zone.entity_id.endswith('_duration') %}
{% if is_state('input_boolean.irrigation_' ~ cycle ~ '_zone' ~ loop.index ~ '_skip', 'off') %}
{# Adjust for rainfall #}
{% if is_state('input_boolean.irrigation_' ~ cycle ~ '_adjust_for_rainfall', 'on') %}
{% set ns.total_time = ns.total_time * states('input_number.irrigation_rainfall_multiplier') | float %}
{% elif is_state('input_boolean.irrigation_' ~ cycle ~ '_adjust_for_temperature', 'on') %}
{% set ns.total_time = ns.total_time * states('input_number.irrigation_temp_multiplier') | float %}
{% else %}
{% set ns.total_time = ns.total_time + states(zone.entity_id) | float %}
{% endif %}
{% endif %}
{% endfor %}
I thought you'd like to know that the {{ cycle_name }} cycle has just started.
The total watering time should be about {{ (ns.total_time * 60) | timestamp_custom('%H:%M', false) }} but I'll let you know when it has finished.
{% else %}
All the {{ cycle_name }} cycle watering is done.
{% endif %}
#===================================================
#=== Notify about irrigation events
#===================================================
- alias: Irrigation Notify About Irrigation Events User2
trigger:
- platform: state
entity_id:
- input_boolean.irrigation_cycle1_running
- input_boolean.irrigation_cycle2_running
condition:
- condition: state
entity_id: input_boolean.irrigation_notify_user2
state: 'on'
action:
- service: telegram_bot.send_message
data_template:
target: !secret chat_id_sabrina
title: '*IRRIGATION SYSTEM*'
message: >
{% if trigger.entity_id == 'input_boolean.irrigation_cycle1_running' %}
{% set cycle = 'cycle1' %}
{% else %}
{% set cycle = 'cycle2' %}
{% endif %}
{% set cycle_name = states('input_text.irrigation_' ~ cycle ~ '_name') %}
{% if trigger.to_state.state == 'on' %}
{% set ns = namespace(total_time = 0) %}
{% for zone in states.input_number if zone.entity_id.startswith('input_number.irrigation_' ~ cycle ~ '_zone') and
zone.entity_id.endswith('_duration') %}
{% if is_state('input_boolean.irrigation_' ~ cycle ~ '_zone' ~ loop.index ~ '_skip', 'off') %}
{# Adjust for rainfall #}
{% if is_state('input_boolean.irrigation_' ~ cycle ~ '_adjust_for_rainfall', 'on') %}
{% set ns.total_time = ns.total_time * states('input_number.irrigation_rainfall_multiplier') | float %}
{% elif is_state('input_boolean.irrigation_' ~ cycle ~ '_adjust_for_temperature', 'on') %}
{% set ns.total_time = ns.total_time * states('input_number.irrigation_temp_multiplier') | float %}
{% else %}
{% set ns.total_time = ns.total_time + states(zone.entity_id) | float %}
{% endif %}
{% endif %}
{% endfor %}
I thought you'd like to know that the {{ cycle_name }} cycle has just started.
The total watering time should be about {{ (ns.total_time * 60) | timestamp_custom('%H:%M', false) }} but I'll let you know when it has finished.
{% else %}
All the {{ cycle_name }} cycle watering is done.
{% endif %}
Why are your Chat ID and API secrets commented out? I would assume that is why the automation is not working. Remove the # from the !secret values and then remove spaces to align properly. I do not use Telegram but looking through some documentation, this appears to be the way it should be configured.
configuration.yaml
# Example configuration.yaml entry for the Telegram Bot
telegram_bot:
- platform: polling
api_key: !secret telegram_api_token
allowed_chat_ids:
- !secret telegram_chat_id
# Example configuration.yaml entry for the notifier
notify:
- platform: telegram
name: Roberto
chat_id: !secret telegram_chat_id
- service: notify.Roberto
data_template:
title: '*IRRIGATION SYSTEM*'on```
on /config/packages/Garden Irrigation/irrigation_notifications.yaml and now give one error.
Package irrigation_notifications setup failed. Component action Integration 'action' not found.
Is it all on one line like that or did your formatting get off during the copy and paste? It cannot all be on the same line. You need to format it properly. Here is an example of my automation but with the service changed to what you would need.
alias: Irrigation Notify When Cycle Starts Or Stops
trigger:
- platform: state
entity_id:
- input_boolean.irrigation_cycle1_running
- input_boolean.irrigation_cycle2_running
condition:
- condition: state
entity_id: input_boolean.irrigation_notify_user1
state: 'on'
action:
- service: notify.Roberto
data_template:
title: '*IRRIGATION SYSTEM*'
message: >
{% if trigger.entity_id == 'input_boolean.irrigation_cycle1_running' %}
{% set cycle = 'cycle1' %}
{% else %}
{% set cycle = 'cycle2' %}
{% endif %}
{% set cycle_name = states('input_text.irrigation_' ~ cycle ~ '_name') %}
{% if trigger.to_state.state == 'on' %}
I thought you'd like to know that the {{ cycle_name }} has just started.
The total watering time should be about {{ (states('sensor.irrigation_' ~ cycle ~ '_duration_in_seconds') | int / 60) | int }} minutes but I'll let you know when it has finished.
I hope you're having a lovely holiday!
{% else %}
All the {{ cycle_name }} watering is done.
{% endif %}
That file stays there. i do not think your “action” should be script.notify.Roberto though. According to the telegram docs I saw, you should only need notify.Roberto as an action.
Does anyone know how to delete this completely? I’ve tried to delete all the files & config lines, but still the automations are there & can’t get rid of them. send help plz!
Good evening everyone, I tried to replace the new release with the old one but I couldn’t get it to go … so I put the old one back up but it has a problem with the manual start and stop and that is it gives me this error:
Fallita chiamata a servizio script/irrigation_cancel_irrigation . not a valid value for dictionary value @ data[‘entity_id’]