I already read a few questions around here about this issue and while some of them provide a good clues, I think mine is specific enough to deserve its own question.
The problem: TV image goes black for a second and comes back randomly or when I turn the lights on/off. Here's how it looks like (3 sec gif): https://gfycat.com/VigorousSlipperyAmericantoad. Sometimes it happens more frequently like every 2 minutes or so. The only other appliance in the house that could draw some power is a rather small fridge.
The setup: I have a small PC being used as a media center. It's connected through HDMI to an Onkyo AV receiver, which is then connected to the TV. All of these are connected to an UPS which is in turn connected to the power socket on the wall. A few more details: the motherboard on the PC is an ASRock FM2A88X-ITX+ and the power supply is a non-branded standard ATX model (500W I think). Between the PC and the received I also have a CEC adapter from Pulse Eight (https://www.pulse-eight.com/p/104/usb-hdmi-cec-adapter). The HDMI cables are standard off-the-shelf, nothing special.
A few months ago I didn't have the UPS, but in the meantime I got one hoping it would solve the issue as I was assuming there were voltage peaks in the circuit or something like that. The UPS didn't make a difference though.
I also tried connecting the PC directly to the TV without the CEC adapter to rule out other devices but the issue persists. So it doesn't seem to be the receiver or the TV. Also, it never happens when I switch the AV source the the cable TV box.
I think it probably has something to do with variations in the current but I'm almost sure it's also related to the PC itself because I tried connecting the same HDMI cable to my MacBook Pro and the issue doesn't occur anymore. I can turn on/off any light switch or just wait for it to happen but it doesn't.
So my theory is that there's something in the PC which is not handling over/under voltage variations as well as the macbook is. Does this make sense? If so, what component in the PC can be causing this? Could it be the power supply or the motherboard?
Any tips to help solve this are highly appreciated!