Ok this should be it, some of the sensors required may not be enabled by default in the integration - if they are not enabled you can enable them by going into HA Settings, Devices & Services and click '1 Device' on the Foxess Modbus integration - it will list all available sensors, and at the bottom it will says +xx entities not shown - click there and you can then click on each entity and slide 'enabled' to on and they will be added.
To do this you must have Grid Consumption ('grid_consumption') , Inverter Power ('rpower') , Feed-in ('feed_in'), CT2 Meter (ct2_meter) all available and showing in the list
As you've seen the inverter reports the wrong load power when your CT2 is generating, that's why the cloud totals get messed up - it can be fixed by applying this logic
Real Load = Grid Consumption + Inverter Power - Feed In + absolute(CT2 )
So we need to create a sensor for that which will report real time power (kW), then we need an integral sensor which will give you an increasing sum of kWh and finally a utility meter that resets on a daily basis and will show what you daily load looks like.
Rather than add them in your configuration file, it will be easier if you use the 'helpers' as you can sensors via the GUI which is much easier if you aren't familiar with yaml.
I can see you have named your inverter as 'h1_5_0_e' which adds that name to all sensor prefix's
So for the first sensor, click Settings, Devices & Services, then Helpers (top right) - then click the blue button 'Create Helper' and select 'Template' from the list, then select 'Template a Sensor'
The name will be 'Real Load'
in the State Template copy and paste the code below
Code: Select all
{% set gcR=states("sensor.h1_5_0_e_grid_consumption") |round(4,default=0) %}
{% set fiR = states("sensor.h1_5_0_e_feed_in") | round(4,default=0) %}
{% set rP = states("sensor.h1_5_0_e_rpower") | round(4,default=0) %}
{% set ct2 = states("sensor.h1_5_0_e_ct2_meter") | round(4,default=0)|abs %}
{% set real_load = gcR + rP - fiR + ct2 %}
{{ real_load|round(3) }}
Unit of Measurement : kW
Device Class : Power
State Class : Measurement
(Leave the Device field blank)
It should look like this (albeit my inverter doesnt have your h1_5_0_e prefix)
Click the 'Submit' button when done.
The next step is to create the integral which converts power (kW) into energy (kWH)
So same thing, click the 'Create Helper' button, Select 'Integral' in the list
The name will be 'Real Load Sum'
Leave 'Metric Prefix' blank it's already scaled correctly
Time Unit is 'Hours'
Input Sensor is 'Real Load' (choose sensor.real_load)
Integration Method : Left
Precision: 3
Leave Max Sub interval as 0
Click the 'Submit button when done
and finally on to the last one
So same thing, click the 'Create Helper' button, Select 'Utility Meter' in the list
The name will be 'Real Load Daily'
Input Sensor is 'Real Load Sum' (choose sensor.real_load_sum)
Meter Reset Cycle is 'Daily'
Meter offset is 0
Leave the rest of the options as default
Click 'Submit' to finish
And that's that, you should now have 3 sensors, one that correctly reports 'real load' (kW), the second is an increasing total that shows 'real load sum' (kWh) and the last one is a daily utility meter that will show the daily total for your house load.
You can repeat that process with the sensor you made below for Total Solar Power and then you can add it to your dashboard - just drop the bit in quotes in the value_template into the template box and you will then have a sensor you can add to your dashboard but check your sensor names I think one of them 'sensor.pv_power_h1_5_0_e' has the inverter name in the wrong place