lawrencefoley / evergy

A simple utility that you can use to access your Evergy account and retrieve you meter readings.
MIT License
31 stars 13 forks source link

Home Assistant Integration #32

Open yourgeekguy opened 2 years ago

yourgeekguy commented 2 years ago

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 -> https://github.com/lawrencefoley/evergy/issues/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?

thebradleysanders commented 1 year ago

I am working on this and will have it done soon. Updates can be seen at: https://github.com/thebradleysanders/evergy

yourgeekguy commented 1 year ago

Oh this is awesome! I actually started using Browse AI to scrape the Evergy site then using their API was able to get that into HASS, but it's not very good. Some days it still misses the scrape, but it's better than nothing. Excited to implement your code here again and see if I can get it working.

lawrencefoley commented 1 year ago

@thebradleysanders This is great! Glad to see someone's working on an integration!

I'll definitely add a link to your repo.

thebradleysanders commented 1 year ago

Thank you, I am glad I could help! As I continue to work on it, please let me know if there are any issues or other sensors you want added.

yourgeekguy commented 1 year ago

@thebradleysanders I just tried installing via HACS. It doesn't seem to be exposing any sensors yet for me. I put in my username and password for Evergy, and then nothing. Am I too early trying to use this or should it be working already? What can I do to help here?

thebradleysanders commented 1 year ago

I had a bug that should now be resolved, please update and try again.

yourgeekguy commented 1 year ago

Just reloaded and the sensor shows available now, but still no luck getting them to load values. Plus, i'm getting an error in the logs now. See below.

This error originated from a custom integration.

Logger: homeassistant.loader Source: custom_components/evergy/sensor.py:28 Integration: Evergy (documentation) First occurred: 5:11:06 PM (1 occurrences) Last logged: 5:11:06 PM

Unexpected exception importing platform custom_components.evergy.sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 779, in get_platform cache[full_name] = self._import_platform(platform_name) File "/usr/src/homeassistant/homeassistant/loader.py", line 796, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/config/custom_components/evergy/sensor.py", line 28, in SCAN_INTERVAL = timedelta(seconds=10800) NameError: name 'timedelta' is not defined

Logger: homeassistant.setup Source: setup.py:344 First occurred: 5:11:06 PM (1 occurrences) Last logged: 5:11:06 PM

Unable to prepare setup for platform evergy.sensor: Platform not found (Exception importing custom_components.evergy.sensor).

thebradleysanders commented 1 year ago

still no luck getting them to load values

Were you able to get this working?

yourgeekguy commented 1 year ago

@thebradleysanders I was stalling to respond as I haven't had a ton of time to review since the other day. I did notice you had some additional updates. I have implemented them and reboot, and so far it looks good! I'll let you know if i run into any other issues! this is great! Now if I can figure out something with KC Water and Spire I'd be set. I may use Browse AI to help out with those for now.