Chosen Solution

I have MacBook Pro, the fan doesn’t turn on by itself but can be turned on manually with Macs fan control application. I have tried smc and pram reset, I can’t reinstall new Mac OS due to overheating and switching it self off. I have also used the apple diagnostics and when the fan is tested it works fine. any ideas what it could be. thank you. Update (11/21/2018)

here a picture of the temperatures

Here’s the needed steps to replace your fan: MacBook Pro 13" Retina Display Early 2015 Fan Replacement and here’s the needed part MacBook Pro 13" Retina (Late 2013-Early 2015) Fan

Which fan is inoperable? The left fan or the right fan? Are both fans inoperable? If you can’t control the fans with fan control software nor does a SMC or PRAM reset help, I think the fan(s) are dead. MacBook Pro 15" Retina Display Mid 2015 Right Fan Replacement MacBook Pro 15" Retina (Late 2013-Mid 2015) Right Fan MacBook Pro 15" Retina Display Mid 2015 Left Fan Replacement MacBook Pro 15" Retina (Late 2013-Mid 2015) Left Fan