-
Notifications
You must be signed in to change notification settings - Fork 13
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
idk #8
Comments
Hey, yeah I can try to help out. Fair warning though - I haven't used this in HA myself, but I just started using HA so I'll be working on creating an energy integration so people can use it. It'd be helpful if you could share your script or how you're running it in HA. I just tried it with my account and it worked, however I did notice they've been doing maintenance on the website recently (#7 ) so it could have been down earlier. |
I guess I don't know how to use it at all. If I can figure out the command line I can probably make it work in HA, I also started using HA a few days ago. |
but if you can share how to use your program, I'll share how to make it work in HA (if I figure that part out) |
Hey @davethepear, you can run this via an integration called pyscript. I've installed it via HACS and then added as an integration into Home Assistant. I then use Visual Studio Code add-on to see the pyscript folder and copied in the kcpl.txt shared in another issue, but then renamed as kcpl.py. Links: Note you need the following helpers: Also see my handing of template sensors in #4. The last item is you need a last_reset which can be done via:
|
wow... I'll see what I can do with that. thanks! |
Honestly while it SEEMS complicated, if you take it one step at a time it's not that bad, and I can help along the way. I did figure out a LOT of the above yesterday, so hopefully we can get @lawrencefoley convinced that HA is amazing (which it is!) so he could code this up as a direct integration with home assistant or through HACS. |
@lawrencefoley if you need HA-side assistance please let me know. Above summarizes MOST of the steps, but I threw a few links to threads elsewhere. I'm happy to help if we end up with a cleaner integration without having to go api --> input_number -- > sensor --> energy. |
yes, HA is pretty cool. I've already figured out some really cool things to do with it. I got HACS installed. Thanks :) |
but after the install command in the readme, I'm at a complete loss as to what to do next. there are NO instructions, nothing here. |
yay, I got it working... very cool. a certain special character in my password was making it mad, among other things. |
I edited kcpl.py
then I got into my configuration.yaml and added this:
admittedly I tried using > filename.txt but, yeah, python... couldn't get print() to parse right either, so I hijacked the logging... but... |
mm yeah, it doesn't clear it out first... I'm not very good with python. so it does what log files do and append. |
Oh shoot, sorry man you are supposed to change the name to kcpl.py in the pyscript folder. My bad I missed that step!!! Can't attach .py files so I changed to .txt. |
oh it's in there... I wonder what it's up to. I'm not very good at this, I guess. it's erroring out, something about aiohttp (even though it's installed) |
@davethepear Great to see you got it working! |
Hey guys, sorry to comment on a closed issue, but I can't seem to get this to work in my HA. I installed pyscript in HACS, placed the kcpl.py file in /config/pyscripts, put the credentials file in /config and in the pyscripts folder (with the correct credentials), manually created all the helpers you mentioned, installed the pyscripts integration. It just doesn't seem to do anything. Manually running the file with python seems to work okay though. I also tried the modified version of the kcpl file that @davethepear shared. It just ends up giving me "import something something" for the sensor values. I'm not sure what I'm doing wrong, is anyone willing to help me figure this out? |
@kreene1987 @kreene1987 |
So, correction, for whatever reason the python script isn't working anymore when ran from hassio via ssh. I thought it was. It is giving me an error: File "/config/pyscript/kcpl.py", line 84, in I'm sure it is something simple I am missing. My HA is running on a raspi4 if that helps |
Okay so actually I think I managed to get it working following @davethepear 's method. About pyscript, how often does it run? I assume it will run automatically at a set interval? At the moment all I have done is manually run the kcpl.py to obtain the text file with the data I need for the sensors. |
I set mine to run a few times a day from cron... |
Thank you I got it working with something similar, just created an automation to run the python script rather than going through pyscript. Thanks for figuring all this out for me lol, looks like I'm good now. |
good. I didn't use pyscript either, it wasn't cooperating. |
Since this seems to be the best discussion about HA integration that I can find, I'll start here. I have this working with a custom component to create sensors that can be used with the energy management, but I'm a little unsure how to interpret some of the data from this. Namely, in my case I get that Also, from my testing, So, are |
Home Assistant integration has been completed, can be seen at https://github.com/thebradleysanders/evergy_home_assistant |
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:
The text was updated successfully, but these errors were encountered: