HA-Irrigation-Version2
HA-Irrigation-Version2 copied to clipboard
Feature Request - General valve switch added
hi meanwhile, congratulations for the product, I need to add a switch for a general solenoid valve upstream of the irrigations thx Tiziano
Way back when I first wrote this I also had a Sonoff as a master switch. Is that what you mean?
I removed it before I released the code (I think) because I decided I had enough failsafe controls without the need for it.
Hi , yes I mean this Thx Tiziano
hi meanwhile, congratulations for the product, I need to add a switch for a general solenoid valve upstream of the irrigations thx Tiziano
You could simply add a separate automation, triggered by the state-change of the downstream valves. :)
HI
HI Could I have more information about it? Thx Tiziano
@tizianojeje Actually having a think about it, I would suggest you create a templated switch consisting of all of the different switches (valves) you wish to control in one action. (A bit like having multiple lights controlled by one switch, even though each one is individually controllable).
Then you control the 1 templated switch from Kloggy's code, which would then activate as many valves simultaneously as you need.
This way, no changes are required to Kloggy's code.
E.G.
switch:
- platform: template
switches:
valve1:
turn_on:
- service: switch.turn_on
target:
entity_id: switch.valve1_downstream
- service: light.turn_on
target:
entity_id: switch.valve1_upstream
turn_off:
- service: switch.turn_off
target:
entity_id: switch.valve1_downstream
- service: light.turn_ff
target:
entity_id: switch.valve1_upstream
valve2:
turn_on:
- service: switch.turn_on
target:
entity_id: switch.valve2_downstream
- service: light.turn_on
target:
entity_id: switch.valve2_upstream
turn_off:
- service: switch.turn_off
target:
entity_id: switch.valve2_downstream
- service: light.turn_ff
target:
entity_id: switch.valve2_upstream
@kloggy, may recommend closing this as resolved? Perhaps adding it to a Q&A if you have one?