[No Longer Maintained] Energy Cost Calculator

I can try, but I'm not hopeful. :smirk:

1 Like

Version 0.3.7 Released

Added an option to the "rate schedule" page to configure which day of the month the monthly reset will run.

@terminal3

Ok thanks, I just set it up we will see how it goes.

I just realized, however, that my setup may be a problem for your app. I assume your program does not reset the energy values of the devices. I know from my own setup that different devices use different commands to do that, and I assume you can't pull that from the device info .

At 00:05 on the 28th I reset all energy values. I graph daily, weekly, monthly energy levels for my whole house and monthly energy levels for individual devices that are on energy reporting devices.

How will resetting energy values effect your calculations?

1 Like

Just opened up the app to take a look and see what it showed and the cost for the freezer seems a bit off.

1 Like

Long story short....no problem. The app has code to handle the energy value being reset. I ended up writing it in because of your scenario. I have a number of Kasa plugs that the driver code resets the energy at the beginning of the day but other plugs that never reset unless done manually. The app can handle either situation.

Basically...I have a variable to capture the energy value at day start. If the energy reading for the device drops below that during the day, then I assume the energy reading has been reset and set that variable to 0. Since the cost is calculated based on how much the energy changed, it should be unaffected.

1 Like

Was this one setup today? Can you enable trace logging, do a refresh, and show the logs?

Here you go.

The info entry from 7:53 was before I turned on logging. That was when I entered the new reset date. When I opened the menu to update rate information I entred a new reset date. I then noticed the Energy Rate value was blank so I thought I needed to enter it again. So I re-entered the same value and saved it. Perhaps that is what caused the issue. If I remember correctly everything looked fine at that point.

{edit] It was not setup today. That has been in since I first set it up and I did not reset the freezer plug energy reading.

1 Like

Don't know if related but I checked the event log for the freezer plug and the last energy reading was at 8:01pm, no energy reading in the log prior to that. The event history is at the default of 20 and the reading at 8:01 was the 20th energy reading in the log.

So I assume the others were deleted due to the event log restriction.

1 Like

The rate entry will clear out once it's set. I think I'll add a display right above the input box to show the current rate so it doesn't look like it's been cleared like you ran across.

As for the cost being computed in the hundreds...I'm not sure. Even if you entered the rate a second time, it only applies from that point forward. The only situation that comes to mind is a typo when the rate was original put, then an energy update from the one device giving the wild calculation. When you entered the rate again, everything fixed itself.

For now, the only way to clear the current cost is to either let it age out (which would take a month) or reinstalling the app. Although, I could add a reset button, but would that would be easiest done to have it reset everything.

Is it possible to add devices from across multiple hubs connected to a single hub with hub mesh? In other words, I want to run this on a single hub in a 3 hub configuration but get data for all energy reporting devices across all three hubs in a single table. Thanks for the consideration

1 Like

Yes that is what I am doing. The rate calculator app resides on a hub that has no devices physically on it. All the devices are connected via hub mesh.

1 Like

I tried changing the rate slightly and it only seem to effect the today's cost. Which is now correct BTW. The weekly and Monthly are not, they still show a $200+ value. It seems to me if I change the rate it should re-calculate all values,

1 Like

One feature that'd be good is being able to install an item that doesn't provide energy monitoring.
I've an 20a immersion switch and the smartlife method is time on x 3151w. It's not going to be fantastically accurate but it'd be a real help and I can guarantee I'm not the only one in this position, especially since my set up is small, and I have two devices that don't monitor energy within themselves... One I can work around (hubitat plug between socket and multiplug). The switch I can't, the time x kwh is the only available method.
As for the app it seems to be working admirably, no issues

1 Like

Another feature suggestion?

When you first add a device could it use the current energy reading as it's starting point for the monthly. Put a note that if you don't want to use any current values you should reset energy readings before adding?

1 Like

I'm not doing this by design. If you're on a static rate schedule, re-calculating may be fine. But for a dynamic schedule where the cost fluctuates throughout the day, it doesn't work at all since part of the historic energy usage may be one rate and part of it another.

I can add another toggle that will force a recalculation based on the current rate...probably not a bad idea.

I can definitely look into it.

I won't. Partially because I can't. I could add a static calculation for your device, but then I would have to code around ensuring that the logic doesn't get applied to anything else. That means being able to identify that specific device type out of thousands of possibilities. I'm not sure there's even a way to code that in aside from having a separate dropdown. Then it falls on the user (who may or may not have seen/read this thread) to know to only select a particular device type. That would inevitably end with many "this thing is broken" posts or folks just not using the app.

How are you doing this? Iā€™m not able to add any devices from my mesh on other hubs.

1 Like

I'm doing the same thing. You just link the devices via hub mesh and they'll show up in the app....if they have the energy monitor capability.

If you share a device from HubA, then on HubB you also need to go to hub mesh in the settings, go to linked devices, and add the device from there. That will create a placeholder device on HubB that replicates the actual devices from HubA.

Iā€™m using @ogiewon iotawatt driver which has child devices. Iā€™m unable to see these children even though they show up in my device list.

1 Like

As you can see, Iā€™m unable to select any of those devices.

1 Like

@rlithgow1

Were you able to use your iotawatt stuff with this?