DanBeard / enphase_envoy

Custom component for enphase_envoy Firmware D7.0.0 +
Apache License 2.0
10 stars 2 forks source link

Unexpected Error #1

Open rjnca opened 2 years ago

rjnca commented 2 years ago

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 commented 2 years ago

did you login with your enlighten account?

rjnca commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Are you getting stats from the batteries?

On Wed, Apr 6, 2022, 7:14 PM Brian Campbell @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/DanBeard/enphase_envoy/issues/1#issuecomment-1090911019, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWHLHRR3H6OIBLMV27PF54DVDYLD7ANCNFSM5QNOQYRQ . You are receiving this because you commented.Message ID: @.***>

briancmpbll commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Mine looks accurate..

Screen Shot 2022-04-14 at 9 50 00 AM Screen Shot 2022-04-14 at 9 50 27 AM
enkrypt3d commented 2 years ago

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

enkrypt3d commented 2 years ago

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

DanBeard commented 2 years ago

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 https://github.com/jesserizzo/envoy_reader/pull/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 commented 2 years ago

My Enphase envoy (DEV) integration just stopped working out of the blue. The envoy is up and running and seems to be working fine. The integration sits at "initializing....." and then eventually fails. Restarting the envoy and HA did nothing......

On Mon, May 9, 2022 at 4:51 PM Daniel Beard @.***> wrote:

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

If the repo envoy_reader is already installed, pip won't pull my fork since it thinks the req is satisfied. I 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 https://github.com/jesserizzo/envoy_reader/pull/91

— Reply to this email directly, view it on GitHub https://github.com/DanBeard/enphase_envoy/issues/1#issuecomment-1121569320, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWHLHRU45FMXT2RZXACCH3DVJF3GBANCNFSM5QNOQYRQ . You are receiving this because you were mentioned.Message ID: @.***>