I’ve upgraded yesterday to the latest version of HA
I discovered the Energy module and tried to add my SolarEdge module.
For an unknown reason only 1 sensor is compatible with Energy module. I tried to customize other sensor with Measurement & Energy classes but without success
I have a SolarEdge Inverter with the ModBus monitor. I’ve been working on this and am getting closer, but not quite there yet. I now have all of the appropriate entities selectable in the Energy dashboard, but it’s not showing any data. I’ve verified the entities have (increasing) values.
I used templates to create the appropriate sensors:
- name: Solar Panel Production Energy Today
unit_of_measurement: "kWh"
unique_id: 12a5c37cc0ac4f15b609c17f81713e41
state: "{{ states('sensor.solaredge_production_power') | float / 1000 | round(4) }}"
device_class: energy
state_class: measurement
#last_reset: '1970-01-01T00:00:00+00:00'
- name: Grid Energy Consumption Today
unit_of_measurement: "kWh"
unique_id: 5082ce586f93494289e521a4bb903924
state: "{{ states('sensor.solaredge_imported_power') | float / 1000 | round(4) }}"
device_class: energy
state_class: measurement
#last_reset: '1970-01-01T00:00:00+00:00'
- name: Energy Export to Grid Today
unit_of_measurement: "kWh"
unique_id: f4fae8a6e46243ad85792344a0bea461
state: "{{ states('sensor.solaredge_exported_power') | float / 1000 | round(4) }}"
device_class: energy
state_class: measurement
#last_reset: '1970-01-01T00:00:00+00:00'
Since the “last_reset” does not seem to be valid in a template (yet?), I set those in customize.yaml:
Can you please share the full section in configuration.yaml ?
I’m getting some error when trying to add the template
Error loading /config/configuration.yaml: while parsing a block collection
in "/config/configuration.yaml", line 24, column 7
expected <block end>, but found '?'
in "/config/configuration.yaml", line 25, column 7
template:
- sensor:
- name: Solar Panel Production Energy Today
unit_of_measurement: "kWh"
unique_id: 12a5c37cc0ac4f15b609c17f81713e41
state: "{{ states('sensor.solaredge_production_power') | float / 1000 | round(4) }}"
device_class: energy
state_class: measurement
#last_reset: '1970-01-01T00:00:00+00:00'
- name: Grid Energy Consumption Today
unit_of_measurement: "kWh"
unique_id: 5082ce586f93494289e521a4bb903924
state: "{{ states('sensor.solaredge_imported_power') | float / 1000 | round(4) }}"
device_class: energy
state_class: measurement
#last_reset: '1970-01-01T00:00:00+00:00'
- name: Energy Export to Grid Today
unit_of_measurement: "kWh"
unique_id: f4fae8a6e46243ad85792344a0bea461
state: "{{ states('sensor.solaredge_exported_power') | float / 1000 | round(4) }}"
device_class: energy
state_class: measurement
#last_reset: '1970-01-01T00:00:00+00:00'
I also use SolarEdge and got it all working properly. The thing to remember for grid consumption and export is that Solar Edge resets these daily. HA expects counters which keep growing, so I have created following configuration with utility meters. And this now works perfectly:
The last 2 defined template sensors are the ones I use for imported and exported power in the Energy Dashboard. I use the default “Solar Edge Lifetime Energy” for the Solar Power of the Energy Dashboard and get accurate readings like below:
No, but I expect something similar as in the solar edge app… It’ll start from scratch. But… Until then we’ll have a few updates and tweaks and we’ll cross that bridge when we get to it…
When using a template sensor for the meters that get reset after midnight, the last_reset attribute needs to reflect this, otherwise (as mentioned above) if the Home Energy Management system thinks the meter values are forever increasing, then at midnight the Home Energy System will show imported energy as negative, and solar production as negative (which probably should be 0), and exported values as positive. Here is something I tried last night and it seems to fix this problem:
Since these meter use cloud polling they do not actually get reset at midnight but some number of minutes after that. However, since it appears the Home Energy Management does an update around 12 minutes after the hour, I decided on minute=10, but again minute = 0 will probably work as well. The only downside I see is if by some chance the cloud polling takes 12 or more minutes after midnight.
Does anyone know if a SolarEdge update is coming from the Dev for energy panel configuration? Lots of great work here, but I’d rather wait a few weeks for a built-in integration if that’s on the way. I’m having the same issue where for every dropdown in the setup I only have 1 option to choose lifetime energy and that doesn’t work.
I just set the integration up for the energy panel, so if there should be other options in the dropdown to choose already and there isn’t, I may not be aware of that. If so, if someone could let me know what should be there I can start troubleshooting it.
I had this problem too. I created this thread with an alternative solution, but also describe how you could solve it with the cloud based Solar Edge integration:
I have all the templates and other sensors installed however, each day their is that data dump from SE that throws off the daily calculations. Anyone see this?
This is added in my configuration.yaml using the new way of doing Template Sensors. Here is an example for one of the SolarEdge sensors that resets at midnight:
This creates a sensor named: sensor.solaredge_exported_energy_template
This sensor will show up in the selection of sensors in the Energy integration’s Electricity Grid and the Energy Integration seems to handle the reseting correctly.
I did similar template sensors for all my sensor.solaredge_xxx sensors that get reset at midnight.
Note: I read somewhere, I forget where, that this last_reset attribute is going away in the 2021.9 release as somehow HA will determine that a sensor is getting reset.