Measure human energy balance Is it possible to track thermodynamic variables via sensors to measure the energy balance of the human body?  In other words, can we measure whether a person will be in a caloric surplus or deficit by looking at heat flows?
 A: Such setups have been operated. (It could be that such setups are in operation as of today, I don't know.)
[later edit: it turns out metabolism chambers are still being operated. They are mentioned in the 2015 article about energy expenditure that Paul Warehem linked to in a comment to this answer.]
The very first experimentor to investigate animal metabolism was Lavoisier. He constructed a calorimeter large enough for a guinea pig to be placed in it. Melting ice maintained a consistent temperature. Lavoisier assessed the amount of heat produced by the animal by measuring the amount of water produced by melting of ice.
A human scale version of that is of course much more involved. A room must be constructed such that that entire room acts as a calorimeter.
You need a room-in-a-room. Temperature sensors measure the termperature inside the inner room and temperature regulating elements on the surface of the outer room maintain that tempearature, so that unmeasured heat flow out of the inner room is prevented.
The temperature of the inner room is actively maintained at a constant temperature too. The heat pump that moves heat out of the inner room must be calibrated so that the amount of heat removed from the inner room is known precisely.
The composition of the air inside the room must be actively maintained too. Air is pumped out and fresh air is pumped in, and the composition of both is monitored, so that the amount of oxygen usa can be reconstructed with precision.
Over the course of a long term study the energy balance of the test person can be reconstructed. Over a sufficiently long time you can see whether the test person is losing weight or not.
With sufficient data gathered the sustenance value of various foods can be assessed.

In the 1950's the technology of using double labeled water was developed.
One of the two oxygen atoms in exhaled $CO^2$ is derived from body water. If the oxygen in water is labeled with $^{18}O$, then $CO^2$ produced by respiration will contain labeled oxygen.
Oxygen is also lost with body water. Deuterium is lost only when body water is lost, so the Deuterium label gives a measure of the amount of loss of body water, from which the the ratio of oxygen in respiration and oxygen in water can be inferred.
It is my understanding that today the double labeled water method is the way metabolism is assessed. Preparing the double labeled water is expensive, but I assume that running a human rated calorimeter setup is way more expensive.

If you also have exact records of food intake then the metabolism data can be used to assess the sustenance value of the food.
