And NOT Condition

Hello,

i have a problem. I try to build a automation for my cover. They should only open if it is not below -3° and humidity ist above 80%.

It should looks likes the boolean nand

0 and 0 = 1
1 and 0 = 1
0 and 1 = 1
1 and 1 = 0

My automation looks:

alias: Rollo Büro öffnen
description: ""
trigger:
  - platform: time
    at: input_datetime.rollo_hoch_office
  - platform: numeric_state
    entity_id: sensor.helligkeit
    above: 2
  - platform: state
    entity_id:
      - input_boolean.test_taster
    to: "on"
condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: input_boolean.rollo_auto_az_switch
        state: "on"
      - condition: not
        conditions:
          - condition: numeric_state
            entity_id: sensor.aussentemperatur
            below: -3
          - condition: numeric_state
            entity_id: sensor.rel_feuchte
            above: 80
action:
  - service: cover.set_cover_position
    data_template:
      position: |
        {% if is_state('binary_sensor.regenstatus','on') %}
          85
        {% else %} 
          100
        {% endif %}
    target:
      entity_id:
        - cover.arbeitszimmer_rollo_links
        - cover.arbeitszimmer_rollo_rechts
mode: single

This is not working. Can someone give me some tip please.

Thx
spacy

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

You only need an AND condition.

sensor.aussentemperatur is above -3 (simpler than “not below -3”)

AND

sensor.rel_feuchte is below 80 (simpler than “not above 80”).

That was my first try. But then my cover was not working.
In my opinion for a working condition it have to be 1 and 1 = 1 (-3 and 80%above) = 1 but here is the problem if it is not below -3 than the condition is not true und the cover is not moving

Is this right?

If it is not below -3 then it is above -3.

condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: input_boolean.rollo_auto_az_switch
        state: "on"
      - condition: numeric_state
        entity_id: sensor.rel_feuchte
        above: 80
      - condition: not
        conditions:
          - condition: numeric_state
            entity_id: sensor.aussentemperatur
            below: -3

the logic above will be true if “the boolean is on AND humidity is above 80 AND the temperature is NOT below -3”.

Why not use above -3?

they could but they were asking for the reason the specific logic they were using above wasn’t working. So I showed them why it wasn’t. :slightly_smiling_face:

Your way would definitely be easier to read.

when i look at your example i tells me that when the humidity is below 80% the cover will not move.
I thing i must try to explain better what my problem is.

Thing about this situation:
In the summer: why my cover shout not move if the humidity is below or above 80% humidity.
Nothing will happen if so. So if i do it like in your example the cover will only work if the humidity is below 80%. Why do so. Why my cover should not move if it is raining?

Now look at the winter time: if the humidity is below or above 80% is no problem let the cover move.
The only moment where the humidity will be a problem is when and only then, if the humidity is high, here above 80% and the temperature is below -3.

If in the winter time the temprature is low here below -3 but the humidity is dry my cover can move without problem. But if the humidity is high my cover will freeze on the button i could break.

So the only moment is :slight_smile: boolean true should be always only not if humidity above 80 and temperature below -3

NAND
above 80% and below -3 = 1
below 80% and below -3 = 1
below 80% and above -3 = 1
above 80% and above -3 = 0

i hope it was now clear what my problem is

THX

So it should only move if the humidity equals 80%?

No, i should always move only not if humidity is above 80 and temprature is below -3

:crazy_face:

sorry my english is not at its best in german i thing it would be easier to explain :wink:

when you take a look at Gatter Schütze
there you can see what i meen. In Siemens S7 it looks like there.
Compare AND,NOT NAND then i hope you understand what i need

@tom_l
Take y look at this topic i found

there is the same discussion. I will try it like there with a template.

I thing NAND in Hassio would be a nice thing and help a lot in automation problems