Too late for my comments to be of value but I had a similar situation with the bathroom fan.
And
I don't have firefly, so this is for the other folks reading and not the op.
It was, believe it or not, a loose wire nut that liked some electrical input and disliked other electrical input. Just the right tight, just the right wires slightly brushing the connection.
I tightened the nut (had to drop the fan. There's a second set of nuts in the ceiling) and the fan quit doing the stupid stuff.
I don't remember if it was shore or inverter or battery it didn't lke, but it was one of them.
I too installed a relay while I was up there.
I now have a wireless remote control for the fan.
|