Skip to content

Instantly share code, notes, and snippets.

@fcamblor
Created July 24, 2023 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fcamblor/c1ba76900fcd04fd4c535fe040eff156 to your computer and use it in GitHub Desktop.
Save fcamblor/c1ba76900fcd04fd4c535fe040eff156 to your computer and use it in GitHub Desktop.
HA Enphase v7 sensors adjustments
template:
# from https://community.home-assistant.io/t/enphase-envoy-with-energy-dashboard/328668
# Envoy's current_power_consumption / current_power_production are not "subtracting" solar production from it
# So we need to deal with it ourselves
- sensor:
- name: Grid Import Power
state_class: measurement
icon: mdi:transmission-tower
unit_of_measurement: W
device_class: power
state: >
{{ [0, states('sensor.envoy_122242068150_current_power_consumption') | int(0) - states('sensor.envoy_122242068150_current_power_production') | int(0) ] | max }}
- name: Grid Export Power
state_class: measurement
icon: mdi:transmission-tower
unit_of_measurement: W
device_class: power
state: >
{{ [0, states('sensor.envoy_122242068150_current_power_production') | int(0) - states('sensor.envoy_122242068150_current_power_consumption') | int(0) ] | max }}
sensor:
- platform: integration
name: Grid Import Energy
source: sensor.grid_import_power
unit_prefix: k
unit_time: h
method: left
- platform: integration
name: Grid Export Energy
source: sensor.grid_export_power
unit_prefix: k
unit_time: h
method: left
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment