The present invention relates to methods for detecting acidosis in a rumen of a ruminant and for optimizing feeding of a ruminant. The present invention also relates to a device for detecting acidosis in a rumen of a ruminant, to a use of the device for detecting acidosis in a rumen of the ruminant and to animal feed. The device comprises a protective agent adapted to dissolve in a rumen when a pH value is less than 6 for a prolonged time, thereby releasing a colouring agent causing a visible change of excrement. The method comprises providing said device for a ruminant and detecting a visible change of the excrement if the ruminant has acidosis in the rumen.