Turn on water pump on sprinkler activation

Trying this automation to turn on the water pump when one of the sprinklers is turned on (either switch.riego_zona_1 or switch.riego_zona_2), but it doesn’t work… any clues?

- id: '1606315842764'
  alias: Some alias
  description: 
  trigger:
  - platform: state
    entity_id: switch.riego_zona_1
    from: 'off'
    to: 'on'
  - platform: state
    entity_id: switch.riego_zona_2
    from: 'off'
    to: 'on'
  condition: []
  action:
  - condition: state
    entity_id: switch.bomba_riego
    state: 'on'
  mode: single

I also tried with only one sprinkler, like so:

- id: '1606315842764'
  alias: Some alias
  description: 
  trigger:
  - platform: state
    entity_id: switch.riego_zona_1
    from: 'off'
    to: 'on'
  condition: []
  action:
  - condition: state
    entity_id: switch.bomba_riego
    state: 'on'
  mode: single

Same outcome.

The action is incorrect. Change it to this:

  action:
  - service: switch.turn_on
    entity_id: switch.bomba_riego
1 Like

:man_facepalming:

Thanks!

1 Like

No problem and Happy Cake Day to you! :cake:

1 Like

Haha, thanks! :raised_hands: