evergy icon indicating copy to clipboard operation
evergy copied to clipboard

Home Assistant Integration

Open yourgeekguy opened this issue 2 years ago • 9 comments

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?

yourgeekguy avatar Sep 02 '22 03:09 yourgeekguy

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

thebradleysanders avatar Mar 24 '23 13:03 thebradleysanders

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.

yourgeekguy avatar Mar 24 '23 19:03 yourgeekguy

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

I'll definitely add a link to your repo.

lawrencefoley avatar Mar 24 '23 19:03 lawrencefoley

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.

thebradleysanders avatar Mar 24 '23 20:03 thebradleysanders

@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?

yourgeekguy avatar Mar 24 '23 20:03 yourgeekguy

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

thebradleysanders avatar Mar 24 '23 21:03 thebradleysanders

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).

yourgeekguy avatar Mar 24 '23 22:03 yourgeekguy

still no luck getting them to load values

Were you able to get this working?

thebradleysanders avatar Mar 27 '23 14:03 thebradleysanders

@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.

yourgeekguy avatar Mar 27 '23 16:03 yourgeekguy