I have been using energy tracking for a while now and it works well but i am struggling to get the costs to work properly in the Dashboard. Like many others i have a Day Rate + $/kWh. Therefore i have a template sensor to calculate this:
I have also tried creating an entity which is a continuous sum of the Daily Consumption cost i.e. it never gets reset back to 0 at midnight.
This still doesn’t work in the Energy Dashboard the cost is much lower than the correct daily cost for the day.
Does anyone use the Use and Entity tracking to total costs option? How have you set this up and used it?
Trouble is last_reset is no longer used as fas as I can tell. Certainly I am getting an error if I try and set it in a template. I am having to use a markdown card to show the calculations. It is very tedious… Surely there must be an obvious reason for this?
Logger: homeassistant.config
Source: config.py:864
First occurred: 10:13:42 AM (1 occurrences)
Last logged: 10:13:42 AM
Invalid config for [template]: [last_reset] is an invalid option for [template]. Check: template->sensor->19->last_reset. (See /config/packages/energy.yaml, line 1).
I am expecting that HA does nothing with that sensor once it is entered as the entity tracking total costs. Therefore, I expect that the value shown in the dashboard should be the same as the state for the sensor? Also, the entity I am providing ONLY is calculating the imported energy cost. I am expecting that this value minus the grid export will equal the Grid Total. Are any of these assumptions incorrect?
Edit: The only other thing I can think of at the moment is in regards to last_reset is the value of the sensor does not go to zero as I am adding in the daily fixed cost so at midnight the sensor drops back to that value…?
Using now() for your last_reset is suspicious. I don’t know when that attribute gets rendered, but it is likely to be every time the state changes. If the state is supposed to reflect the total cost for the day, it should probably be reset at midnight, otherwise maybe take the last_reset from sensor.daily_energy_offpeak, which presumably also resets daily.