The variational principle asserts that the shift-invariant Gibbs measures coincide exactly with the minimisers of the entropy density. A new characterisation of the entropy density leads to the variational principle for the loop O(n) model, and for the annealed version of the Ising model in a random percolation environment. This is based on joint work with Martin Tassy (arXiv:1907.05414).