ESP8266 Relay (active low): how to prevent triggering on boot or reset (SOLVED)

I don’t have a lot of experience with PWN but unfortunately i think this is a hardware problem not a software one. From what i know D1 and D2 are the only 100% stable pins on boot for D1 mini, you can try a different pin to see how it reacts on boot or a different D1 mini if you have a spare(I’ve had cheap clones that react differently).

This site investigated pin outputs on boot and their behavior ESP8266 GPIO Behaviour at Boot

What i would try if you don’t mind complicating yourself is maybe adding a relay between your PWN pin and your light. That way after boot you activate the relay and complete the circuit and can drive your light as you would normally and during boot there might be a mismatch between the pin that operates the relay and your pwn pin which means the light won’t flicker.