Automation triggered without the conditions being met

Hello community,

I have created an Automation that switches on the underfloor heating pump when at least one of the thermostats is switched on.

My problem is that this automation always executes (and thus the pump is turned on), despite the fact that not all conditions are met.

When I test the conditions I get the message: “Condition not met”…

In summary, the script below executes the following (every 2 minutes):
WHEN
pump is off
AND
thermostat1 is on OR thermostat2 is on OR thermostat3 is on
THEN
turn on pump

Any help would be greatly appreciated🙏

alias: Turn on floor heating pump
description: ""
trigger:
  - platform: time_pattern
    minutes: /2
    hours: /1
condition:
  - condition: and
    conditions:
      - condition: device
        type: is_off
        device_id: f34600f3ee4d36b1afdf96f33524f995
        entity_id: 93afc0ded26f48afea759f88f590f988
        domain: switch
      - condition: or
        conditions:
          - condition: device
            type: is_on
            device_id: f34600f3ee4d36b1afdf96f33524f995
            entity_id: d26d9d36b3a40fc1eb6633c1dd28115b
            domain: switch
          - condition: device
            type: is_on
            device_id: f34600f3ee4d36b1afdf96f33524f995
            entity_id: ec3e35c1bb5d64e3c2993f6a28265669
            domain: switch
          - condition: device
            type: is_on
            device_id: f34600f3ee4d36b1afdf96f33524f995
            entity_id: 47ab121d8d364527b44961ea0b484a41
            domain: switch
          - condition: device
            type: is_on
            device_id: f34600f3ee4d36b1afdf96f33524f995
            entity_id: d807daa32572f0e05f6663adb1137ef7
            domain: switch
          - condition: device
            type: is_on
            device_id: f34600f3ee4d36b1afdf96f33524f995
            entity_id: b8a0509bb2b673a6b1753fde8f284b7c
            domain: switch
          - condition: device
            type: is_on
            device_id: 6a7976bfdd5e7b1854172d413afd1e53
            entity_id: 4afea60030dfe300a1f11284c0e13d24
            domain: switch
action:
  - type: turn_on
    device_id: f34600f3ee4d36b1afdf96f33524f995
    entity_id: 93afc0ded26f48afea759f88f590f988
    domain: switch
mode: single

If you check the traces on the automation last time it triggered unwanted you will probably see why it triggered.

Yes, I test it from within the automation editor:

All states are switched off (the pump and the 3 thermostates)

I’m also curious about your solution with the state trigger.

You saw that well😄. Actually there are even more than 6 thermostats (13 pieces), but I tried to keep it simple. Apparently I didn’t succeed in this🤦‍♂️

So far I understand. I would therefore expect the pump not to be turned on.

However, the pump is switched on even though the conditions are not met.

If the conditions are also skipped when running manually, then I completely understand.

I think I have now also made the solution correctly with state triggers as you suggested. This is indeed a better option for switching on the pump (one of the thermostats must be on).

But what is the best way to make a circuit for turning off the pump (all thermostats must be turned off)?

alias: Turn on underfloor heating pump
description: ""
trigger:
  - platform: device
    type: turned_on
    device_id: f34600f3ee4d36b1afdf96f33524f995
    entity_id: d26d9d36b3a40fc1eb6633c1dd28115b
    domain: switch
  - platform: device
    type: turned_on
    device_id: f34600f3ee4d36b1afdf96f33524f995
    entity_id: ec3e35c1bb5d64e3c2993f6a28265669
    domain: switch
  - platform: device
    type: turned_on
    device_id: f34600f3ee4d36b1afdf96f33524f995
    entity_id: 47ab121d8d364527b44961ea0b484a41
    domain: switch
  - platform: device
    type: turned_on
    device_id: f34600f3ee4d36b1afdf96f33524f995
    entity_id: d807daa32572f0e05f6663adb1137ef7
    domain: switch
  - platform: device
    type: turned_on
    device_id: f34600f3ee4d36b1afdf96f33524f995
    entity_id: b8a0509bb2b673a6b1753fde8f284b7c
    domain: switch
condition:
  - condition: device
    type: is_off
    device_id: f34600f3ee4d36b1afdf96f33524f995
    entity_id: 93afc0ded26f48afea759f88f590f988
    domain: switch
action:
  - type: turn_on
    device_id: f34600f3ee4d36b1afdf96f33524f995
    entity_id: 93afc0ded26f48afea759f88f590f988
    domain: switch
mode: single

I think I changed it to a state trigger correctly. Thank you in advance for your feedback and for the pump shutdown automation

alias: Turn on underfloor heating pump v2.0
description: ""
trigger:
  - platform: state
    entity_id:
      - switch.vloerverwarming_verdeler_begane_grond
      - switch.vloerverwarming_verdeler_begane_grond_2
      - switch.vloerverwarming_verdeler_begane_grond_3
      - switch.vloerverwarming_verdeler_begane_grond_4
      - switch.vloerverwarming_verdeler_begane_grond_5
      - switch.vloerverwarming_verdeler_verdieping
      - switch.vloerverwarming_verdeler_verdieping_2
      - switch.vloerverwarming_verdeler_verdieping_3
      - switch.vloerverwarming_verdeler_verdieping_4
      - switch.vloerverwarming_verdeler_verdieping_5
      - switch.vloerverwarming_verdeler_verdieping_6
      - switch.vloerverwarming_verdeler_zolder
      - switch.vloerverwarming_verdeler_zolder_2
    from: "off"
    to: "on"
condition:
  - condition: state
    entity_id: switch.vloerverwarming_verdeler_begane_grond_6
    state: "off"
action:
  - type: turn_on
    device_id: f34600f3ee4d36b1afdf96f33524f995
    entity_id: 93afc0ded26f48afea759f88f590f988
    domain: switch
mode: single

A switch group might be helpful here to avoid the repetition.

1 Like

Using a group seems to me to be an excellent idea, but the group doesn’t quite work.

The group does switch on as soon as one of the thermostats switches on, but switching off the group does not work. When the last thermostat switches off, the group remains switched on. The only way to disable the group is manually.

(the option “all entities” in the group is switched off)

I later discovered that the pump itself was also part of the group by mistake. Of course that wasn’t my intention.

Once I removed the pump switch from the group it worked like a charm!

Thanks for all the help @123 and @Troon :pray:t2:

1 Like

Not sure where that assumption is coming from. Your example above is the only one using the switch group, so I’d assume it’s that being used and it’s working fine after removing the pump switch from the group, which was causing a circular reference of sorts.

Your assumption is incorrect.

The solutions offered by you and @Troon are very elegant and efficient.

So I use both the Group solution and the automation based on the Group.