Making automation based on comparing two entities

However, in addition to handling the unknown and unavailable sensor problem, the template variable that I posted will be re-evaluted whenever either of the two sensors change.

Oh really? That makes A LOT of sense. I will try that as well. As for now I just changed below and above and also changed -1 to +1 because now it works the opposite way. But yes - thanks for being alerted and mentioning this fact. Someone could actually miss this.

However now at least know how it works. Actually I was even thinking about it when I was doing this automation. “Does it compare both values against each other or only first against second”. But I thought then “Well… it says if A > B so it has to compare both I guess”. Clearly I was mistaken. It compares first against second while the first one change value. Now I get it.

P.S. Which answer in this entire threat should I mark as "SOLLUTION’ now? xD

I’m apparently not bright enough to have followed all of this well enough that I tried this a few times but ended up just doing it in node red instead. I’m not great at node red but it was way too easy and had my notifications going in a few minutes.

What does this look like in visual editor? I can’t quite get there

You can’t do it strictly in visual editor. I mean you can make whole automation in editor but this part (comparing two values) has to written in YAML:

1 Like