Skip to content
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

Unexpected Error #1

Open
rjnca opened this issue Mar 10, 2022 · 19 comments
Open

Unexpected Error #1

rjnca opened this issue Mar 10, 2022 · 19 comments

Comments

@rjnca
Copy link

rjnca commented Mar 10, 2022

I added this to my HA setup and got this error when trying to configure it:

This error originated from a custom integration.

Logger: custom_components.enphase_envoy.config_flow
Source: custom_components/enphase_envoy/config_flow.py:32
Integration: Enphase Envoy (DEV)
First occurred: 10:28:37 AM (2 occurrences)
Last logged: 10:29:20 AM

Unexpected exception
Traceback (most recent call last):
File "/config/custom_components/enphase_envoy/config_flow.py", line 154, in async_step_user
envoy_reader = await validate_input(self.hass, user_input)
File "/config/custom_components/enphase_envoy/config_flow.py", line 32, in validate_input
envoy_reader = EnvoyReader(
TypeError: init() got an unexpected keyword argument 'enlighten_user'

@enkrypt3d
Copy link

did you login with your enlighten account?

@rjnca
Copy link
Author

rjnca commented Mar 25, 2022

Yes.. I removed the custom component again, made sure that nothing was hiding in the python cache, re-pulled the files from the repository, restarted HA, and tried to add the component again, but got the same result
Screen Shot 2022-03-25 at 10 05 31 AM
Screen Shot 2022-03-25 at 10 05 43 AM
Screen Shot 2022-03-25 at 9 59 34 AM

@enkrypt3d
Copy link

Similar issue when I tried it, so I ended up using this one although it does not have the battery stats. Trying to figure out a way to merge these 2.....

https://github.com/jesserizzo/envoy_reader

@briancmpbll
Copy link

briancmpbll commented Apr 6, 2022

I was able to work around this issue by copying envoy_reader.py from https://github.com/DanBeard/envoy_reader/tree/enlighten_owner_token_support/envoy_reader into the custom_components/enphase_envoy folder and changing the from envoy_reader.envoy_reader import EnvoyReader lines in __init__.py and config_flow.py to from .envoy_reader import EnvoyReader.

I also replaced the requirements array in manifest.json with

  "requirements": [
    "envoy_utils"
  ],

This will prevent hass from trying to install a conflicting version of envoy_reader, which is what I was having issues with.

@enkrypt3d
Copy link

enkrypt3d commented Apr 6, 2022 via email

@briancmpbll
Copy link

I get total battery percentage. The code here is averaging the percentages from all the batteries and reporting a single number. I don't think it would be difficult to report individual numbers from each battery though. I'm not very familiar with hass component development, but I think I could give it a shot after looking through the code.

@briancmpbll
Copy link

@enkrypt3d Try out the HACS integration I have here https://github.com/briancmpbll/home_assistant_custom_envoy

It's based off of this repo but with individual battery reporting.

@enkrypt3d
Copy link

awesome! Any idea how to get these entitles to show up in the energy dashboard? I'm not sure what it is looking for. The entities are there and working though:

image

@briancmpbll
Copy link

The lifetime energy production entity should work for solar production.

I don’t know if the local api provides numbers that are useful for to and from grid energy though.

Likewise for battery values. You could potentially do some calcs by comparing the previous and current values of the current battery capacity entity, but it’s not available from the local api directly from what I can see.

@enkrypt3d
Copy link

This is a great improvement beyond the built in integration anyway. Does it work with teh latest version of HA? I'm on 2022.2.9 and afraid to upgrade as it usually breaks tons of stuff...

@enkrypt3d
Copy link

image
This is the energy dashboard element I was talking about... not sure what is required to get these entitles to show up here.

@briancmpbll
Copy link

It’s working fine with the latest version for me.

I don’t think the local api provides any battery charge and discharge values as far as I can tell. I’m looking at calculating it based on change in the battery capacity, but it won’t be perfect.

@briancmpbll
Copy link

If you use node-red you could set up something like this and use those values for the battery in the energy dashboard:
A6186EE9-A23F-4944-8BB2-2418ED6B80ED

You could probably do something like this with hass automations too.

The numbers aren’t going to be exact, but close enough for usability.

@enkrypt3d
Copy link

image

Seeing odd behavior on this integration.... there's no way my system made 6 MW of power at 9AM on a cloudy day..... not seeing this same value reflected in the myenlighten app....

@rjnca
Copy link
Author

rjnca commented Apr 14, 2022

Mine looks accurate..
Screen Shot 2022-04-14 at 9 50 00 AM
Screen Shot 2022-04-14 at 9 50 27 AM

@enkrypt3d
Copy link

Yea mine looks accurate most of the time but some days it shows these weird spikes that are not reflected in enlighten.

@enkrypt3d
Copy link

image
happened again... I think this was during an upgrade or HA Restart.... totally crushes the graph :(

@DanBeard
Copy link
Owner

DanBeard commented May 9, 2022

The original issue is probably that the integration needs my forked envoy_reader as a requirement. (It also supports D7.x.x ) https://github.com/DanBeard/envoy_reader/tree/enlighten_owner_token_support

See the requirement in https://github.com/DanBeard/enphase_envoy/blob/main/manifest.json

If the repo envoy_reader is already installed, pip won't pull my fork since it thinks the req is satisfied. So you need to delete the envoy_reader repo in site-packages before installing this integration.

Potential improvements: We could rename my fork to avoid this, or do a check in the component to print a better error message, or see if we can get the PR approved jesserizzo/envoy_reader#91

The first choice would be the most user friendly. I don't have a lot of time right now to work on that but will put that on my todo list. (if someone wants to fork and make a PR to rename it to enphase_envoy7 or something that's all we'd have to do I think)

@enkrypt3d
Copy link

enkrypt3d commented Oct 4, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants