Conditions in summary true while one of them is rated false

Hi there,

Tried to set up a lawn mower automation that should only be executed when there was no rain within the past 12 hours:

[… AND he did not mowe within the past three days at least 9 times (3 mowing-periods per day) AND it’s not raining now.]

condition:
  - condition: and
    conditions:
      - condition: numeric_state
        entity_id: sensor.wetter_rain
        below: 0.1
      - condition: numeric_state
        entity_id: sensor.seppls_vergangene_3_tage
        below: 9
      - condition: not
        conditions:
          - condition: state
            entity_id: sensor.wetter_condition
            state: rainy
            for:
              hours: 12

Last night it was rainy, and this morning as automation should have been executed the rainy state within the past 12 hours was detected correctly, although conditions in summary resulted true:

Executed: 4. Juli 2023 um 07:10:00
Result:

result: true

## conditions/0

Executed: 4. Juli 2023 um 07:10:00
Result:

result: true

## conditions/0/entity_id/0

Executed: 4. Juli 2023 um 07:10:00
Result:

result: true state: 0

## conditions/1

Executed: 4. Juli 2023 um 07:10:00
Result:

result: true

## conditions/1/entity_id/0

Executed: 4. Juli 2023 um 07:10:00
Result:

result: true state: 7

## conditions/2

Executed: 4. Juli 2023 um 07:10:00
Result:

result: true

## conditions/2/conditions/0

Executed: 4. Juli 2023 um 07:10:00
Result:

result: false

## conditions/2/conditions/0/entity_id/0

Executed: 4. Juli 2023 um 07:10:00
Result:

result: false state: cloudy wanted_state: rainy

How can that be?

Any help would be highly appreciated,
Thank you!

For this to be true (so the “not” makes it false) the state right now must be rainy, and it must have been that way continuously for at least 12 hours.

Post the sensor history graph beginning at 7:10 am and going back 12 hours.

Okay, obviously I am missing sth - sorry.

Shouldn’t it be false ?? My (confusing ?) logic:

Past 12 hours: rain => state: rainy => condition true => as it should be not => condition should not be passed => actions should not be run!

Sorry for the confusion… :grimacing:

Look what I quoted. Just the bit inside the NOT condition.

I see, thank you Tom! :slightly_smiling_face:

But it still don’t get why the condition is passed then? Does the for-part mean it has to rain continuously including the trigger moment??

And if so, would a history stats sensor like this solve the problem:

sensor:
- platform: history_stats
  name: Regen in den letzten 12 Stunden
  entity_id: sensor.wetter_condition
  state: "rainy"
  type: count
  start: "{{ now() - timedelta(hours=12) }}"
  end: "{{ now() }}"

In addition with:


condition:
  - condition: and
    conditions:
      - condition: numeric_state
        entity_id: sensor.wetter_rain
        below: 0.1
      - condition: numeric_state
        entity_id: sensor.seppls_vergangene_3_tage
        below: 9
      - condition: numeric_state
        entity_id: sensor.regen_in_den_letzten_12_stunden
        below: 1

Please do this:

Thank you very much - worked fine!

That was a request for more information not an answer. What did you find when you looked at the history?