Home Energy Management in 2021.8

You need to create two template sensors: Template - Home Assistant

Gentlemen,
i am close to get this up and running.

My e3DC shows their values in W not in kWh which would be needed.
Can you tell how i can copy/clone the entities to calculate them to kWh?

i tried to import them twice on my modbus yaml.

    - name:                E3DC solar power
      unit_of_measurement: W
      address:             40067
      device_class:        power

    - name:                E3DC solar power
      unit_of_measurement: kWh
      address:             40067
      device_class:        energy
     scale: 0.001
     round: 2

but this did not work as the address was doubled and so skipped.
I have a heat pump which i could use as consumer and it shows up on the energy config.

Any tip for me?
thank you very much.
cheers A

You didn’t read the thread…

Integration - Riemann sum integral - Home Assistant (home-assistant.io)

Alex, thanks!
I did manage to create a template which re-calcuates watt into kwH.
But i will try your tip.

Have also to figure out how i can use the negative grid power and create a new sensor for splitting as well. My Grid sensor delivers -/+ values depending on direction. Battery as well.

so stay tuned :slight_smile:

Alex,
how do you understand this?
If you have a sensor that provides you with power readings in Watts (uses W as unit_of_measurement ), then you can use the integration sensor to track how much energy is being spent.

Should this reflect the live spending/producing of Watt on Kilowatt?
I configured the action but the sensor gives me some weird details. Looks nearly like a summary of kWh since its running.

- platform: integration
  name:  e3dc_solar_power_kwh
  source: sensor.e3dc_solar_power
  unit_prefix: k
  round: 2
  method: left

So my live data shows 400 Watt (now) and the riemann presents 8.x kWh.

thanks
A.

A template that does what? It’s difficult to calculate that conversion without the integral. Probably your template will never produce accurate results, or maybe it produces wrong results.

For the negative values: if negative means exported for the meter you are using, then you can easily create a template sensor that calculates the abs() of the value, then you use this to feed the integral for the exported energy. Check this post as an example.

First you have to understand the difference between power and energy:

You are comparing apples with oranges. Look at the drawing above: power is the water flow rate, energy is the amount of water in the bucket. Power is an instantaneous measured value, Energy is calculated taking into account how much power in time. Time is the key variable to understand the difference among the two. Is it clear now? :slight_smile:

Alex,
you are awesome. Thanks for your help and explanation.
So my live power calculates with the hours and kW/h is the result.
I am a absolut noob when it comes to electricity. So your help is much appreaciated!

About the template… I think we better not talk about it. But as a conclusion i used your proposal and implemented the sensor creation. Which then brought me to kWh question.

Negative values i got. These are from the grid as we give back W into the grid and if the battery is at his end we consume. As we had a sunny day while i created the sensor and we uploaded into the grid i assume this produced the total of the sensor to become negative. Same for the battery. We discharged more than we loaded. This is how i explain it… OR… i just made something badly wrong :slight_smile:
thanks Alex!
armin
PS here are some screenshots.
grid
house_consumption
solar
battery

Got it up and running.
Had to split the values negative/positve into different sensors.
But now it does not look so bad.
But how can i adjust the “self consumed solar energy” for today its foggy and cloudy with a bit of rain the solar energy produced went into the house but the picture shows into the grid.

obviously, like I suggested previously, if you have a sensor that gives you in one value export+import based on the sign, you need to first split it in 2 sensors and use abs() to make the negative absolute value the exported energy sensor. glad you understood how it worked. :slight_smile:

self-consumed is calculated based on production/import/export sensors, if those 3 values are correct, autoconsumption (or self-consumption) is calculated correctly. So please check those 3 sensors.

Generally, take this into account:

Autoconsumption = Production - Export
Total Consumption = Import + Autoconsumption

This is how I get data (both power and energy) from my three-phase meter (Elios4You), as you can see, the Autoconsumption value is derived from other values.

You noticed that I don’t want to give you quick solutions or workarounds, I want you to understand, so you can fix it yourself and maybe do things in a better way, and in the end being able to help others. I learned and still learning a lot reading other people here on the forum, and after more than 1y I try to help as I can.

If I’m not clear enough, please tell me…:slight_smile:

Ciao,

Alessandro

buonasera Alessandro, ancora grazie mille per l’aiuto!
alora, back to the drawing board for me. :slight_smile:

i will go through and see how i fiddle this out. your chart helps a lot.
I might draw it down and look what i can map against it.
Especially this:
Autoconsumption = Production - Export
Total Consumption = Import + Autoconsumption

Stay tuned… Enjoy your evening!
best regards armin

but still something on the flow chart bothers me
Solar to House - line is there but i don’t see a “dot” moving from solar to house while from solar to grid is one.
Battery to Grid - this should not be there at all as we do not load the battery through the grid nor we discharge it into it,

.2021-11-13_21-26-40

Solar to Grid is the summary out of : Solar production - battery charging - own consumption (house)
Solar to House: there is no option to configure on the Gui
Same for Solar to battery.
At least i could not find one.

Oh, you speak italian, nice, or it’s just a translation tool? :slight_smile:
Always at the drawing board, more time you spend there, to understand how things work, the better your integrations/automations will be. You never stop going to the drawing board with HA, there’s always room for improvement. :slight_smile:

If you carefully read my last post, I told you how autoconsumtpion (“solar to house” as you call it) is calculated from import/export/production sensors. :slight_smile:

If you see 0 autoconsumption, it means there’s something wrong with those sensors used to calculate it.

buon giorno, Alessandro.
My wife is Italian. But have to confess that my Italian could be much better. I would survive by ordering food and coffee. And btw. i did stop drinking Latte Macchiato in the afternoon … haha.

You are right. Do things right otherwise you do them twice. And here i am.
So let me cleanup my sensors and entities and give them understandable names.
Power (W), calculated Energy (kWh) then i can move them together into the ones which i need for consumption and production.

I copied the e3dc stuff out from another topic here on HA. But i should have renamed them to get a better understanding. My bad. my cleanup…
Keep fingers crossed!
cheers A.

Have to say that this was a challenge… Especially to strike out negative values for the solar return to grid calculation.
Now it does look better. Have to monitor it the next days.

1 Like

it’s a “strange” thing to do during meals…we often see tourists doing that in Italy and we joke a little about it. your wife gave you a good advice. :slight_smile:

if you don’t focus a little on the theory behind things, you risk redoing it 20 times…when I started with HA I immediately noticed the trial&error approach was not the proper way to do things. :slight_smile:

Good approach. Scratch everything, and concentrate on one sensor at a time…if every sensor give you proper values (double check the values with something else, the meter, etc.) the end result in the energy integration will be ok.

don’t worry, it’s common practice, but never expect that copying and everything automagically works is always effective. every installation is different, you can copy and adapt things when you fully understand the theory behind it. :slight_smile:

aaahhhhh… what tha …
Where does this now come from?


Energy from the Grid should go into the House.
But here it does look like it went into the Battery…

Grid Tab should be OK with Positive (import) and Solar back to Grip (export).
Solar Panel is single value.
Battery has two entries. Charge and DIscharge.

The E3DC Box does not charge from Grid. Would not make sense.

I cannot explain this. Do you have me tip?

Hello, I’ve read all the thread posts, and for what I’ve read my ShellyEm power meter should work out of the box with the official Shelly integration in the new Energy panel, but, apart for the Lovelace UI where it show up and work without problem, and all the measurement are ok (power, energy in Kwh, current and so on) I’ve no luck in add the Shelly Em in the Energy panel, with the same response: no source in the dropbox menu!
All the entity sensors are ok, as usual for the Shelly Em, don’t have modified or add nothing in configuration, nor sensors template, but NOTHING show up as source in the dropbox menu of Energy panel. What was wrong?
Max

I don’t see the flow diagram, so don’t know if that 11.68 value comes from Solar production or what…you cut the screenshot.

Ciao Massimo,

Shelly official integration provides all the necessary attributes needed for the Energy Integration. I have several of them.

First thing: did you check the attributes of the Shelly EM entity? Use dev tools to check, here’s one of my EMs:

As you can see, that sensor appears in the listbox of energy integration because it has state_class, device_class and unit_of_measurement properly configured.

So post a screenshot of dev tools for the sensor, so we can check what are its attributes.

Many thanks Alex for your reply, as show my sensor’s state are equal to your, but don’t show up in Energy panel dropbox as you show:

Any hints?