What is this?
An app for calculating energy costs. The app leverages the new table method provided by Bruce to give a nice graphical display of costs per device and totals. The cost value for each device, along with the total, can be mapped to a hub variable. The hub variables can be used to display the cost in a dashboard tile or have a connector device created for sharing via Maker API.
The energy consumption and cost values are updated anytime there is an energy update from any device, when the app page is loaded, or when the "Refresh Table" button is clicked.
How to Set A Static Rate:
- Go to the rate page:
- Ensure the toggle is disabled.
- Enter your rate per kWh information.
Note: Numbers only. The input field will clear anything extra automatically. More than one decimal in the input will result in grave peril. - Optionally set the currency symbol for dashboard displays/variables.
- Click Next
Repeat these steps to update the rate information as needed.
How to Set A Rate Schedule
- Go to the rate page:
- Ensure the toggle is enabled.
- Click the "Add rate schedule" button
- Give the schedule a name.
- Select "Days of Week", "Start Time", "Months", and "Rate Cost".
- Optionally set the currency symbol for dashboard displays/variables.
- Click Next
- If ever needed, the "Manual Override" box can be used to immediately change the rate cost.
Limitations
- Rates - The app, at present, can not accommodate ad-hoc rate settings (like critical rate periods that are called whenever the power company deems necessary).
- Data - This app is only capable of tracking usage from the time that a device is added. If a device is added, removed, and added again, all values will be reset to 0.
Drivers/Historical Data
- There are scheduled jobs to grab the required data for the historical tracking.
- At 12:01 am, the app will grab the current energy value for each device. As energy for the device is updated throughout the day, the value at the start of the day is subtracted from the current value to determine that day's usage. If the device driver does something unexpected with the energy value after the 12:01 run, then the data could be skewed (or if the energy value is manually reset).
- Weekly usage is reset on Sunday at 12:00:40 a.m.. This is done by copying the "usage this week" over to "usage last week" and then resetting "usage this week".
- Monthly usage is reset on the first day of the month at 12:00:45 a.m. and uses the same process as the weekly usage.
- "Energy Use Last Month" and "Energy Use Last Week" are static values after the above jobs have ran. That means the values for the "Totals" will not update, even if a device is added/removed.
Probably others that I've yet to discover/think of.
INSTALLATION
Can be installed using HPM; just search for "Energy Calculator Plus"
Manual installation requires just the app. All code can be found in my GitHub repo .