I’m not sure if I’ll be able to help you here, but I’ve gone through a fairly similar situation, at least in some respects, so maybe you’ll get something from this.
I normally lead a relatively low stress life. I’m a student and I work part time and I had a relationship that was starting to go sour. I also am in good shape phsyically, I do cardio and weight lifting regularly. What I found was that subconsciously I was hindering my erections. As you mentioned, you had an erection while sleeping, which is a tell tale sign that the issue is psychological (you can get an erection because you got an erection). I to had that ability, and when I would wake up alone, I always had morning wood. When I was around her though, I immediately had issues maintaining an erection. It was just my minds way of telling my body, “you really aren’t happy with her”.
Now I realize that this may not be the same for you, but maybe its your bodies way of telling you something else is wrong. I’d spend some time thinking deeply about how everything is going in your life and how you feel about everything. You also mentioned that when you’re by yourself, or watching porn, you weren’t able to attain a good erection. I also had this issue, because I had it going through my head that I had ED from previous events.
One thing that I’d be weary of is that you claim you have no symptoms of depression. I also thought I had no signs of depression. I’ve now been on anti-depressants for 3 months since a set of trips to see a psychiatrist, and I’ve been feeling much more like my old self. My problem was that when looking for it initially, I either over analyzed stuff, or dismissed it as being too minor to matter. You really need an outside opinion to diagnose whether or not your depressed, as those who are generally will dismiss symptoms.
Ok, I’ve been going on and on, and I realize that I haven’t probably made a ton of sense. Basically, I’d suggest seeing a psychologist, just to talk about stuff and get to the bottom of any issues. I’d also go see a urologist, incase you’re worried about anything physical. Odds are, physically, you’re fine. Maybe there are just things going on inside your head that you have yet to see, or maybe you just need to get off the vicodine ;) . If you’re anything like me, things that go on in your head will affect you more than you can imagine. The mind is a powerful thing and getting an outside opinion on it is important.
Hope some of this stuff floating around my head helps you out,
House