I agree that it's worth checking a quote on a car from Bled to Piran/Portorož. The rental fee is often cheap (it was about 15 euro/day for me); the expensive part is insurance. I'm paranoid about damaging the car, which was reinforced after scraping a column in a parking garage in France with a rental car; so I usually get full coverage so that I can just walk away without any further hassle if I damage the car (as I did in France). Most on this forum would think I'm crazy for doing that, but it lowers my anxiety, which makes for a better trip for me!
If you are doing public transport... I would change my suggestion for Bled/Bohinj... stay in Bled because you will have better transportation options. Ukanc is the end of the bus line, and I don't think you will want to start at the end of the bus line every morning. I think there is plenty to keep you occupied for 4 nights in/around Bled -- Bohinj/Vogel one day, Vintgar Gorge/Bled one day, day trip to Radovljica/other surrounding towns one day. There is a shuttle in summer that runs from Bled to the Vintgar Gorge (2019 info on shuttle). Radovljica, by the way, has a great tourist information website with a good events calendar.
If you end up doing public transport in the Soča Valley, the Soča Valley tourism website has a page that summarizes public transportation. Vesna, the owner of guide company that provides local experiences in the area also has a page about public transportation in the area on her website.
For Bovec/Kobarid, i would probably stay at Kobarid, which would give you better access to Tolmin (another gorge, a beautiful church built by Austro-Hungarian soldiers during WWI for their dead comrades) and to the Brda region (wine, if you are so inclined).
Five nights seems like a lot for Bovec/Kobarid to me. I would think about 4 there and 4 in Ljubljana. You can go to Idrija from either (a little shorter bus ride from Ljubljana than Kobarid) to visit the UNESCO World Heritage mercury mines and the local lace-making culture created by the wives of the miners. I added Idrija to my itinerary even though mercury mines didn't sound that interesting to me (I deferred to the UNESCO World Heritage folks); I found the town (and its mines) very interesting.
I loved Piran. So, I would spend 2 nights there.