lawrencefoley / evergy Goto Github PK
View Code? Open in Web Editor NEWA simple utility that you can use to access your Evergy account and retrieve you meter readings.
License: MIT License
A simple utility that you can use to access your Evergy account and retrieve you meter readings.
License: MIT License
I've been trying to figure out your code here. I'm not very good with these kinds of things, but really was hoping to get this implemented in Home Assistant. I've tried a few different methods mentioned in other issues like this one -> #8
Is there a more clear "how-to" documentation on how to get this integrated into Home Assistant? Can anyone that has effectively done so create a video or share more details on how you integrated it?
I don't know if I'm stupid or it no longer works, but I've been beating my head against the wall for a while now. I'm pretty sure it installed, don't know how to import into HA, and running it directly ends up with this:
2021-08-19 06:20:44,360 - INFO - root - - Logging in with username: [email protected]
2021-08-19 06:20:45,488 - ERROR - root - - Must login first
Traceback (most recent call last):
File "./kcpl.py", line 81, in <module>
logging.info("Last usage data: " + str(data[-1]))
TypeError: 'NoneType' object has no attribute '__getitem__'
Hello @lawrencefoley ,
Evergy just did a site redesign, and the account number is no longer where it used to be.
I know you are no longer maintaining this project, but I've found a new way to get the account number and could put in a pull request if you're willing to review/merge.
Thanks.
KCPL changed their website to use an API instead of form POSTs to retrieve meter data.
The API URL is in the format: https://www.kcpl.com/api/report/usage/<meterNumber>?interval=d
Right now the code uses HTML parsing to handle the login and for getting the meter ID(s). Research should be done to see if this part can be replaced with just HTTP calls.
Benefits would include:
https://www.evergy.com/api/user/current
It looks like Evergy is has replaced the API implemented here with the Oracle's Utilities Opower API, and there's an existing library that implements its *.opower.com
API calls here: https://github.com/tronikos/opower
I'd suggest archiving this repository with a note with how this implementation has been superseded by new stuff.
Thanks for your work on this repo! I've been using this implementation for a while.
Are you having any issues with this? Mine has stopped working since January 13th, it seems like Evergy might have adjusted their API. I haven't dug into it much, just curious if you're having the same issue. I'm getting an error message like I'm not logged in when running GetUsage.
Evergy has scheduled maintenance on their website sometimes. During the maintenance you get redirected (HTTP 301
) to https://www.evergy.com/planned-outage
.
The code should be changed to handle this and log an error about the maintenance.
This also seems to happen sometimes late at night, possibly for system patches:
2021-10-13 23:04:26,271 - INFO - root - - Logging in with username: [email protected]
Traceback (most recent call last):
File "main.py", line 35, in <module>
usage = client.get_usage(start=date.today(), end=date.today(), query_scale="mi")
...
File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Add the ability to retrieve hourly usage. This URL can be used to do that (note the interval
parameter). There seems to be some (currently unknown) delay on the hourly data showing up.
https://www.evergy.com/api/report/usage/1111110000?interval=h&from=9/15/2020&to=9/16/2020
Since the merger of KCPL the kcpl.com
website redirects to evergy.com
. Because of this and the new website, the login doesn't work any longer. The other functions probably don't work as well.
Need to either make fixes for this to work with the new website/api or create a new project with a name such as evergy-api
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.