martinarva/dynamic_energy_cost

Allow configurable daily reset time

dunxd opened this issue · 1 comments

When measuring overnight charging (e.g. an EV) it makes sense to reset the counters at a time other than 0:00. Allow option to change this but keep midnight as default.

I would like to keep the integration simple and do only daily, monthly, yearly costs.

If you want to have a sensor with different periods and resets I recommend to use home assistant Utility Meter integration.

Feed in your daily cost sensor from my integration to Utility Meter for example like this if you want it to reset 7am:

Add this to configuration.yaml

utility_meter:
  overnight_ev_cost:
    source: <your ev daily cost sensor>
    name: Overnight EV Charging cost"
    cron: "0 7 * * *"

Explanation of the cron fields field:

  • 0 - The minute (0 past the hour).
  • 7 - The hour of the day (7 AM).
  • Every day of the month.
  • Every month.
  • Every day of the week.