Utility meter from a number

I want to create a utility meter from a number.

The reason for this is that the entities are dumb wall panels working from zigbee fused switch units. There is no sensor available to report a kWh reading.

To counter this I’ve created a number template which will return 1500 when the switch is on, and 0 when the switch is off… so far, so good.

However, when I go to the utility meter helper, it refuses the number.office_heater and insists that I use a sensor.

I want to do this via GUI. Any suggestions please, or will I have to revert to configuration.yaml editing?

Use this instead: Powercalc - Virtual power sensors

Thanks. I’ll look into that. I was trying to get it working in native HA, however.

This constant value while on sounds like power not energy. Energy increases with time on.

You can not feed power to a utility meter, only energy.

There are probably a few ways around this but none as easy and well thought out as powercalc.

1 Like

I do this - kind of, but for production instead of consumption - with a two-step approach

1
I use an integral helper sensor to convert the power production of each one of my solar panels from current W to lifetime kWh with this appraoch:

Instead of my power input ‘Panel D’ you’d use you ‘fixed number’ sensor.

2
I take utility meter helpers to turn it into hourly and daily resetting values:

Note:

  1. I think I read somewhere that some folks recommend either a Left Riemann Sum or a Right Riemann Sum (I forgot which one, though) - but I’d set up my sensor already so I didn’t bother to change it.
  2. My production sensors only update every 5 minutes, so the value is about 3% off from why I see on my solar provider’s web view (but because I can’t download/API it from there I had to re-create it myself) - if your assumption of 1500 (W, I assume) is good, the delta to the real value should be miniscule.

That is not going to help. They don;t have an actual power sensor. Even if they change their fake power sensor to a template sensor instead of a template number it will only update when the switch is turned on or off. Leading to large approximation errors.

Agree, that the result will only be as good as the initial estimate of the power usage.
If 1500W is spot on then the result will be fine, if not then not.

I used a guesstimate for my AC power consumption before I had CTs on the circuits.
Was it great? No!
Was it better than nothing? Definitely!

No it won’t. The integral sensor only updates when the source sensor updates. Which is only when the switch turned on or off. This will introduce large errors.

Imagine if this only updated once a day. Like the switch case above.

Thanks very much. I managed to put something together. Not how it should be used, but it works for me.
https://msknight.com/ha/heating-5.html