Skip to main content

Enphase Energy and HomeAssistant

If you have Enphase solar PV and battery systems, it is relatively easy to integrate them with HomeAssistant.

Enabling Battery Calculations In Energy Dashboard

This guide was written in September 2025 with HomeAssistant 2025.9.3

By default, the Envoy IQ Battery 5P doesn't come with charging and discharging CTs. However, there is a sensor that shows how many watts are flowing to or from the battery at a given time (if it's negative the battery is discharging, if it's positive the battery is charging).

Identify Your Power Sensor ID

You'll need to track down your encharge sensor id by going to Settings > Devices & Services > Enphase Envoy > Encharge <some id>

Click through to "Power":

image.png

If you click "Show more" Home Assistant will open up a longer graph showing the battery power over time and you will see the sensor ID in the URL:

http://homeassistant.local:8123/history?entity_id=sensor.encharge_012345678901_power&start_date=<date>

Make a note of the bolded value for your device.

Add Split Functions

Based on the HomeAssistant Enphase Envoy documentation you can create separate two sensors which are needed for displaying the rate of charge and the rate of discharge separately. Adding something like the following to your config yaml should work 

I recommend using File Editor and Developer Tools for making and applying these changes


# Other configuration...
template:
    - sensor:
        - name: "Battery Discharge Power"
          unique_id: calculated_envoy_battery_discharge_power
          unit_of_measurement: "W"
          device_class: power
          state_class: measurement
          state: "{{ [0, states('sensor.encharge_123456789012_power') | int(0)] | max }}"
          
        - name: "Battery Charge Power"
          unique_id: calculated_envoy_battery_charge_power
          unit_of_measurement: "W"
          device_class: power
          state_class: measurement
          state: "{{ [0, -(states('sensor.encharge_123456789012_power') | int(0))] | max }}"

For Enphase IQ5 Battery, Power is negative when charging and Positive when Discharging

Once you save your config and restart Home Assistant, the Charge and Discharge Power sensors should show up under Settings > Devices & Services > Helpers

image.png

Add Integral Sensors (kwh)

Next we need to create integrals for these values (the power values are in watts/kilowatts and we care about kilowatt-hours)

Click Create Helper and select Integral Sensor

image.png

Select the corresponding sensor from the entity list and set the integration method as "Left Riemann sum"

image.png

You'll need to create these integral sensors for both charge and discharge.

Add Battery Sensor to Energy Dashboard

Finally navigate to your energy dashboard and open the configuration view. Select "Add a battery system". Select "Battery Charge Integral" for energy going into the battery and "Battery Discharge Integral" for energy coming out of the battery.

image.png

It can take an hour or two for HomeAssistant to start collecting and displaying battery data but it will show up in the energy dashboard.

image.png