This is not how power works

Here is an example of what the History Graph card shows on my dryer’s power draw:

Note that diagonal line. That’s as if it gradually increases in power draw over the course of about a day. But that’s not what actually happened. During that diagonal line, power draw was actually at 0W, and at the end it had jumped to 100W.

I guess from the History Graph’s point of view, there is missing data and it’s attempting (badly) to interpolate steps in between. But when I go into the history for this entity, it shows the data points correctly:

So it’s almost like the History Graph is (incorrectly) assuming 0W to be “missing data” or something.

Hypothetically, if the meter was genuinely unreachable, which wasn’t the case, even then this bad attempt at interpolation wouldn’t make sense. Maybe it would for something like a light sensor, but power draw doesn’t work like that. If the power meter is unplugged, and unreachable, its connected device can’t possibly draw any power. Because, you know, it’s unplugged.

But I digress, none of that is the case. The power meter was functioning perfectly fine the whole time. It’s just the graph that’s making it look weird and incorrect.

I could be wrong and I’m sure my answer will be unhelpful but I think that is the intended behavior of the graph. I’m not saying it’s right. I’m saying that’s the way HA intends it to work.

I think…

Could be. Like I said for a light sensor it does make sense. Because what it is sensing, “continues on” even when there’s no data, and usually has a gradual gradient, for example when measuring sunlight intensity. But for power, this cannot be the case, for power meters that sit in line with the thing they’re measuring.

So maybe the intention was right for certain types of data, but not for others.

If this truly is intended behaviour, and I can imagine it might be, then perhaps an option is in order to switch “no data” and zero-measurements to be equivalent or not.

Otoh, I feel the graph should not actually try to interpolate anything, but rather just display what it knows. I mean if there’s no data, there’s no data, and you won’t be fooled into thinking your sensor did any measuring there, when it didn’t.

I’m sure is a quirk of the logarithmic plot, given that log(0) is undefined/-infinity.

If you turn off log scale it will draw as you expect. I’ve seen a few open issues about log scales, I don’t know if they’ll be addressed or not, but generally 0 is not a good value for a log plot.

3 Likes