If you have a sensor that provides you with power readings in Watts (uses W as unit_of_measurement, device_class of power), then you can use the integration sensor to track how much energy is being spent. Take the next manual YAML configuration as an example: