irrigation_unlimited
irrigation_unlimited copied to clipboard
Question: how do I control an engine valve
Have motorized valves for irrigation. In Homeassistant they are set up as covers. How can I control these devices (e.g. entity: cover.ventil001) with Irrigation Unlimited? Control attributes are 'open', 'close', 'stop'(typical for covers in homeassistant) .
Thanks
Create an automation that tracks the sensor (binary_sensor.irrigation_unlimited_c1_z1 for example). When it changes make a service call to the cover.ventil001 entity. You can control any using this technique. This is untested but it will go something like this:
automation:
- alias: Irrigation Unlimited Cover Control
trigger:
platform: state
entity_id:
- binary_sensor.irrigation_unlimited_c1_z1
action:
service: >
{% if trigger.to_state == 'on' %}
cover.open_cover
{% else %}
cover.close_cover
{% endif %}
target:
- cover.ventil001
Let me know your final work as it would be good to publish it in the documentation for others in this situation.
Many thanks for the answer. I've only now come to test the proposal. The following automation with the "Pforte" motorized valve works in my test environment:
alias: rTestIrrigation
description: Testumgebung
trigger:
- platform: state
entity_id:
- binary_sensor.irrigation_unlimited_c1_z1
condition: []
action:
- service: |-
{% if trigger.to_state.state == 'on' %}
cover.open_cover
{% else %}
cover.close_cover
{% endif %}
entity_id: cover.ventilp_179_cover_1
mode: single
That's a workable solution.
For the test, I set up a switch to control a solenoid valve. My configuration.yaml:
...
irrigation_unlimited:
controllers:
- name: "Wasser"
zones:
- name: "Pforte"
entity_id: "cover.ventilp_179_cover_1"
schedules:
- time: "08:00"
duration: "00:20"
- name: "Test"
entity_id: "switch.bre_et125"
schedules:
- time: "08:00"
duration: "00:20"
...
The valve test should be switched on at 8:00 for 20 minutes. But, switch.bre_et125 comes on at 8:00 only for about 15s. The status of the related entity 'binary_sensor.irrigation_unlimited_c1_z2' goes On at 8:00 and Off at 8:20. What is wrong?
Remove the entity_id: "cover.ventilp_179_cover_1"
line, the automation should be driving this. What is the underlying switch.bre_et125
and can you drop it on a button card and control it from there?
irrigation_unlimited:
controllers:
- name: "Wasser"
zones:
- name: "Pforte"
schedules:
- time: "08:00"
duration: "00:20"
- name: "Test"
entity_id: "switch.bre_et125"
schedules:
- time: "08:00"
duration: "00:20"
Many thanks for the quick response. I adjusted my configuration.yaml as indicated.
For Irrigation Unlimited I installed the HACS frontend.
This allows me to control the "Pforte" motorized valve very well via the automation.
The "Test" valve (switch.bre_et125) is also only activated for approx. 15s here. The status of the related entity 'binary_sensor.irrigation_unlimited_c1_z2' goes On for e.g. 2 minutes. switch.bre_et125 is a Sonoff WiFi switch for switching a solenoid valve.
I have a number of Sonoff zigbee switches and get the same result when there is a communication problem. HA sends the signal to the device and displays it as 'on' but fails to receive a response after about 15 seconds and then displays it as 'off'. There is usually a corresponding message in the log.
Add an entities card like this and see if it does the same thing.
type: entities
entities:
- switch.bre_et125
title: Test switch
Sorry -.-" forget the 15s problem. In my Sonoff (Tasmota) a Pulsetime=15 was set. Now he does what he should.