Thanks! I’ll apply your update.
Something else I’ve noticed is that the API doesn’t always cleanly. Could be something local (DNS on my network or whatever) but I think what I want to do is, in the event that 0 is returned by the wholesale sensor, make the applied rate sensor whatever my cap value is.
That or retain yesterdays number using this sort of code.
[Sensor: If "not available" occurs keep the previous value - #4 by Troon]
I’m thinking I’d rather air on the side of overcosting and go with the cap though.