This can be done using a third party integration:
It’s a lot more advanced than just on or off too. it can estimate power based on light brightness or colour too.