Hi I have two solar panels and a hoymiles DTU.
Now I want to find out if a battery makes sense.
My idea to do so is to keep track of my solar power overproduction (power I generated but did not use) over time and how much power I use from the grid because I produce no or too less solar power.
Basically I want a card on which I can see what is my overproduction in kWh over time (daily, weekly monthly, yearly, total) and the same for the grid usage.
I.e. in April I “wasted” 20 kWh and took 40kWh from the grid.
Sry if this is a very basic question but I was not able to do this on my own
ATM I track my powerusage with a set of smartmeters and some base usage (like the fridge that runs 24h):
template:
- sensor:
# 24h Base Power Consumption (Always 21.5W)
- name: "24h Base Power Consumption"
unique_id: 24h_base_power
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: 21.5 # Constant power usage
# Lights Power Consumption (80W from 08:00 - 23:59)
- name: "Lights Power Consumption"
unique_id: lights_power_consumption
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: >
{% set hour = now().hour %}
{% if 8 <= hour < 24 %}
20
{% else %}
0
{% endif %}
- name: "Total Power Consumption"
unit_of_measurement: "kW"
device_class: power
state_class: measurement
state: >
{{ (
states('sensor.24h_base_power_consumption')|float +
states('sensor.lights_power_consumption')|float)
/ 1000 }}
- name: "Total Power Consumption Combined"
unit_of_measurement: "W"
state: >
{% set plugs = [
states('sensor.unbenannt_p110_derzeitiger_verbrauch') | float(0),
states('sensor.unbenannt_p110_derzeitiger_verbrauch_2') | float(0),
states('sensor.unbenannt_p110_derzeitiger_verbrauch_3') | float(0),
states('sensor.unbenannt_p110_derzeitiger_verbrauch_4') | float(0)
] %}
{{ (plugs | sum) + states('sensor.total_power_consumption') | float(0) }}
- name: "Solar Overproduction"
unit_of_measurement: "W"
state: >
{% set consumption = states('sensor.total_power_consumption_combined') | float(0) %}
{% set solar = states('sensor.wechselrichter_ac_leistung') | float(0) %}
{{ [solar - consumption, 0] | max }}
- name: "Grid Usage"
unit_of_measurement: "W"
state: >
{% set consumption = states('sensor.total_power_consumption_combined') | float(0) %}
{% set solar = states('sensor.wechselrichter_ac_leistung') | float(0) %}
{{ [consumption - solar, 0] | max }}
- name: "Solar Overproduction Hourly"
unit_of_measurement: "kWh"
state: >
{% set stats = state_attr('sensor.solar_overproduction_energy', 'statistics') %}
{{ stats['sum'] if stats else 0 }}
- name: "Solar Overproduction Energy"
unit_of_measurement: "kWh"
state: >
{{ (states('sensor.solar_overproduction_energy_wh') | float(0)) / 1000 }}
Ah and a OT question:
how to stretch a card over multiple columns?