[No Longer Maintained] Energy Cost Calculator

Known Issues

  • None.

To-do List

  • Update the first post (holy buckets a lot has changed).
  • Discard abnormally high energy reports.
  • Add rate scheduling.
  • Incorporate rate adjustments into cost calculation.
  • Handle holidays in rate scheduling.
  • Add option to use a virtual switch temporarily set a new rate cost (like critical rate periods).
  • Add user verification when rate value is above 1 unit (e.g. $10, €10, etc.)
  • Move advanced features to their own page.
    • Day of month selection for monthly reset
    • Reset options for the table (e.g. reset by device for day/week/month, reset all)

Feature Requests (Not Guaranteed)

2 Likes

Very nice!

2 Likes

Excellent work!
Look forward to the update with historical data.

1 Like

Shweeet. Thanks for this.

I love energy monitoring data. :nerd_face:

1 Like

Dayum.... More chill stuff.

2 Likes

I set this up and it didn't let me select any of my Iris v2 outlets, and I wondered why. They only report power, and do not collect the cumulative energy consumption in the driver state.

I know it's a different approach than you've taken in this app, but it would be nice to get this table to support any device that reports power consumption. Although maybe that's done by asking the drivers to be updated to support cumulative energy.

1 Like

Correct. Power companies calculate costs based on energy usage. Energy is power over time. Power is just a point in time reading. So, something needs to constantly read power usage while keeping track of time to accurately calculate energy usage. I don't think that'll be feasible in an app.

1 Like

I thought a good approximation could be done by the app subscribe to power reports from the device and having a energy accumulator for each device. When the power value changes, it would add (power * delta_time) to the energy accumulator. Similarly, the table would show the (accumulator + power * delta_time) when displaying the table.

That was how I initially thought this app was going to work.

But, that's a complication, and perhaps a different app!

2 Likes

That could, and probably would, result in wildly inaccurate results. Easiest scenario to highlight the challenge would be the power meter plug on my dryer. I have it set to report power changes of >500W to cut down on spamming the z-wave mesh. Here's some reporting from a cycle last night.

2022-12-29 00:10:11.662	 6218
2022-12-29 00:07:41.661	 545

So, during that three minutes, did we use .3 KWH or .027 KWH? Stack that over a day/week/month and you can see how the problem would compound very quickly.

1 Like

If you wanted the app to compute a reasonable approximation for energy usage on a particular device, you'd want to not use high values on those devices.

Do any of the device handlers already use this sort of algorithm internally? E.g., my Aeotec Smart Energy Switches (which show up here) have a setting for Minimum Watts Change Report value. Does that affect the energy value it reports? Is it computed in the device and reported, or is it computed in the device handler? There's no way I can see to reset it, for instance.

1 Like

"It's a Christmas Miracle" I am blown away by the talent of our staff/users/developers. Almost every visit here I see another piece of functionality, that makes HE even better.
Thanks to all !

5 Likes

From what I can tell with the Aeotec Heavy Duty Smart Switch, Zooz ZEN15, and Kasa plugs that I have, energy is calculated on the device itself. I even wrote a small app that would let me reset the energy value for any device. All of them just go back to their previous reading with the next update.

1 Like

How well would this work with iotawatt or is it fairly device agnostic?

1 Like

As long as it reports energy, it'll work with the app.

1 Like

Sneak peak:

I'm still doing some testing around scheduling readout resets and what-not. My plan is to add cost columns for this week and this month along with the option to also set those to a hub variable. Also need to run back through the changes I've made over the last few days to better write some of the logic.

5 Likes

@FriedCheese2006,
Thanks for this. I am not sure why the readings for my Tasmota plugs are not being populated?
I've just tested the plugs in Home Assistant and the data populate fine in your table.

Table

Computer status in HE

image

Exercise Machine status in HE

image

1 Like

The driver directly in HE is not setting the normal attribute of "energy" but is using a non-standard attribute of "energyToday" instead. I presume when you bring the same data over from HA, it's using the "energy" attribute like normal. I would suggest asking the driver author to update the driver to use the standard energy attribute or you can edit it yourself.

1 Like

Version 0.2.1 Released

  • Significant UI Overhaul - created a new page for linking the cost data to hub variables; complete with it's own table. Updated color coding to hopefully make the data easier to read (feedback is welcome here).

Ignore the negative values; the issue causing those has been fixed (like 90% sure)


  • Historical data - added tracking of energy usage over the current/past week and current/past month. Variable options have been added to allow linking the costs for 'this week' and 'this month' per device along with totals.
3 Likes

If it works for my tuya zigbee 3.0 plugs I'll be ecstatic. Have been fighting the electric company for ages and have proved they're overcharging me by 10% at least. Fun since also fighting breast cancer and fibro.
How'd you manage to get a black background, the white fries my eyes and its more power hungry on a lot of phones.
Incidentally has anyone else had outlets switching themselves off for no discernable reason? Two were running a fridge and freezer amongst other things, but the third is running reptile lights and two hubs.. Doesn't happen with the same plugs on Shartlife

Thanks for all the work. If it works with my gear it'll be absolutely perfect.

Rosie.

1 Like

From Chrome on desktop, I use an extension called "Dark Reader" mainly because it has a quick toggle for bouncing between dark and light.

If you use Chrome for mobile, you can go to "chrome://flags/", search for dark, and force enable it: