Edge driver to read values from other devices, sum then store?

My driver is for energy and power calculations

Also here are examples how to use @Mariano_Colmenarejo Virtual Number Fields

Rules API is used for reading other devices’ values.