Envoy integration- reversed sign of grid power

I am using the Envoy integration.

Solar production is shown correctly on the integration.

However, the house consumption in the Envoy seems to be displayed as Grid in the integration.

Then the house is being shown as the sum of the two- so way, way too high.

My Envoy has been working perfectly for 5yrs and everything shows correctly in ENLIGHTEN.

So I think there are differing Envoy setups (for instance CTs can be configured in a couple of different ways).

I cannot find any settings to tweak. Any thoughts about how to fix this?

1 Like

What do you mean by that? The Envoy integration creates 8 sensors - 4 for production and 4 for consumption - and none of them says anything about the grid.

My “Today’s Energy Consumption” sensor is pretty close to the house consumption value displayed in the Enphase app (and probably just a bit off because the app is many minutes delayed).

If you have a look at these two screen shots, it should be clear. As a newbie I can only put one per post.

Above shows grid total reporting the actual consumption, which is incorrect. Here is the other pic. I have configured nothing because I cannot see where I chan change anything wrt sensors.

envoy1

OK, thanks for the clarification. Unfortunately you cannot directly add the consumption sensor to the energy dashboard under “Electricity grid”.

I wanted to find you a link to one of the plenty threads in this forum explaining what additional sensors you will need, but couldn’t find one quickly, so here is my own configuration:

First you need to calculate power exporting and power importing from your production and consumption sensors (your sensor names may be a little different):

template:
  - sensor:
      # Generation  to grid
      - name: "Current Power Exporting"
        unique_id: envoy_current_power_exporting
        unit_of_measurement: 'W'
        state: "{{ [0, (states('sensor.envoy_current_power_production') | int(0) - states('sensor.envoy_current_power_consumption') | int(0))] | max }}"
        state_class: "measurement"
        device_class: "power"
        availability: "{{ not is_state('sensor.envoy_current_power_production', 'unavailable') and not is_state('sensor.envoy_current_power_consumption', 'unavailable') }}"
      # Grid to house
      - name: "Current Power Importing"
        unique_id: envoy_current_power_importing
        unit_of_measurement: 'W'
        state: "{{ [0, (states('sensor.envoy_current_power_consumption') | int(0) - states('sensor.envoy_current_power_production') | int(0))] | max }}"
        state_class: "measurement"
        device_class: "power"
        availability: "{{ not is_state('sensor.envoy_current_power_production', 'unavailable') and not is_state('sensor.envoy_current_power_consumption', 'unavailable') }}"

And then you calculate the energy imported and exported:

sensor:
  # Aggregating data
  - platform: integration
    method: left
    source: sensor.current_power_importing
    name: Lifetime Imported Energy
    unit_prefix: k
    round: 2
  - platform: integration
    method: left
    source: sensor.current_power_exporting
    name: Lifetime Exported Energy
    unit_prefix: k
    round: 2

These last two sensors are the one you add to your energy dashboard.

For comparison, this is how my day looked like:

Thank you. I’ll work on it using your example.
Very helpful.

1 Like

Worked very well.
Thank you!

2 Likes

How are you all getting consumption to even work?? I used “Enphase Envoy (DEV)” repo in HACS. I only get solar production. No sensor is available via this to add for consumption. Happy to change to another repo to get this to work.

EDIT: Adding screenshot
image

But your screenshot shows that you have a consumption sensor?! The integration should create 4 consumption sensors in total, and you can then use the current power production and consumption sensors to calculate imported and exported energy, as I have described above.

Which integration did you use? I can redo this and see where I get to.

I use the built-in Envoy integration

Lucky you. My system install was after it all broke for new installs. Stuck with HACS options. Okay just found a HACS integration that doesn’t err on consumption. Will see if it starts showing data and then loop back to your template!

1 Like

Good afternoon, I am new to this and I have just installed the solar panels with Envoy. I have Envoy (DEV) integration.
The current consumption and production sensors do not appear in the energy panel. If you recognize them with this name:
sensor.envoy_122xxxxxxxx_current_power_consumption.
Could you tell me where I should make the changes you indicate?
Thank you very much in advance.

image

That is correct - those sensors are just providing the raw data from your Envoy and are not suitable as-is to be used in the energy dashbboard.

You have to copy the configuration from my post above and replace the power consumption and power production entity names with your own.
I personally use package files to organise my configuration, so that in this example the 4 new sensor definition can stay together.

Where does this part go? I added that in configuration.yaml after the template and didn’t see anything created after a reload.

I can see that you have already received quite a bit of help in the other thread. Is that now all working for you?

Just in general, I would really recommend looking into distributing your configuration into package files. That way you can keep all configuration of a particular topic together.

Hey there. Yeah I was completely lost so that thread helped me understand where/how to drop those into config. I see what you mean though and will do that once I get it working.

At this point, I see the two new sensor entities in the Dashboard options to add. I’m assuming lifetime is daily totals adding up daily based on your example screenshot.

Weirdly, this is what I’m getting even after restarting HA:

This is what is in the configuration.yaml with the edits to match my Envoy entity names:

template:
(other templates removed)

  - sensor:
      # Generation  to grid
      - name: "Current Power Exporting"
        unique_id: envoy_current_power_exporting
        unit_of_measurement: 'W'
        state: "{{ [0, (states('sensor.envoy_202240181134_current_power_production') | int(0) - states('sensor.envoy_202240181134_current_power_consumption') | int(0))] | max }}"
        state_class: "measurement"
        device_class: "power"
        availability: "{{ not is_state('sensor.envoy_202240181134_current_power_production', 'unavailable') and not is_state('sensor.envoy_202240181134_current_power_consumption', 'unavailable') }}"
      # Grid to house
      - name: "Current Power Importing"
        unique_id: envoy_current_power_importing
        unit_of_measurement: 'W'
        state: "{{ [0, (states('sensor.envoy_202240181134_current_power_consumption') | int(0) - states('sensor.envoy_202240181134_current_power_production') | int(0))] | max }}"
        state_class: "measurement"
        device_class: "power"
        availability: "{{ not is_state('sensor.envoy_202240181134_current_power_production', 'unavailable') and not is_state('sensor.envoy_202240181134_current_power_consumption', 'unavailable') }}"


# Sensor Entities (Non-Template)

sensor:
  # Aggregating data
  - platform: integration
    method: left
    source: sensor.current_power_importing
    name: Lifetime Imported Energy
    unit_prefix: k
    round: 2
  - platform: integration
    method: left
    source: sensor.current_power_exporting
    name: Lifetime Exported Energy
    unit_prefix: k
    round: 2

In this case the lifetime sensors just keep increasing indefinitely, and the energy dashboard picks up the change for each day.

Ah, yes, I have seen that before when helping someone else with this integration. There is a short period of time (a couple of hours?) while the sensors build up some initial data before that all works properly on the enegery dashboard.

Copy all. Seems to be working now after not checking it overnight. No solar generated just yet but no more errors and it does show the correct 2kwh import since midnight.

1 Like