ppluti007
(Pluto)
December 15, 2020, 2:40pm
1
Hi All,
I have a solar system (Huawei 2000L) and thanks to huawei_solar integration (https://github.com/Emilv2/huawei_solar ) i can get data from it.
The huawei_solar integration give me the real time solar power and power meter grid power (exchange with the grid +/-) and the daily_yield (total FV energy producted)
i’m using “utility meter” and “integration - Riemann sum integral” for calculate daily energy daily energy autoconsumend.
strange behaviour is that the utility meter my_home_daily_energy_autoconsumption every day start correctly when FV switch on but it doesn’t have a gradual course, it starts with a jump… so the auto-consumed energy is higher than the FV production…
any idea?
Thank You!!
tom_l
December 15, 2020, 7:15pm
2
Can you please post your configuration for your integral sensor?
ppluti007
(Pluto)
December 15, 2020, 9:21pm
3
Thank you for you response…
this is my config:
utility_meter.yaml
my_home_daily_energy_autoconsumption:
source: sensor.my_home_energy_autoconsumed
cycle: daily
sensor/solar.yaml
- platform: huawei_solar
host: '192.168.1.63'
- platform: integration
name: my_home_energy_autoconsumed
source: sensor.my_home_power_autoconsumed
unit_prefix: k
round: 2
- platform: template
sensors:
my_solar_power_production:
friendly_name: "Potenza Prodotta dal Fotovoltaico"
unit_of_measurement: 'W'
value_template: "{{ states('sensor.sun2000l_4_6ktl')|round(2) }}"
#power_meter_active_power > 0 => selling to grid
#power_meter_active_power < 0 => buying to grid
my_grid_power_purchased:
friendly_name: "Potenza Consumata dalla Rete"
unit_of_measurement: 'W'
value_template: >-
{% if state_attr('sensor.sun2000l_4_6ktl', 'power_meter_active_power') < 0 -%}
{{ -state_attr('sensor.sun2000l_4_6ktl', 'power_meter_active_power')|round(2) }}
{%- else -%}
0
{%- endif %}
my_grid_power_sold:
friendly_name: "Potenza Venduta alla Rete"
unit_of_measurement: 'W'
value_template: >-
{% if state_attr('sensor.sun2000l_4_6ktl', 'power_meter_active_power') > 0 -%}
{{ state_attr('sensor.sun2000l_4_6ktl', 'power_meter_active_power')|round(2) }}
{%- else -%}
0
{%- endif %}
my_home_power_consumption:
friendly_name: "Potenza consumata della Casa"
unit_of_measurement: 'W'
value_template: "{{(states('sensor.my_solar_power_production')|round(2) + states('sensor.my_grid_power_purchased')|round(2) - states('sensor.my_grid_power_sold')|round(2) )|round(2)}}"
my_home_power_autoconsumed:
friendly_name: "Potenza autoconsumata"
unit_of_measurement: 'W'
value_template: >-
{% if states('sensor.my_solar_power_production')|round(2) < states('sensor.my_home_power_consumption')|round(2) %}
{{ states('sensor.my_solar_power_production')|round(2) }}
{%- else -%}
{{ states('sensor.my_home_power_consumption')|round(2) }}
{%- endif %}
sensor.sun2000l_4_6ktl is the sensor created by huawei_solar integration
Thanks
tom_l
December 15, 2020, 9:29pm
4
- platform: integration
name: my_home_energy_autoconsumed
source: sensor.my_home_power_autoconsumed
unit_prefix: k
round: 2
Try setting the method to left. Read the paragraph under that link as to why.
ppluti007
(Pluto)
December 15, 2020, 11:06pm
5
I have followed your advice. I let you know how it works
Thanks a lot
ppluti007
(Pluto)
December 16, 2020, 3:48pm
6
the jump is smaller than yesterday but it’s there…
tom_l
December 16, 2020, 7:11pm
7
I had a look at the sensors available from this custom integration. You have:
“grid_exporterd_energy” [sic] and “total_yield”
I’m not 100% sure what these are but would this not work (written in correct template format of course, not the pseudo code below)?
my_home_power_consumption = total_yield - grid_exporterd_energy
If this is the value you need you can feed it directly to the utility meter for a daily value, no integration required.