That's a good idea, thank you! Have you thought about using a master/slave socket strip yet? That would be a good tool for your use case: The main idea is that the devices plugged into the slave sockets are switched on/off depending on the power consumption of the device plugged into the master socket, i.e. if your PC plugged into the master socket switches to sleep mode (and therefore uses less power), all your monitors / speakers / lights will be turned off.
This would be another (and maybe simpler) way to achieve this behavior 🙂
Have a nice day!