You also want to conditionalize the sensor to being available only when the three source sensors are available. This is generally done with the availability template and the Jinja function has_value('entity').
Set state class to total_increasing and device class to energy. I am not sure if these can be done via the UI. You may have to add them to configuration.yaml.