Energy Management in Home Assistant

I added the state_class: property to the ultility_meter: yaml and config check fails.
What do I do wrong?

1 Like

I don’t think you need state_class on utility_meter. Mine show up for selection in the energy dashboard without any editing.

It works with Tibber if you have realtime meter (Pulse or Watty).
You will not get total solar production from Tibber, you can get that from your inverter.

That is smart! :slight_smile:

I believe it is the accumulated total, Home Assistant doesn’t do consumption on “live” usage - unless you use the integration component.

I think you should use the accumulated total energy consumption in kWh, the power consumption in W is only a snapshot of the as-is.

As far I read you must use for the pv input the total energy production of it
Is there an easy way to calculate from daily generating to an total generation because I have only actual power and daily production.

I do have a Pulse, and use the Ginlong (Solis) inverter data for solar production. Tibber Accumulated consumption + Tibber acc. production + Ginlong solar generated, all kWh,

Thanks. I added state_class: measurement and last_reset: 1970-01-01T00:00:00+00:00 to my sensor.power_total_* entities which have the kWh for consuming and producing energy (peak and off-peak) via a customs_glob in my config.
After restarting HA, I was now able to select these entities and add them for consumption or return and I added static prices.

Besides the costs for energy, here in NL, we also pay a daily fee for energy transport and network maintenance.
Is there a way to include these costs also somehow?

Hi @slovenc,
I used a simple Node Red automation to toggle the state of two input booleans at specific times and created a template sensor in the configuration:

- platform: template
  sensors:
    energy_price:
      friendly_name: "Energy Price"
      unit_of_measurement: 'Eur/kWh'
      value_template: >
        {% if is_state('input_boolean.horario_vazio','on') %}
          0.110577
        {% elif is_state('input_boolean.horario_fora_vazio','on') %}
          0.237636
        {% else %}
          0
        {% endif %}

Hope it helps.

1 Like

Hi Frenck, I also have a solar edge converter but I can get the integration working. After entering the site id and api key I get an unknown error.
I did use the integration in the past, maybe that causing the issue. Could you please help?

My apologies if this is answered… I searched and then read through, but I didn’t see this anywhere.

My rate structure for consumption is:

BASIC RATE PER MONTH
$14.20 * for the first 50 kWh or less
$0.093655 per kWh for all kWh in excess of above

How do I account for that in my tariff setup?

I’m interested in the 3 tariffs. I posted my code in the following post but couldn’t get it to work. Energy Management in Home Assistant - #383 by kinteseay

Got it fixed. In the core.config_entries file there was an old SolarEdge section. After removing it and a HAS reboot I managed to install and configure the SolarEdge extension.

Example of how I got 3 tariffs working:


template:
  - sensor:
      - name: Tariff Price
        state: >
            {% if is_state('utility_meter.daily_energy', 'peak') %}
                {{ 0.541145 * 0.75 }}
            {% elif is_state('utility_meter.daily_energy', 'shoulder') %}
                {{ 0.277145 * 0.75 }}
            {% else %}
                {{ 0.177045 * 0.75 }}
            {% endif %}

See this link for full details

Hi,
I tried many options, but I am not getting my entities visible in Grid consumption list.
Can you notice any failure…

Below are my sensors:

- platform: mqtt
  name : "MQTT House Meter Reading"
  unit_of_measurement: "kWh"
  device_class: energy
  state_topic: "vzlogger/data/chn2/agg"
  expire_after: 3600
  force_update: true

- platform: template
  sensors:
    electric_meter:
      friendly_name : "Electricity Meter Reading"
      unit_of_measurement: "kWh"
      # device_class: power
      device_class: energy
      value_template: "{{ (states('sensor.mqtt_house_meter_reading') | float / 1000) | round(3) }}"
1 Like

Thanks Hamish. When I set up as you have the “energy distribution” is not accurate - I am pulling about 1kw at the moment (it’s the middle of the night and the kids heater is on) but it says 3.3kw. In fronius app it shows 1kw. Any clues on what’s happening here?

Hi! Could homeone point me to the right direction how to purge energy usage history? I had a faulty config in my home assistant glow and now it says that I have used a months worth of energy in the last couple of days. I tried recorder purge for the glow-device and it’s entities but it didn’t help.

You are missen the ‘h’ in the round images. I think it is correct. The value in the circle is the cumulative value of the day. 3.3 is the sum of the bars of the day.
kW is the actual consumpion per second. W= Joule/second.

kWh is consumption over a timespan of an hour.

You can use 100kW for one second, and 0 for the other 3599 seconds and still end up with low kWh value.

You see in the y axis of the bars, the kWh is about 0,8 per bar. 800W. That looks correct

1 Like

Thanks , I see how it works now. Those kinds of graphics usually show real-time, updated every few seconds so that (and the animations!) threw me a little but now I notice the “h” you are right.

Would love to see a real-time version of this visual too.

1 Like