Irrigation delay when it's raining

Hey everyone, so i am quite new to this and quite enjoy home assistant. Now I wanted to make an automation, that when the weather service reports rain above 5mm (not fixed yet), the irrigation programm get’s stopped.
I am sure there are better ways to do this, but i also want to understand why it’s not working.
I did this in the UI, not in yaml but anyways, here is the automation i came up with, sadly it doesn’t work, it never get’s triggered, what am i doing wrong here?

thanks everyone!

alias: RainDelay
description: ""
triggers:
  - type: precipitation
    device_id: 9cafed4b07f63e84167e4f53aabf0938
    entity_id: d7e7a96aedd5ad90df6b933935764f34
    domain: sensor
    trigger: device
    above: 0
conditions: []
actions:
  - choose:
      - conditions:
          - type: is_precipitation
            condition: device
            device_id: 9cafed4b07f63e84167e4f53aabf0938
            entity_id: d7e7a96aedd5ad90df6b933935764f34
            domain: sensor
            above: 5
        sequence:
          - action: switch.turn_off
            metadata: {}
            data: {}
            target:
              entity_id: switch.enable_program
      - conditions:
          - type: is_precipitation
            condition: device
            device_id: 9cafed4b07f63e84167e4f53aabf0938
            entity_id: d7e7a96aedd5ad90df6b933935764f34
            domain: sensor
            below: 5
        sequence:
          - action: switch.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: switch.enable_program
mode: single

Hi, welcome to the forum!

Have you checked the automation traces? (right hand upper corner while viewing/editing that automation)

Maybe try to use wait for trigger in your automation and use for trigger your condition.

yes, problem is, it doesn’t seem to get triggered when the entity changes it’s state for some reason…

Try this:

trigger: numeric_state
entity_id:
  - sensor.your_rain_sensor_here
above: 0

what exactly do you mean by that?

You can try wait for trigger action.

thanks, i worked it out i think. i changed the whole trigger from device to entity. I chose the wrong trigger for this kind of automation, so now it’s

alias: RainDelayNew
description: ""
triggers:
  - trigger: state
    entity_id:
      - sensor.wien_innere_stadt_precipitation
conditions: []
actions:
  - choose:
      - conditions:
          - condition: numeric_state
            entity_id: sensor.wien_innere_stadt_precipitation
            above: 5
        sequence:
          - action: switch.turn_off
            metadata: {}
            data: {}
            target:
              entity_id: switch.enable_program
      - conditions:
          - condition: numeric_state
            entity_id: sensor.wien_innere_stadt_precipitation
            below: 5
        sequence:
          - action: switch.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: switch.enable_program
mode: single

that does the job, i guess i just need some kind of timer or something, so that the program doesn’t just start directly after the rain, because then everything would be wet anyway…