-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add last_reset attribute to daily cost sensors for correct Energy Dashboard costs #58
Conversation
…in the Energy dashboard
I have just updated my install with this file and am not seeing the attribute on my totals, I will leave it in place and see if they appear tomorrow! |
👍 thanks |
@megakid I've just observed that gas resets at local time midnight (currently BST), whereas electricity resets using UTC midnight (at least for my supplier). We might want to look at making this configurable if we see variations by supplier - @Blackduke77 if you have both, are you able to advise whether both your gas & electricity import today sensors reset at 00:00 local time? It looks like in your previous screenshot that your electricity resets at 00:00 (assuming your Home Assistant system time is Europe/London). |
Thanks for checking @Blackduke77. How about in your history graphs for gas and electricity imported, at what time do you see them reporting 0? Also do you know if you have a SMETS1 or SMETS2 meter? With my meters I see gas resetting to 0 at 00:00 (BST) and electricity at 01:00 (BST). The current implemented logic uses local midnight for both gas and electricity, but I've a suspicion that we might need to make that configurable. |
Thanks for confirming, I think the current code should work for you then (as your meter is respecting DST). I'll submit a PR tomorrow allowing users to configure an override - looks like it can be common with some suppliers: https://forums.moneysavingexpert.com/discussion/6452051/british-gas-electric-driver-ev-tariff-hours-gmt-vs-bst |
Happy to test, apart from basic functionality, is there anything else to test, do you want me to reset integration and reset it back up |
Thanks @Blackduke77, it'd be good to test the following scenarios:
One thing I do notice is that the only way to make config changes take effect is to restart home assistant (this is also the case with the existing release). I might have a look at making it reloadable similar to other integrations, though I'm off on holiday for the next week so it'll need to wait 🙂 |
This introduces logic to correctly populate the last_reset attribute of the monetary total sensors for gas and electicity.
Specifically this aims to address the issue raised in #57