1 day. It is all tricks, there is no question about that. I think the issue is, especially when I get excessively tired but also when I drink, my brain basically turns off. At least, the System 2 thinking part (for anyone familiar with the book Thinking Fast and Slow) does, so I just do whatever the habit driven instinct brain wants. That said, it's typically not just tired -> PMO. There's usually a point where I realize I don't have the energy to do what I am trying to do but try to force it anyway and when that fails is when my brain goes into the habit loop. So I just need to walk away.
On alcohol it's a few things.
1. Drink less. Not complicated. I don't need to get full-on drunk when I go out with people. A little buzzed is sufficient.
2. Let the alcohol fade a bit before I go home, ie. back off any alcohol like an hour before I am going home.
3. Just forget about doing anything after I get home. Turn off the lights, turn off my phone, get in bed.
If I can avoid using when excessively tired or using alcohol, I really should mostly be home free, because that's beeen almost all my uses since I lost the streak.