Energy Management in Home Assistant

I dont understand this.

where to put the code with the beginning :

-platform: integration


You put it in the configuration.yaml file. Do not try to put it within a template sensor block.

It goes after



  - platform: integration
    source: sensor.house_consumption_value
    name: Imported Energy
    unit_prefix: k
    round: 2
    method: left

I use Enphase Energy (Solar) for my CT monitoring.
Trying to figure out how to make this mesh/work for me in HA.

Hard thing to figure out is… Enphase only provides Consumption (from breaker panels via CTs) and Production (kWh from solar panels).

Reviewing Enlighten Dashboard → This is the enphase toolset
The grey on the top (blue/grey) is what I Imported from the grid.
The grey on the bottom (orange/grey) is what I sold back to the grid.

and then comparing to the HA Energy Dashboard…
I didn’t use 210kWh today… It is mis-calculating

…This doesn’t really line up correctly.
Only have 2 data sets to work with makes it a challenge. I am trying to work with custom sensor templates, like Consumption - Production = ? (Unsure what this value would get me).

Wondering if Sense would be of any value?
Or if anyone in Colorado uses IREA and knows how to use their API to retrieve data values?

Enphase entities from the integration:

Could be related to the data resolution. If enphase has 15min power values, HA should poll the API at least every 15min.
Is the frequency of polling the API aligned with your data resolution in Enphase?

Hi @fireheadman.

I have already posted this link many times including as a reply to one of your posts.

Please read this thread as I have my enphase envoy working perfectly with Energy Dashboard.

1 Like

No, when you use the enphase integration, it scrapes the http://envoy.local/production.json file every minute.

People don’t read the damned thread. They post the same question over and over because their time is more important than anyone elses, and they can’t simply read a thread and learn something. Even the search button is too difficult.


You are not wrong, I had already replied to fireheadman that exact point!

I found the solution:
purge_keep_days: 1000

db_url: ‘sqlite:///:memory:’ <<<<-----this erase when you restar pc

ahhh yeh, of course it will.

Hi. Below is a screen from my mobile phone. The phone is an iPhone 6 with a HA app. As you can see there is a little problem with display home consumption value. Did anybody have a similar problem? This bad visualization I have on the iPhone HA app and on the web browser on it. The same situation was on my Samsung tablet. On PC everything works perfectly.

Im running iPhone 6s (14.7.1) and HA iOS 2018.8 I have NOT got that issue.

Suggest checking App Configuration > General > Page Zoom ??

Solar and Consumption in under wrong hours

I checked this whole post but couldn’t find an answer.

Can someone help me with two problems which might be related:

the first hour of the day shows a big negative for both solar en consumption. These are clearly the reset figures of the previous day. But how do i get them in the previous day?

During the day the figures in the columns are two hour out i.e. the production and consumption from 9:00 to 10:00 are shown under 7:00am

I check the date and time and both Europe/Lisbon and UTC are correct?

Any help would be much appreciated.

I want to explore this new feature of the latest HA release now that I have solar panels installed.
Nonetheless I’m stumbling on the very basic step: how do I enable or activate this? I cannot find energy management configurations anywhere and if I use the “energy configuration page” on the documentation (Energy Cards - Home Assistant), I get to a 404 error (

1 Like

@sparkydave, that was it, thank you very much!

Now I have another problem. In order to use simpler names for the power and energy sensors that are generated by the Fronius integration, I setup a set of template sensors (using the template integration) for each of those Fronius sensors.
Each sensor state property is just a simple expression that returns the state of the original Fronius sensor.

When I try to select a sensor on the Energy configuration dropdowns, all I get to choose is one of the Fronius sensors (the one on the second row on the image I’m posting here), besides other energy related sensors that are associated with my zwave devices. The template sensor that I created (highlighted in red on the image below), although it has the proper state class as “measurement” it does not show on the dropdown.
Here is its definition:

  - name: "energy_total_fronius_inverter_1"
    unit_of_measurement: 'Wh'
    state_class: "measurement"
    device_class: "energy"
    state: " {{ (states('sensor.energy_total_fronius_inverter_1_http_192_168_1_99') |float) }}"

How can I set my custom sensors so that they show up in here?

I just posted my config here:
Shelly EM Energy Management Setup MQTT

Its not good idea, I have local raw data from daily production and it’s OK.
I will not download data from the cloud as I have locally available data.
I will also not set up a separate database to accumulate data locally.
Entity data is correct - Energy tab displays them wrong

No doubt your PR will fix it. Thanks for contributing so positively.