Virtual watts sensors for calculate kWh value

I would like to create a virtual watt sensors to calculate electrical devices which have a constant power draw such as LED light, let said the LED light power is 50W. I know i can use the “utility meter” helper to do this but problem now is once I off it, the LED power suppose drop to 0W. I also know that this utility meter required some changes on input so that it can record kWh value, most properly need a time trigger by minute that can generate some random value on that virtual watt sensors. How can I create automation for this situation?

See here:

2 Likes

just try it, quite useful. Thank you !