Hi,
I am using the SolarEdge Integration for getting information about the Solar Production “this year” and “this month”.
Since these values will be reset after the current month / current year, I want to use them somehow for creating a history…
How much energy was produced in the year 2021 how much energy was produced in each month of 2021…
It would be great, if the values could be stored in the database, for example:
April 2021: 1.500.000 kWh
May 2021: 1.550.000 kWh…
…
…
December 2021: 300 kWh
2021: 9.503.003 kWh
Same for 2022 and so on.
Also, I have created some custom sensors, for calculating the kWh per kWp of my installation.
This is the current configuration:
# kWh / kWp calculation
solaredge_yearly_kwh_kwp:
state_class: measurement
device_class: energy
friendly_name: "Yearly kWh/kWp"
unit_of_measurement: "kWh/kWp"
value_template: >-
{{ (states('sensor.solaredge_energy_this_year_kwh') | float / '13.26' | float) | float(default=0.0)|round(2) }}
solaredge_monthly_kwh_kwp:
state_class: measurement
device_class: energy
friendly_name: "Monthly kWh/kWp"
unit_of_measurement: "kWh/kWp"
value_template: >-
{{ (states('sensor.solaredge_energy_this_month_kwh') | float / '13.26' | float) | float(default=0.0)|round(2) }}
solaredge_daily_kwh_kwp:
state_class: measurement
device_class: energy
friendly_name: "Daily kWh/kWp"
unit_of_measurement: "kWh/kWp"
value_template: >-
{{ (states('sensor.solaredge_energy_today_kwh') | float / '13.26' | float) | float(default=0.0)|round(2) }}
How can I make them “persistant” so that I can also get a history?
EDIT:
I’ve added this as Utility meter… but then I am getting an error…
utility_meter:
yearly_energy_per_kwp:
- source: sensor.solaredge_yearly_kwh_kwp
name: Yearly kWh per kWp
cycle: yearly
monthly_energy_per_kwp:
- source: solaredge_monthly_kwh_kwp
name: Monthly kWh per kWp
cycle: monthly
yearly_energy:
- source: solaredge_energy_this_year_kwh
name: Yearly kWh
cycle: yearly
monthly_energy:
- source: solaredge_energy_this_month_kwh
name: Monthly kWh
cycle: monthly
the error:
nvalid config for [utility_meter]: expected a dictionary for dictionary value @ data['utility_meter']['monthly_energy']. Got [OrderedDict([('source', 'solaredge_energy_this_month_kwh'), ('name', 'Monthly kWh'), ('cycle', 'monthly')])]
expected a dictionary for dictionary value @ data['utility_meter']['monthly_energy_per_kwp']. Got [OrderedDict([('source', 'solaredge_monthly_kwh_kwp'), ('name', 'Monthly kWh per kWp'), ('cycle', 'monthly')])]
expected a dictionary for dictionary value @ data['utility_meter']['yearly_energy']. Got [OrderedDict([('source', 'solaredge_energy_this_year_kwh'), ('name', 'Yearly kWh'), ('cycle', 'yearly')])]
expected a dictionary for dictionary value @ data['utility_meter']['yearly_energy_per_kwp']. Got [OrderedDict([('source', 'sensor.solaredge_yearly_kwh_kwp'), ('name', 'Yearly kWh per kWp'), ('cycle', 'yearly')])]. (See /config/configuration.yaml, line 20).
``