Power Switch Energy Reporting?

How are people doing energy reporting for power switches?

In theory, I get that you can call ResetEnergy() every 1h or something, then have the device report out the energy on an hourly basis. Then you send that to InfluxDB and sum it up/graph it.

In practice, though, I'm wondering how you get the timing to work out. For example, what if you do your ResetEnergy() at :00, but the device reports energy usage at :01? There doesn't seem to be a way to set the exact minutes after the hour that the device reports energy usage.

Another way I guess to do it would be that you could have the device report energy usage every minute, and in that case if you did a ResetEnergy() at :00, then you would have the full sixty minutes, but that seems a bit chatty from a reporting perspective.

Any ideas?

Maybe I don't understand what you want, but if you want hourly energy readings why not just read it every hour and then subtract current from last reading. You can save the last reading in a local or hub variable.

2 Likes

This is how I am doing hourly and daily reporting for my plugs ( the driver does not have a ResetEnergy() custom command ) :

@adam_ca

If you're interested in doing per circuit, look at iotawatt

Thanks, yes am looking at that. For now trying per device.

@terminal3 the challenge is that I can’t figure out how to control when after the hour the device reports its energy.

@kkossev Thanks! Will take a look at that.

If you're reading back the energy from the device at set intervals, then why does when it reports have an effect. You really need to be that accurate?

1 Like

Well my power cost changes depending on the time of day, so it would be nice to align. I guess I will play around with the device (ZEN15) to see how it determines the start time for the countdown (eg unplug replug, changing the reporting time frame, etc).

That is something I have never had to deal with , since our power company uses a flat rate at all times.

You can set the time interval the Zen15 will report, but you can read it's energy setting at any time. You don't have to wait for it to report.

Thanks! Yes, you are correct in that you can poll it manually using Refresh(). So I think the solution is just to poll it at :59 after the hour, then do an EnergyReset().

As an FYI, for the ZEN15, it doesn't currently report anything less than .002 kWh for energy, which was throwing me off in some earlier testing. Also note that there needs to be at least 5 seconds between a Refresh() and an EnergyReset() to get an Energy value from the reset.

Download the Hubitat app