A note on the relations between thermodynamics, energy definitions and Friedmann equations