Enphase Envoy Gateway no longer reporting after updating to 0.96.1

Enphase Envoy Gateway no longer reporting after updating to 0.96.1

Error while setting up platform enphase_envoy
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/src/homeassistant/homeassistant/components/enphase_envoy/sensor.py", line 45, in async_setup_platform
    from envoy_reader.envoy_reader import EnvoyReader
  File "/usr/local/lib/python3.7/site-packages/envoy_reader/envoy_reader.py", line 8, in <module>
    import requests_async as requests
ModuleNotFoundError: No module named 'requests_async'

Have the same issue

2019-07-20 17:08:21 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform enphase_envoy
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 442, in wait_for
return fut.result()
File “/usr/src/homeassistant/homeassistant/components/enphase_envoy/sensor.py”, line 45, in async_setup_platform
from envoy_reader.envoy_reader import EnvoyReader
File “/usr/local/lib/python3.7/site-packages/envoy_reader/envoy_reader.py”, line 8, in
import requests_async as requests
ModuleNotFoundError: No module named ‘requests_async’

Known issue:

me too, 60% of my automations are dead, Arghhhh! :open_mouth:
breathe jon… breathe… you survived without home assistant for years its ok… its ok…

You can use the rest component if the fix is a while off…

wonderful thanks.
a solution doesn’t get much more robust than directly grabbing the JSON.
the ‘voltage’ variable was on my wish list, this is a way to fix that too.
:slight_smile:

Can you share your config I’m having trouble getting it to work

Here is my old rest sensor based configuration - I hope this still works…

This is what I got to work on an envoy-s
will need tweaking for other models
requests_async seems to be used to detect models on the component
I also added some templates for kWh and MWh

# Enphase Envoy - Rest
sensor:
  - platform: rest
    name: solar production
    json_attributes:
      - wattHoursToday
      - wattHoursSevenDays
      - wattHoursLifetime
    resource: http://envoy/api/v1/production
    value_template: "{{ value_json.wattsNow }}"
    unit_of_measurement: 'W'
  - platform: template
    sensors:
      solar_today_wh:
        value_template: "{{ states.sensor.solar_production.attributes['wattHoursToday'] }}"
        unit_of_measurement: 'Wh'
      solar_week_wh:
        value_template: "{{ states.sensor.solar_production.attributes['wattHoursSevenDays'] }}"
        unit_of_measurement: 'Wh'
      solar_lifetime_wh:
        value_template: "{{ states.sensor.solar_production.attributes['wattHoursLifetime'] }}"
        unit_of_measurement: 'Wh'

  - platform: template
    sensors:
      solar_lifetime:
        friendly_name: "Solar Lifetime Production"
        unit_of_measurement: 'MWh'
        value_template: "{{ (states('sensor.solar_lifetime_wh') |float / 1000000 ) | round(2) }}"
  - platform: template
    sensors:
      solar_week:
        friendly_name: "Solar Last Week"
        unit_of_measurement: 'kWh'
        value_template: "{{ (states('sensor.solar_week_wh') |float / 1000 ) | round(0) }}"
  - platform: template
    sensors:
      solar_today:
        friendly_name: "Solar Today"
        unit_of_measurement: 'kWh'
        value_template: "{{ (states('sensor.solar_today_wh') |float / 1000 ) | round(1) }}"

edit: added unit_of_measurement: ‘W’
to the current prodution

Thanks for the post but why not wait until the code is fixed…
It worked before…

this is one of those ‘costing money’ issues.
many people use this data to run pool pumps and the like for free.
its a good lesson in REST anyway, its good to dive into new things :slight_smile:

I simplified it to:

  - platform: rest
    name: solar production
    json_attributes:
      - wattHoursToday
      - wattHoursSevenDays
      - wattHoursLifetime
      - wattsNow
    resource: http://envoy/api/v1/production
  - platform: template
    sensors:
      solar_now_kw:
        friendly_name: "Solar current production"
        value_template: "{{ (states.sensor.solar_production.attributes['wattsNow'] | float / 1000 ) | round(3) }}"
        unit_of_measurement: 'kW'
      solar_today_kwh:
        friendly_name: "Solar Today"
        value_template: "{{ (states.sensor.solar_production.attributes['wattHoursToday'] | float / 1000 ) | round(1) }}"
        unit_of_measurement: 'kWh'
      solar_week_kwh:
        friendly_name: "Solar last 7 days"
        value_template: "{{ (states.sensor.solar_production.attributes['wattHoursSevenDays'] | float / 1000 ) | round(1) }}"
        unit_of_measurement: 'kWh'
      solar_lifetime_mwh:
        friendly_name: "Solar Lifetime"
        value_template: "{{ (states.sensor.solar_production.attributes['wattHoursLifetime'] | float / 1000000 ) | round(2) }}"
        unit_of_measurement: 'mWh'
1 Like

Any update on a fix on this matter, not the provided workaround up here??

I haven’t seen a fix, but the workaround is the same as the component, just less code to configure.

Since hass 2020.12, i have the same problem. No refresh for envoy enphase since yesterday.
I don’t use rest platform, i use platform enphase_envoy

This particular issue is fixed in 2020.12.1.

1 Like

It’s ok for me, thanks