I’ve been measuring my solar panel production in Home Assistant ever since the panels were installed and I really like the insights that this has been giving me.
I’m able to capture the produced energy by using the ‘SMA Solar‘ integration as this is the vendor of my inverter. The SMA integration works quite well out of the box but has one downside: It only provides one kWh sensor that passes the total produced energy to Home Assistant. This is a useful sensor if you only want to look at the total produced energy or when you have all your panels facing in the same direction. In my case I have panels facing east and facing west. As seen below, the amount of panels is equal on both sides of the house but the production isn’t.
I figured out by looking through the provided ‘SMA Solar‘ sensors in Home Assistant that my inverter does measure the different panel groups on two different sensors (sensor.stp6_0_3av_40_341_pv_power_a and sensor.stp6_0_3av_40_341_pv_power_b). The measurement is in Watts and not in kWh.
While Watts is perfectly fine as a measurement for production insights the default Energy Dashboard in Home Assistant is only capable of showing kWh sensors (with an Energy device class). So to make the two individual solar panel groups show up in the Energy Dashboard you need to convert a Watt sensor into a kWh sensor. Once you figure out that you need the Riemann sum integral integration for this the exercise is easy.
- platform: integration
source: sensor.stp6_0_3av_40_341_pv_power_a
name: energy_produced_east_panels
unit_prefix: k
round: 2
- platform: integration
source: sensor.stp6_0_3av_40_341_pv_power_b
name: energy_produced_west_panels
unit_prefix: k
round: 2
All you need to do is add the above code (adjusted to your personal sensor naming) in your configuration.yaml. You need one platform integration per sensor. After saving your yaml file and rebooting Home Assistant you can add the additional sensors to your Energy Dashboard. Do wait for your new sensors to have some data point collected.