Energy Management in Home Assistant

Have you tried to type over the EUR, that worked for me ?

I’ve managed to add total consumption / return / solar template sensors (using this as my starting point and this to set last reset time, thanks for sharing your config).

homeassistant:
  customize_glob:
    sensor.haenergy_*:
      last_reset: "2021-08-05T08:05:00+00:00"
      state_class: measurement

template:
  # Home Energy sensors for HAEnergy
  - sensor:
      - name: HAEnergy Consumption
        state: "{{ states('sensor.emoncms2_import_all_time') | float | round(2) }}"
        unit_of_measurement: "kWh"
        state_class: measurement
        device_class: energy
      - name: HAEnergy Return to Grid
        state: "{{ states('sensor.emoncms2_export_all_time') | float | round(2) }}"
        unit_of_measurement: "kWh"
        state_class: measurement
        device_class: energy
      - name: HAEnergy Solar Production
        state: "{{ states('sensor.emoncms2_solar_all_time') | float | round(2) }}"
        unit_of_measurement: "kWh"
        state_class: measurement
        device_class: energy

Are they acceptable to use? In HA, they are new sensors and but doesn’t start from 0. I’ve set their last_reset to when I set it up in HA. But they start from non-zero. I can reset it in emonCMS if it helps, it is arbitrary number from when emonCMS was setup.

It’s been a few hours and the dashboard is still completely empty. Hence the question above.

Is there any way to debug why it remains completely empty?

EDIT: upon checking again, it has sprang to life :smiley: It’s beautiful!

3 Likes

On the tarif-aspects, too bad here in Flanders/Belgium we will be using a new method as of 2022 called “Capaciteitstarief” (capacity-tarif) based on “Kwartierpiek” meting (quart-hour peak measurement) so not a “fixed” X cents / kWh anymore.

Not so easy to incorporate in the calculation model I think.

No, continues empty…

I use the CircuitSetup 6 Channel board, esphome and cts to currently monitor my energy (see setup video from Travis (https://youtu.be/BOgy6QbfeZk). How do I add this to the new built in energy monitoring?

while testing, i added 2 of those, how to remove it? :slight_smile:

Really cool new addition. Solaredge works, although adding it was a little confusing since the solaredge lifetime energy is measured in Wh. The dropdown menu says it expects kWh. But it seems the conversion works.

Too bad though that I can’t add any of my smart plugs to the detailed section for individual devices. I have a bunch of Fibaro zwave wall plugs and tasmota flashed gosund plugs, but they do not show up.

1 Like

You can remove them from the Integrations panel in Configuration
image| 592x408

2 Likes

hi I have the same problem, any idea when the official growatt integration will be updated to support this?

i have 3 sonoff switch and energy meter… only 2 were grabbed by this tool, one is missing… but I can see on my dashboard…

energy: in my configuration.yaml did the trick

1 Like

I wish there were easier ways of not loading things in the default_config: because of what you just encountered. I can’t currently make use of energy: and would like to hide it, but I’m concerned if something new gets added to the default_config: that I would like to use I’ll miss it if I remove default_config: and have everything individually listed.

2 Likes

This is a great initiative :clap:!

It’s as if you where reading our minds. Just two weeks ago I started a project to read my smart energy meter using ESPHome in my house. It’s almost finished and the new views and database capabilites will come very handy.

A small solar installation will be next.

Knx sensors have a device_class set if you configured the appropriate type:.
You can add the missing state_class and last_reset attributes with customize for now.

2 Likes

@frenck This is super AWESOME! THANK YOU!

Is it possible to use the YOULESS integration here?

I have a youless LS120 on my energy meter and i have the integration already in Home Assistant since several years. And it would be super awesome to have this data in the Energy service.

image

2 Likes

Use this for your smart plugs:

Check part “Energy” at the end of the doc.

It is possible. But then you wouldn’t need to add that metric in the first place. Even though you buy the certified power (as we have here), the power you get to your house might still be fossil-based as that is what is available on the grid at the point. The certified means the power company will compensate for it with more power generated at different times.

can anyone tell me if i setup correct?

for MQTT :

  - platform: mqtt
    state_topic: !secret smappee_service_location
    value_template: "{{ value_json['channelPowers'][2]['power'] }}"
    unit_of_measurement: "W"
    icon: mdi:power-plug
    name: "Smappee Huidig verbruik L3"
    device_class: power
    state_class: measurement

for TEMPLATE, seems i’m unable to add state_class, not supported when i do a check config

  - platform: template
    sensors:
      smappee_huidige_opbrengst:
        value_template: >
          {% if (states('sensor.smappee_huidige_opbrengst_l1')  +  states('sensor.smappee_huidige_opbrengst_l2')  +  states('sensor.smappee_huidige_opbrengst_l3'))|int  < 0 %}
            0
          {% else %}
            {{ (states('sensor.smappee_huidige_opbrengst_l1'))|int  +  (states('sensor.smappee_huidige_opbrengst_l2'))|int  +  (states('sensor.smappee_huidige_opbrengst_l3'))|int }}  
          {% endif %}
        unit_of_measurement: "W"
        icon_template: mdi:white-balance-sunny
        friendly_name: "Smappee Huidige opbrengst"
        device_class: power
        #state_class: measurement

and in customize i have :

sensor.smappee_huidig_verbruik_l3:
  last_reset: "2021-08-05T08:05:00+00:00"
sensor.smappee_huidige_opbrengst:
  last_reset: "2021-08-05T08:05:00+00:00"

because i dont see anything in my Energy,… i have more MQTT sensors, based on above config

I think you need to use the Modern State-based Template Sensor so that state_class is supported.

2 Likes

It’s unsupported for the ‘legacy’ method of defining a Template Sensor. You have to use the new ‘modern’ method where the sensor is defined in the template domain.

State-based Template Sensors


EDIT

Ninja’d by ardysusilo

2 Likes