Basic Automation Help

I’m new to HA and am trying my first automation, which is trying to control the solar heating for my pool. I have a sensor in my pool to measure its temperature and one on my roof to test its temperature. I have it so the pool heating pump turns on when the roof temperature is greater than or equal to the pool temperature and turns off when it is below. I am also trying to have it turned off if it reaches a preset condition. I have tried doing this by adding an OR condition, but it does not seem to fire. Can anyone advise as to where I’m going wrong?

alias: Turn off Pool Heating
description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.gw2000c_temperature_1
    above: sensor.gw2000c_soil_temperature_1
conditions:
  - condition: or
    conditions:
      - condition: numeric_state
        entity_id: sensor.gw2000c_temperature_1
        above: 31
    enabled: true
actions:
  - type: turn_off
    device_id: 2ab2c5c38e9fef64c1ae3f484e65a93c
    entity_id: a175ed1d2e99b22ddc0285ef6ad11957
    domain: switch
mode: single

Thanks in advance.

That’s not how automations work. Conditions aren’t checked until after a trigger fires.

Add it as an extra trigger rather than a condition. Trigger’s are OR logig, so if either trigger fires the pump will turn off.

You can add it as a condition to your turn on automation to prevent it turning on.

Thanks, I will try that.