Thanks Petro. OK if that is how HA works. I was hoping for some workaround or guidance on how to sum two energy sensors “correctly” when I have two power inputs. I can’t believe I am the only one in this situation.
PS: Would it make sense put in a suggestion for an OR-function for the availability sensor to the good people at HA HQ - and where to do so?
You can sum 2 sensors w/ the group sensor in the UI without template sensors. It will have the same behavior. You want unavailable states because you don’t want fake states in your calculation. If the source is bad, then the result should be bad. You aren’t the only one who wants the ‘bad’ values to persist. But typically people only want that for their UI, not calculations.
Thinking this trough again. I would often have the situation where one sensor is zero (not bad) and the other also having a valid number (not bad). Would the availability sensor accept zero as “available”? If so I think I can use the availability sensor as is actually.
0 is not unavailable. The only reason you were getting 0 above is becuase you were using float(0) which defaults the value to 0 when the source is unavailable.
It looks like the availability sensor is working. No strange jumps this night/morning although I can see that the inverter has been offline. Thank you guys!
One little supplemental question since you find my setup so inventive … would you use " | min | abs " or the " if-function " in this case? The sensor delivers both positive and negative values. I only want the negative values and then I want to turn them into positive values. Which is less Rube Goldberg? Thanks!