We discuss in detail the experimental investigation of thermally induced fluctuations of the relative phase between two weakly coupled Bose–Einstein condensates (BECs). In analogy to superconducting Josephson junctions, the weak coupling originates from a tunnelling process through a potential barrier which is obtained by trapping the condensates in an optical double-well potential. The observed fluctuations of the relative phase are in quantitative agreement with a many body two mode model at finite temperature. The agreement demonstrates the possibility of using the phase fluctuation measurements in a bosonic Josephson junction (BJJ) as a primary thermometer. This new method allows for measuring temperatures far below the critical temperature where standard methods based on time of flight measurements fail. We employ this new thermometer to probe the heat capacity of a degenerate Bose gas as a function of temperature.