Hi @Dynamix72 until now… nope. And I did not have time to dig into it. So far I just ignore the gauge. Not my preferred option though.
In HA I find it very hard to create nice graphs for things like net usage (produced-consumed). I used to work with domoticz+dashticz and that was easy peasy. However the interface is bad for WAF
Hello,
I found your problem while searching somethinge else.
Have you tried to make a sensor template which inverts the Value of your Sensor which representates your net energy consumption?
example
- sensor:
- name: "netto_stroomverbruik_pos"
device_class: energy
state_class: total_increasing
unit_of_measurement: "kWh"
state: >
{%set temp = states('netto_stroomverbruik') | float(0)%}
{{ temp * -1 }}
not tested, but when u add this sensor and delete the other (including Paneelen) in the section “Teruglevering” it should calculate right.
Hi there,
I had the same problem but the solution is actually very simple!
Like you i had my solar power feed back to grid set to the same entity as my solar power total AC production (solaredge (AC Energy kWh) in my case). which obviously results in them having the same value in the dashboard.
Your calculated solar power feed back to grid is actually measured separately by your slimme meter. if you set it up like this it should work.
Hi @Bleda22 that should work, however I do not have a separate entity to monitor what my solar panels produce (Zonneplan) so this is not working for me unfortunately.
The best option would be in my opinion to create a sensor which makes the “teruglevering” a Net-value: take the value of the “Electricity Meter Energy consumption” from the “slimmemeter” and substract the “Electricity Meter Energy production” from it in the same time period.
But then… that could be negative and that is not what HA energy dashboard supports.
Sorry I must have misunderstood.
A dumb question maybe but if you don’t have a separate entity to monitor you PV production, then I assume you use the slimme meter production value to visualize your solar production in the energy dashboard?
If so, this is incorrect.
The slimme meter is not aware of your total PV production or your own PV production consumption.
slimme meter production value is the excess power delivered back to the grid.
Edit:
So your self consumed PV production should be: total PV production of today - Slimme meter production
I found the solution by adding the HACS integration Zonneplan ONE and use the yield sensor for the solar panels in the energy dashboard. Now it shows what I actually use of my solar energy and what is returned to the grid! Gauges are working as well.
Next step is to reliably make sensors which are a combination of high and low tariff for production and consumption. I thought I had a solution but the sensors all of a sudden stopped calculating and I did not find a solution yet. This thread
So but is there a way then to use this without having an additional reader to measure the solar panels?
Subtract the current consumption from the current production seems to be the easiest way to get this going.
Hi, happy to know you solved the problem!
Please, can you share also a picture of ‘energy configuration page’ (Where you set grid consumption/ return to grid / solar production) and a short description of the source of these entities?
Here mine:
I use PVOutput as data source:
for ‘grid consumption’ I put the ‘Energy consumed’ that actually is the total amount of energy consumed by the house, not the energy pulled from the grid.
In ‘return to grid’ the energy generated.
In addition, from PVOutput I can have also ’ power generated/ power consumption ', but probably useless for that.
Thanks!
Hi @AndyIoT sure, no problem.
For “Netverbruik” I use the dsmr delivery high and low, “Teruglevering” is dsmr return high and low. I use the P1 dsmr interface for my Dutch smart meter.
For the “Zonne-energieproductie” I use the “Zonneplan one” HACS integration and the counter is the “sensor.zonneplan_yield_total”.
Picture with some nice grafitti on it.
Thanks! I’ll try to review my settings following yours.
Here how I solved my problems, if someone fall in same trouble! And, if you find simple solution… share!
Because PVOutput.org integration don’t provide different ‘sensors’ for energy imported and exported, but only generated and consumed ‘instant power’ and ‘total energy’, I had to retrieve the required data as below.
A) Create 2 sensors, one for “instant power import”, another for “instant power export”. In templates.yaml define 2 sensors:
#The instant power consumed from grid'
- sensor:
- name: 'power_from_grid'
unit_of_measurement: 'W'
state_class: measurement
device_class: energy
attributes:
last_reset: '1970-01-01T00:00:00+00:00'
state: >
{% set generated = states('sensor.power_generated') | float (0) %}
{% set consumed = states('sensor.power_consumed') | float (0) %}
{% set power_from_grid = [0, consumed | int - generated | int ] | max %}
{{power_from_grid}}
#The instant power exported to grid
- sensor:
- name: 'power_to_grid'
unit_of_measurement: 'W'
state_class: measurement
device_class: energy
attributes:
last_reset: '1970-01-01T00:00:00+00:00'
state: >
{% set generated = states('sensor.power_generated') | float (0) %}
{% set consumed = states('sensor.power_consumed') | float (0) %}
{% set power_to_grid = [0, generated | int - consumed | int ] | max %}
{{power_to_grid}}
B) Then create 2 “HELPERS” , type “Integration – Riemann sum integral”, from the Input sensor defined above, for instance named “energy_from_grid” and “energy_to_grid”.
C) Because these helpers are incremental, we need to create 2 “Utility Meters” that reset starts from 0 every day:
In configuration.yaml add:
# Utility meters
utility_meter:
daily_energy_from_grid:
source: sensor.energy_from_grid
name: Daily_import
unique_id: 'energy_from_grid'
cycle: daily
daily_energy_to_grid:
source: sensor.energy_to_grid
name: Daily_export
unique_id: 'energy_to_grid'
cycle: daily
D) Then use these 2 meters ( Daily_import / Daily_export) in Energy configuration.
Hi AndyIoT,
Thank you for posting this! I’ve copied it and tweaked it to make my setup make sense.
Note for others who follow the same path, the first two sensors needed to be changed to device_class power rather than energy. After that the device_class flowed correctly through to the Riemann Sum Integrations.
My setup has data coming from Iotawatt with CT for each circuit in my house (but no CT on the main supply). One circuit is the solar generation. I used your config to calculate the grid_export and grid_import values from the CT values.
Regards,
Jason
Hi AndyIoT,
Thank you for your input.
I attempted to follow your example, but I seem to have not followed the instructions properly as I don’t see the integration into the graph nor can I get the gauge card to show a Daily figure as the error says Entity is non-numeric: sensor.daily_export.
This is my config entry.
#The instant power consumed from grid
template:
- sensor:
- name: 'power_from_grid'
unit_of_measurement: 'W'
state_class: measurement
device_class: power
attributes:
last_reset: '1970-01-01T00:00:00+00:00'
state: >
{% set generated = states('sensor.power_generated') | float (0) %}
{% set consumed = states('sensor.power_consumed') | float (0) %}
{% set power_from_grid = [0, consumed | int - generated | int ] | max %}
{{power_from_grid}}
#The instant power exported to grid
- sensor:
- name: 'power_to_grid'
unit_of_measurement: 'W'
state_class: measurement
device_class: power
attributes:
last_reset: '1970-01-01T00:00:00+00:00'
state: >
{% set generated = states('sensor.power_generated') | float (0) %}
{% set consumed = states('sensor.power_consumed') | float (0) %}
{% set power_to_grid = [0, generated | int - consumed | int ] | max %}
{{power_to_grid}}
and this is the Utility Meters
# Utility meters
utility_meter:
daily_energy_from_grid:
source: sensor.energy_from_grid
name: Daily_import
unique_id: 'energy_from_grid'
cycle: daily
daily_energy_to_grid:
source: sensor.energy_to_grid
name: Daily_export
unique_id: 'energy_to_grid'
cycle: daily
I have obiously done something daft, can you help me please
hello, I also could not make the integration appear in the graph, something to be done?
- sensor:
- name: 'power_to_grid'
unit_of_measurement: 'kW'
state_class: measurement
device_class: energy
attributes:
last_reset: '1970-01-01T00:00:00+00:00'
state: >
{% set generated = states('sensor.solarh_12748_today_eq') | float (0) %}
{% set consumed = (states('sensor.pzem_004t_v3_r_energy') | float (0) /1000) + (states('sensor.pzem_004t_v3_s_energy') | float (0) /1000) %}
{% set power_to_grid = [0, generated | int - consumed | int ] | max %}
{{power_to_grid}}
utility_meter:
daily_energy_to_grid:
source: sensor.energy_to_grid
name: Daily_export
unique_id: 'energy_to_grid'
cycle: daily
The same here, not sure what I have missed either
Did you get it working there? Are you Brazilian too?
I also use the Hoymilles integration and I’m using PZEM to measure, just like you. I spent two weeks breaking my head to complete this panel, I didn’t understand the logic, but in the end it worked!
If you want help, enter the “Home Assistant Brazil” telegram and I or other members can help you better.
Hi,
Please help
I have this code and not working well. Where is the problem? Need sensor to garafana and want the same data which is on energy dashboard self consumed solar energy hourly and dayli and monthly.
template:
- sensor:
- name: "elfogyasztott_energy"
unit_of_measurement: "kWh"
state: >-
{% if states('sensor.inverter_total_yield') | float(0) - states('sensor.energy_produced_luxembourg') | float(0) > 0 %}
{{(states ('sensor.inverter_total_yield') | float(0) - states('sensor.energy_produced_luxembourg') | float(0)) | round (3) }}
{% else %}
{{(states ('0.0') | float(0)) |round(3) }}
{% endif %}
device_class: energy
state_class: total_increasing
and have this utility meter setup:
utility_meter:
elfogyasztott_energy_hourly:
source: sensor.elfogyasztott_energy
cycle: hourly
elfogyasztott_energy_daily:
source: sensor.elfogyasztott_energy
cycle: daily
elfogyasztott_energy_monthly:
source: sensor.elfogyasztott_energy
cycle: monthly
When I restart HA get a huge data about 487kWh. After ‘calibrating’ the utility meter sensors it start from 0 but not calculat the real data. So something wrong soewhere.
[edit: typo]
Sorry to revive this old thread, but i also ran into the same issue. Actually i have 2 questions:
-
Assuming (heh) you are using DSMR Reader as your integration, which DSMR entities are you using for your delivery/production in the dashboard setup? Are those the 'low tariff usage/high tariff usage´ and 'low tariff returned/high tariff usage´ ones (which correspond to the actual meter readings, so since the ‘beginning of time’)
I also tried to use the ‘Power usage total’ and 'Power return total (daily) ones, which are i think some calculated daily values (so low+high), but i see some slight differences there. -
Second question is actually your original problem. I have an entity that actually gives me the yield of the solar panels (i have Envoy PVs from which i read the actual daily yield in kWh) but the ‘Self consumed’ gauge is staying on 0%. Any ideas?
See images below for my setup.
I had the same issue with my energy dashboard and self-consumed solar energy gauge. It can be frustrating not being able to see that data, especially when it’s so useful. In my experience, you’re right that a template sensor would be the way to go. You could create one to calculate the consumed solar energy, and then add it to your energy dashboard. However, I’m not sure about HA’s magic - it might be worth looking into that as well. As for removing the gauge without removing the solar panel graphic, that’s a bit trickier. Have you tried looking for an option to hide or disable the gauge? Sometimes there are options like that in dashboard settings. On a related note, I recently stumbled upon an article that answered all my questions about how solar farms work. It was really informative and helped me understand more about solar energy in general. Maybe it could help you too!