I have got a relay hooked up to my raspberry pi connected to some water valves in my garden. Now I would like only be able to only turn on one switch at a time.
Only idea I had was to have an automation that instantly turns off the switch if there is another one turned on already. Problem is the switch is on for about a second before turning off again.
Does anyone have a better solution for that?
Heres the automation I came up with:
automation:
- alias: Switch 1
trigger:
platform: state
entity_id: switch.switch1
to: 'on'
condition:
condition: or
conditions:
- condition: state
entity_id: switch.switch2
state: 'on'
- condition: state
entity_id: switch.switch3
state: 'on'
action:
- service: homeassistant.turn_off
entity_id: switch.switch1