Energy Management in Home Assistant

The option to do this natively is coming in 2021.10.0


You had me excited by quoting integrations :rofl: I thought there is an upcoming integration for smart meters.

2021.10 will allow use of kWh for gas consumptions.

Side note, my gas tariff price calculation is wrong. The resulting number should be bigger, because every m3 has more energy than 1 kWh. My price conversion came out £0.013 from £0.04.
Because new version allows use of kWh, no point fixing this.

Today was a very good example of the issue with how the energy is calculated and hassio suppressing same values.
In the graph you can see the negative spikes. One in the morning because it is the first negative value of the day so does the calculation over the entire evening and night. The negative spikes during the day are the result of the same issue. Calculation from that negative value until the last negative value in the morning.
In the second graph you can see my negative values over time that are the base for the pruple calculations in the first graph.

Is it only me but did anyone else notice that the yearly energy on the energy page is way off since the first October update? It now gives me a slighly higher value than the current month value, instead of the sum of all months. It was still correct with the last September update. Other values seem correct (day, week, month).

EDIT: Just recheked, it actually shows the monthly value instead of the yearly value.

If I add sept and oct month it equals what I show for year

That’s what it used to do since the start of the energy section in HA and till the first October update of HA, I haven’t changed a thing. Now it shows the current month in “Year”, but it seems that the figure is slightly off compared to the monthly value.

for giggles hit Ctrl-F5

Thanks but a browser refresh isn’t the solution, the problem exists on all my devices that operate as an HA client.


Yesterday, the integration logged my year-round solar production. :frowning:

How can I delete this or change it to normal data?

Thanks for the help!

Only by deleting in the database.

Looking to see if someone can check what I’m doing here. I’m having trouble having ANY energy consumption or cost show up in my graphs. I have energy: enabled in the configuration.yaml

The two sensors I have integrated are:

  - sensor:
      - name: "Server Closet Power"
        unit_of_measurement: kW
        state: >
          {{  (states('sensor.ups_nominal_real_power')|float) / 1000 }}   #Provides Watts, converted to kW   
        device_class: power
        state_class: measurement
          last_reset: '1970-01-01T00:00:00+00:00'
- platform: integration
  name: Server Closet Energy
  source: sensor.server_closet_power
  method: left
  unit: kWh
  unit_prefix: k
  unit_time: h
  round: 2

I have also tried just using the sensor.ups_nominal_real_power itself as the source for the closet energy, however neither totals show up overtime.

I think you have enough with :

  - platform: integration
    source: sensor.ups_nominal_real_power
    name: server_closet_power
    unit_prefix: k
    round: 2
    method: left

Right thanks, that’s what I thought as well but that doesn’t work either! The entity just ends up being “unknown” as a value and never graphs any consumption :-/

should have unit_of_measurement: “W”

The platform: integration is converting it to kWh and that is what you need for the energy dashboards. It can take some time befor the server_closet_power will be available (can take up to 2 hours)

Just double checked that and it set as the following for customize:

  device_class: power
  state_class: measurement
  unit_of_measurement: "W"

Outputs right now at a constant 249

that looks ok

Will keep playing around, glad someone else looked thanks – do you think something might be up with the database? Might need a wipe? I noticed someone reference some energy things saying they needed to add a missing table that may not have upgraded / added it.

i had to add this to the configuration.yaml
#Default Config - Home Assistant


I use Windcentrale. You can also use Windvangers. Both only in NL with Greenchoice.

You can “produce” as much as you want, but the limit is something like 80% of your annual consumption. Besides my solar panels I produce about 2.5 MWh wind.

1 Like

Not sure when they changed/fixed things, but the Energy setup now appears to work just fine with the Tesla Powerwall.

Time zone appears to be ignored, however, and just using UTC.