Hehey
I got a dashboard showing some device’s state and theri power consumption (in a gauge).
I got a design problem with my Thirdreallity plugs.
If the device is off, I see a power consumption of 0.4 to 0.7W (I suppose its the comsumption of the plug itself). I want it to be 0 if the device is powered off.
So I created a template helper with following code:
Sure, if you don’t care about the difference between unavailable and 0.
As long as you are not feeding this sensor to a Riemann sum integrator and then utility meter, then having 0 instead of unknown will not cause any issues.