Enphase Envoy with Energy Dashboard

Hi @mvana, ah yes, you are correct, my apologies for the mix up

I was easily confused by HASS and I wrongly assumed you meant HACS.
HASS = Home Assistant (Native Integrations)
HACS = Home Assistant Community Store (3rd party repositories)

In answer to your question, the code for the native integration is found here.
homeassistant/components/enphase_envoy

I’m quite novice on python code, so unfortunately I can’t help you find where the token is stored.

At the moment, I am using my own solution via the rest sensor, originally because the native integration didn’t support d7 at the time, but now mainly so I can have efficient 10 second updates instead of 60 second updates. The downside is that it is slightly more complicated to setup than the native implementation and I have to manually refresh my token once a year.
Now that the native implementation supports token authentication, I recommend my solution less than the native one for general use.
I still also use the native Enphase integration for recording sensors like “today_s_energy_production” and “today_s_energy_consumption” so I can verify my figures against what the Envoy reports and also check in on the functionality of the native implementation.

One thing that I notice is that your Grid doesnt have an export sensor.
Is this on purpose?

Here is my config for comparison at https://homeassistant.local/config/energy

Mine is a bit more complicated as I have different costs at different times of the day but I recommend having at least an import (grid consumption) and export (return to grid) sensor as well as a production sensor.

I found where it might be stored in the code here

1 Like

The underlying issue I am fighting with is that I do not see the
https://homeassistant.local/config/energy you have shown.

What I have related in the '“config” is http://homeassistant.local:8123/config/entities
and I can see Envoy in integrations or devices
but I didn’t find any configurable properties.
Either I do not know where to look or it isn’t there(?)
May be the time to delete this (native?) integration and install the custom one.
Thanks!

Thanks for the Python pointer. Will look how to dump the key into the log file.

1 Like

Have you tried
http://homeassistant.local:8123/config/energy

Is there anything there that looks like my screenshot?

I recommend you stick with the native integration, because none of the enphase integrations will automatically provide you with import and export sensors because the envoy doesn’t supply import and export readings. This is a gap that home assistant needs to fill using calculations.

The only exception to this statement is
my own solution via the rest sensor which is not an integration, but simply a rest sensor that targets a different source of information than what the enphase integrations use.

For every enphase integration, native or hacs, the following needs to be done.

What you have to do is go to the first post at top of this article and follow the instructions using:

Step1. Template sensors to calculate power import and power export.

Step2. The integration sensor to convert instant power to energy over time.

Once you do those 2 steps, you should be able to choose the new energy sensors in the energy dashboard here

http://homeassistant.local:8123/config/energy

Hi @del13r , thank your for this awesome guide. Quick Question, I’m on latest everything. When I check my unit of measurement for _current_power_consumption and production, it is in kW by default.

Do I need to then change the unit_of_measurement in your template sensor to “kW”.?
If so, then do I also need to remove the unit_prefix of “k” in sensor platform?

Please if you can help / update?

Hmm, that is different to what I get.

My model is an envoy-s-metered-eu (env-s-wm-230). May I ask what model of envoy you have?

Also, are you using the native (built in) enphase integration or a home assistant community store repository (HACS)?

Yes, so they just installed mine 2 months ago and mine is env-iq-am1-240.
And I’m using the native built in new enphase integration.

I changed my YAML to say kW, and remove the prefix, but not sure if that is correct, hence asking you.

here is a screenshot

Was that via the GUI
image

Or via /homeassistant/customize.yaml
image

or did you have to write a new template sensor to divide by 1000W to get 1KW?

no sorry, I meant your code, where you have

unit_of_measurement: W
I changed it to
unit_of_measurement: kW

AND

where you had
unit_prefix: k
I removed that line.

So I don’t know if it will work correctly?

Let me rephrase question.
How should I re-write your code to support my situation, while keeping my defaults?

This code:

Looking at this screenshot, the W to kW conversion appears to be correct.

I would say yes to changing the unit_of_measurement in your template sensor to “kW".

looking at this link:
https://www.home-assistant.io/integrations/integration/#unit_prefix

It says the following:

unit_prefix string (optional, default: None)

Metric unit to prefix the integration result. Available units are k, M, G and T.

Given that statement, I would leave that line as it was with k as the unit_prefix.

Thanks, so that’s what I originally did.
Which is changed W to kW and left the prefix = k.
But then in the chart (graph), it would show kkW (it was adding that prefix).

So now, I just want to make sure I get correct calculus.
I can see the correct on enphase app.

ah ok, in that case, then remove the unit_prefix line

Hi @del13r , Ok so I’ll let it collect for 24 hours, and then switch my energy dashboard. Hopefully, I would be able to see the perfect graph, and what I’m using myself VS what I’m exporting :slight_smile:

I’ll revert back here with my screenshot.

Only worried if somewhere I need to divide or multiple by 1000 :slight_smile:

1 Like

Energy dashboard will only show data from the moment you add the sensors to the energy dashboard onwards.

Just making sure you arent expecting to have a full day of data visible in energy dashboard as soon as you add them.

Right, so for now, since I just added these sensors, energy dashboard doesn’t show anything correct for today.

The long term statistics which energy dashboard uses as a data source used to be calculated at 12 mins past the hour for the previous hour which is why Energy Dashboard warns you with this message:

After setting up a new device, it can take up to 2 hours for new data to arrive in your energy dashboard.

Hi @automateme1,

I have @fireheadman asking a similar question to what you were asking about at Enphase Envoy with Energy Dashboard - #573 by automateme1

Just checking to see if you were able to successfully turn this into a sensor using rest?

1 Like