#other logical operations than AND in if-then-else

1 messages · Page 1 of 1 (latest)

ancient dome
#

I have an automation that looks like this (truncated for clarity):

alias: climate_lueftung_kueche
description: ""
triggers:
  (some stuff)
conditions: []
actions:
  - if:
      - condition: and
        conditions:
          - condition: state
            entity_id: binary_sensor.terrassentur_kuche_offen
            state: "off"
          - condition: state
            entity_id: binary_sensor.fenster_kuche_offen
            state: "off"
    then:
      (do stuff)
    else:
      (do other stuff)

What else can go in the condition stanza? could I have a - condition: or instead? What else would work? Is there an nand? nor? xor?

heavy socket
#

A xor B = (A or B) and not (A and B)
I'm sure you can figure out nor and nand

ancient dome
#

So you are saying I have to nest an or into a not, I can't have an explicit nor?

heavy socket
#

Correct

#

Those 3 are the only options

proud inlet
#

Also worth noting that in the original example there is no need for the and logic. The and logic is only useful when nested underneath or or not

ancient dome
#

Don't worry, I can do Boole maths if you drag me out of bed drunk at three in the morning. Since the above example treats the entities as pure boolean entities (which they are not) I want to do a nand flip to account for unavailable ones.