The calculation appears to be working as expected, the instant load shows (for example) 97 W and the energy graph shows (for example) 0.6 kWh. So far so good.
However when I try to add the integration to the energy dashboard it doesn’t appear in the dropdown list.
An integration from the current clamp monitor works as expected for the house energy usage but I can’t get this new one to appear.
Is it because the sensor is a template sensor and not a ‘real’ one? Or have I configured something wrong?
It does appear that the Energy Dashboard only consumes sensors with a state class of “total_increasing” which means that the dashboard is smart enough to read an increasing sensor for example “Today’s Solar Energy Generation” measured in kWh – it will sample the sensor and take the difference between the previous value and the current value to determine the amount of energy generated during that sample and graph it for you
Checking further, I was able to get my Integration sensor added to the Energy dashboard after customizing the device_class.
homeassistant:
customize:
sensor.current_solar_power_generation_kwh:
icon: mdi:flash
device_class: energy
The attributes are listed as seen below – notably my state_class is “total”
state_class: total
source: sensor.envoy_current_power_production
unit_of_measurement: kWh
icon: mdi:flash
friendly_name: Current Solar Energy Production
device_class: energy