mikey0000 / ha-electric-kiwi

HACS compatible version of the electric kiwi integration
GNU General Public License v3.0
17 stars 0 forks source link

Feature Request: Add usage counters #9

Open Berserkir-Wolf opened 8 months ago

Berserkir-Wolf commented 8 months ago

I'd like to get either the read_consumption_summary or read_consumption_averages endpoint added into the integration to be able to see power usages. Daily usages would be useful, though I believe there is a delay on the data returned by the Juice API.

mikey0000 commented 8 months ago

Yes there is a delay, so only historical data is accurate e.g 2 days ago, it can also depend on your meter too. Its easy enough to add and data would be eventually consistent but the problem with HA is its not really able to go back in time to set the values, so any historical data from the sensor would be wrong.

its something that has been kinda asked for, but I've not really looked hard at it on how it would be useful since sensors generally give real time data. I've not played with the electricity side of HA yet to provide a feed into the energy tab which is probably where its most useful.

Open to ideas and to trying things out here. On that I do need to update this repo with the improvements I've made to the official integration now they are at feature parity.

mikey0000 commented 8 months ago

Always welcome to PR a change too.

Berserkir-Wolf commented 8 months ago

Yeah, I pulled this repo to my instance then overwrote the contents of the files with the contents of the ones in the core repo, just so that I was working from a base that made sense. I'm registered as a juice dev as well, so I'm thinking a nightly update for the usage of today-2. It'll mean Hass has outdated data, but it will at least give trend information to be able to make automation adjustments timing wise. As I read it, the summary one breaks it into segments so could be useful for hour-of-day information. It'll also allow for HA to give you an "average daily power usage" that is mostly accurate.

mikey0000 commented 8 months ago

I saw your repo. If the time of the data can be set can pull periodically and update a set at once. Users will need to be able to set weekly/daily/monthly IIRC. You can use juice hacker dev accounts if you set HA to use the dev config (cloud) instead of prod when developing, the auth works.

mikey0000 commented 8 months ago

Supposedly opower does it, so will investigate that integration