Struggling to setup Energy integration (read Solar production) in a correct way.
I have a Huawei SUN2000 solar system with a battery. The default entities/sensors from the custom integration GitHub - Emilv2/huawei_solar: Home Assistant custom component for Huawei inverters are: daily_yield : sensor that represents the daily energy in kWh (produced by the solar panels or stored in the battery) given to my home. total_yield: sensor that represents the total energy in kWh (produced by the solar panels or stored in the battery) given to my home. storage_charge_discharge_power: sensor that represents power in Watt van actual charge (+) or discharge (-) of battery storage_total_charge: sensor in kWh with total charged energy in battery storage_total_discharge: sensor in kWh with total discharged energy in battery
I understood that the energy integration wants sensor with total amount of energy in kWh.
For the grid (public electrical network) I use the DSMR integration and get: energy_delivered_tariff1: total amount of energy delivered at daytime energy_delivered_tariff2: total amount of energy delivered at nighttime energy_returned_tariff1: total amount of energy returned / injected at daytime energy_returned_tariff2: total amount of energy returned / injected at nighttime
For the grid and the battery the above mentioned sensors seems to work correct.
Problem is the Solar Production. The custom entity also has an entity called âsensor.sun2000_4_6ktl_l1_hvserialnumberâ with a state and a lot of attributes.
I found out that the attribute âinput powerâ gives the actual solar panel production.
I made a template:
The energy integration needs sensors in kWh with the total, increasing value. I made a sensor based on the Riemann sum integral integration. This integrations makes a sum of the produced power in Watts to energy in (k)Wh.
This creates a sensor sensor.total_yield_pv in kWh, what I need for the Energy integration.
The âDeveloper Toolsâ are showing the sensor correctly with an increasing value.
For some reason, even after a restart Iâm not able to select this sensor in the Energy integration.
I tried to add âdevice_class: energyâ and âdevice_state: measurementâ but this is not allowed in an integration.
Could you help me to sort out this problem?
Thanks to read my complete story/post. I wanted to explain as much as detailed in order to hopefully get an answer to this complicated situation.
As you can see, I donât see any total_increasing or total as state_class
Anyway as I already mentioned: itâs not possible to add a state_class or device_state to a sensor integration.
Please clarify your comments.
Could you chase me in the right direction what I have to customize
Which entity is wrongly configured? I suspect it is generated by the custom integrations so why should I open an issue at home-assistant/core?
Configuration check passed, restarted HA and check by âDeveloper Toolsâ. sensor.total_yield_pv has an attribute state_class: total (not total_increasing).
Unluckely could not select this entity as Solar panel in the Energy integration.
Added also device_class: energy in customization but no luckâŚ
My last idea would be to wait an hour or two until long-term statistics are generated for that entity - if it doesnât appear then too I donât know.
Hello @Johanvh did you end up getting working okay in the end?
Iâve the same environment and am only embarking on getting this going nowâŚ
Any help would be gratefully appreciated.
I added the two items @Johanvh mentioned in the 1st post but get
Anything I miss so far? I donât have a customize.yml file to add the total_increasing stuff to.
This sensor is created in template.yaml:
P.S. I have a seperate template.yaml. My configuration.yaml contains
template: !include template.yaml
In the energy dashboard I use âsensor.total_solar_productionâ
sensor:
- name: totale productie van de zonnepanelen
unique_id: total_solar_production
unit_of_measurement: âkWhâ
icon: mdi:solar-power
state: â{{ states (âsensor.opbrengst_zonnepanelenâ) | float(0) }}â
device_class: energy
state_class: total_increasing
The sensor âsensor.opbrengst_zonnepanelenâ means solar productions used in the above template is created in âsensor.yamlâ:
P.S. I have again a seperate sensor.yaml. configuration.yaml has
sensor: !include sensor.yaml
platform: integration
source: sensor.input_power
name: opbrengst zonnepanelen
unit_prefix: k
unit_time: h
round: 2
The source for this sensor comes from âsensor.input_powerâ; the Huawei integration
Is the opbrengst van de zonnepanelen entity more acurrate?
Iâve just installed this integration, but the solar produced is a lot lower then the provided apps say. (Might be caused because I have a battery too).
Do you still need this with the latest version of the integration?
It seems that the Huawei application (or website) is delayed. Home Assistant gets the information straight from the inverter so itâs direct real-time information. It is also updated much faster in Home Assistant compared to the Huawei portal⌠I have a battery as well but this is not related to the solar panel production.
I installed the integration by HACS so Iâm informed once the integration has an update and I always use the latest version
Hi, This might be a border question to the topic but Iâm about to select the brand for my new solar installation. So I use the classic⌠âBesides it doesnât work, how is it?â phrase.
Iâm I able to control an Huawei battery to charge and discharge or is it only to watch what happens?