Enphase Envoy - D7 firmware with JWT - A Different Approach

At this screen, you can either press the first blue button to login to enphase with your email/password to generate a JWT or you can paste in your 408 character JWT into the token text box.
Either way your web browser doesn’t remember this for long so you will have to do this step often when browsing to the envoy from the web browser which is annoying.

Core log quick view shows no errors. REST-related errors, IP address errors, or password errors are not present in the full log.

Another issue previously seen is forgetting to put “Bearer in front of the 408charactertoken and put ” at the end of the line in secrets.yaml

1 Like

Is this normal for the template sensors to show error in visual studio?

This solved it. Sorry for not reading the full instructions.

1 Like

I use the file editor addon to edit the configuration.yaml as I feel it might have more yaml logic to detect issues specific to home assistant.

Thanks.

May I ask what specifically was missing incase anyone else has issues in the future?

Edit: I see you replied to my “Bearer “ comment so I assume that’s what was missing.

1 Like

Wow - just, wow! Your normal detailed explanations of something many would struggle with (including me). I was using your original code to integrate my D5 Envoy until I moved. I’ll be putting solar on my new house, so this post will get a big, fat bookmark. Thank you!

Is there a way to split out per-phase consumption and production using this method for 3-phase systems?

1 Like

Hi @Sddawson,

Thanks so much!

There is information per phase in the url that I am polling, so it is possible, I just haven’t tested it myself as I’m on single phase.

Here is an example of per phase information available in the url.

OK, great, that’s promising. Thanks again.

1 Like

As usual,@del13r, you rock!!! Thank you so much for this detailed guideline. It’s working perfectly and the best thing is that you don’t need to integrate the envoy into HA.

1 Like

Thanks so much for posting this, tons of detail that is super helpful. I’m struggling to figure out why Energy Export is not working ( "{{ (value_json[1].actEnergyRcvd / 1000 | float(0)) | round(2) }}"). This value is always coming back as zero for me. Below is an example call response. Any thoughts?

[
  {
    "eid": 704643328,
    "timestamp": 1690079407,
    "actEnergyDlvd": 609552.964,
    "actEnergyRcvd": 29.698,
    "apparentEnergy": 755217.114,
    "reactEnergyLagg": 55503.243,
    "reactEnergyLead": 131274.361,
    "instantaneousDemand": -0,
    "activePower": -0,
    "apparentPower": 673.81,
    "reactivePower": 662.942,
    "pwrFactor": 0,
    "voltage": 245.867,
    "current": 5.481,
    "freq": 60,
    "channels": [
      {
        "eid": 1778385169,
        "timestamp": 1690079407,
        "actEnergyDlvd": 304642.56,
        "actEnergyRcvd": 13.049,
        "apparentEnergy": 377519.05,
        "reactEnergyLagg": 27749.26,
        "reactEnergyLead": 65708.794,
        "instantaneousDemand": -0,
        "activePower": -0,
        "apparentPower": 336.719,
        "reactivePower": 330.77,
        "pwrFactor": 0,
        "voltage": 122.941,
        "current": 2.739,
        "freq": 60
      },
      {
        "eid": 1778385170,
        "timestamp": 1690079407,
        "actEnergyDlvd": 304910.404,
        "actEnergyRcvd": 16.65,
        "apparentEnergy": 377698.064,
        "reactEnergyLagg": 27753.984,
        "reactEnergyLead": 65565.568,
        "instantaneousDemand": 0,
        "activePower": 0,
        "apparentPower": 337.091,
        "reactivePower": 332.171,
        "pwrFactor": 0,
        "voltage": 122.926,
        "current": 2.741,
        "freq": 60
      },
      {
        "eid": 1778385171,
        "timestamp": 1690079407,
        "actEnergyDlvd": 0,
        "actEnergyRcvd": 0,
        "apparentEnergy": 0,
        "reactEnergyLagg": 0,
        "reactEnergyLead": 0,
        "instantaneousDemand": 0,
        "activePower": 0,
        "apparentPower": 0,
        "reactivePower": 0,
        "pwrFactor": 0,
        "voltage": 0,
        "current": 0,
        "freq": 60
      }
    ]
  },
  {
    "eid": 704643584,
    "timestamp": 1690079407,
    "actEnergyDlvd": 447569.605,
    "actEnergyRcvd": 0,
    "apparentEnergy": 502202.254,
    "reactEnergyLagg": 2024.422,
    "reactEnergyLead": 117567.086,
    "instantaneousDemand": 1337.395,
    "activePower": 1337.395,
    "apparentPower": 1564.312,
    "reactivePower": -447.998,
    "pwrFactor": 0.855,
    "voltage": 245.852,
    "current": 12.745,
    "freq": 60,
    "channels": [
      {
        "eid": 1778385425,
        "timestamp": 1690079407,
        "actEnergyDlvd": 202699.984,
        "actEnergyRcvd": 0,
        "apparentEnergy": 230382.355,
        "reactEnergyLagg": 278.095,
        "reactEnergyLead": 40389.948,
        "instantaneousDemand": 521.862,
        "activePower": 521.862,
        "apparentPower": 625.919,
        "reactivePower": -92.514,
        "pwrFactor": 0.837,
        "voltage": 122.924,
        "current": 5.122,
        "freq": 60
      },
      {
        "eid": 1778385426,
        "timestamp": 1690079407,
        "actEnergyDlvd": 244869.621,
        "actEnergyRcvd": 0,
        "apparentEnergy": 271819.9,
        "reactEnergyLagg": 1746.327,
        "reactEnergyLead": 77177.139,
        "instantaneousDemand": 815.533,
        "activePower": 815.533,
        "apparentPower": 938.393,
        "reactivePower": -355.483,
        "pwrFactor": 0.867,
        "voltage": 122.928,
        "current": 7.623,
        "freq": 60
      },
      {
        "eid": 1778385427,
        "timestamp": 1690079407,
        "actEnergyDlvd": 0.031,
        "actEnergyRcvd": 0,
        "apparentEnergy": 346.265,
        "reactEnergyLagg": 23.294,
        "reactEnergyLead": 0.311,
        "instantaneousDemand": 0,
        "activePower": 0,
        "apparentPower": 1.542,
        "reactivePower": -0,
        "pwrFactor": 0,
        "voltage": 12.485,
        "current": 0.123,
        "freq": 60
      }
    ]
  }
]

Cheers @jon102034050 thanks for the kind words.

There’s your problem. Unfortunately I cannot explain why your envoy is returning 0

If I was to make an assumption, maybe your ct clamp is installed in the load only location.

1 Like

Thanks for confirming, my solar is brand new, so I guess I’ll just keep digging.

If I was to make an assumption, maybe your ct clamp is installed in the load only location and possibly only measuring what your house is consuming.

Looking at this diagram, my assumption makes sense.

Here is my setting from https://envoy.local/installer/setup/home#meters/detail/consumption

1 Like

hmm, I get a 401 when I attempt to hit /installer/setup/home#meters/detail/consumption

Is there an installer button at the bottom of the page?

Could also try
https://enlighten.enphaseenergy.com/systems/yoursystemid/devices?status=active

I get a 401 when I attempt to click the installer button from the local IP address page. From googling around, it looks like I might have to request this access from my installer.

Thanks for hanging with me while I figure this out, I appreciate it! Your guess was spot on, I paid the money for Enlighten Manager and can now see that my consumption meter is set to Load only. I guess next step is to contact my installer to figure out the reasoning for this

image

1 Like

@del13r - as others have said "You are a legend".

I used your original guide to set up the sensors for the Energy dashboard and my own energy dashboard and data. It has been extremely useful to maximise efficiency from my solar set-up. I find my dashboard is far more useful than the Enphase app and website - in fact I very rarely use them because they are often hours out of date.

My dashboard gives me a continual read-out of my import cost, FIT income and even how much money I have saved by self-consumption of solar. I get a live net cost/income each day - including the network charge which accounts for almost 50%.

Similar to the gauges you use, I find this most useful to decide whether the dishwasher can go on…etc etc
Power gauge

Your set-up will give me a much more real-time picture.

EDIT: I did notice my net power - which should be negative at this point (sun just gone down) is positive, so using the rest setup that graph above would be showing +0.464kw, not the actual -0.464kw

I am not sure why because I did a copy and paste of your example - just with the word “rest” so I could differentiate from my existing sensors.

  - name: "Power Net Rest"
    value_template: "{{ value_json[1].activePower | int(0) }}"
    state_class: measurement
    device_class: power
    unit_of_measurement: W
    icon: mdi:transmission-tower

EDIT 2
I did notice in the json output activePower was showing as positive:
“reactEnergyLead”: 0.063,
“instantaneousDemand”: 0.637,
“activePower”: 0.637,