[No Longer Maintained] Energy Cost Calculator

It appears that the app is looking for devices that implement the "capability.energyMeter" only. The built-in Hubitat "Generic Component Power Meter" driver (which is used by my IoTaWatt integration) only implements the "Power Meter" capability. This is why the IoTaWatt child devices do not appear as selectable devices.

2 Likes

Didn't think of that, but yeah makes sense. I don't have to worry about it so I didn't consider it.

That would be great.

1 Like

Hi - this is a great app! However, it seems to only pick up Zwave devices that measure power - not zigbee devices. I have several zigbee plugs (eg Centralite) that report power but those don't come up in your app. Same question about wifi devices, eg I have several shelly dimmers that report power. Any way to add them?

1 Like

The app doesn't care about the protocol the device uses. What matters is whether or not the device has the energy capability.

Do the Centralite plugs report energy?

I have two Shelly 1PMs and they needed a driver code update to work with the app properly (they report in watt-minutes instead of the normal kilowatt-hour).

Does Iotawatt not provide energy reporting?

It definitely can report Energy data. The question then becomes how does one manage the "Energy" attribute of a Hubitat Energy Meter device? When does it reset? Every minute? Every Hour? Every Day? Every week? Every Month?

I could probably enhance the integration for the IoTaWatt to create Energy Child devices... But I would need to know when is the appropriate time to reset the KWh value of each device? I cannot see allowing it to grow indefinitely... :thinking:

For most real-time home automation tasks, instantaneous Power is what is needed.

For historical cost tracking, Energy obviously makes the most sense. It is pretty easy to calculate Energy usage in Grafana, using data from the IoTaWatt that is sent to InfluxDB. Thus, I have never considered using Hubitat for such a purpose.

1 Like

The centralite plugs report power - possibly not energy. But clearly one can calculate energy use from power so I assume the app did that - not the case?

1 Like

Ultimately...it's your driver so I'm not going to try to tell you how to handle it. I have Kasa plugs that reset daily right after midnight. Then I have Zooz ZEN15s and an Aeotec heavy duty switch that don't reset unless done manually.

This app is written to handle either scenario.

1 Like

Not the case because to do this accurately you need continuous, instantaneous power reporting. Here's a short sample of why I'm not doing this in the app:

Okay, I see. So apparently the driver for the Shelly dimmer 2 does not capture the power or energy reporting even though the device supports it. However, I have home assistant device bridge set up and if I turn on the energy sensor in home assistant, I can pass it to HE, and your app does pick that up.

1 Like

Which driver are you using? The built-in?

I've tried both the built in one and the Shelly Plus Dimmer community driver. Neither one seems to capture energy from this particular device.
The community driver I've tried is this one:

  • Copyright : © 2020 Allterco Robotics US
  • Version : 1.0.1
  • author : Scott Grayban
  • icon :
  • DriverStatus : Current
  • InternalName : ShellyPlusDimmer
  • UpdateInfo : Up to date
  • LastRefresh : 2022/12/08 12:33:53
  • RelayChannel : 0
1 Like

If I'm not mistaken...Shelly is maintaining that driver now. It may be worth while to open a support case with them and request they add the functionality. I was going to offer to pick one up so I could tweak the driver, but the price is a little steep considering I have no use-case.

Is there anyway to pull the data from before the app was installed? I had this running since it first came out. Accidentally I made the cost of electricity in dollars and not cents. I then wanted to change it back to cents. It errored out the app, so I removed it and reinstalled it. Now my history is gone from the table, but the devices that are linked up have the data stored on them. I'm using Kasa KP115's.

Summary

1 Like

Can you get me the error message from the logs? Want to make sure whatever happened doesn't happen again. I have logic to catch and reformat the rate, but I may have missed something.

To get the month total back would need changes in a few spots. I can PM some changes to make, but it'll be at your own risk if your hub catches on fire :laughing:

So I get the argument here about accuracy, but here's an example - I have a 4000W shop heater controlled by a Sinope Load controller. I can set it to report changes of 100W. Here's the output over about 10 min as it cycles on and off. Although these aren't instantaneous changes I think they're frequent enough to calculate a useful value for energy used. And since I know that in between reports, the change is less than 100W (2.5%), I'm comfortable with that level of accuracy.

3,Pgm,01/20/2023 09:50:10,,,,Basement Shop Area - Test Power Metering,63
3,Pgm,01/20/2023 09:51:32,,,,Basement Shop Area - Test Power Metering,1811
3,Pgm,01/20/2023 09:51:37,,,,Basement Shop Area - Test Power Metering,4227
3,Pgm,01/20/2023 09:54:38,,,,Basement Shop Area - Test Power Metering,4127
3,Pgm,01/20/2023 09:55:27,,,,Basement Shop Area - Test Power Metering,2795
3,Pgm,01/20/2023 09:55:33,,,,Basement Shop Area - Test Power Metering,63
3,Pgm,01/20/2023 09:57:00,,,,Basement Shop Area - Test Power Metering,2336
3,Pgm,01/20/2023 09:57:05,,,,Basement Shop Area - Test Power Metering,4202
3,Pgm,01/20/2023 10:00:35,,,,Basement Shop Area - Test Power Metering,2111
3,Pgm,01/20/2023 10:00:40,,,,Basement Shop Area - Test Power Metering,62
3,Pgm,01/20/2023 10:02:12,,,,Basement Shop Area - Test Power Metering,4139

Can one create a virtual device that reports energy? Wondering if I could set up a rule or something to calculate energy used from power and then set the value of a virtual device that would be picked up by your app.

1 Like

You may be ok with it because it may not be too inaccurate in your case. But, this app is publicly available to anyone. For many use cases, an educated guess (which in and of itself would be very difficult to determine programmatically for any possible device) would end up being wildly inaccurate over the course of a day/week/month. At worst, that would result in this app being useless in those cases. At best, I'll end up forever big hunting edge cases for making the educated guess.

You can absolutely do this. With several options:

  1. Write it into the existing devices driver.
  2. Create a small app that can make the educated guess and set the energy value on a virtual, child device.
  3. Use the existing "virtual Omni sensor" with Rule Machine calculating the energy value.
1 Like

Hahah. it's alright. I'll pass on hub fires. :sweat_smile:

It was several days ago, so no longer available.

1 Like

I had thought about doing this for awhile and this thread got me motivated to set it up

Here is an example of a RM rule to have a power only plug report energy. Now this really only works for something that comes on and maintains constant power. I have a attic fan that is setup with an old Iris V1 plug. I still have a few of these plugs and they are old and I was reimbursed by Lowes for them when they dropped the IRIS system, so I figure if they die in the attic heat I'm not out much. They do not have energy reporting. The fan runs at a approximately 200watts.

This rule monitors runtime and updates a virtual energy monitor, I have added the virtual energy monitor to this Energy Calculator app and it seems to be working. I am using the virtual omni sensor as mentioned above.

3 Likes

Thank you - that's really helpful.

1 Like