How it works:
If the temperature rises, the density of the liquid in the thermometer is reduced. The comparatively heavier balls lose buoyancy and sink. When the room temperature decreases on the other side, the lighter balls gain buoyancy and gradually rise.