How to use two triggers at the same time? - Trigger1 AND trigger2 -

I am new to HA and struggle to set up a quite simple automation, hope someone can help me please :slight_smile:

The automation is like this:
When “Buffertank” temperature sensor is higer than 65C AND “Brugsvand” temperature sensor is lower 58C Then “Actions”

My Yaml file:

alias: "Opvarme brugsvand fra buffertank "
description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.buffertank_temp_top
    above: 65
conditions:
  - condition: numeric_state
    entity_id: sensor.shellyplus1_2cbcbb2ffb90_temperature_5
    below: 58
actions:
  - type: turn_on
    device_id: 12eb8b911d881b0c09501dc6902ce83b
    entity_id: c22e20a023dbb51010e6467cdda0e31c
    domain: switch
  - type: turn_off
    device_id: 6875e235cfcb6b90b0c07a4c5f6cbc7f
    entity_id: 88dc5243d71893ce4f6f04db01768603
    domain: switch
mode: parallel

Hello olejens,
Welcome to the HA Forum!

Thanks for coming here and asking a question.

Would you be so kind as to adjusting the format of your code so that we can read it properly & check the YAML spacing, etc. Editing your original is the preferred way. It is very hard for us to tell what is what when the text formatter jumbles everything like that.

Use the </> button or this:
Here is an example of how to fix it from the site FAQ Page.
How to help us help you - or How to ask a good question.

You need to have both the 65 an 58 entities as trigger and both of them as condition also.

I am totaly new in this an not a programmer… is it posible you can explain a bit more pls… ? :slight_smile:

You only have two entities tank and brugsvand.
Those are the two entities, put them both as trigger and both as condition.

If you post the automation correctly formatted then me or someone else will edit your code.
But I’m not going to edit a code that is that much work to fix

Now is the code correctly formattet :slight_smile:

Is it what you mean? :slight_smile:

alias: "Opvarme forbrugsvand fra buffertank "
description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.buffertank_temp_top
    above: 65
  - trigger: numeric_state
    entity_id: sensor.shellyplus1_2cbcbb2ffb90_temperature_5
    below: 58

conditions:
  - condition: numeric_state
    entity_id:
      - sensor.buffertank_temp_top
    above: 65
  - condition: numeric_state
    entity_id: sensor.shellyplus1_2cbcbb2ffb90_temperature_5
    below: 58
actions:
  - type: turn_on
    device_id: 12eb8b911d881b0c09501dc6902ce83b
    entity_id: c22e20a023dbb51010e6467cdda0e31c
    domain: switch
  - type: turn_off
    device_id: 6875e235cfcb6b90b0c07a4c5f6cbc7f
    entity_id: 88dc5243d71893ce4f6f04db01768603
    domain: switch
mode: parallel

Yes that is clrrect

Thank You! :slight_smile:

1 Like