it is like that,
that if only the first condition is not met, the entire script will probably no longer be processed.
Although the second condition is fulfilled, he probably won’t get to this point at all
looks like exactly that what you wrote…
if i change the code directly in the yaml-file looksokay…
but i think to use the visual editor is a little tricky…
No, mine only has 1 Or condition, with 2 Numeric State conditions nested underneath it. The original you posted has 2 Or conditions, each with only 1 Numeric State.
You just have to click the correct “+ Add Condition”:
Clicking the one inside the box of the Or condition makes it one of the “or”-ed tests, clicking outside the box of the Or condition creates a new box because it is a completely different condition not related to the Or.
Also, take a look at the alias/descriptions of the Or conditions. The default alias states how many conditions are being “or”-ed.
your code and @Didgeridrew’s is not the same… i’m sure he’ll explain. but i wanted to respond to i think to use the visual editor is a little tricky
if you don’t want to use the visual editor to write the code, you should still write the code inside the ui’s yaml editor.
if you really want to write raw yaml, do it in that mode. then after you write it but before you run it, switch it to visual editor mode and see if it reads like you expect… home assistant will check a bunch of things about your code, and will barf at a bunch of mistakes… catching a bunch of issues.
it would have highlighted the “or” issue you had in your code.
The last screenshoots …
is that so
thats works only if the first condition If with 2 matches (one of this have to be true) are true and the second condition have also to be true
Yes, though my main point was to show how the conditions are separated visually and that the auto-generated aliases for the condition building blocks will tell you how many conditions they are affecting. There is no good reason to have an Or condition with only 1 option.
An Or condition that only has 1 option is essentially the same as not having the Or. This was the flaw of the original post. Because they weren’t in the same Or, neither of those Or’s was doing anything…
The following are functionally equivalent
#1: from the original post:
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.temperatur_am_kronendach
above: input_number.max_temperatur_nacht
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.luftfeuchtigkeit
above: input_number.max_luftfeuchtigkeit_nacht
2:
- condition: numeric_state
entity_id: sensor.temperatur_am_kronendach
above: input_number.max_temperatur_nacht
- condition: numeric_state
entity_id: sensor.luftfeuchtigkeit
above: input_number.max_luftfeuchtigkeit_nacht
what uses what its very new for me to can see all clear
If I use If, then, else and further nest the else statement with further If queries, I can see this pretty quickly. At least it’s easier… I still have to get used to the conditions and instructions