Automation doesn't switch off

Hello everyone,

i’m desperately trying to create an automation that timer switches on a pump and switches it off again after a few seconds.
Switching on always works fine at the set time, but unfortunately the automatic switching off does not.
The pump can also be switched on and off manually without any problems.

This is my automations.yaml file:

- id: '1596196203519'
  alias: Hochbeet_Bewaesserung
  description: ''
  trigger:
  - at: '14:51'
    platform: time
  condition:
  - below: '500'
    condition: numeric_state
    entity_id: sensor.feuchtigkeit_1_2
  - below: '500'
    condition: numeric_state
    entity_id: sensor.feuchtigkeit_2_2
  - below: '500'
    condition: numeric_state
    entity_id: sensor.feuchtigkeit_3_2
  - above: '20'
    condition: numeric_state
    entity_id: sensor.tank_fullstand_2
  action:
  - data: {}
    entity_id: switch.pumpe_2
    service: switch.turn_on
  - delay: 10s
  - data: {}
    entity_id: switch.pumpe_2
    service: switch.turn_off

Does anyone have any ideas?

That is not valid. If you had looked at the logs you would have seen an error.

A 10 second delay can be done any of these ways:

- delay: 10
- delay: "00:00:10"
- delay:
    seconds: 10
2 Likes

All right! Perfect, now it works.
Thank you!

I created the sequence with the automations editor and thought there would be a check when I entered it.