I do not think he knew they were cops
But the difference between me and those cops is that the guy should have said to himself "OK,just in case they *are* cops I'll open the door without a gun in my hand because if they are cops they just might shoot me".
I recently got a license to carry...my first one.I was stopped by the NY State Police in September for a minor violation (I paid a $50 fine). When the cop appeared at my window the first thing I said to him was "I don't know if I'm required to tell you this but I have a license to carry and I'm unarmed now". I did it so he would know that I recognized that he was in charge and I posed no threat to him. I didn't want him to get nervous and shoot me.
The guy in this case was *beyond* stupid...so stupid that his heirs shouldn't get a penny.