Need testers for updated Enphase Envoy sensor

The indentation is incorrect. Also missing a sensors definition under platform (which inst_power_differnence is a child of).

sensor:
- platform: template
  sensors:
      inst_energy_difference:
        friendly_name: Instant Energy Difference
        icon_template: >
          {% if (states("sensor.inst_energy_difference") | int > 0) -%} 
            mdi:solar-panel
          {%- elif (states("sensor.inst_energy_difference") | int < 0) -%}
            mdi:transmission-tower
          {%- else -%}
            mdi:power-off
          {%- endif %}
        friendly_name_template: >
          {% if (states("sensor.inst_energy_difference") | int > 0) -%} 
            Currently Exporting
          {%- elif (states("sensor.inst_energy_difference") | int < 0) -%}
           Currently Importing
          {%- else -%}
            Balanced
          {%- endif %}
        unit_of_measurement: "W"
        device_class: power
        value_template: >
          {{ '%0.1f' | format(states('sensor.hauxtonenvoy_current_energy_production') | float - states('sensor.hauxtonenvoy_current_energy_consumption') | float) }}
1 Like

Great! Thanx @dgaust

It seems so simple once you get it working! I will try to learn more about cards and sensors and templates. I managed to get the inst_energy_difference card installed to my dashboard so wait to see what happens tomorrow if we get any sunshine here in the UK! I also made some automation with positive values of the inst_energy_difference as the trigger so hopefully my UFH will come on at different solar outputs for each room.

P.S. what is that card called which graphs two values? I couldnt find it in the dashboard and tried searching for dual cards but did not uncover anything yet.

EDIT: Is it the HACS mini-graph-card?

Thanx again :slight_smile:

No worries. Yes it is the mini-graph-card from HACS, the card yaml is below

entities:
  - color: Green
    entity: sensor.solarenvoy_current_energy_production
    index: 0
    name: Generation
    show_state: true
  - color: Yellow
    entity: sensor.solarenvoy_current_energy_consumption
    index: 1
    name: Consumption
    show_state: true
hours_to_show: 14
icon: 'mdi:solar-power'
name: Solar
value_factor: -3
unit: kW
points_per_hour: 4
type: 'custom:mini-graph-card'
1 Like

Hello, I would love to be able to recreate the enphase energy website display, EDIT: no time for this right now. ignore me.

since my installer wont let me have access to enlighten and enphase says its up to the installer. long story but tl;dr i cant get access.

specifically , a display like this with the grid of panels that are color coded, each panel color coded to the amount of wattage they are producing. e.g. grey = zero watts, red = under 100 w, orange 101-200, 201-250watts yellow, green 251-300w+

i want this because i have some trees and i am thinking of chopping some down to see results.
I guess I have to learn the scripting, was just hoping if someone already did something similar that they could share , or share tips / tricks…

THANKS btw.

my installer wont let me have access to enlighten

If you mean access to Enlighten manager, all I had to do was fill out their form to sign-up via credit card. The docs had said I’d need an invite from my installer, but things changed somewhere along the way. https://enphase.com/en-us/support/upgrade-module-data-through-enlighten-manager

That being said, I don’t find the reports or displays in Enlighten Manager to be very useful to me the homeowner. That solar panel heat map is useful if you are looking at it at the right time. Time based graphs are much more useful.

If you haven’t already in home assistant, plot the power output, and the sun elevation. Since I don’t have any trees tall enough to shade my roof, the power output (current watts) follows roughly the same curve as the angle of the sun. (At least until it gets cloudy.) I’m using a basic template sensor to extract the elevation angle from sun.sun. I also use that sensor to figure out the right time to turn on the outside lights. On clear days any drops in output are most likely to be shading.

Since the sun angle changes throughout the year you might want to look at any historical data you have before taking down any trees that will take a long time to grow back. For part of the year my chimney shades a couple of my panels in the afternoon. If I looked at only the data from that time of year, I wouldn’t have put panels in that place. Over the course of the year, they manage to generate enough energy that they were worth installing.

I found but haven’t tried this github repo GitHub - baysinger/enphase_scraper: Downloads per-inverter data from your solar array. that will download a file per inverter per day over a given date range.

Thanks , that scraper is for scraping from the enlighten manager website, to which I do not want to pay for.

My installer has its own website for monitoring and it sucks too. see picture below

I can access and download my inverter data directly right now over my local network from my envoy s. I had homeassistant doing that, although my sd card just burned out last night so i need to redo my rpi install .

@somejerk

Well you could always look at your current system inverter numbers and record them (so you don’t have to go up on the roof and under all the panels), then go buy yourself a new Envoy-s and Install it yourself. It’s easy enough. But you would have to send a support request to Enphase to unregister the micro inverters from the old Envoy-s did that they can be re registered on to the me one.

Following on from @gregtd’s great work, I’ve made an update to the Enphase Envoy sensor. This change allows the update rate of the Inverters production to be adjusted independently of the other sensor production updated rate.

I made this change to fix a problem that I was encountering where the Enphase Envoy sensor data would be Unavailable for long periods of time. By looking at the sensor debug logs I could see that the time taken to fetch the data from the Envoy-S would increase until it exceeded the 30s timeout limit and then it could stay unavailable for long periods. After a bit of searching I found that this was a know issue related to overloading the Envoy-S server.

Since the Inverters only update every 5 or 15 mins, depending on Envoy-S configuration whereas production data updates every minute it makes sense to decouple the two update rates.

The change introduces two new configuration parameters:

  • inverter_update_period - integer value which defines minutes between Inverters data update requests sent to Envoy-S
  • inverter_logging_full - boolean value that defines whether to send the last Inverters data during a async_update_data() fetch so that the inverter entity information doesn’t show Unknown.

I use:

  - platform: enphase_envoy
    ...
    inverter_update_period: 5
    inverter_logging_full: False

as I don’t want to fill my logs with duplicate data. Not including the new configuration parameters, and thus leaving them at defaults, will result in behaviour identical to the current sensor.

If you want to try my update then you will need to replace the homeassistant/components/enphase_envoy/sensor.py with this version. This change also requires an update to jesserizzo/envoy_reader included in PR#63 which is located at /usr/local/lib/python3.8/site-packages/envoy_reader/envoy_reader.py for my system.

After changing these two files and updating your configuration.yaml you will need to restart HomeAssistant.

I have also added associated debug statements, so you can see what the sensor is doing by enabling debug logging:

logger:
  default: info
  logs:
    homeassistant.components.enphase_envoy: debug

in your configuration.yaml

2 Likes

hello,
how to create sensor/card like this web page enphase please ?

04 05

Hello,
I’m using this:
1° create energy_importing Watt
2° convert into Wh
3° create a daily Wh
4° energy independence
Pierre

calcul power import (W)

  energy_importing:
    friendly_name: 'Current Energy Importing'
    value_template: '{{ [0, (states('sensor.pv_envoy_current_energy_consumption') | int - states('sensor.pv_envoy_current_energy_production') | int)] | max }}'
    unit_of_measurement: 'W'
    icon_template: 'mdi:flash'    

Création de l’énergie importée du réseau en Wh

  • platform: integration
    source: sensor.energy_importing
    name: energy_imported_wh
    unit_prefix: k
    round: 2
    method: left

creation energie journaliere importée en Wh

utility_meter:
daily_energy_import:
source: sensor.energy_imported_wh
cycle: daily

Création du taux d’Independance Energetique

  • platform: template
    sensors:
    taux_independance_energetique:
    friendly_name: ‘taux Independance Energetique’
    value_template: ‘{{ ((1 - ((states(‘sensor.daily_energy_import’)|float *1000 / states(‘sensor.pv_envoy_today_s_energy_consumption’)|float)))*100)| round(1) }}’
    unit_of_measurement: "%’

merci @mathep34

je test

it possible for you to post this on french forum ?

Hi @mathep34
Bonjour!

Does this method of Energy Independence require the HA instance to have been running from midnight to get the historical Imported Power reading from 00:00? I note on the Enphase Enlighten App that they have a “Imported” energy figure. Do you know if it is possible to extract that from the Ehphase Envoy-S directly as with the other available data in HA using any addition to this:

# EnPhase Data
sensor:
  - platform: enphase_envoy
    name: Hauxton
    ip_address: 192.168.xx.xx
    username: envoy
    monitored_conditions:
      - production
      - daily_production
      - seven_days_production
      - seven_days_consumption
      - lifetime_production
      - lifetime_consumption
      - consumption
      - daily_consumption
      - inverters

Then the Energy Independence would match the Enlighten App exactly?

Hello @angusc ,
I did it like this because I don’t know how they calculate it .
I have same config

And, Energy Independence is not exactly same…
Pierre

1 Like

Ok thank you, according to enlighten app they calculate like this:

But they don’t subtract the solar that we export to grid so their percentage is on the favorable side to us, but I guess helping mother earth with our green solar.

Hopefully someone will add support to read Envoy data on Enpower and Encharge batteries as well. I see that http://envoy.local/home.json returns some data on both, for those Envoy’s which have the latest firmware.

I’m working on retrieving battery data from production.json page of the Envoy.

Though I have some questions as I don’t have an Envoy with ACB or Encharge or the Encharge Smart Switch device.

I can pull the Battery data and display this in Home Assistant:

For most users without Batteries installed the production.json web page returns this at the end of the page:

...
"storage":[{"type":"acb","activeCount":0,"readingTime":0,"wNow":0,"whNow":0,"state":"idle"}]}

Though the one (and only one that I’ve seen) where batteries were installed the production.json returned this at the end:

...
"storage": [{"type": "acb","activeCount": 4,"readingTime": 1595203104,"wNow": -178,"whNow": 285,"state": "charging","percentFull": 6}

The difference between the two is the percentFull attribute.

I’m thinking rather than display the above data in Home Assistant for everyone, only display the battery data if the percentFull attribute is present, which would result in something like this in Home Assistant:

The questions I have for everyone is:

  • Is percentFull always only shown for systems that have batteries installed?
  • For @ryans suggestion to display the status of the Encharge Smart Switch, would it make sense to display it as a separate entity in Home Assistant as this device can be installed without Batteries?
1 Like

Hello,

I am struggling to get off the ground here. New to HA. Have SSH setup, have edited my configuration.yaml with the following at the end of the file - so it looks like this in its entirety:

# Configure a default setup of Home Assistant (frontend, api, etc) default_config:

Text to speech

tts:

  • platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

ENPHASE ENVOY (SOLAR) SENSOR

  • platform: enphase_envoy
    name: envoy
    ip_address: 192.168.0.242
    monitored_conditions:
    • consumption
    • production
    • daily_consumption
    • daily_production
    • seven_days_consumption
    • seven_days_production
    • lifetime_consumption
    • lifetime_production
    • inverters

I have done nothing with any python scripts etc… not sure if this matters, but am running HA on Pi. I do not seem to have a homassistant or a components directory so unsure where to start.

Can anyone offer some baby steps for me to get going please?

thanks

Mark

apologies about the formatting of the contents of the configurations.yaml

Are you looking for suggestions on how to display the Envoy data? Or are you having problems even seeing the Envoy data?