home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.16k stars 29.84k forks source link

Enphase Envoy stopped working after update #26124

Closed Tim-GitHub closed 4 years ago

Tim-GitHub commented 5 years ago

Home Assistant release with the issue: 0.97.2

Last working Home Assistant release (if known): 0.95.4

Operating environment (Hass.io/Docker/Windows/etc.): Hass.io (RPi)

Component/platform: Enphase Envoy

Description of problem: The Enphase Envoy component has been working fine for me since I implemented it months ago. I updated from 0.95.4 to 0.97.2, and found my Enphase Envoy sensors all show '0' or 'unknown.'

Traceback (if applicable):

Got a response from 'http://<internal ip>/production.json', but metric could not be found. Maybe your model of Envoy doesn't support the requested metric.

Additional information: I made no changes to my configuration before/after the upgrade. As soon as Home Assistant booted up on 0.97.2 my Enphase Envoy sensors were broken. I tried removing some of the 'monitors_conditions' but the issue persists. I saw there was a recent issue for this component, but I'm not sure they are related (https://github.com/home-assistant/home-assistant/issues/25331) as I am not getting any depenencie errors, and that issue was meant to be resolved already.

Envoy Part Number: 800-00551-r02 Envoy Software Version: R4.10.35 (6ed292)

The contents of http://internal_ip/production.json:

{"production":[{"type":"inverters","activeCount":17,"readingTime":1566435522,"wNow":706,"whLifetime":3371711}],"storage":[{"type":"acb","activeCount":0,"readingTime":0,"wNow":0,"whNow":0,"state":"idle"}]}

The contents of http://internal_ip/api/v1/production (if helpful):

{
  "wattHoursToday": 16999,
  "wattHoursSevenDays": 125048,
  "wattHoursLifetime": 3371710,
  "wattsNow": 708
}

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

<This is within my sensors.yaml>

- platform: enphase_envoy
  ip_address: <internal ip>
  monitored_conditions:
    - production
    - daily_production
    - seven_days_production
    - lifetime_production

EDIT: Issue formatting cleanup.

Tim-GitHub commented 5 years ago

I'm wondering if this commit is a contributing factor: https://github.com/jesserizzo/envoy_reader/commit/06dbd6c95c9f1a3d46065b6c8770a86c6e3719ab#diff-1d467e911e4915e7bf4553b84b2bcc4d

I have an Envoy-S, but I have no consumption data. If I understand what changed here, previously if the production.json returned anything other than 3 fields (production, storage and I assume consumption?) then it falls back to using /api/v1/production. In my case there is no consumption, and so with this commit (>=2), my Envoy is now (correctly) identified as an Envoy-S. If this is the case, then prior to updating to 0.97.2 my Envoy component was falling back on my /api/v1/production, which is why it was working correctly. If that is the case, then the question is why my production.json is not being parsed correctly.

@jesserizzo I'm not sure if that helps, or if I'm totally wrong. But just trying to help!

csjo commented 5 years ago

I too am seeing 0 in my production with my enphase envoy iq.

I'm on .97.2, on synology home assistant docker. Nothing in my homeassistant.log other than:

2019-08-27 07:31:02 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.envoy_current_energy_production is taking over 10 seconds

jesserizzo commented 5 years ago

@Tim-GitHub I believe you have hit the nail right on the head. Can you run this from the command line and see what it gives you? https://github.com/jesserizzo/envoy_reader/blob/fix_envoy_detection/envoy_reader/envoy_reader.py

Tim-GitHub commented 5 years ago

@jesserizzo Here you go:

Enter the Envoy IP address or host name, or press enter to use 'envoy' as default: internal_ip
Reading...
production:              1391
consumption:             Got a response from 'http://internal_ip/api/v1/production', but metric could not be found. Maybe your model of Envoy doesn't support the requested metric.
daily_production:        1129
daily_consumption:       Got a response from 'http://internal_ip/api/v1/production', but metric could not be found. Maybe your model of Envoy doesn't support the requested metric.
seven_days_production:   117231
seven_days_consumption:  Got a response from 'http://internal_ip/api/v1/production', but metric could not be found. Maybe your model of Envoy doesn't support the requested metric.
lifetime_production:     3575750
lifetime_consumption:    Got a response from 'http://internal_ip/api/v1/production', but metric could not be found. Maybe your model of Envoy doesn't support the requested metric.
inverters_production:   {'redacted': 114, 'redacted': 115, 'redacted': 115, 'redacted': 116, 'redacted': 114, 'redacted': 117, 'redacted': 117, 'redacted': 10, 'redacted': 6, 'redacted': 7, 'redacted': 5, 'redacted': 112, 'redacted': 7, 'redacted': 113, 'redacted': 90, 'redacted': 0, 'redacted': 117, 'redacted': 116}
csjo commented 5 years ago

Did that do the trick? If so, what is the next steps getting this pushed to the next release? I recently installed solar and would love to have this on my dashboard! :)

jesserizzo commented 5 years ago

@csjo @Tim-GitHub I just put in a pull request for this fix. Not sure if it's in time for the release on the 18th, if not it'll be on the 9th.

csjo commented 4 years ago

I see this got pushed in the .100 release, but it's not working for me yet. Tim, did you have any luck?

djinn5150 commented 4 years ago

I was having the issue as well, for some reason its not updating on the back end of my install, copied the code to custom_components and it works like a charm now

Pino7777 commented 4 years ago

I still have the issue 'Entiteit is niet-numeriek: sensor.enphaseenvoy_current_energy_production' on HA 0.100.2. my configuration.yaml:

PaulAntonDeen commented 4 years ago

@jesserizzo I also still have my original problem that envoy has been broken since 0.95.2 would it be better to continue here or open a new issue? 2019-10-31 15:29:41 ERROR (MainThread) [homeassistant.components.enphase_envoy.sensor] Got a response from 'http://192.168.2.7/production.json', but metric could not be found. Maybe your model of Envoy doesn't support the requested metric.