When I go to the initial screen of the Energy dashboard, it has a series of prompts…and it has the sensors from my enphase system, but they are cumulative sensors:
Grid consumption is not given by the envoy box, instead it gives you how much you consume in total, and how much you produce, as a power metric.
So grid consumption is the difference between total consumption minus production: you can achieve this by doing this:
Template sensors under “template:”
- sensor:
- name: Grid Import Power
state_class: measurement
icon: mdi:transmission-tower
unit_of_measurement: W
device_class: power
state: >
{{ [0, states('sensor.envoy_xxxx_current_power_consumption') | int(0) - states('sensor.envoy_xxxx_current_power_production') | int(0) ] | max }}
- sensor:
- name: Grid Export Power
state_class: measurement
icon: mdi:transmission-tower
unit_of_measurement: W
device_class: power
state: >
{{ [0, states('sensor.envoy_xxxxx_current_power_production') | int(0) - states('sensor.envoy_xxxxx_current_power_consumption') | int(0) ] | max }}
Sensors under “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
Then add “Grid export power” and “Grid import power” to the energy dashboard